mirror of
https://github.com/boostorg/mpl.git
synced 2025-08-03 14:54:30 +02:00
Used inheritance for syntax-friendly use in conditionals.
[SVN r18374]
This commit is contained in:
@@ -63,13 +63,25 @@ template<
|
|||||||
, typename BOOST_MPL_AUX_VOID_SPEC_PARAM(Last)
|
, typename BOOST_MPL_AUX_VOID_SPEC_PARAM(Last)
|
||||||
>
|
>
|
||||||
struct distance
|
struct distance
|
||||||
{
|
// Aleksey claims borland doesn't like inheritance here, but it passes
|
||||||
// agurt, 29/sep/02: Borland doesn't like inheritance here
|
// all the same tests; the workaround can easily be enabled again if
|
||||||
typedef typename aux::distance_impl<
|
// verified. -- dwa 2003/5/8
|
||||||
|
# if 1 || !defined(__BORLANDC__)
|
||||||
|
: aux::distance_impl<
|
||||||
typename BOOST_MPL_AUX_ITERATOR_CATEGORY(First)
|
typename BOOST_MPL_AUX_ITERATOR_CATEGORY(First)
|
||||||
, First
|
, First
|
||||||
, Last
|
, 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
|
BOOST_MPL_AUX_AGLORITHM_NAMESPACE_END
|
||||||
|
@@ -54,8 +54,8 @@ struct vector_iterator
|
|||||||
|
|
||||||
template< typename Other >
|
template< typename Other >
|
||||||
struct BOOST_MPL_AUX_ITERATOR_DISTANCE
|
struct BOOST_MPL_AUX_ITERATOR_DISTANCE
|
||||||
|
: minus<typename Other::pos,Pos>
|
||||||
{
|
{
|
||||||
typedef typename minus<typename Other::pos,Pos>::type type;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user