c++ - Is there a design reason why std::set doesnt have front and back member functions? -


  1. i know can use *s.begin(), same argument can used vector, has front/back
  2. often use ordered property of set/map "smallest" element/key - ofc fact i not reason have it, example :)

here i'm talking design reasons why front/back bad design, please skip obvious reasons committee forgot it...

i imagine words "front" , "back" reserved sequence containers (i.e. order of elements determined order of insertion), , words meant suggest physical position in sequence.

since set not sequence container (but instead associative container), isn't appropriate. in particular, note meaning of "front" can change later insertions of unrelated element.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -