Is string class a container too ?
As I see, it also has begin and end iterator/
Thankyou
Printable View
Is string class a container too ?
As I see, it also has begin and end iterator/
Thankyou
std::string is really just a typedef for std::basic_string<char>
I believe std::string meets most of the requirements for a container. I'm not sure it meets all of them.
From the 2003 standard:
Quote:
21.3 paragraph 2
The class template basic_string conforms to the requirements of a Sequence, as specified in (23.1.1).
Additionally, because the iterators supported by basic_string are random access iterators (24.1.5),
basic_string conforms to the the requirements of a Reversible Container, as specified in (23.1).