Why invariants in D 2.0 std.string?

Adam D. Ruppe destructionator at gmail.com
Tue Oct 30 20:53:43 PDT 2007


I just grabbed the D 2.006 compiler, and there is a change from before that
I'm wondering why it was done.

In std.string, the functions previously worked with const(char)[]. Now, they
all work with invariant(char)[] instead, taking one in, and passing one back.

What is the reasoning behind that? Them promising not to change the string
makes sense, but requiring invariant doesn't seem quite right to me.


-- 
Adam D. Ruppe
http://arsdnet.net



More information about the Digitalmars-d mailing list