My solutions to templates:
I used to have a single file and I defined all my template declarations in there and just included it within my appropriate headers.
Currently I do this:
Here is how I use it:
I do this ONLY for template classes.
What do you guys think of this approach vs my previous one?
I kicked my previous approach ages ago, I'm very surprised that every time I come back to doing my work in C++ that "extern" has yet to be implemented.
Why?
I used to have a single file and I defined all my template declarations in there and just included it within my appropriate headers.
Currently I do this:
Code:
#ifndef VIRTUALKEYBOARD_CPP
#define VIRTUALKEYBOARD_CPP
#include "VirtualKeyboard.hpp"
//Definitions go here
#endif
Here is how I use it:
Code:
#include "VirtualKeyboard.hpp"
#include "VirtualKeyboard.cpp"
I do this ONLY for template classes.
What do you guys think of this approach vs my previous one?
I kicked my previous approach ages ago, I'm very surprised that every time I come back to doing my work in C++ that "extern" has yet to be implemented.
Why?