Suppose I have two classes Foo1<T> and Foo2<T> .
Then I want to create a bar function that references std::vector<Foo1<T>> or std::vector<Foo2<T>> , but always returns a std::vector<Foo1<T>> :
template<class T, class Y> std::vector<Foo1<T>> bar(std::vector<Y<T>>&)
Unfortunately, the compiler does not like the bit <Y<T>> . One way around this is to provide two overloads, but is there a way I can arrange above to fix it?
c ++ c ++ 11 templates
P45 imminent
source share