encode_decode.hpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. // Copyright (C) 2004 Arkadiy Vertleyb
  2. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  3. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  4. // boostinspect:nounnamed
  5. #ifndef BOOST_TYPEOF_ENCODE_DECODE_HPP_INCLUDED
  6. #define BOOST_TYPEOF_ENCODE_DECODE_HPP_INCLUDED
  7. #ifndef BOOST_TYPEOF_SUPPRESS_UNNAMED_NAMESPACE
  8. # define BOOST_TYPEOF_BEGIN_ENCODE_NS namespace { namespace boost_typeof {
  9. # define BOOST_TYPEOF_END_ENCODE_NS }}
  10. # define BOOST_TYPEOF_ENCODE_NS_QUALIFIER boost_typeof
  11. #else
  12. # define BOOST_TYPEOF_BEGIN_ENCODE_NS namespace boost { namespace type_of {
  13. # define BOOST_TYPEOF_END_ENCODE_NS }}
  14. # define BOOST_TYPEOF_ENCODE_NS_QUALIFIER boost::type_of
  15. # define BOOST_TYPEOF_TEXT "unnamed namespace is off"
  16. # include <boost/typeof/message.hpp>
  17. #endif
  18. BOOST_TYPEOF_BEGIN_ENCODE_NS
  19. template<class V, class Type_Not_Registered_With_Typeof_System>
  20. struct encode_type_impl;
  21. template<class T, class Iter>
  22. struct decode_type_impl
  23. {
  24. typedef int type; // MSVC ETI workaround
  25. };
  26. template<class T>
  27. struct decode_nested_template_helper_impl;
  28. BOOST_TYPEOF_END_ENCODE_NS
  29. namespace boost { namespace type_of {
  30. template<class V, class T>
  31. struct encode_type : BOOST_TYPEOF_ENCODE_NS_QUALIFIER::encode_type_impl<V, T>
  32. {};
  33. template<class Iter>
  34. struct decode_type : BOOST_TYPEOF_ENCODE_NS_QUALIFIER::decode_type_impl<
  35. typename Iter::type,
  36. typename Iter::next
  37. >
  38. {};
  39. }}
  40. #endif//BOOST_TYPEOF_ENCODE_DECODE_HPP_INCLUDED