fix doc example typo
[boost.git] / boost / typeof / pointers_data_members.hpp
blob2b47e97a976224102293c701a1277a063175e76d
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)
5 #ifndef BOOST_TYPEOF_POINTERS_DATA_MEMBERS_HPP_INCLUDED
6 #define BOOST_TYPEOF_POINTERS_DATA_MEMBERS_HPP_INCLUDED
8 #include <boost/typeof/encode_decode_params.hpp>
9 #include <boost/typeof/encode_decode.hpp>
11 #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
13 BOOST_TYPEOF_BEGIN_ENCODE_NS
15 enum {PTR_DATA_MEM_ID = BOOST_TYPEOF_UNIQUE_ID()};
17 template<class V, class P0, class P1>
18 struct encode_type_impl<V, P0 P1::*>
20 typedef BOOST_TYPEOF_ENCODE_PARAMS(2, PTR_DATA_MEM_ID) type;
23 template<class Iter>
24 struct decode_type_impl<boost::mpl::size_t<PTR_DATA_MEM_ID>, Iter>
26 typedef Iter iter0;
27 BOOST_TYPEOF_DECODE_PARAMS(2)
29 template<class T> struct workaround{
30 typedef p0 T::* type;
32 typedef typename decode_type_impl<boost::mpl::size_t<PTR_DATA_MEM_ID>, Iter>::template workaround<p1>::type type;
33 typedef iter2 iter;
36 BOOST_TYPEOF_END_ENCODE_NS
38 #endif//BOOST_TYPEOF_POINTERS_DATA_MEMBERS_HPP_INCLUDED