From 3e4face0797e739a28e32345c4e2efdfb127a8c6 Mon Sep 17 00:00:00 2001 From: Peder Holt Date: Fri, 5 Oct 2007 14:32:04 +0000 Subject: [PATCH] Better support for BOOST_TYPEOF_NESTED_TYPEDEF for Borland [SVN r39707] --- include/boost/typeof/typeof_impl.hpp | 34 +++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/include/boost/typeof/typeof_impl.hpp b/include/boost/typeof/typeof_impl.hpp index 4d9962a..d627b85 100755 --- a/include/boost/typeof/typeof_impl.hpp +++ b/include/boost/typeof/typeof_impl.hpp @@ -106,6 +106,38 @@ namespace boost { namespace type_of { typedef _typeof_encode_fraction fraction_type; #endif +#ifdef __BORLANDC__ +namespace boost { namespace type_of { + template + struct generic_typeof_fraction_iter { + typedef generic_typeof_fraction_iter self_t; + static const int pos=(Pos::value); + static const int iteration=(pos/5); + static const int where=pos%5; + typedef typename Iter::template _apply_next::type fraction_type; + typedef generic_typeof_fraction_iter next; + typedef typename v_iter >::type type; + }; +}} +#define BOOST_TYPEOF_NESTED_TYPEDEF_IMPL(expr) \ + template\ + struct _typeof_encode_fraction {\ + typedef _typeof_encode_fraction<_Typeof_Iteration> self_t;\ + BOOST_STATIC_CONSTANT(int,_typeof_encode_offset = (_Typeof_Iteration*BOOST_TYPEOF_LIMIT_SIZE));\ + typedef boost::type_of::offset_vector,boost::mpl::size_t > _typeof_start_vector;\ + BOOST_PP_REPEAT(BOOST_TYPEOF_LIMIT_SIZE,BOOST_TYPEOF_NESTED_TYPEITEM,expr)\ + template\ + struct _apply_next {\ + typedef _typeof_encode_fraction type;\ + };\ + };\ + template\ + struct _typeof_fraction_iter {\ + typedef boost::type_of::generic_typeof_fraction_iter > self_t;\ + typedef typename self_t::next next;\ + typedef typename self_t::type type;\ + }; +#else #define BOOST_TYPEOF_NESTED_TYPEDEF_IMPL(expr) \ template\ struct _typeof_encode_fraction {\ @@ -124,7 +156,7 @@ namespace boost { namespace type_of { typedef typename boost::type_of::v_iter >::type type;\ typedef _typeof_fraction_iter next;\ }; - +#endif #ifdef __MWERKS__ # define BOOST_TYPEOF_NESTED_TYPEDEF(name,expr) \