Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 1 | // Copyright (C) 2004 Arkadiy Vertleyb |
| 2 | |
| 3 | // Distributed under the Boost Software License, Version 1.0. (See accompanying |
| 4 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
| 5 | |
| 6 | // boostinspect:nounnamed |
| 7 | |
| 8 | #ifndef BOOST_TYPEOF_ENCODE_DECODE_HPP_INCLUDED |
| 9 | #define BOOST_TYPEOF_ENCODE_DECODE_HPP_INCLUDED |
| 10 | |
| 11 | #include <ndnboost/mpl/deref.hpp> |
| 12 | #include <ndnboost/mpl/next.hpp> |
| 13 | |
| 14 | #ifndef BOOST_TYPEOF_SUPPRESS_UNNAMED_NAMESPACE |
| 15 | |
| 16 | # define BOOST_TYPEOF_BEGIN_ENCODE_NS namespace { namespace ndnboost_typeof { |
| 17 | # define BOOST_TYPEOF_END_ENCODE_NS }} |
| 18 | # define BOOST_TYPEOF_ENCODE_NS_QUALIFIER ndnboost_typeof |
| 19 | |
| 20 | #else |
| 21 | |
| 22 | # define BOOST_TYPEOF_BEGIN_ENCODE_NS namespace ndnboost { namespace type_of { |
| 23 | # define BOOST_TYPEOF_END_ENCODE_NS }} |
| 24 | # define BOOST_TYPEOF_ENCODE_NS_QUALIFIER ndnboost::type_of |
| 25 | |
| 26 | # define BOOST_TYPEOF_TEXT "unnamed namespace is off" |
| 27 | # include <ndnboost/typeof/message.hpp> |
| 28 | |
| 29 | #endif |
| 30 | |
| 31 | BOOST_TYPEOF_BEGIN_ENCODE_NS |
| 32 | |
| 33 | template<class V, class Type_Not_Registered_With_Typeof_System> |
| 34 | struct encode_type_impl; |
| 35 | |
| 36 | template<class T, class Iter> |
| 37 | struct decode_type_impl |
| 38 | { |
| 39 | typedef int type; // MSVC ETI workaround |
| 40 | }; |
| 41 | |
| 42 | template<class T> |
| 43 | struct decode_nested_template_helper_impl; |
| 44 | |
| 45 | BOOST_TYPEOF_END_ENCODE_NS |
| 46 | |
| 47 | namespace ndnboost { namespace type_of { |
| 48 | |
| 49 | template<class V, class T> |
| 50 | struct encode_type : BOOST_TYPEOF_ENCODE_NS_QUALIFIER::encode_type_impl<V, T> |
| 51 | {}; |
| 52 | |
| 53 | template<class Iter> |
| 54 | struct decode_type : BOOST_TYPEOF_ENCODE_NS_QUALIFIER::decode_type_impl< |
| 55 | typename Iter::type, |
| 56 | typename Iter::next |
| 57 | > |
| 58 | {}; |
| 59 | }} |
| 60 | |
| 61 | #endif//BOOST_TYPEOF_ENCODE_DECODE_HPP_INCLUDED |