Here is my code:
#include <iostream>
int main(int argc, char const *argv[])
{
std::string s = "hello";
std::cout << s.size() << std::endl;
return 0;
}
To my surprise, I can compile and run it with clang++
, though I even don't add #include <string>
.
So, is it necessary to add #include <string>
in order to use std::string
?