Dear all,
In the discussion of 23-06-2003 it was concluded that the following
concept compiles under VC++.NET 2003:
class KA
{
public:
template <typename U>
void Foo(const U& rU);
};
template <typename U>
void KA::Foo(const U& rU)
{
}
template <>
void KA::Foo(const std::string& rstr)
{
}
unfortunately if the class is also a template, an out of inline
definition does NOT compile, even under the new improved VC++.NET 2003
compiler:
template <typename T>
class KA_T
{
public:
template <typename U>
void Foo(const U& rU);
};
template <typename T>
template <typename U>
void KA_T<T>::Foo(const U& rU)
{
}
template <typename T>
template <>
void KA_T<T>::Foo(const std::string& rstr)
{
}
this gives error C2244. Of course there are many ways to circumvent
this,
but my main question is this legal c++ or do I something wrong?
Me.