July 28, 2009 Does immutable(char)[] have any advantage over const(char)[] for function parameters? | ||||
---|---|---|---|---|
| ||||
I currently almost always use const(char)[] for function parameters to make it possible to also pass char[] strings to the function. Are there any disadvantages like optimization issues? |
July 28, 2009 Re: Does immutable(char)[] have any advantage over const(char)[] for function parameters? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Trass3r | On Tue, 28 Jul 2009 12:40:43 -0400, Trass3r <mrmocool@gmx.de> wrote:
> I currently almost always use const(char)[] for function parameters to make it possible to also pass char[] strings to the function.
>
> Are there any disadvantages like optimization issues?
The inability to use pure functions on those arguments. Although, I'm not sure where the threading model is going, this might be an old requirement, since only shared data would arbitrarily change during a function call.
-Steve
|
Copyright © 1999-2021 by the D Language Foundation