Why we cant separate the template declaration file and implementation file in c++. What is the underneath reason for this.
Thanks.
You can do that, but you can not put implementation to .cpp
file.
The reason is simple, when you are using template it is instantiated bu substituting types. When you have separate cpp file you have no type parameter substituted to implementation and linker could not find them.