diff --git a/example/lambda_future.cpp b/example/lambda_future.cpp index 9e62b14c..b58d37af 100644 --- a/example/lambda_future.cpp +++ b/example/lambda_future.cpp @@ -23,7 +23,7 @@ #include #if defined BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION \ - && ! defined BOOST_NO_CXX11_LAMBDAS + && ! defined BOOST_NO_CXX11_LAMBDAS && ! (defined BOOST_MSVC && _MSC_VER < 1700) int main() diff --git a/example/with_lock_guard.cpp b/example/with_lock_guard.cpp index b53cbbf5..f3a4cd80 100644 --- a/example/with_lock_guard.cpp +++ b/example/with_lock_guard.cpp @@ -15,7 +15,7 @@ boost::mutex m; // protection for 'x' and 'std::cout' int x; -#if defined(BOOST_NO_CXX11_LAMBDAS) +#if defined(BOOST_NO_CXX11_LAMBDAS) || (defined BOOST_MSVC && _MSC_VER < 1700) void print_x() { ++x; std::cout << "x = " << x << std::endl; @@ -43,11 +43,11 @@ void job() { #endif int main() { -#if defined(BOOST_NO_CXX11_LAMBDAS) +#if defined(BOOST_NO_CXX11_LAMBDAS) || (defined BOOST_MSVC && _MSC_VER < 1700) std::cout << "(no lambdas)" << std::endl; #endif - boost::scoped_thread<> thread_1(job); - boost::scoped_thread<> thread_2(job); - boost::scoped_thread<> thread_3(job); + boost::scoped_thread<> thread_1((boost::thread(job))); + boost::scoped_thread<> thread_2((boost::thread(job))); + boost::scoped_thread<> thread_3((boost::thread(job))); return 0; } diff --git a/include/boost/thread/with_lock_guard.hpp b/include/boost/thread/with_lock_guard.hpp index cf3fdc24..63e7910e 100644 --- a/include/boost/thread/with_lock_guard.hpp +++ b/include/boost/thread/with_lock_guard.hpp @@ -16,7 +16,8 @@ namespace boost { #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && \ - !defined(BOOST_NO_CXX11_DECLTYPE) + !defined(BOOST_NO_CXX11_DECLTYPE) && \ + !defined(BOOST_NO_CXX11_TRAILING_RESULT_TYPES) /** * Utility to run functions in scope protected by mutex. diff --git a/test/sync/futures/async/async_pass.cpp b/test/sync/futures/async/async_pass.cpp index c67abe20..37253da3 100644 --- a/test/sync/futures/async/async_pass.cpp +++ b/test/sync/futures/async/async_pass.cpp @@ -182,7 +182,7 @@ int main() boost::this_thread::sleep_for(ms(300)); int res; { - check_timer timer(ms(300)); + check_timer timer(ms(500)); res = f.get(); } BOOST_TEST(res == 3); @@ -206,7 +206,7 @@ int main() boost::this_thread::sleep_for(ms(300)); int res; { - check_timer timer(ms(300)); + check_timer timer(ms(500)); res = f.get(); } BOOST_TEST(res == 3); @@ -230,7 +230,7 @@ int main() boost::this_thread::sleep_for(ms(300)); int res; { - check_timer timer(ms(300)); + check_timer timer(ms(500)); res = f.get(); } BOOST_TEST(res == 3); @@ -255,7 +255,7 @@ int main() boost::this_thread::sleep_for(ms(300)); int res; { - check_timer timer(ms(300)); + check_timer timer(ms(500)); res = f.get(); } BOOST_TEST(res == 3); @@ -279,7 +279,7 @@ int main() boost::this_thread::sleep_for(ms(300)); int res; { - check_timer timer(ms(300)); + check_timer timer(ms(500)); res = f.get(); } BOOST_TEST(res == 3); @@ -305,7 +305,7 @@ int main() boost::this_thread::sleep_for(ms(300)); int res; { - check_timer timer(ms(300)); + check_timer timer(ms(500)); res = f.get(); } BOOST_TEST(res == 3); @@ -332,7 +332,7 @@ int main() boost::this_thread::sleep_for(ms(300)); int res; { - check_timer timer(ms(300)); + check_timer timer(ms(500)); res = f.get(); } BOOST_TEST(res == 3); @@ -357,7 +357,7 @@ int main() boost::this_thread::sleep_for(ms(300)); int res; { - check_timer timer(ms(300)); + check_timer timer(ms(500)); res = f.get(); } BOOST_TEST(res == 3); @@ -384,7 +384,7 @@ int main() boost::this_thread::sleep_for(ms(300)); int res; { - check_timer timer(ms(300)); + check_timer timer(ms(500)); res = f.get(); } BOOST_TEST(res == 3); @@ -408,7 +408,7 @@ int main() boost::this_thread::sleep_for(ms(300)); int res; { - check_timer timer(ms(300)); + check_timer timer(ms(500)); res = f.get(); } BOOST_TEST(res == 3); @@ -432,7 +432,7 @@ int main() boost::this_thread::sleep_for(ms(300)); int res; { - check_timer timer(ms(300)); + check_timer timer(ms(500)); res = f.get(); } BOOST_TEST(res == 3); @@ -456,7 +456,7 @@ int main() boost::this_thread::sleep_for(ms(300)); int* res; { - check_timer timer(ms(300)); + check_timer timer(ms(500)); res = &f.get(); } BOOST_TEST(res == &i); @@ -479,7 +479,7 @@ int main() boost::this_thread::sleep_for(ms(300)); int* res; { - check_timer timer(ms(300)); + check_timer timer(ms(500)); res = &f.get(); } BOOST_TEST(res == &i); @@ -502,7 +502,7 @@ int main() boost::this_thread::sleep_for(ms(300)); int* res; { - check_timer timer(ms(300)); + check_timer timer(ms(500)); res = &f.get(); } BOOST_TEST(res == &i); @@ -526,7 +526,7 @@ int main() boost::this_thread::sleep_for(ms(300)); int* res; { - check_timer timer(ms(300)); + check_timer timer(ms(500)); res = &f.get(); } BOOST_TEST(res == &i); @@ -549,7 +549,7 @@ int main() boost::future f = boost::async(f2); boost::this_thread::sleep_for(ms(300)); { - check_timer timer(ms(300)); + check_timer timer(ms(500)); f.get(); } } @@ -570,7 +570,7 @@ int main() boost::future f = boost::async(boost::launch::async, f2); boost::this_thread::sleep_for(ms(300)); { - check_timer timer(ms(300)); + check_timer timer(ms(500)); f.get(); } } @@ -591,7 +591,7 @@ int main() boost::future f = boost::async(boost::launch::any, f2); boost::this_thread::sleep_for(ms(300)); { - check_timer timer(ms(300)); + check_timer timer(ms(500)); f.get(); } } @@ -613,7 +613,7 @@ int main() boost::future f = boost::async(boost::launch::deferred, f2); boost::this_thread::sleep_for(ms(300)); { - check_timer timer(ms(300)); + check_timer timer(ms(500)); f.get(); } } @@ -637,7 +637,7 @@ int main() boost::this_thread::sleep_for(ms(300)); MoveOnly res; { - check_timer timer(ms(300)); + check_timer timer(ms(500)); res = f.get(); } BOOST_TEST_EQ(res.value, 2); @@ -661,7 +661,7 @@ int main() boost::this_thread::sleep_for(ms(300)); MoveOnly res; { - check_timer timer(ms(300)); + check_timer timer(ms(500)); res = f.get(); } BOOST_TEST(res.value == 2); @@ -684,7 +684,7 @@ int main() boost::this_thread::sleep_for(ms(300)); boost::csbl::unique_ptr res; { - check_timer timer(ms(300)); + check_timer timer(ms(500)); res = f.get(); } BOOST_TEST(*res == 3); @@ -709,7 +709,7 @@ int main() boost::this_thread::sleep_for(ms(300)); boost::csbl::unique_ptr res; { - check_timer timer(ms(300)); + check_timer timer(ms(500)); res = f.get(); } BOOST_TEST(*res == 3); @@ -732,7 +732,7 @@ int main() boost::this_thread::sleep_for(ms(300)); boost::csbl::unique_ptr res; { - check_timer timer(ms(300)); + check_timer timer(ms(500)); res = f.get(); } BOOST_TEST(*res == 3); @@ -758,7 +758,7 @@ int main() boost::this_thread::sleep_for(ms(300)); boost::csbl::unique_ptr res; { - check_timer timer(ms(300)); + check_timer timer(ms(500)); res = f.get(); } BOOST_TEST(*res == 3); @@ -781,7 +781,7 @@ int main() boost::this_thread::sleep_for(ms(300)); boost::csbl::unique_ptr res; { - check_timer timer(ms(300)); + check_timer timer(ms(500)); res = f.get(); } BOOST_TEST(*res == 3); diff --git a/test/sync/mutual_exclusion/with_lock_guard/with_lock_guard_lambda.cpp b/test/sync/mutual_exclusion/with_lock_guard/with_lock_guard_lambda.cpp index 2b04d71a..8eda53de 100644 --- a/test/sync/mutual_exclusion/with_lock_guard/with_lock_guard_lambda.cpp +++ b/test/sync/mutual_exclusion/with_lock_guard/with_lock_guard_lambda.cpp @@ -20,7 +20,7 @@ #include #include -#if defined(BOOST_NO_CXX11_LAMBDAS) +#if defined(BOOST_NO_CXX11_LAMBDAS) || (defined BOOST_MSVC && _MSC_VER < 1700) void test_lambda() { std::cout << "C++11 lambda disabled" << std::endl; }