mirror of
https://github.com/nlohmann/json.git
synced 2026-02-18 17:36:26 +00:00
Capture exceptions by const& in docs. (#4099)
This commit is contained in:
@@ -20,7 +20,7 @@ int main()
|
||||
{
|
||||
json::json_pointer p9("foo");
|
||||
}
|
||||
catch (json::parse_error& e)
|
||||
catch (const json::parse_error& e)
|
||||
{
|
||||
std::cout << e.what() << '\n';
|
||||
}
|
||||
@@ -30,7 +30,7 @@ int main()
|
||||
{
|
||||
json::json_pointer p10("/foo/~");
|
||||
}
|
||||
catch (json::parse_error& e)
|
||||
catch (const json::parse_error& e)
|
||||
{
|
||||
std::cout << e.what() << '\n';
|
||||
}
|
||||
@@ -40,7 +40,7 @@ int main()
|
||||
{
|
||||
json::json_pointer p11("/foo/~3");
|
||||
}
|
||||
catch (json::parse_error& e)
|
||||
catch (const json::parse_error& e)
|
||||
{
|
||||
std::cout << e.what() << '\n';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user