From 66193b0d3815d00f54ea46253beac46a9eae5664 Mon Sep 17 00:00:00 2001 From: "Vicente J. Botet Escriba" Date: Fri, 17 Apr 2015 18:31:34 +0200 Subject: [PATCH] Test with generic lambdas. --- example/lambda_future.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/example/lambda_future.cpp b/example/lambda_future.cpp index 6df1cee7..fd15d448 100644 --- a/example/lambda_future.cpp +++ b/example/lambda_future.cpp @@ -42,6 +42,14 @@ int main() int result = f2.get(); BOOST_THREAD_LOG << "f2 " << result << BOOST_THREAD_END_LOG; } +#if ! defined BOOST_NO_CXX14_GENERIC_LAMBDAS + { + boost::future f1 = boost::async(boost::launch::async, []() {return 123;}); + boost::future f2 = f1.then([](auto f) {return 2*f.get(); }); + int result = f2.get(); + BOOST_THREAD_LOG << "f2 " << result << BOOST_THREAD_END_LOG; + } +#endif } catch (std::exception& ex) {