Function.withAttributes

Return a new Function object with the attributes attribute set to value.

struct Function
withAttributes
(
uint value
)

Examples

nothrow int answer();
enum model = refract!(answer, "answer");
with (FunctionAttribute) {
    mixin(
        model
        .withName("pureAnswer")
        .withAttributes(model.attributes | pure_)
        .mixture);
    static assert(functionAttributes!pureAnswer & pure_);
    static assert(functionAttributes!pureAnswer & nothrow_);
}

Meta