Boost logo

Boost :

From: Jason Hise (chaos_at_[hidden])
Date: 2005-04-27 10:29:54


John Maddock wrote:

>> Right now, the following code will not compile for me:
>> typename aligned_storage < sizeof ( MyClass ) >::type storage;
>> this was formerly:
>> aligned_storage < sizeof ( MyClass ) > storage;
>> but I added the ::type after reading the above message. Am I doing
>> something wrong, or do I just need an up to date version of the library?
>>
>> I am using VC 7.1 and get the error:
>> error C2039: 'MyClass' : is not a member of
>> 'boost::aligned_storage<size_>'
>
>
> OK, lets take this a step at a time:
>
> 1) You didn't need to change anything, the whole point was that no
> existing code should break.

Ok, I was just thinking that using aligned_storage instead of
aligned_storage::type might have been an invalid usage from the
beginning (I probably should have tracked down the documentation).

> 2) The code you posted above should non-the-less compile. Are you
> using the latest cvs?

No I wasn't. I am now, and the problem has gone away :) However, I am
worried that people who still have the old version of aligned_storage
may be unable to test my singleton library when it comes up for review.
It appears that aligned storage itself is not a POD, so the ::type is
necessary. Should I package the new version of aligned_storage with the
singleton zip so that testers will not run into problems?

> The error message also looks strange: 'MyClass' is not a member of
> aligned_storage after all!

My mistake, that should read:
error C2039: 'type' : is not a member of 'boost::aligned_storage<size_>'

I was trying to translate a more complex use case and error message to a
simpler one, which I should have compiled independently.

-Jason


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