
2013/1/17 Robert Jones
Hi All
Can anyone tell me what's wrong with this? The error message is so huge I'm a bit overwhelmed!
I suspect type deduction is failing, but none of my efforts to correct it have worked.
Thx, Rob.
#include
#include #include #include #include #include void f( const double & ) { }
template <class Compare> void sorted( Compare cmp ) { using boost::adaptors::adjacent_filtered; using boost::phoenix::arg_names::_1; using boost::phoenix::arg_names::_2;
std::vector<double> input = { 0.0, 1.0, 2.0, 3.0, 4.0 };
// Ok for_each( input | adjacent_filtered( cmp ) , f );
// Not Ok for_each( input | adjacent_filtered( bind( cmp, _1, _2 ) ) , f ); }
int main( ) { sorted( std::less<double>( ) ); }
Make sure your 'bind' comes from phoenix not std.