Everything was perfect until I added a template. Searched 3 pages of google but none of suggestions were helpful. Most of answers were that compiler can't find definition but it is right after declaration in .h file. Rewrote whole code to make sure it wasn't some random tiny mistake but getting the absolute same error. Maybe I don't pay enough attention? What is wrong with this code? Thanks for any help
If there is no implementation, then the main() has seen only a declaration and assumed that something else provides implementation, but nobody else invokes the operator<<.
Alright, looks like I actually didn't pay enough attention. operator<< was a friend function for Sparse_Polynomial and I didn't declare it before the class. Sorry I didn't inculde this. The fact that it worked without templates kinda mislead me. Now this works.