Use correct is_swappable implementation for VS2017+

This commit is contained in:
Simon Brand
2019-02-19 10:57:43 +00:00
parent 3449fbc904
commit 7ef0154330
2 changed files with 4 additions and 4 deletions

View File

@@ -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}));

View File

@@ -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 {};