string str = "aaaaa"; writefln(parse!(char)(str)); -- Result: conv.d(650): static assert "Dunno how to parse a char" --- Should work for generic code.
Types which should at least be handled: - char, wchar, dchar - cfloat, cdouble, creal - ifloat, idouble, ireal Probably also (with default behaviour e.g. bool -> "true" -> true, "false" -> false): - bool - string, wstring, dstring
I initially thought that more types are covered by parse, but find out after looking at code that it works only for integral and real types. So at least documentation should be improved.
to() and parse() can now convert from string to bool: http://www.dsource.org/projects/phobos/changeset/1646
Fixed: http://www.dsource.org/projects/phobos/changeset/2054 http://www.dsource.org/projects/phobos/changeset/2055