[Patch]: Separate classes for constant iterators and miscellaneous optimizations
Gabriel Dos Reis
gdr@integrable-solutions.net
Sun Aug 3 23:35:00 GMT 2003
Gawain Bolton <gbolton@free.fr> writes:
| This patch introduces new classes for constant iterators for std::list
| and the _Rb_tree class which is used to implement the
| std::{multi}*{map|set} containers.
|
| The reasons for doing this are:
|
| * code clarity/simplicity
| * eliminate need for const_casts
I think we should aim at more code sharing than code duplication
targetting const_cast<> eliminating. "More codes" in headers means
potential increase in compile-time. We also need to take that aspect
into account when working on "perfomance" or code "header washing".
As of container member functions accepting or not-accepting
const_iterator, there is a library DR regarding const-correctness.
The general sentiment is that const_iterator should be accepted in
more situations than is currently the case.
-- Gaby
More information about the Libstdc++
mailing list