@huxley Got a question for you (and any other C++ furs out there)

I've got a template function, and I'm calling it from main(). This works fine, however when I move formatArray() into print.cpp and add a matching prototype to print.h, it can no longer find the function. I can put other functions in print.h and the compiler finds them, there's just something odd about including a header with a template function I'm not getting.

@maldrasen @huxley this is a problem with templates and .cpp files. The template generally needs to be defined in a header, because the compiler only makes an instantiation of it for a particular type when it actually gets used. So if the template is defined in the printf.cpp but it’s used in main.cpp, then the compiler doesn’t see that use case when it compiles printf.cpp and thus no instance of the function gets made.

Basically, put template definitions in a header.

@19 @maldrasen yup this