T
Tomás
I'm writing code at the moment which I intend to be 100% portable and
well-defined in line with the current C++ Standard.
I like the "export" feature, whereby I can put template functions in
source files (where I feel they belong -- unless I intend them to be
inline, of course).
I realise, however, that the majority of compilers are defective in that
they do not implement the "export" feature.
I see that the FAQ offers an alternative:
//header.hpp
template<class T>
T Get();
#ifdef UNSUPPORTED_EXPORT_KEYWORD
#include "header.cpp"
#endif
//header.cpp
#ifdef UNSUPPORTED_EXPORT_KEYWORD
#define export
#endif
export template<class T>
T Get()
{
return 0;
}
Do many of you here use this? I'm thinking of starting to use it in my
code. I'm going to put a "readme" file with it saying:
If your compiler doesn't implement the "export" feature, then define blah
blah...
While I'm at it, are there any othere things in the C++ Standard that
aren't done properly by a lot of compilers?
-Tomás
well-defined in line with the current C++ Standard.
I like the "export" feature, whereby I can put template functions in
source files (where I feel they belong -- unless I intend them to be
inline, of course).
I realise, however, that the majority of compilers are defective in that
they do not implement the "export" feature.
I see that the FAQ offers an alternative:
//header.hpp
template<class T>
T Get();
#ifdef UNSUPPORTED_EXPORT_KEYWORD
#include "header.cpp"
#endif
//header.cpp
#ifdef UNSUPPORTED_EXPORT_KEYWORD
#define export
#endif
export template<class T>
T Get()
{
return 0;
}
Do many of you here use this? I'm thinking of starting to use it in my
code. I'm going to put a "readme" file with it saying:
If your compiler doesn't implement the "export" feature, then define blah
blah...
While I'm at it, are there any othere things in the C++ Standard that
aren't done properly by a lot of compilers?
-Tomás