Boost logo

Boost :

Subject: Re: [boost] boost::aligned_storage is not a POD.
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2017-02-11 22:17:55


Le 11/02/2017 à 18:01, Andrey Semashev via Boost a écrit :
> On 02/11/17 19:25, Vicente J. Botet Escriba via Boost wrote:
>> Hi,
>>
>> boost::aligned_storage is not a POD.
>>
>> I suspect it is because of the declared constructors
>>
>>
>> private: // noncopyable
>>
>> aligned_storage(const aligned_storage&);
>> aligned_storage& operator=(const aligned_storage&);
>>
>> public: // structors
>>
>> aligned_storage()
>> {
>> }
>>
>> ~aligned_storage()
>> {
>> }
>>
>>
>> Was this intentional?
>>
>> Why aligned_storage is not copyable?
>
> The usage pattern of boost::aligned_storage is different from that of
> std::aligned_storage. You can get a POD type through the nested type
> typedef:
>
> typedef boost::aligned_storage< 16 >::type aligned_storage_pod;
>
Thanks, I missed the usage as a trait.
> I think, boost::aligned_storage is not copyable because it doesn't
> know how to copy the contents. And since in C++03 it can't define
> =default constructors, it had to define a user-defined constructor
> making the type non-POD.
No problem.

Vicente


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