Nathan Ridge wrote:
The following code illustrates the problem:
#include
#include int main() { int a[] = {1, 2, 3}; auto is_odd = [](int i){ return i % 2 == 1; }; boost::min_element(a | boost::adaptors::filtered(is_odd)); } The errors are shown below.
Is there a workaround for this?
Use oven::regular boost::min_element(a | boost::adaptors::filtered(pstade::oven::regular(is_odd)) ); and here is the documentation of oven::regular http://p-stade.sourceforge.net/oven/doc/html/oven/utilities.html#oven.utilit... *** Note *** `#define BOOST_RESULT_OF_USE_DECLTYPE` is necessary to compile the above code. Without this, we have compiler errors (the oven library seems not fully compatible with new compilers yet). Regards, Michel