add test to compile without exceptions

This commit is contained in:
Niels Lohmann
2020-08-10 09:48:11 +02:00
parent 1b28a58280
commit 4080d0b1a4
4 changed files with 16 additions and 5 deletions
+4 -2
View File
@@ -5,6 +5,8 @@
#include <utility> // pair
#include <vector> // vector
#include <nlohmann/detail/macro_scope.hpp>
namespace nlohmann
{
@@ -64,7 +66,7 @@ template <class Key, class T, class IgnoredLess = std::less<Key>,
}
}
throw std::out_of_range("key not found");
JSON_THROW(std::out_of_range("key not found"));
}
const T& at(const Key& key) const
@@ -77,7 +79,7 @@ template <class Key, class T, class IgnoredLess = std::less<Key>,
}
}
throw std::out_of_range("key not found");
JSON_THROW(std::out_of_range("key not found"));
}
size_type erase(const Key& key)