Challenge: write a reference counted slice that works as much as possible like a built-in slice
Tejas
notrealemail at gmail.com
Wed Dec 15 02:13:53 UTC 2021
On Tuesday, 14 December 2021 at 15:51:58 UTC, Atila Neves wrote:
> On Tuesday, 14 December 2021 at 12:14:52 UTC, Tejas wrote:
>> On Thursday, 11 November 2021 at 09:24:17 UTC, Atila Neves
>> wrote:
>>> On Wednesday, 10 November 2021 at 13:52:26 UTC, deadalnix
>>> wrote:
>>>> [...]
>>>
>>> `@disable this();`, but you knew that. It's true that
>>> requiring a programmer to do something to prevent bugs is a
>>> terrible idea. Sigh.
>>
>> Sorry for reviving this thread, was just sifting through...
>> The following code also outputs `dtor!`, unfortunately :(
>>
>> ```d
>>
>> import std.stdio:writeln;
>>
>> struct S{
>> @disable this();
>> ~this(){
>> writeln("dtor!");
>> }
>> }
>>
>> void main(){
>> S s = void;
>> }
>>
>> ```
>>
>> Compiler :
>> LDC - the LLVM D compiler (1.25.0):
>> based on DMD v2.095.1 and LLVM 11.1.0
>
> Is there an issue for this?
Apparently one will have to develop a program that will showcase
UB with this type of code. Only then will a bug report be
accepted.
And I lack the skill to do that :(
More information about the Digitalmars-d
mailing list