c++ - When a string is "" or a vector has no elements, is `begin()` equal to `end()`? -
when std::string "" or vector has no elements, begin() equal end()?
if so, value of begin()/end()?
when std::string "" or vector has no elements, begin() equal end()?
yes, empty standard library container, including std::string , std::vector, begin() return same iterator end().
if so, value of begin()/end()?
it iterator unique container, should not dereferenced. doing cause undefined behavior.
Comments
Post a Comment