From e44d098414cd28356fe5c3dc75830d56bd1cc566 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Thu, 8 May 2003 22:22:39 +0000 Subject: [PATCH] Used inheritance for syntax-friendly use in conditionals. [SVN r18374] --- include/boost/mpl/distance.hpp | 20 ++++++++++++++++---- include/boost/mpl/vector/aux_/iterator.hpp | 2 +- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/include/boost/mpl/distance.hpp b/include/boost/mpl/distance.hpp index 71c06ca..bd28d2c 100644 --- a/include/boost/mpl/distance.hpp +++ b/include/boost/mpl/distance.hpp @@ -63,13 +63,25 @@ template< , typename BOOST_MPL_AUX_VOID_SPEC_PARAM(Last) > struct distance -{ - // agurt, 29/sep/02: Borland doesn't like inheritance here - typedef typename aux::distance_impl< +// Aleksey claims borland doesn't like inheritance here, but it passes +// all the same tests; the workaround can easily be enabled again if +// verified. -- dwa 2003/5/8 +# if 1 || !defined(__BORLANDC__) + : aux::distance_impl< typename BOOST_MPL_AUX_ITERATOR_CATEGORY(First) , First , Last - >::type type; + > +# endif +{ +# if 0 && defined(__BORLANDC__) + typedef typename aux::distance_impl< + typename BOOST_MPL_AUX_ITERATOR_CATEGORY(First) + , First + , Last + >::type type; + BOOST_STATIC_CONSTANT(typename type::value_type, value = type::value); +# endif }; BOOST_MPL_AUX_AGLORITHM_NAMESPACE_END diff --git a/include/boost/mpl/vector/aux_/iterator.hpp b/include/boost/mpl/vector/aux_/iterator.hpp index a61ae60..2a6f513 100644 --- a/include/boost/mpl/vector/aux_/iterator.hpp +++ b/include/boost/mpl/vector/aux_/iterator.hpp @@ -54,8 +54,8 @@ struct vector_iterator template< typename Other > struct BOOST_MPL_AUX_ITERATOR_DISTANCE + : minus { - typedef typename minus::type type; }; };