Hi,

    I have a question about smart pointer policies.  I feel this is some
missing link in shifted_ptr.

Definitions:
1)
struct shifted_header
{
    union
    {
        int m_count;
        void * m_owner;
    };

    ...
};

2)
template <typename T>
    struct shifted_object
    {
        shifted_header m_header;
        T m_object;
    };

3)
void * operator new (size_t, shifted_type const &) returns a pointer of type
T, sizeof(shifted_object), member of shifted_object<T>.

$100 Question:
When I am looking at the "Storage Policy", p. 189, Modern C++ Design; the
class must be initialized by a StoredType object while in my situation the
StoredType is a shifted_object<T> and 'new (so) T' returns a pointer to T
(member of shifted_boject<T>).  What am I supposed to do if I want to keep
it optimized and simple?



Thanks,

Philippe A. Bouchard




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

Reply via email to