I am trying to implement a container like std::map in C++. I have a small query while overloading operator . I see that this operator works in two ways:
Mapped_T &operator(const Key_T &);
When the key does not exist,
std::map constructs a new value using the value class's default constructor, and returns a reference to the newly-inserted value.