|
Boost Users : |
Subject: Re: [Boost-users] boost::bind overloaded operators
From: Thomas Heller (thom.heller_at_[hidden])
Date: 2012-07-11 09:56:03
On 07/11/2012 03:35 PM, tolik levchik wrote:
> Hello, i have some questions:
> 1) Why min_element give me errors without BOOST_RANGE_ENABLE_CONCEPT_ASSERT
> defined 0? Is it uses only for make error messages more readable? Is it safe
> to define it to 0?
> #include<vector>
> //#define BOOST_RANGE_ENABLE_CONCEPT_ASSERT 0
> #include<boost/range.hpp>
> #include<boost/range/adaptors.hpp>
> #include<boost/range/algorithm.hpp>
> #include<boost/range/numeric.hpp>
> #include<boost/bind.hpp>
>
> struct foo{
> int x;
> };
>
> int main()
> {
> using namespace boost::adaptors; using boost::bind;
>
> std::vector<foo> vec;
> auto rng = vec | transformed(bind(&foo::x, _1));
> boost::accumulate(rng, 0); // ok
> boost::min_element(rng); // error
> }
>
> 2) Why only logical operators overloaded for boost::bind and arithmetic one
> are not? Is it safe to define it manually with BOOST_BIND_OPERATOR?
The safest option would be to upgrade to Boost.Phoenix. It has
everything that Boost.Bind has and more!
>
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
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