Re: [boost]Re: Re: [serialization] non-conformance incollection_load_imp.hpp

----- Mensaje original ----- De: Aleksey Gurtovoy <agurtovoy@meta-comm.com> Fecha: Sábado, Marzo 6, 2004 8:17 pm Asunto: Re: [boost]Re: Re: [serialization] non-conformance incollection_load_imp.hpp
This exchange illustrates the problem rather nicely. Its not clear to me from the name "aligned_storage" that its meant to do the same job as "stack_allocate" and in fact is easily confused with other boost functions. I've been able to find no documentation nor test nor other information. The only place its used is in variant.hpp but its not mentioned in the documentation of that either. There is no statement in the header itself as to what it does and the code is sufficiently non-trivial that it's not obvious what its supposed to do. The fact that it has a parameter than stack_allocate doesn't need also suggests that it's intended purpose is different from
Robert Ramey wrote: that
of stack_allocate.
It doesn't, see aligned_storage's "Rationale" subsection in http://tinyurl.com/39asx.
I don't quite get what you mean. So, does boost::aligned_storage serve as a replacement for stack_allocate? Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

JOAQUIN LOPEZ MU?Z writes:
Robert Ramey wrote:
Its not clear to me from the name "aligned_storage" that its meant to do the same job as "stack_allocate" and in fact is easily confused with other boost functions. I've been able to find no documentation nor test nor other information. The only place its used is in variant.hpp but its not mentioned in the documentation of that either. There is no statement in the header itself as to what it does and the code is sufficiently non-trivial that it's not obvious what its supposed to do. The fact that it has a parameter than stack_allocate doesn't need also suggests that it's intended purpose is different from that of stack_allocate.
It doesn't, see aligned_storage's "Rationale" subsection in http://tinyurl.com/39asx.
I don't quite get what you mean.
That the fact that 'aligned_storage' has different number/type of parameters _does not_ by itself suggests that it has different purpose. The difference is due to the cited rationale.
So, does boost::aligned_storage serve as a replacement for stack_allocate?
'stack_allocate' should be definitely using it, e.g.: template< typename T > struct stack_allocate { T* address() const { return static_cast<T*>(storage_.address()); } private: aligned_storage< sizeof(T), alignment_of<T>::value > storage_; }; -- Aleksey Gurtovoy MetaCommunications Engineering
participants (2)
-
Aleksey Gurtovoy
-
JOAQUIN LOPEZ MU?Z