ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> boost
boost
[boost] Re: Re: Proven ptr<>
by Philippe A. Bouchard other posts by this author
Aug 12 2002 4:08PM messages near this date
Re: [boost] Proven ptr<> | [boost] Re: Re: Proven ptr<>
>  I'm not sure if this ptr<> type under discussion works this way, but in
>  general you can't conformingly use char* arithmetic with offsets to find
>  the sub-parts of non-POD types.

The offsets are what static_cast<> s return.  I cheat in the syntax when I
say ptr_base<T, __false_type> ::m_ptr is of type T *; it's just to make the
code cleaner.  It is a pointer to a memory block in fact but I have to
figure out the best way to properly align the allocated block with T, U and
extra integers before going further.  I was thinking of this pointee type:

template <typename T> 
    struct ptr_block
    {
        int m_counter;
        int m_typeid;

        union
        {
            int;
            T;
        } m_object;
    };

But operator new (size_t, rc_type const &) won't be easy to implement
because size_t is not a compile-time constant.



Philippe A. Bouchard





_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Thread:
Peter Dimov
Philippe A. Bouchard
David B. Held
David Abrahams
Philippe A. Bouchard
Philippe A. Bouchard
Greg Colvin
David B. Held
Philippe A. Bouchard
David Abrahams
David Abrahams
Philippe A. Bouchard
David Abrahams
Philippe A. Bouchard
Philippe A. Bouchard
Philippe A. Bouchard
Greg Colvin
Philippe A. Bouchard
Greg Colvin
Greg Colvin

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved