Re: [Boost-users] using transform_iterator with std::lower_bound

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? Thanks, Alexis Programming Tutorial: In Python: To do this, do this In Perl: To do this, do this or this or this or this... In C: To do this, do this, but be careful In C++: To do this, do this, but don't do this, be careful of this, watch out for this, and whatever you do, don't do this ____________________________________________________________________________________ Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping

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
participants (2)
-
Alexis H. Rivera-Rios
-
shunsuke