Boost logo

Boost :

From: Levente Farkas (lfarkas_at_[hidden])
Date: 2001-10-04 11:25:03


hi,
I try to compile the attached example and faild both with MSVC 6sp5 and
gcc-2.96 on linux. the problem is in unary_compose (from compose1). even if I
switch from std::compose1 to boost::compose1 the problem exists. the reason
is a bit complicated. every function object (subclass of std::unary_function)
return with result_type which is usualy not a reference! what's more it
can't be a reference since everybody suppose these functions are return
with T& and result_type defined as T. that's the reason why projection_iterator
suppose it and put & the place where it's required. IMHO this whole
thing is a huge design mistake. result_type should have to be defined
as the real result type of operator(). anyway this would be a better
choise for argument_type too. solutions (if we don't would like to
change the whole stl paradigm to right way result_type have to be the
real result type,...) to change all functionals definition to
typename call_traits<typename unary_traits<Operation1>::result_type>::param_type
in this case all functor can be used as an argumnet for another functor.
without this this's unsolvable.
or anybody has any better idea?

 -- Levente "Si vis pacem para bellum!"



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