"Gennadiy Rozental" <[EMAIL PROTECTED]> escribió en el mensaje
news:[EMAIL PROTECTED]
> > In fact, it might be tempting to use the other bits as well.
> > For example, I'd imagine a variant implementation that uses
> > 8 bits to flag the currently active type. I imagine this interface:
> >
> >     template <class T>
> >     class aligned_storage
> >     {
> >         public:
> >
> >         void const*     address() const;
> >         void*           address();
> >
> >         unsigned char   tag() const;
> >         void            tag(unsigned char data);
> >     };
>
> In fact it might be tempting to use all of them available:
>
> template <class T>
> class aligned_storage
> {
>     typedef ... max_size_type_that_fit_in_padding;
> public:
>
>     void const*      address() const;
>     void*               address();
>
>     max_size_type_that_fit_in_padding   tag() const;
>     void                 tag(max_size_type_that_fit_in_padding data);
> };
>
> Gennadiy.
>
I think I like this enhanced version.
'max_size_type_that_fit_in_padding'
must better be one of the intergral types
to make easy and safe to use, so I guess that
there might ocurr that some bits
are wasted anyway.

Fernando Cacciola




_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to