Partial specialization of class template.
I have a class template:
Code:
template<typename T1, typename T2>
class A
{
public:
void f1();
void f2();
void f3();
int f4();
};
The class is actually much longer.
Now, in case the second template parameter is float, f4 should return std::string instead of int.
Code:
template<typename T1>
class A<T1, float>
{
public:
void f1();
void f2();
void f3();
std::string f4();
};
Is there any way to accomplish this without specifying all of the other parts of the class again?
What I'm really trying to do is writing a concatenation_iterator that runs through two iterators in succession. If those iterators are of input iterator category, the postfix ++ operator should return a proxy object, for other categories it should return a copy of itself as is the normal behaviour of postfix ++.