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

Popular posts from this blog

php - cannot display multiple markers in google maps v3 from traceroute result -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -