I have 2 header files that have identical content:
template<typename T> inline void func(){
}
I include these 2 headers in a main.cpp file then I compile:
g++ main.cpp -o run
But I get:
In file included from main.cpp:2:0:
test2.cpp:1:34: error: redefinition of ‘template<class T> void func()’
template<typename T> inline void func(){
^
In file included from main.cpp:1:0:
test.cpp:1:34: error: ‘template<class T> void func()’ previously declared here
template<typename T> inline void func(){
What am I getting this error if use inline function which can be redefined?