|
Boost Users : |
From: David Abrahams (dave_at_[hidden])
Date: 2007-11-28 15:56:49
on Tue Nov 27 2007, "Robert Dailey" <rcdailey-AT-gmail.com> wrote:
> Hi,
>
> I heard from someone that when building a shared library (DLL file), the compiler will not do
> the same processing of MPL code that it would do for an EXE. For example:
>
> struct Foo
> {
> static const float val = 1.5f;
> };
>
> When exporting the 'Foo' class to a shared library, what will become
> of the 'val' member?
I'm pretty certain that code is illegal. AFAIK only integral constants
can be initialized inside the class body.
> Is just the number "1.5f" written out or what? I've given a very
> simple example, but the more complex example expands into the
> boost::mpl library, which follows the same concepts.
This example really has nothing to do with MPL, since initialization
of floats is not a compile-time operation in C++. Maybe you could be
more specific about what you're trying to do?
-- Dave Abrahams Boost Consulting http://www.boost-consulting.com
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net