Boost logo

Boost :

From: Gennadiy Rozental (gennadiy.rozental_at_[hidden])
Date: 2003-04-20 04:52:42


> 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.


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