This may be a simple question for some of you. But I was wondering if the std::string container is a container. By container, I mean containers, for example, std::vector , std::list and std::deque .
Since std::basic_string<> accepts types other than integer characters, it is also optimized when working with character arrays. Itβs not clear to me in which category it falls.
This will compile:
#include <string> #include <iostream> int main() { std::basic_string<int> int_str; int_str.push_back(14); return 0; }
But adding this line:
std::cout << int_str << std::endl;
This is not true. Thus, from these facts, I can conclude that std :: basic_string was not intended to work with types other than characters.
This may be a strange question for you. The reason I need to know this is because I am working on a framework and I still canβt determine in which category the string will fall.
Tim
source share