Function to check, followed by a variadic number of function attributes as strings
true, if the function has the list of attributes attached and false otherwise.
real func(real x) pure nothrow @safe; static assert(hasFunctionAttributes!(func, "@safe", "pure")); static assert(!hasFunctionAttributes!(func, "@trusted")); // for templates attributes are automatically inferred bool myFunc(T)(T b) { return !b; } static assert(hasFunctionAttributes!(myFunc!bool, "@safe", "pure", "@nogc", "nothrow")); static assert(!hasFunctionAttributes!(myFunc!bool, "shared"));
Checks whether a function has the given attributes attached.