I'm getting a stupid little error and I'm pretty lost to where I'm going wrong.
When I try to compile my code it says: Template argument 1 is invalid
Template argument 2 is invalid
Refering to the "type" template I declared.
Am I declaring it wrong or am I just totally blind and missing something obvious?
Because if I just change the "type" template that I made with, say, int,
it works fine.
displayvector is also a templated function (it uses "type").
And templates need to be fully visible (including their implementation) at the point of use since they are instantiated at compile time.
The actual functions generated from the templates will not necessarily be inlined. It's just that the source text needs to be visible at compile time to generate the actual function(s) requested. There are whole C++ libraries that are header only because they consist only of templates. Most of boost is just headers. https://www.boost.org/