|
Boost : |
From: Jeremy Siek (jsiek_at_[hidden])
Date: 2001-03-04 16:37:42
I'm not sure that we've found the "perfect" solution... but at the same
time, I'd like to get iterator_adaptors out the door, and it would be bad
to change the interface later. So I'm in favor of going with the following
interface style (suggested by someone in an earlier email):
typedef
boost::iterator_adaptor_generator<int*, boost::default_iterator_policies,
boost::iterator_adaptor_types
::reference<int>
::iterator_category<std::input_iterator_tag>::type
>::type Iter;
The trick with getting this approach right, as Dave pointed out, is that
the creation of defaults can only happen for types that are suppose to be
defaulted. I've attached a file that does this. I've done a quick check to
make sure it works for VC++ and g++. The file creates a
iterator_adaptor_generator class... it should be straightforward to apply
the same technique to iterator_adaptor itself.
Cheers,
Jeremy
----------------------------------------------------------------------
Jeremy Siek www: http://www.lsc.nd.edu/~jsiek/
Ph.D. Candidate email: jsiek_at_[hidden]
Univ. of Notre Dame work phone: (219) 631-3906
----------------------------------------------------------------------
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk