|
Boost : |
From: Jeremy Siek (jsiek_at_[hidden])
Date: 2001-02-27 21:37:51
Another variation:
boost::iterator_adaptor<int*, reverse_iterator_policies,
iterator_traits_builder
::Reference<int>::Pointer<int*>::Distance<std::ptrdiff_t>
::Value<int>::Category<std::input_iterator_tag>
>
The above is closer to Aleksey's initial suggestion, except that the Base
type does not go into the iterator_traits_builder. Instead types not
specified in the iterator_traits_builder are assigned a default_argument
type, which the iterator_adaptor notices and swaps for the real default
type.
With the above, the iterator_adaptor just takes a Traits class as the
third argument, and people can optionally use the builder.
On Tue, 27 Feb 2001, David Abrahams wrote:
abraha> It's all very well and good to emulate keyword arguments,
abraha> but shouldn't they be optional? After all, the type
abraha> described below is nearly just:
abraha>
abraha> boost::iterator_adaptor<const int*, boost::reverse_iterator_policies>
abraha>
abraha> I realize the type below is more explicit, but it's also a
abraha> /lot/ more complex.
abraha>
----------------------------------------------------------------------
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