Boost logo

Boost :

From: Daryle Walker (darylew_at_[hidden])
Date: 2000-07-09 23:28:35


C++ has a keyword "export," which lets you place templates outside header
files into source code. Unfortunately, no compiler I know of supports it.
They should someday, and maybe Boost should take it into account. We could
move any template function with a large (i.e. wouldn't be inlined)
implementation to a *.cpp file, and connect it to its header with "export."
I'm not sure if "export" is required, or which version (header's declaration
or source's definition) gets the "export" mark. Like other features of C++
that may be missing on some compilers, we could add a pre-processor flag in
config.hpp to warn about missing export-support. The flag could allow the
*.cpp file to be included in the *.hpp file if it's true. There are at
least two potential problems:

1. Since there is no known (AFAIK) implementation of "export," and that the
config.hpp flags are written for compilers missing support instead of ones
with support of a feature, conceivably every compiler we know of has to be
added, leading to a long list.

2. Some compilers without support (like the version of CodeWarrior I have)
'protect' the user by parsing the "export," but then reporting that exported
templates aren't supported and ending the compile. This means that we can't
even safely stick the "export" in front of a declaration. We would have to
use macro magic for the declarations too, yuck!

Opinions?

-- 

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk