Cryptic template template parameter error
问题 I'm trying to create a function that gets the keys from a std::map or an std::unordered_map . I could use a simple overload, but first I'd love to know what's wrong with this code. template<typename K, typename V, template<typename, typename> class TContainer> std::vector<K> getKeys(const TContainer<K, V>& mMap) { std::vector<K> result; for(const auto& itr(std::begin(mMap)); itr != std::end(mMap); ++itr) result.push_back(itr->first); return result; } When calling it with an std::unordered_map