Boost logo

Boost :

From: Howard Hinnant (hinnant_at_[hidden])
Date: 2004-05-24 09:15:43


Sorry for the delay in replying.

On May 23, 2004, at 5:33 AM, Gennaro Prota wrote:

> On Sun, 16 May 2004 11:04:45 -0400, Howard Hinnant
> <hinnant_at_[hidden]> wrote:
>
>> I believe this is a compiler error and the only way I'm aware of to
>> work around it is to perform this computation:
>>
>> const bool no_padding = bits_per_block == CHAR_BIT *
>> sizeof(Block);
>> const mode m = table_width >= CHAR_BIT && no_padding
>> ? access_by_bytes : access_by_blocks;
>
> Sorry for asking again, but I tried CW9.2 evaluation version and it
> *doesn't* give errors. Since I'm worried that introducing two new
> class templates can trigger warnings/errors with other compilers,
> Would it be ok to write e.g.
>
> const bool no_padding = bits_per_block == CHAR_BIT * sizeof(Block);
> const bool table_is_large_enough = table_width >= CHAR_BIT;
>
> return do_count(
> m_bits.begin(), num_blocks(), Block(0),
> (mode_to_type<
> (no_padding && table_is_large_enough?)
> access_by_bytes : access_by_blocks
>> *) 0
> );
>
> ?

Yes, I believe this will work.

>> using class static const members instead of function-locale const
>> variables.
>>
>>> ### mwcc Compiler:
>>> # 1419: const ctype<Ch> & fac =
>>> BOOST_USE_FACET(ctype<Ch>,
>>> os.getloc());
>>> # Error: ^^^^^
>>> # undefined identifier 'ctype'
>>> # (included from:
>>> # dynamic_bitset.hpp:17
>>> # bitset_test.hpp:27
>>> # dyn_bitset_unit_tests1.cpp:12)
>>
>> Looks like <locale> is not getting included.
>
> This one is odd. I see that the command line used for regression
> testing includes "-runtime dmd", and our metrowerks config file has
>
> // locale support is disabled when linking with the dynamic runtime
> # ifdef _MSL_NO_LOCALE
> # define BOOST_NO_STD_LOCALE
> # endif
>
> Since I test for BOOST_NO_STD_LOCALE before #including it may well be
> that <locale> is not getting included :) But why everything works with
> CW 9.2 instead? Can you please confirm that _MSL_NO_LOCALE is defined
> for version 8.3 and not for 9.2?

That is correct, for building/using the std::lib in a DLL
configuration. When linking statically to the std::lib, _MSL_NO_LOCALE
is not defined for either release. When _MSL_NO_LOCALE is defined,
that means that facets (such as ctype) don't exist as well. In a
nutshell, chapter 22 disappears, along with everything that appears in
the <locale> synopsis.

-Howard


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