A @nogc isValidDchar.

This commit is contained in:
Ferdinand Majerech 2014-07-29 01:57:07 +02:00
parent cac25207f1
commit 61424b0ac6

View file

@ -237,3 +237,10 @@ unittest
appender.putDChar('á');
assert(appender.data == "found unsupported escape character: 'a''unknown'");
}
/// @nogc version of std.utf.isValidDchar
bool isValidDchar(dchar c) @safe pure nothrow @nogc
{
return c < 0xD800 || (c > 0xDFFF && c <= 0x10FFFF);
}