Does size_t(0)it use the same as used 0in the following code?
const string foo = "testing";
const size_t pos = foo.find("i");
string name = foo.substr(size_t(0), pos);
That is, when I bet only 0, does it convert to size_t(0)? If so, is one form preferable to another? I guess it t(0)is the best because it makes the conversion explicit. On the other hand, perhaps some programmers consider size_t(0)verbose? I guess in practice nobody cares.
source
share