Assigning a static array
Steven Schveighoffer
schveiguy at yahoo.com
Fri Apr 19 07:00:26 PDT 2013
On Thu, 18 Apr 2013 19:15:06 -0400, H. S. Teoh <hsteoh at quickfur.ath.cx>
wrote:
> I'm all for making this @system at the very least, if not outright
> compile error. Storing a persistent reference to a stack-allocated
> object is outright wrong... in the case of variadic array args, if the
> compiler can't prove that args will *always* be a dynamic array, then
> any attempt to save a reference to it should be rejected outright IMO.
I like bearophile's solution, we increasingly need scope to work for D to
be easy to avoid mistakes.
-Steve
More information about the Digitalmars-d-learn
mailing list