Boost logo

Boost :

From: fresl_at_[hidden]
Date: 2001-03-17 13:53:51

It seems impossible to compile
either with g++ (one of the latest snapshots from
with its own library) or Comeau's compiler `como'
(with its library) because:

line 832: error: no default constructor exists for class
         transform_iterator_policies() { }
    detected during:
    instantiation of
    instantiation of
        T1, T2, 0>::compressed_pair_imp()
    instantiation of
    instantiation of
       "boost::iterator_adaptor<Base, Policies, Value,
                      Reference, Pointer, Category,
     instantiation of
     instantiation of
        "void _DefaultConstructible_concept_specification<_Type>
     instantiation of
        "void _TrivialIterator_concept_specification<
     instantiation of
        "void _InputIterator_concept_specification<
     instantiation of
        "_OutputIter std::copy(_InputIter, _InputIter,
     at line 38 of "transform_iterator_example.cpp"

When `std::bind1st(std::plus<int>(), 4)' is replaced
by `std::negate<int>()' in the call of `std::copy()',
example can be compiled by both compilers -- struct
`std::negate<>' (at least in g++ and como libraries)
has only `operator()' and therefore compilers can
generate default constructor.

It is possible to cheat and add default constructor to
`std::binder1st<>' (and to `binder2nd<>' and to ...),
but I wonder what standard says about default-construct-
ability of these functors.


Kresimir Fresl

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