Properly constrain the basic_json conversion operator

Fixes #2491
This commit is contained in:
Louis Dionne
2021-06-17 13:17:43 -04:00
parent 926fab47d0
commit b0e5965d71
5 changed files with 41 additions and 19 deletions

View File

@@ -39,6 +39,7 @@ using nlohmann::json;
#include <list>
#include <cstdio>
#include <type_traits>
#include <utility>
#if (defined(__cplusplus) && __cplusplus >= 201703L) || (defined(_HAS_CXX17) && _HAS_CXX17 == 1) // fix for issue #464
@@ -620,4 +621,9 @@ TEST_CASE("regression tests 2")
nlohmann::to_json(o["foo"], s);
}
}
SECTION("issue #2825 - Properly constrain the basic_json conversion operator")
{
static_assert(std::is_copy_assignable<nlohmann::ordered_json>::value, "");
}
}