fork(2) download
  1. #include <iostream>
  2. #include <set>
  3. #include <map>
  4. using namespace std;
  5.  
  6. template <typename V>
  7. inline V get_value(const V& v) { return v; }
  8. template <typename K, typename V>
  9. inline V get_value(const pair<K, V>& p) { return p.second; }
  10.  
  11. int main() {
  12.  
  13. set<int> s;
  14. s.insert(99);
  15. map<char, int> m;
  16. m['a'] = 100;
  17.  
  18. cout << get_value(*s.begin()) << endl;
  19. cout << get_value(*m.begin()) << endl;
  20.  
  21. return 0;
  22. }
Success #stdin #stdout 0s 3276KB
stdin
Standard input is empty
stdout
99
100