https://issues.dlang.org/show_bug.cgi?id=13544
Vladimir Panteleev <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #2 from Vladimir Panteleev <[email protected]> --- (In reply to Walter Bright from comment #0) > The signature for functions like std.file.copy() takes "in char[]" so it can > be called with both mutable and immutable strings. If an exception gets > thrown, the conservative assumption is that the source may get changed > so the string is duplicated. > > The problem, again, is bloat. > > The solution is to add two overloads for FileException, one taking string > and one taking const(char)[]. Doesn't that mean that we'd also need to add overloads to std.file.copy (and many other std.file functions)? (In reply to hsteoh from comment #1) > A better solution is to use to!string, which is a no-op if the source and > destination types are identical. That won't work for "in char[]", will it? It would only work by making the constructor templated. --
