How to obtain the types of the key and the value of a std::map using std::iterator_traits?
I am newbee here as well as in template programming. I have a dictionary (means, it could be either std::map or std::vector<std::pair<type1, type2>> or std::set<std::pair<, >> ...) I wanted to write an algorithm, which act like standard library algorithms using the iterators of the passed container. Following is the idea. #include <iostream> #include <algorithm> #include <type_traits> #include <vector> #include <array> #include <map> #include <set> #include <iterator> // two different types enum EnumA { one, two, three, four, five, six}; enum EnumB { one, three, four, six}; // TypeA TypeB usin
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.