This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [Patch]: Separate classes for constant iterators and miscellaneous optimizations
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: gp dot bolton at computer dot org
- Cc: libstdc++ at gcc dot gnu dot org
- Date: 04 Aug 2003 01:35:13 +0200
- Subject: Re: [Patch]: Separate classes for constant iterators and miscellaneous optimizations
- Organization: Integrable Solutions
- References: <3F2D970B.9070609@free.fr>
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