[D1] capitalize cannot be interpreted at CT

strtr strtr at sp.am
Wed Jul 21 19:09:40 PDT 2010


Could somebody please explain this error to me.

----
import std.uni : toUniUpper;
import std.string : capitalize;

void main()
{
	const char[] name = `test`;

	// C:\dmd\src\phobos\std\string.d(983): Error: _aApplycd2 cannot be
interpreted at compile time, because it has no available source code
	const char[] name_c = capitalize(name);

	// my partial solution
	const char[] name_c2 = cast(char)toUniUpper(name[0]) ~ name[1..$];
}
----


More information about the Digitalmars-d-learn mailing list