Because you're using templates.
As templates must be compiled in a different way, they must go in the header file.
If you want them in the source file, it's also ok if you declare/define them inside the class.