Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 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 | #include <ndnboost/typeof/encode_decode_params.hpp> |
| 6 | |
| 7 | // member functions |
| 8 | |
| 9 | template<class V, class T, class R BOOST_PP_ENUM_TRAILING_PARAMS(n, class P)> |
| 10 | struct encode_type_impl<V, R(T::*)(BOOST_PP_ENUM_PARAMS(n, P)) BOOST_TYPEOF_qualifier> |
| 11 | { |
| 12 | typedef R BOOST_PP_CAT(P, n); |
| 13 | typedef T BOOST_PP_CAT(P, BOOST_PP_INC(n)); |
| 14 | typedef BOOST_TYPEOF_ENCODE_PARAMS(BOOST_PP_ADD(n, 2), BOOST_TYPEOF_id + n) type; |
| 15 | }; |
| 16 | |
| 17 | template<class Iter> |
| 18 | struct decode_type_impl<ndnboost::mpl::size_t<BOOST_TYPEOF_id + n>, Iter> |
| 19 | { |
| 20 | typedef Iter iter0; |
| 21 | BOOST_TYPEOF_DECODE_PARAMS(BOOST_PP_ADD(n, 2)) |
| 22 | template<class T> struct workaround{ |
| 23 | typedef BOOST_PP_CAT(p, n)(T::*type)(BOOST_PP_ENUM_PARAMS(n, p)) BOOST_TYPEOF_qualifier; |
| 24 | }; |
| 25 | typedef typename workaround<BOOST_PP_CAT(p, BOOST_PP_INC(n))>::type type; |
| 26 | typedef BOOST_PP_CAT(iter, BOOST_PP_ADD(n, 2)) iter; |
| 27 | }; |
| 28 | |
| 29 | // undef parameters |
| 30 | |
| 31 | #undef BOOST_TYPEOF_id |
| 32 | #undef BOOST_TYPEOF_qualifier |