Because map
requires DefaultConstructible values, since when using subscript operator and the key is not found it adds it mapped to a default constructed value.
More Related Contents:
- Different behavior of C++ with default value for public vs private scope
- Object array initialization without default constructor
- Inheriting constructors
- What is difference between instantiating an object using new vs. without
- no default constructor exists for class
- Order of calling constructors/destructors in inheritance
- Dual emission of constructor symbols
- Why do we not have a virtual constructor in C++?
- What does a colon following a C++ constructor name do? [duplicate]
- Can the template parameters of a constructor be explicitly specified?
- What is constructor inheritance?
- How to use base class’s constructors and assignment operator in C++?
- Why shared_from_this can’t be used in constructor from technical standpoint?
- What is a copy constructor in C++?
- The copy constructor and assignment operator
- Why is the copy-constructor argument const?
- C++: When (and how) are C++ Global Static Constructors Called?
- How to pass a function pointer that points to constructor?
- Error: cannot bind non-const lvalue reference of type ‘int&’ to an rvalue of type ‘int’
- Why does C++ not have a const constructor?
- How do you use the non-default constructor for a member?
- How to use sfinae for selecting constructors?
- constructor invocation mechanism
- Calling a virtual function from the constructor
- “No appropriate default constructor available”–Why is the default constructor even called?
- Has the new C++11 member initialization feature at declaration made initialization lists obsolete?
- Default member values best practice
- Scope resolution operator being used twice
- Calling a constructor to re-initialize object
- C++ Constructor/Destructor inheritance