From dddbb00da467f10cb2fa01957aa33f7d2cc8b9db Mon Sep 17 00:00:00 2001 From: Peder Holt Date: Fri, 8 Sep 2006 16:21:49 +0000 Subject: [PATCH] Merged from HEAD: DMC support for BOOST_TYPEOF_NESTED_TYPEDEF [SVN r35049] --- include/boost/typeof/typeof_impl.hpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/include/boost/typeof/typeof_impl.hpp b/include/boost/typeof/typeof_impl.hpp index 7426905..0802199 100755 --- a/include/boost/typeof/typeof_impl.hpp +++ b/include/boost/typeof/typeof_impl.hpp @@ -94,6 +94,18 @@ namespace boost { namespace type_of { BOOST_STATIC_CONSTANT(int,BOOST_PP_CAT(value,n) = sizeof(boost::type_of::encode<_typeof_start_vector>(expr).item ## n));\ typedef boost::mpl::size_t BOOST_PP_CAT(item,n); +#ifdef __DMC__ +#define BOOST_TYPEOF_NESTED_TYPEITEM_2(z,n,expr)\ + typedef typename _typeof_encode_fraction::BOOST_PP_CAT(item,n) BOOST_PP_CAT(item,n); + +#define BOOST_TYPEOF_FRACTIONTYPE()\ + BOOST_PP_REPEAT(BOOST_TYPEOF_LIMIT_SIZE,BOOST_TYPEOF_NESTED_TYPEITEM_2,_)\ + typedef _typeof_fraction_iter fraction_type; +#else +#define BOOST_TYPEOF_FRACTIONTYPE()\ + typedef _typeof_encode_fraction fraction_type; +#endif + #define BOOST_TYPEOF_NESTED_TYPEDEF_IMPL(expr) \ template\ struct _typeof_encode_fraction {\ @@ -106,7 +118,8 @@ namespace boost { namespace type_of { BOOST_STATIC_CONSTANT(int,pos=(Pos::value));\ BOOST_STATIC_CONSTANT(int,iteration=(pos/BOOST_TYPEOF_LIMIT_SIZE));\ BOOST_STATIC_CONSTANT(int,where=pos%BOOST_TYPEOF_LIMIT_SIZE);\ - typedef typename boost::type_of::v_iter<_typeof_encode_fraction,boost::mpl::int_ >::type type;\ + BOOST_TYPEOF_FRACTIONTYPE();\ + typedef typename boost::type_of::v_iter >::type type;\ typedef _typeof_fraction_iter next;\ };