1 // Copyright (C) 2004 Arkadiy Vertleyb 2 // Use, modification and distribution is subject to the Boost Software 3 // License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) 4 5 #ifndef BOOST_TYPEOF_POINTERS_DATA_MEMBERS_HPP_INCLUDED 6 #define BOOST_TYPEOF_POINTERS_DATA_MEMBERS_HPP_INCLUDED 7 8 #include <boost/typeof/encode_decode_params.hpp> 9 #include <boost/typeof/encode_decode.hpp> 10 11 #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() 12 13 BOOST_TYPEOF_BEGIN_ENCODE_NS 14 15 enum {PTR_DATA_MEM_ID = BOOST_TYPEOF_UNIQUE_ID()}; 16 17 template<class V, class P0, class P1> 18 struct encode_type_impl<V, P0 P1::*> 19 { 20 typedef BOOST_TYPEOF_ENCODE_PARAMS(2, PTR_DATA_MEM_ID) type; 21 }; 22 23 template<class Iter> 24 struct decode_type_impl<boost::type_of::constant<std::size_t,PTR_DATA_MEM_ID>, Iter> 25 { 26 typedef Iter iter0; 27 BOOST_TYPEOF_DECODE_PARAMS(2) 28 29 template<class T> struct workaround{ 30 typedef p0 T::* type; 31 }; 32 typedef typename decode_type_impl<boost::type_of::constant<std::size_t,PTR_DATA_MEM_ID>, Iter>::template workaround<p1>::type type; 33 typedef iter2 iter; 34 }; 35 36 BOOST_TYPEOF_END_ENCODE_NS 37 38 #endif//BOOST_TYPEOF_POINTERS_DATA_MEMBERS_HPP_INCLUDED 39