unsafe STL patch

François Dumont francois.cppdevs@free.fr
Thu Jan 28 20:45:00 GMT 2010


Hi

    Here is my new proposition, is it what you were expecting ?

    However it do not compile. When I run tests g++ complains about not 
knowing the __iter_base struct defined in bits/stl_algobase.h. I might 
be missing something obvious, do you see it ? I wonder if I have not a 
problem of pch. Is there any when building tests ? How to regenerate 
them or disable this feature ? It would also help me if you could tell 
me how to build/run tests from the testsuite_files I have generated 
without running the abi check ?

    Do you have a link to the FSF form ?

Bests

Paolo Carlini wrote:
> 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.
>   

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: iter_base.patch
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20100128/fab7216e/attachment.ksh>


More information about the Libstdc++ mailing list