refCounted not @safe?
12345swordy
alexanderheistermann at gmail.com
Fri May 1 22:52:28 UTC 2020
On Friday, 1 May 2020 at 21:31:57 UTC, Steven Schveighoffer wrote:
> struct S {}
>
> void main() @safe
> {
> import std.typecons;
> auto s = S().refCounted;
> }
>
> Error: @safe function D main cannot call @system function
> std.typecons.refCounted!(S).refCounted
> Error: @safe function D main cannot call @system destructor
> std.typecons.RefCounted!(S,
> cast(RefCountedAutoInitialize)0).RefCounted.~this
>
> How do I do refCounted in @safe code?
You can't. You can't make it safe, unless you fix the bug
regarding destructors not being attribute friendly.
-Alex
More information about the Digitalmars-d
mailing list