Visual C++ Annoyance of the Day

Lazy template expansion.

The case for:

  • makes writing the compiler easier

The case against:

  • means the export keyword doesn’t work, so you have to explicitly include the template definition in every single file you want to use it in

Nearly every goddamned file in my project depends on this templated function I’m working on at the moment. It takes half an hour to recompile the project. I shall shortly be paying Microsoft’s compiler developers a visit to *cough* “talk things through”.

Edit

Turns out it’s not a VC++ problem; it’s an every-compiler-in-the-world problem. More here. I think the Java/Ruby approach might be better here.

Comments are closed.