From 4b91299d10c0c45fb0e2821ffd9fc5f106b20c34 Mon Sep 17 00:00:00 2001 From: akumta Date: Wed, 20 Jan 2016 11:15:40 -0800 Subject: [PATCH] update for ticket #11927 std::swap for C++ 03 is located under and for C++11 under --- test/optional_test_swap.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/optional_test_swap.cpp b/test/optional_test_swap.cpp index dac7ae1..1bb679c 100644 --- a/test/optional_test_swap.cpp +++ b/test/optional_test_swap.cpp @@ -23,6 +23,13 @@ #include "boost/core/lightweight_test.hpp" +#if __cplusplus < 201103L +#include +#define SWAP_EX_SPEC +#else +#include +#define SWAP_EX_SPEC noexcept +#endif using boost::optional; using boost::none; @@ -237,12 +244,14 @@ void swap(optional_swap_test::class_whose_default_ctor_should_be_used & x, optio template <> void swap(optional_swap_test::class_whose_default_ctor_should_not_be_used & x, optional_swap_test::class_whose_default_ctor_should_not_be_used & y) +SWAP_EX_SPEC { optional_swap_test::swap(x, y); } template <> void swap(optional_swap_test::class_without_default_ctor & x, optional_swap_test::class_without_default_ctor & y) +SWAP_EX_SPEC { optional_swap_test::swap(x, y); }