Boost logo

Boost :

Subject: Re: [boost] [Locale] Static locale initialisation
From: Alexander Lamaison (awl03_at_[hidden])
Date: 2010-04-11 10:37:01

On Sun, 11 Apr 2010 07:23:10 -0700 (PDT), Artyom wrote:

>> The problem seems to be that
>> std::has_facet looks for a Facet
>> with an id of 46 (0x2e).  But when it gets to this
>> line:
>>     const facet *_Facptr = _Id <
>> _Ptr->_Facetcount
>>    ? _Ptr->_Facetvec[_Id] : 0; // null if
>> id off end
>> _Facetcount is 46 so it decides it's off the end.  I
>> notice that in the
>> working version _Facet::id is 44 (0x2c).
> Till I get to VS at evening so I'll be able to answer. Few questions:
> 1. Are you using statically or dynamically liked boost.locale?


> 2. Are you using statically or dynamically liked boost.test?


> 3. If you use dynamically liked versions do you specify correct import
> defines?


> 4. The last what parameters of CMake did you used when you build
> boost.locale library.

I'm afraid I don't understand the question

> 5. I really hope that after build you did not switch Debug/Release from
> the MSVC project but rather prepared two solutions with passing
> correct options to CMake?

I generated the single solution using CMake which puts a debug and release
configuration in the same file. This is how it's supposed to work, right?
I didn't run CMake twice to create two seperate solutions.

>> Any idea what's happening here?
> Yes... This is what called why I love dlls very much ;-)
> So it is very easy to screw everything up when using dlls and static
> class members...
> So what happens something somehow didn't used everything correctly.
> So you should be extremely careful when creating or using DLLs.

I'm not using DLLs here! My repro code does it with a simple EXE. All it
takes is a single static locale instance. This may even repro on Linux.
> Each facet type should have specific unique id which is static member
> of facet class (std::locale::id).
> If this id is not unique - two different ids would be created
> and thus there would be mismatch of facets and you would not
> be able to use them.

Where are these ids generated? I tried to find it but it seems that they
appear by magic :P

> P.P.S.: I'll take a look on the code you gave today or tomorrow.



Boost list run by bdawes at, gregod at, cpdaniel at, john at