Make const char* keys streamable when exception is thrown
This commit is contained in:
parent
1ef43dcb29
commit
b5a01851d9
@ -100,6 +100,12 @@ inline const std::string KEY_NOT_FOUND_WITH_KEY(const std::string& key) {
|
|||||||
return stream.str();
|
return stream.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline const std::string KEY_NOT_FOUND_WITH_KEY(const char* key) {
|
||||||
|
std::stringstream stream;
|
||||||
|
stream << KEY_NOT_FOUND << ": " << key;
|
||||||
|
return stream.str();
|
||||||
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline const std::string KEY_NOT_FOUND_WITH_KEY(
|
inline const std::string KEY_NOT_FOUND_WITH_KEY(
|
||||||
const T& key, typename enable_if<is_numeric<T>>::type* = 0) {
|
const T& key, typename enable_if<is_numeric<T>>::type* = 0) {
|
||||||
@ -120,6 +126,12 @@ inline const std::string BAD_SUBSCRIPT_WITH_KEY(const std::string& key) {
|
|||||||
return stream.str();
|
return stream.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline const std::string BAD_SUBSCRIPT_WITH_KEY(const char* key) {
|
||||||
|
std::stringstream stream;
|
||||||
|
stream << BAD_SUBSCRIPT << " (key: \"" << key << "\")";
|
||||||
|
return stream.str();
|
||||||
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline const std::string BAD_SUBSCRIPT_WITH_KEY(
|
inline const std::string BAD_SUBSCRIPT_WITH_KEY(
|
||||||
const T& key, typename enable_if<is_numeric<T>>::type* = nullptr) {
|
const T& key, typename enable_if<is_numeric<T>>::type* = nullptr) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user