#include <iostream>
#include <map>

int main()
{
    std::map<int, int> m { { 4, 4 } };

    try
    {
        std::cout << m.at(4) << std::endl;

        m.at(5);
    }
    catch (std::out_of_range const& e)
    {
        std::cout << "out_of_range: " << e.what() << std::endl;
    }

    return 0;
}
