On Standards Compliance and Visual C++ 2005

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
 
C

Carl Daniel [VC++ MVP]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top