|
Sir,
Thanks for replying to my post.
But after replacing also the compliler shows errors. The error generate by the compiler is
netoprinhtem.cpp:34: warning: friend declaration ‘std::ostream& operator<<(std::ostream&, const Derived<T>&)’ declares a non-template function
netoprinhtem.cpp:34: warning: (if this is not what you intended, make sure the function template has already been declared and add <> after the function name here) -Wno-non-template-friend disables this warning
netoprinhtem.cpp:35: warning: friend declaration ‘std::istream& operator>>(std::istream&, Derived<T>&)’ declares a non-template function
netoprinhtem.cpp:40: warning: friend declaration ‘Derived<T> operator+(T, Derived<T>)’ declares a non-template function
netoprinhtem.cpp: In function ‘int main(int, char**)’:
netoprinhtem.cpp:107: warning: converting to non-pointer type ‘double’ from NULL
netoprinhtem.cpp: In member function ‘Derived<T> Derived<T>::operator+(T) const [with T = double]’:
netoprinhtem.cpp:115: instantiated from here
netoprinhtem.cpp:71: warning: converting to non-pointer type ‘double’ from NULL
/tmp/ccMrOSpk.o: In function `main':
netoprinhtem.cpp:(.text+0xe5): undefined reference to `operator>>(std::basic_istream<char, std::char_traits<char> >&, Derived<double>&)'
netoprinhtem.cpp:(.text+0xf8): undefined reference to `operator<<(std::basic_ostream<char, std::char_traits<char> >&, Derived<double> const&)'
netoprinhtem.cpp:(.text+0x41c): undefined reference to `operator<<(std::basic_ostream<char, std::char_traits<char> >&, Derived<double> const&)'
netoprinhtem.cpp:(.text+0x43d): undefined reference to `operator<<(std::basic_ostream<char, std::char_traits<char> >&, Derived<double> const&)'
netoprinhtem.cpp:(.text+0x45e): undefined reference to `operator<<(std::basic_ostream<char, std::char_traits<char> >&, Derived<double> const&)'
If u can plese help me on this.
Thankin you
|