blob: 881eb1b9dd7d99c174a8eaf8a2721d0e3a6df643 [file] [log] [blame]
auto inferNothrow()
in
{
}
out
{
}
do
{
return 1;
}
auto dontInferNothrowIn()
in
{
throw new Exception(null);
}
do
{
return 1;
}
auto dontInferNothrowOut()
out
{
throw new Exception(null);
}
do
{
return 1;
}
enum isNothrow(Attr...) = (Attr.length >= 1)
&& (Attr[0] == "nothrow" || isNothrow!(Attr[1 .. $]));
static assert(isNothrow!(__traits(getFunctionAttributes, inferNothrow)));
static assert(!isNothrow!(__traits(getFunctionAttributes, dontInferNothrowIn)));
static assert(!isNothrow!(__traits(getFunctionAttributes, dontInferNothrowOut)));