Best way to make a template function conditionally @trusted

tsbockman thomas.bockman at gmail.com
Fri Apr 2 00:12:10 UTC 2021


On Friday, 2 April 2021 at 00:03:32 UTC, Paul Backus wrote:
> On Thursday, 1 April 2021 at 22:35:01 UTC, tsbockman wrote:
>> Is there a better way?
>
> Here's a technique I've used:
> ...
> As long as the compile-time check is correct, this is sound: 
> the @trusted lambda can be called from @safe code if and only 
> if `shouldBeSystem == false`.

Thanks. That is somewhat better than my version.


More information about the Digitalmars-d-learn mailing list