Boost logo

Boost :

From: Fernando Cacciola (fcacciola_at_[hidden])
Date: 2003-04-20 17:00:19


"Gennadiy Rozental" <gennadiy.rozental_at_[hidden]> escribió en el mensaje
news:b7tqjt$kng$1_at_main.gmane.org...
> > 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


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