Skip to content

Commit 377c767

Browse files
Updated exception handling to catch const reference in out_of_range (#4331)
Co-authored-by: LeilaSh <[email protected]>
1 parent 16b3d84 commit 377c767

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/examples/at__keytype_const.c++17.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ int main()
3636
// try to read from a nonexisting key using string_view
3737
std::cout << object.at("the fast"sv) << '\n';
3838
}
39-
catch (const json::out_of_range)
39+
catch (const json::out_of_range& e)
4040
{
4141
std::cout << "out of range" << '\n';
4242
}

0 commit comments

Comments
 (0)