Topic: container requirements--erase()


Author: Max TenEyck Woodbury <mtew@cds.duke.edu>
Date: 1997/06/30
Raw View
Samsammy1 wrote:
>
> I agree to the above suggestion.
>
> I think there is just too much name pollution in the STL and C++ standard
> library.
>

    While I agree that .erase() could and should be synonomous with
.clear(), the argument about name space pollution is pretty thin. These
names appear WITHIN classes and each class is its own name space.

mtew@cds.duke.edu
---
[ comp.std.c++ is moderated.  To submit articles: Try just posting with your
                newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  Comments? mailto:std-c++-request@ncar.ucar.edu
]





Author: mcg@wheezy.CS.Berkeley.EDU (Michael C. Greenspon)
Date: 1997/06/18
Raw View
Is there any good reason that the container requirements for sequences
(23.1.1) and associative containers (23.1.2) overload the 'erase' function
for removing elements at specific locations, but then define a new named
function clear() to remove all the elements in the container?  Wouldn't it
make more sense / more elegance to overload erase() with no args as a
synonym for erase(begin(), end())  rather than taking up another very
common member name slot? (Remember, classes other than those supplied by
STL may be designed to meet the container requirements and this may
involve mixing in other interfaces.)

Any chance of this being changed in subsequent revisions of the draft?

Thanks,
--Michael Greenspon
---
[ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
[ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
[ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]





Author: samsammy1@aol.com (Samsammy1)
Date: 1997/06/18
Raw View
I agree to the above suggestion.

I think there is just too much name pollution in the STL and C++ standard
library.



varghese "sam" samuel
---
[ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
[ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
[ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]