[Patch] PR11504: -Wcast-qual and general constness issues with stl_tree.h

Gabriel Dos Reis gdr@integrable-solutions.net
Sat Jul 26 09:53:00 GMT 2003


Gawain Bolton <gbolton@free.fr> writes:

| >Why repeat twice the same tokens, especially when the difference is
| >only in the type of the argument?
| >
| >     template<class _Np>
| >       static _Np
| >       _S_minimum(_Np __x)
| >       {
| >          while (__x->_M_left != 0)
| >            __x = __x->_M_left;
| >          return __x;
| >       }
| >
| Personally I don't like this because it's less obvious what's

Personnally, I do like that because it exposes some type-safety
issues (I don't think they are serious however).  The above is no more
obscure that the duplications you're proposing.

-- Gaby



More information about the Libstdc++ mailing list