Templates in .cpp files

I blogged a few days ago about the need to define templated members within header files, and why I found that annoying. Well, when looking through the propositions for C++0x, the next specification of C++ that could be released as a draft this year, I was pleased to see the heading “Extern Template”. The syntax would be thus:
extern template class std::vector<myclass>;
See the full infromation, and the rest of teh changes in this spec here.

Leave a comment

Leave a Reply

Your email address will not be published. Required fields are marked *