Boost logo

Boost :

From: jsiek_at_[hidden]
Date: 1999-11-26 21:24:25


I suppose if the relational operators need to be added, the
right way to do it would be to use boost/operators.hpp,
and add the operators to the "helper" classes.

template <class DerivedClass>
struct foward_iterator_helper :
  public equality_comparable<DerivedClass,DerivedClass>,
  public postfix_inc_operator<DerivedClass>,
  public member_operator<DerivedClass> { };

template <class DerivedClass>
struct bidirectional_iterator_helper :
  public equality_comparable<DerivedClass,DerivedClass>,
  public postfix_inc_operator<DerivedClass>,
  public postfix_dec_operator<DerivedClass>,
  public member_operator<DerivedClass> { };

template <class DerivedClass>
struct random_access_iterator_helper :
  public equality_comparable<DerivedClass,DerivedClass>,
  public less_than_comparable<DerivedClass,DerivedClass>,
  public postfix_inc_operator<DerivedClass>,
  public postfix_dec_operator<DerivedClass>,
  public member_operator<DerivedClass>,
  public random_access_operators<DerivedClass> { };

On a side note. Are you guys aware of the addition of concept_checks.h
to the SGI STL implementation? If not let me put in a plug for that
technology. It allows a template library to check "up front" if the
input meets its requirements (at least, the "type" requirements), and
even tricks the compiler into giving halfway decent error messages.

jsiek_at_[hidden] writes:
>
> About the relational operators... I left them out on purpose, since
> they are covered by std::rel_ops. However, I'm not sure that is the
> right decision for practical portability reasons. What do you all
> think?
>
> Cheers,
>
> Jeremy


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk