Fix compilation error that can occur with custom string not implicitely convertible to std::string

This commit is contained in:
Stephane Janel 2021-02-11 23:44:46 +01:00
parent 176d8e261a
commit dc7f80581c
2 changed files with 4 additions and 4 deletions

View File

@ -3499,7 +3499,7 @@ class basic_json
JSON_CATCH (std::out_of_range&) JSON_CATCH (std::out_of_range&)
{ {
// create better exception explanation // create better exception explanation
JSON_THROW(out_of_range::create(403, "key '" + key + "' not found", *this)); JSON_THROW(out_of_range::create(403, "key '" + std::string(key.begin(), key.end()) + "' not found", *this));
} }
} }
else else
@ -3550,7 +3550,7 @@ class basic_json
JSON_CATCH (std::out_of_range&) JSON_CATCH (std::out_of_range&)
{ {
// create better exception explanation // create better exception explanation
JSON_THROW(out_of_range::create(403, "key '" + key + "' not found", *this)); JSON_THROW(out_of_range::create(403, "key '" + std::string(key.begin(), key.end()) + "' not found", *this));
} }
} }
else else

View File

@ -20282,7 +20282,7 @@ class basic_json
JSON_CATCH (std::out_of_range&) JSON_CATCH (std::out_of_range&)
{ {
// create better exception explanation // create better exception explanation
JSON_THROW(out_of_range::create(403, "key '" + key + "' not found", *this)); JSON_THROW(out_of_range::create(403, "key '" + std::string(key.begin(), key.end()) + "' not found", *this));
} }
} }
else else
@ -20333,7 +20333,7 @@ class basic_json
JSON_CATCH (std::out_of_range&) JSON_CATCH (std::out_of_range&)
{ {
// create better exception explanation // create better exception explanation
JSON_THROW(out_of_range::create(403, "key '" + key + "' not found", *this)); JSON_THROW(out_of_range::create(403, "key '" + std::string(key.begin(), key.end()) + "' not found", *this));
} }
} }
else else