Bug 2718 – Inconsistent string parameters in Phobos functions

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2009-03-09T10:11:00Z
Last change time
2015-06-09T01:21:08Z
Assigned to
andrei
Creator
clugdbug

Comments

Comment #0 by clugdbug — 2009-03-09T10:11:27Z
Some trivial inconsistencies in Phobos functions. Some of them are quite annoying. std.utf: string toUTF8(string s); -> string toUTF8(const(char)[] s); std.string: const(char)* toStringz(const(char)[] s); -> immutable(char)* toStringz(const(char)[] s); (Returning a const is always suspicious). std.stream: void write(char[] s); -> void write(const(char)[] s); size_t printf(char[] format,...); -> size_t printf(const(char)[] format,...); std.encoding: abstract const string toString(); -> abstract string toString();
Comment #1 by andrei — 2010-09-26T14:20:33Z