On Thursday, May 16, 2013 11:13:27 Regan Heath wrote: > So, I think in cases where the function/method doesn't need to retain the > argument for longer than the lifetime of the call it should accept > const(char), otherwise as you mentioned earlier it's better to simply > require the caller provide the immutable(char) you require.
Well, as I said, the decision depends on what you're doing with the string. If you're just operating on it and not storing it or duping it, then const(char)[] or inout(char)[] makes the most sense, whereas if you're storing it or duping it, odds are that immutable(char)[] makes the most sense. - Jonathan M Davis