-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add noexcept checks, and some missing noexcepts
- Loading branch information
Théo DELRIEU
committed
Jan 14, 2017
1 parent
7a7bc07
commit b023103
Showing
3 changed files
with
31 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#include <catch.hpp> | ||
|
||
#include "json.hpp" | ||
|
||
using nlohmann::json; | ||
|
||
enum test | ||
{ | ||
}; | ||
|
||
struct pod {}; | ||
struct pod_bis {}; | ||
|
||
void to_json(json &, pod) noexcept; | ||
void to_json(json &, pod_bis); | ||
static json j; | ||
|
||
static_assert(noexcept(json{}), ""); | ||
static_assert(noexcept(nlohmann::to_json(j, 2)), ""); | ||
static_assert(noexcept(nlohmann::to_json(j, 2.5)), ""); | ||
static_assert(noexcept(nlohmann::to_json(j, true)), ""); | ||
static_assert(noexcept(nlohmann::to_json(j, test{})), ""); | ||
static_assert(noexcept(nlohmann::to_json(j, pod{})), ""); | ||
static_assert(not noexcept(nlohmann::to_json(j, pod_bis{})), ""); | ||
static_assert(noexcept(json(2)), ""); | ||
static_assert(noexcept(json(test{})), ""); | ||
static_assert(noexcept(json(pod{})), ""); |