diff --git a/test/function_input_iterator_test.cpp b/test/function_input_iterator_test.cpp index 5443a11..6be27d2 100644 --- a/test/function_input_iterator_test.cpp +++ b/test/function_input_iterator_test.cpp @@ -10,6 +10,16 @@ #include #include + +#if !defined(BOOST_NO_CXX11_DECLTYPE) +// Force boost::result_of use decltype, even on compilers that don't support N3276. +// This enables this test to also verify if the iterator works with lambdas +// on such compilers with this config macro. Note that without the macro result_of +// (and consequently the iterator) is guaranteed to _not_ work, so this case is not +// worth testing anyway. +#define BOOST_RESULT_OF_USE_DECLTYPE +#endif + #include #include @@ -90,7 +100,7 @@ int main() BOOST_TEST_EQ(generated[i], static_cast(42 + i)); #if !defined(BOOST_NO_CXX11_LAMBDAS) && !defined(BOOST_NO_CXX11_AUTO_DECLARATIONS) \ - && (!defined(BOOST_NO_CXX11_DECLTYPE_N3276) || defined(BOOST_RESULT_OF_USE_DECLTYPE)) + && defined(BOOST_RESULT_OF_USE_DECLTYPE) // test the iterator with lambda expressions int num = 42; auto lambda_generator = [&num] { return num++; };