Boost logo

Boost Users :

From: shunsuke (pstade.mb_at_[hidden])
Date: 2008-02-05 12:42:17


Alexis H. Rivera-Rios wrote:
> Just so you know, the code compiles fine in VC2005 and
> Windriver Diab compiler. Gcc 3,4 is the one that
> complains. Can somebody explain me why that happens?

mem_fun_ref_t is not DefaultConstructible, so that
its transform_iterator is not.
lower_bound requires ForwardIterator, which shall be DefaultConstructible.
Hence, that code is not guaranteed to compile.

Easy workaround is to write functor type from scratch.
BTW, I'm proposing a library(waiting for review)
which contains workaround named `regular`: http://tinyurl.com/3awba9

Regards,

-- 
Shunsuke Sogame

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net