Best practices for logical const

Steven Schveighoffer schveiguy at yahoo.com
Sat Feb 15 19:16:15 PST 2014


On Sat, 15 Feb 2014 22:04:25 -0500, Meta <jared771 at gmail.com> wrote:

> Obviously this is extremely contrived, but inout is effectively logical  
> const here. Is there no way to know what the "original" mutability of t  
> is at compile-time?

No, because only one version of the function is generated. That is part of  
the benefit of inout over a template.

If you DO want to know whether it's mutable, use a template.

-Steve


More information about the Digitalmars-d mailing list