----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/28094/#review61677 -----------------------------------------------------------
src/common/resources.cpp <https://reviews.apache.org/r/28094/#comment103459> I would suggest using `std::all_of` here except we can't use lambdas yet :( ```cpp return std::all_of( std::begin(that.resources), std::end(that.resources), [&](const Resource& resource) { return contains(resource); }); ``` Without lambdas, we need to use `bind` which gets nasty because `contains` is overloaded. ```cpp return std::all_of( std::begin(that.resources), std::end(that.resources), lambda::bind( static_cast<bool (Resources::*)(const Resource&)>(Resources::contains), this, lambda::_1)); ``` Sadness. - Michael Park On Nov. 15, 2014, 7:32 a.m., Jie Yu wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/28094/ > ----------------------------------------------------------- > > (Updated Nov. 15, 2014, 7:32 a.m.) > > > Review request for mesos, Ben Mahler and Vinod Kone. > > > Bugs: MESOS-1974 > https://issues.apache.org/jira/browse/MESOS-1974 > > > Repository: mesos-git > > > Description > ------- > > <= is non-intuitive. See ticket for details. > > > Diffs > ----- > > include/mesos/resources.hpp 0e37170 > src/cli/execute.cpp ddaa20d > src/common/resources.cpp e9a0c85 > src/examples/low_level_scheduler_libprocess.cpp 89b4318 > src/examples/low_level_scheduler_pthread.cpp e5cd48a > src/examples/no_executor_framework.cpp 9c84e03 > src/examples/test_framework.cpp e87198b > src/master/hierarchical_allocator_process.hpp 31dfb2c > src/master/master.cpp 83c2f8a > src/tests/mesos.hpp c1d64a7 > src/tests/resources_tests.cpp 3e50889 > src/tests/slave_recovery_tests.cpp 98e059f > > Diff: https://reviews.apache.org/r/28094/diff/ > > > Testing > ------- > > make check > > > Thanks, > > Jie Yu > >
