If you have a template with two template arguments, one for the underlying type, and the other being a container of the underlying type, how can you get an iterator to an unspecified container?
Code:template<typename T, typename K> class Foo{ K container; public: Foo(const K& container){ // get iterator to 'k' // copy 'T' elements from 'k' } }; int main(){ std::vector<int> vec; Foo<int, std::vector<int> > foo_vec(vec); std::list<int> list; Foo<int, std::list<int> > foo_list(list); return 0; }



LinkBack URL
About LinkBacks



