Boost logo

Boost :

From: MB (mb2act_at_[hidden])
Date: 2006-01-05 08:07:11


I think non-intrusive customization way needs four specializations;
'X', 'const X', 'volatile X' and 'const volatile X'.
At last, twenty specializations are required for five metafunctions.
I view that's something like the pitfall of public virtual interfaces.
Only range_result_iterator happens to work around by using remove_cv.


  I added followings to <libs/range/doc/example.cpp>:

    template< class Range >
    typename boost::range_result_iterator<Range>::type
    my_begin(Range& rng)
      return boost::begin(rng);

      // then...
      my_begin(cpair); // error

  Why not something like:

    template< class T >
    struct range_result_iterator :
      mpl::eval_if< is_const<T>,
        range_const_iterator< typename remove_cv<T>::type >,
        range_iterator< typename remove_cv<T>::type >
    { };


Boost list run by bdawes at, gregod at, cpdaniel at, john at