Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r51349 - in sandbox/mirror/boost/mirror: . detail
From: chochlik_at_[hidden]
Date: 2009-02-20 09:23:10


Author: matus.chochlik
Date: 2009-02-20 09:23:09 EST (Fri, 20 Feb 2009)
New Revision: 51349
URL: http://svn.boost.org/trac/boost/changeset/51349

Log:
[mirror 0.3.x]
- minor updates

Text files modified:
   sandbox/mirror/boost/mirror/detail/meta_attribs_base.hpp | 21 ++++++++-------------
   sandbox/mirror/boost/mirror/meta_attributes.hpp | 4 ++--
   2 files changed, 10 insertions(+), 15 deletions(-)

Modified: sandbox/mirror/boost/mirror/detail/meta_attribs_base.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/detail/meta_attribs_base.hpp (original)
+++ sandbox/mirror/boost/mirror/detail/meta_attribs_base.hpp 2009-02-20 09:23:09 EST (Fri, 20 Feb 2009)
@@ -312,9 +312,9 @@
                 Class& instance, \
                 position_of_##NAME position \
         ){return NULL;} \
- static inline type_of_##NAME* address_zero_based( \
+ static inline ptrdiff_t offset_of( \
                 position_of_##NAME position \
- ){return NULL;} \
+ ){return ptrdiff_t(-1);} \
         BOOST_MIRROR_REG_TEMPLATE_OR_CLASS_ATTRIB_EPILOGUE( \
                 TYPE_SELECTOR, \
                 NAME, \
@@ -384,9 +384,13 @@
                 Class& instance, \
                 position_of_##NAME position \
         ){return &instance.NAME;} \
- static inline type_of_##NAME* address_zero_based( \
+ static inline ptrdiff_t offset_of(\
                 position_of_##NAME position \
- ){return &(((Class*)0)->NAME);} \
+ ){ \
+ unsigned char arena[sizeof(Class)]; \
+ unsigned char* attr((unsigned char*)&(((Class*)arena)->NAME));\
+ return attr - arena; \
+ } \
         BOOST_MIRROR_REG_TEMPLATE_OR_CLASS_ATTRIB_EPILOGUE( \
                 TYPE_SELECTOR, \
                 NAME, \
@@ -574,15 +578,6 @@
                         (const unsigned char*)base_class::address(instance, pos)
                 );
         }
-
- template <int I>
- static inline ptrdiff_t offset_zero_based(mpl::int_<I> pos)
- {
- return calculate_offset(
- (const unsigned char*)0,
- (const unsigned char*)base_class::address_zero_based(pos)
- );
- }
 };
 
                 

Modified: sandbox/mirror/boost/mirror/meta_attributes.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/meta_attributes.hpp (original)
+++ sandbox/mirror/boost/mirror/meta_attributes.hpp 2009-02-20 09:23:09 EST (Fri, 20 Feb 2009)
@@ -851,9 +851,9 @@
                 }
 
                 // offset getter
- inline static ptrdiff_t offset_zero_based(void)
+ inline static ptrdiff_t offset_of(void)
                 {
- return meta_attributes::offset_zero_based(position());
+ return meta_attributes::offset_of(position());
                 }
 
                 // value getter


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk