Skip to content

Commit

Permalink
CXX11
Browse files Browse the repository at this point in the history
  • Loading branch information
gogagum authored and Georgiy Guminov committed Jun 10, 2024
1 parent 4d51285 commit 93abb91
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 7 deletions.
5 changes: 0 additions & 5 deletions test/function_input_iterator_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@

#include <boost/config.hpp>

#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 <boost/core/lightweight_test.hpp>
#include <boost/iterator/function_input_iterator.hpp>
Expand Down Expand Up @@ -108,8 +106,6 @@ int main()
BOOST_TEST_EQ(*it3, 54);
}

#if !defined(BOOST_NO_CXX11_LAMBDAS) && !defined(BOOST_NO_CXX11_AUTO_DECLARATIONS) \
&& defined(BOOST_RESULT_OF_USE_DECLTYPE)
// test the iterator with lambda expressions
int num = 42;
auto lambda_generator = [&num] { return num++; };
Expand All @@ -123,7 +119,6 @@ int main()
BOOST_TEST_EQ(generated.size(), 10u);
for(std::size_t i = 0; i != 10; ++i)
BOOST_TEST_EQ(generated[i], static_cast<int>(42 + i));
#endif // BOOST_NO_CXX11_LAMBDAS

return boost::report_errors();
}
2 changes: 0 additions & 2 deletions test/function_output_iterator_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ int main()
BOOST_TEST_EQ(n, 6);
}

#if !defined(BOOST_NO_CXX11_LAMBDAS) && !defined(BOOST_NO_CXX11_AUTO_DECLARATIONS)
{
int n = 0;
auto it = boost::iterators::make_function_output_iterator([&n](int x) { n -= x; });
Expand All @@ -55,7 +54,6 @@ int main()

BOOST_TEST_EQ(n, -6);
}
#endif

return boost::report_errors();
}

0 comments on commit 93abb91

Please sign in to comment.