Modern C++ Won't Save Us

Kagamin spam at here.lot
Wed Apr 28 16:32:14 UTC 2021


On Tuesday, 27 April 2021 at 05:01:09 UTC, Walter Bright wrote:
> On 4/26/2021 1:20 PM, MoonlightSentinel wrote:
>> Isn't this an error that should be detected by DIP25 / 
>> DIP1000? I was quite surprised that -preview=dip1000 accepted 
>> this code.
>
> The checks are defeated by the @trusted function:
>
>     @property inout(To)* buffPtr() inout
>     {
>         return _ptr == useStack ? _buff.ptr : _ptr;
>     }
>
>
> https://github.com/dlang/phobos/blob/master/std/internal/cstring.d#L229

Introduced in 
https://github.com/dlang/phobos/commit/681964cfbfb4480e756f5f40d3e9871db2469937
How old is it?


More information about the Digitalmars-d mailing list