Boost logo

Boost-Commit :

From: peder.holt_at_[hidden]
Date: 2007-10-05 10:32:06


Author: burbelgruff
Date: 2007-10-05 10:32:04 EDT (Fri, 05 Oct 2007)
New Revision: 39707
URL: http://svn.boost.org/trac/boost/changeset/39707

Log:
Better support for BOOST_TYPEOF_NESTED_TYPEDEF for Borland
Text files modified:
   trunk/boost/typeof/typeof_impl.hpp | 34 +++++++++++++++++++++++++++++++++-
   1 files changed, 33 insertions(+), 1 deletions(-)

Modified: trunk/boost/typeof/typeof_impl.hpp
==============================================================================
--- trunk/boost/typeof/typeof_impl.hpp (original)
+++ trunk/boost/typeof/typeof_impl.hpp 2007-10-05 10:32:04 EDT (Fri, 05 Oct 2007)
@@ -106,6 +106,38 @@
     typedef _typeof_encode_fraction<self_t::iteration> fraction_type;
 #endif
 
+#ifdef __BORLANDC__
+namespace boost { namespace type_of {
+ template<typename Pos,typename Iter>
+ struct generic_typeof_fraction_iter {
+ typedef generic_typeof_fraction_iter<Pos,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<self_t::iteration>::type fraction_type;
+ typedef generic_typeof_fraction_iter<typename Pos::next,Iter> next;
+ typedef typename v_iter<fraction_type,mpl::int_<self_t::where> >::type type;
+ };
+}}
+#define BOOST_TYPEOF_NESTED_TYPEDEF_IMPL(expr) \
+ template<int _Typeof_Iteration>\
+ 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_TYPEOF_VECTOR(0)<>,boost::mpl::size_t<self_t::_typeof_encode_offset> > _typeof_start_vector;\
+ BOOST_PP_REPEAT(BOOST_TYPEOF_LIMIT_SIZE,BOOST_TYPEOF_NESTED_TYPEITEM,expr)\
+ template<int Next>\
+ struct _apply_next {\
+ typedef _typeof_encode_fraction<Next> type;\
+ };\
+ };\
+ template<typename Pos>\
+ struct _typeof_fraction_iter {\
+ typedef boost::type_of::generic_typeof_fraction_iter<Pos,_typeof_encode_fraction<0> > self_t;\
+ typedef typename self_t::next next;\
+ typedef typename self_t::type type;\
+ };
+#else
 #define BOOST_TYPEOF_NESTED_TYPEDEF_IMPL(expr) \
         template<int _Typeof_Iteration>\
         struct _typeof_encode_fraction {\
@@ -124,7 +156,7 @@
             typedef typename boost::type_of::v_iter<fraction_type,boost::mpl::int_<self_t::where> >::type type;\
             typedef _typeof_fraction_iter<typename Pos::next> next;\
         };
-
+#endif
 #ifdef __MWERKS__
 
 # define BOOST_TYPEOF_NESTED_TYPEDEF(name,expr) \


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk