pointers_data_members.hpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. #ifndef BOOST_TYPEOF_POINTERS_DATA_MEMBERS_HPP_INCLUDED
  5. #define BOOST_TYPEOF_POINTERS_DATA_MEMBERS_HPP_INCLUDED
  6. #include <boost/typeof/encode_decode_params.hpp>
  7. #include <boost/typeof/encode_decode.hpp>
  8. #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
  9. BOOST_TYPEOF_BEGIN_ENCODE_NS
  10. enum {PTR_DATA_MEM_ID = BOOST_TYPEOF_UNIQUE_ID()};
  11. template<class V, class P0, class P1>
  12. struct encode_type_impl<V, P0 P1::*>
  13. {
  14. typedef BOOST_TYPEOF_ENCODE_PARAMS(2, PTR_DATA_MEM_ID) type;
  15. };
  16. template<class Iter>
  17. struct decode_type_impl<boost::type_of::constant<std::size_t,PTR_DATA_MEM_ID>, Iter>
  18. {
  19. typedef Iter iter0;
  20. BOOST_TYPEOF_DECODE_PARAMS(2)
  21. template<class T> struct workaround{
  22. typedef p0 T::* type;
  23. };
  24. typedef typename decode_type_impl<boost::type_of::constant<std::size_t,PTR_DATA_MEM_ID>, Iter>::template workaround<p1>::type type;
  25. typedef iter2 iter;
  26. };
  27. BOOST_TYPEOF_END_ENCODE_NS
  28. #endif//BOOST_TYPEOF_POINTERS_DATA_MEMBERS_HPP_INCLUDED