Used inheritance for syntax-friendly use in conditionals.

[SVN r18374]
This commit is contained in:
Dave Abrahams
2003-05-08 22:22:39 +00:00
parent 6337bf66de
commit e44d098414
2 changed files with 17 additions and 5 deletions

View File

@@ -63,13 +63,25 @@ template<
, typename BOOST_MPL_AUX_VOID_SPEC_PARAM(Last)
>
struct distance
// 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
>
# endif
{
// agurt, 29/sep/02: Borland doesn't like inheritance here
# 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

View File

@@ -54,8 +54,8 @@ struct vector_iterator
template< typename Other >
struct BOOST_MPL_AUX_ITERATOR_DISTANCE
: minus<typename Other::pos,Pos>
{
typedef typename minus<typename Other::pos,Pos>::type type;
};
};