mirror of
https://github.com/nlohmann/json.git
synced 2026-02-26 13:26:28 +00:00
Capture exceptions by const& in docs. (#4099)
This commit is contained in:
@@ -11,7 +11,7 @@ int main()
|
||||
json j = {1, 2, 3, 4};
|
||||
j.at(4) = 10;
|
||||
}
|
||||
catch (json::out_of_range& e)
|
||||
catch (const json::out_of_range& e)
|
||||
{
|
||||
// output exception information
|
||||
std::cout << "message: " << e.what() << '\n'
|
||||
|
||||
Reference in New Issue
Block a user