forked from TartanLlama/optional
Use correct is_swappable implementation for VS2017+
This commit is contained in:
@@ -22,7 +22,7 @@ TEST_CASE("Noexcept", "[noexcept]") {
|
||||
|
||||
SECTION("swap") {
|
||||
//TODO see why this fails
|
||||
#if !defined(_MSC_VER) || _MSC_VER > 1900
|
||||
#if !defined(_MSC_VER) || _MSC_VER >= 1900
|
||||
REQUIRE(noexcept(swap(o1, o2)) == noexcept(o1.swap(o2)));
|
||||
|
||||
struct nothrow_swappable {
|
||||
@@ -48,7 +48,7 @@ TEST_CASE("Noexcept", "[noexcept]") {
|
||||
|
||||
SECTION("constructors") {
|
||||
//TODO see why this fails
|
||||
#if !defined(_MSC_VER) || _MSC_VER > 1900
|
||||
#if !defined(_MSC_VER) || _MSC_VER >= 1900
|
||||
REQUIRE(noexcept(tl::optional<int>{}));
|
||||
REQUIRE(noexcept(tl::optional<int>{tl::nullopt}));
|
||||
|
||||
|
@@ -278,8 +278,8 @@ using enable_assign_from_other = detail::enable_if_t<
|
||||
!std::is_assignable<T &, const optional<U> &>::value &&
|
||||
!std::is_assignable<T &, const optional<U> &&>::value>;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
// TODO make a version which works with MSVC
|
||||
#if defined(_MSC_VER) && _MSC_VER < 1900
|
||||
// TODO make a version which works with MSVC 2015
|
||||
template <class T, class U = T> struct is_swappable : std::true_type {};
|
||||
|
||||
template <class T, class U = T> struct is_nothrow_swappable : std::true_type {};
|
||||
|
Reference in New Issue
Block a user