On Standards Compliance and Visual C++ 2005

  • Thread starter Thread starter Antti Keskinen
  • Start date Start date
A

Antti Keskinen

Hi there !

Does anyone know if Visual C++ 2005 will support the 'export' keyword in
template definitions ? Or alternatively, the use of seperate modules in
template declarations ?

Like, I can declare a templated class in 'class.h', then include this file
in 'class.cpp' and define the members, and take the class into use by
including 'class.h' in a code module that instantiates the template ?

-Antti Keskinen
 
Antti Keskinen said:
Hi there !

Does anyone know if Visual C++ 2005 will support the 'export' keyword in
template definitions ? Or alternatively, the use of seperate modules in
template declarations ?

No, it will not. As of 2005, Comeau remains the only shipping 'export'
implementation.
Like, I can declare a templated class in 'class.h', then include this file
in 'class.cpp' and define the members, and take the class into use by
including 'class.h' in a code module that instantiates the template ?

Nope. The closest you can come sans 'export' is pre-instantiated templates
in a library, but that presumes that you know a-priori all the types your
templates will be instantiated with. This technique is used in the
standard library for string and stream classes pre-instantiated on char and
wchar_t.

-cd
 
Back
Top