I am a new bee to template based programming and I have this error when compiling my project
error : multiple definition of Expr::Chapter_2<double>::get_pointer()
objectfile.o:/Filename.h:42 first defined here.
The given code is entirely inside a .h header file. Any pointers to resolve this issue is highly appreciated.
code :
template< typename T >
class Chapter_2{
-------
public :
inline T* get_pointer();
-------
};
// Function definitions
template< typename T >
T* Chapter_2<T>::get_pointer() {
------code------
}
// double specialization of template
template<>
double* Chapter_2<double>::get_pointer() {
------code------
}