October 2011
Beginner to intermediate
1200 pages
35h 33m
English
This is the prototype for the default constructor:
explicit basic_string(const Allocator& a = Allocator());
Typically, you would accept the default argument for the allocator class and would use the constructor to create empty strings:
string bean;wstring theory;
The following relationships hold after the default constructor is called:
• The data() method returns a non-null pointer to which 0 can be added.
• The size() method returns 0.
• The return value for capacity() is not specified.
Suppose you assign the value returned by data() to the pointer str. In this case, the first condition means str + 0 is valid.
Read now
Unlock full access