Boost logo

Boost :

From: Jeremy Siek (jsiek_at_[hidden])
Date: 2001-03-29 11:13:54


Hi Kresimir,

What a bummer, it looks like we can't legally use std::binder1st with
transform_iterator. The requirement for default constructor is not
accidental, it is absolutely required because the function object needs to
be contained in the iterator, and the standard requires iterators to have
default constructors. We'll have to use a replacement for binder1st in the
example.

Perhaps the lack of default constructor in std::binder1st qualifies as a
DR?

Cheers,
Jeremy

On Sat, 17 Mar 2001 fresl_at_[hidden] wrote:
fresl>
fresl> It seems impossible to compile
fresl> `transform_iterator_example.cpp'
fresl> either with g++ (one of the latest snapshots from
fresl> `http://www.codesourcery.com/gcc-snapshots.html',
fresl> with its own library) or Comeau's compiler `como'
fresl> (with its library) because:
fresl>
fresl> "/home/krcko/include/boost/iterator_adaptors.hpp",
fresl> line 832: error: no default constructor exists for class
fresl> "std::binder1st<std::plus<int>>"
fresl> transform_iterator_policies() { }
fresl>
fresl> It is possible to cheat and add default constructor to
fresl> `std::binder1st<>' (and to `binder2nd<>' and to ...),
fresl> but I wonder what standard says about default-construct-
fresl> ability of these functors.
fresl>
fresl>
fresl> Sincerely,
fresl>
fresl> Kresimir Fresl

----------------------------------------------------------------------
 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