On Fri, 25 Apr 2014 20:50:46 -0400, Ola Fosheim Grøstad
<ola.fosheim.grostad+dl...@gmail.com> wrote:
On Friday, 25 April 2014 at 15:32:40 UTC, Steven Schveighoffer wrote:
You know what, in fact, @nogc may need to be re-branded as
compiler-specific.
You should have a compiler switch that let's you get "compiler-optimal
non-portable @nogc".
I feel like I'm being a nag, but it sure seems to me like having something
like that is no different than custom behavior of @nogc. Basically, I have
a file blah.d, which can only be compiled with X, even if it's only with
the option X -extraNogcFunctionality
In other words, I have this function. It can avoid GC allocations if the
compiler can do extra steps to prove it. But not all compilers go to these
lengths.
So if I only care about compiling with savvy enough compilers, why do I
need to use some special compiler-specific escape? I think the attribute
is fine being defined as "if you can't do this without calling the GC,
refuse to compile," and the compiler may or may not compile it.
In any case, I don't need another explanation, I don't think it will ever
make sense to me.
-Steve