This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: unsafe STL patch


Hi,
> Hello
>
>    This is a patch proposition to:
> - Limit impact on STL safe mode on performance
> - Limit template method instanciation
>
>    My point is that once an iterator range has been validated thanks
> to the check_valid_range or any similar function it is useless to keep
> the safe wrapper when passing it to the normal container
> implementation. Of course the safe wrapper can only be removed if the
> check_valid_range has been able to validate that begin is before end
> which is only possible for random access iterator.
The idea makes sense.

I think it's becoming rather clear that a mechanism like your __unsafe
is rather useful in general: in stl_algobase.h I'm guilty to have
duplicated it two times in __miter_base and __niter_base. Are you
willing to figure out first an abstraction for that?
>    The patch is limited to the impact on the list safe implementation.
> If you find an interest in this patch I will generalize it to other
> safe containers, complete ChangeLog and perhaps fill a FSF form.
The conditional seems a bit strange to me: if the premise holds, then
the consequent should not have that <perhaps> in it ;)

Paolo.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]