On 17/01/2015 13:19, Victor Bazarov wrote:
Please read the FAQ 5.8 _carefully_. You can find the FAQ to this
newsgroup here: http://www.parashift.com/c++-faq-lite/
Victor
Ok, I compiled the site example, and it works. So obviously in my code
there is something I cannot find. I ll try to double check..
site example which works:
template<typename T> class Foo; // pre-declare the template class
itself
template<typename T> Foo<T> operator+ (const Foo<T>& lhs, const Foo<T>&
rhs);
template<typename T>
class Foo {
public:
Foo(T const& value = T());
friend Foo<T> operator+ <> (const Foo<T>& lhs, const Foo<T>& rhs);
private:
T value_;
};
template<typename T>
Foo<T>::Foo(T const& value)
: value_(value)
{ }
template<typename T>
Foo<T> operator+ (const Foo<T>& lhs, const Foo<T>& rhs)
{ return Foo<T>(lhs.value_ + rhs.value_); }