Boost logo

Boost :

From: Daniel Krügler (dsp_at_[hidden])
Date: 2004-01-27 11:29:49


Hello, David,

David Abrahams schrieb:
> Daniel Krügler <dsp_at_[hidden]> writes:
>
>
>>- Assumption one: Boost does not provide the definitions of
>>potential static constants hidden by the BOOST_STATIC_CONSTANT
>>definition (I used only the headers of the library, so my potential
>>testing bug would be that I had to include the corresponding
>>translation units of boost providing the constant's definitions,
>>but sorry - I did not find them!).

[snip]

>
>>As I said: If this assumption is false, please blame me straight
>>for incomplete testing and for trying to spread bad rumors on this
>>(really!) great library.
>
>
> It's probably not false in most cases.

Thanks for this answer, Dave.

>>- Assumption two: Even if Boost does provide these definitions,
>>there may occur problems due to the VC7.1 flags /Za and /Ze (aka
>>disabling and enabling language extensions), which I will explain
>>in the following. The same point applies as to assumptions one, if
>>I did incomplete testing or testing with rather old boost libraries.
>>
>>The nasty thing concerning the /Ze flag is that it effectively does
>>not "extend" the language in every case. A small testing case is the
>>following program:
>>

[snip]

> Looks like a bug to me.

Then we are two, at least. Thanks for your opinion.

>>Question: Is this special deficiency of the VC7.1 compiler taken
>>account in the current boost library?
>
>
> I doubt it. How would we do that?

I don't know. I hope, that there might exist a similar solution as
to the wchar_t problem (have a look at the thread "ICC wchar_t proposed
solution"), which takes advantage of a compiler macro _WCHAR_T_DEFINED
to do the right thing. Whether a similar #define exists for the /Za and
/Ze option, I don't know. Is anyone aware of this? A view into the
compiler help was not very convincing. The remark "..and automatically
defines the __STDC__ predefined macro for C programs" seems not very
helpful for C++ programs.

> Well, it seems to me that we can only respond to actual problems. Do
> you have an actual case of using a Boost library where these issues
> cause you trouble?

A contrived example for the first issue was given in my original
posting. I repeat it here again:
---------------------------------------------------------------
#include <boost/mpl/vector.hpp>
#include <boost/mpl/size.hpp>

void foo(const long&)
{
}

int main()
{
   typedef boost::mpl::vector<char, double> MyTypeContainer;
   typedef boost::mpl::size<MyTypeContainer> MPSizeType;

   foo(MPSizeType::value);
}
---------------------------------------------------------------

Switch to /Za, if you use the VC7.1, the mentioned mingw compiler will
choke anyway.

The second problem would result **iff** boost provides the missing
definitions of boost::mpl::size<>::value and similar. In this case
the VC7.1 compiler would choke similarily (but fortuneatly not the
mingw compiler any longer), if instead of the /Za flag the complimentary
/Ze flag is set :-((

Greetings,

Daniel


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