1 // Copyright (C) 2005 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 5 #ifndef BOOST_TYPEOF_ENCODE_DECODE_PARAMS_HPP_INCLUDED 6 #define BOOST_TYPEOF_ENCODE_DECODE_PARAMS_HPP_INCLUDED 7 8 #include <boost/preprocessor/cat.hpp> 9 #include <boost/preprocessor/repetition/repeat.hpp> 10 11 // Assumes iter0 contains initial iterator 12 13 #define BOOST_TYPEOF_DECODE_PARAM(z, n, text) \ 14 typedef boost::type_of::decode_type<iter##n> decode##n; \ 15 typedef typename decode##n::type p##n; \ 16 typedef typename decode##n::iter BOOST_PP_CAT(iter, BOOST_PP_INC(n)); 17 18 #define BOOST_TYPEOF_DECODE_PARAMS(n)\ 19 BOOST_PP_REPEAT(n, BOOST_TYPEOF_DECODE_PARAM, ~) 20 21 // The P0, P1, ... PN are encoded and added to V 22 23 #define BOOST_TYPEOF_ENCODE_PARAMS_BEGIN(z, n, text)\ 24 typename boost::type_of::encode_type< 25 26 #define BOOST_TYPEOF_ENCODE_PARAMS_END(z, n, text)\ 27 , BOOST_PP_CAT(P, n)>::type 28 29 #define BOOST_TYPEOF_ENCODE_PARAMS(n, ID) \ 30 BOOST_PP_REPEAT(n, BOOST_TYPEOF_ENCODE_PARAMS_BEGIN, ~) \ 31 typename boost::type_of::push_back<V, boost::type_of::constant<std::size_t,ID> >::type \ 32 BOOST_PP_REPEAT(n, BOOST_TYPEOF_ENCODE_PARAMS_END, ~) 33 34 #endif//BOOST_TYPEOF_ENCODE_DECODE_PARAMS_HPP_INCLUDED 35