I have a template functions defined in a header file under a namespace. When I include this header in two source file in the same project. I don't get redefinition error.
/* template.h */
namespace x
{
template<typename T>
function(t)
{
/* implementation */
}
}
/*test.cpp*/
#include "template.h"
/* test2.cpp */
#inlcude "template.h"
In the above case I don't get any redefinition error. .Why I am not receiving any error?