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

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

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -