LeetCode 1146: Snapshot Array
The class template provided provides the necessary public interface, anything else should be private rather than public. Therefore the variable int curr_shot_id and the variable std::unordered_map&lt;int, std::vector&lt;pair&lt;int, int&gt;&gt;&gt; id_map; should be declared after private:.
The variable curr_shot_id should be initialized by the constructor SnapshotArray(int length).
    SnapshotArray(int length)
    : curr_shot_id{0}
    { }

It's not clear that you need a binary search of the map since a map is a direct access memory structure which means that the key will be hashed and that provides a direct reference to the object stored.