Struct Function

A struct capturing all the aspects of a function necessary to produce a string mixin that re-creates the function (excepting the body).

struct Function ;

Fields

NameTypeDescription
attributes immutable(ulong)Function attributes. Initial value: std.traits.functionAttributes!fun
body_ immutable(char[])Function body. Initial value: ;.
localName immutable(char[])A string that evaluates to a symbol representing the function in the local context.
name immutable(char[])Function name. Initial value: __traits(identifier, fun).
overloadIndex immutable(int)Index of function in its overload set, if created by functionsOf, or -1.
parameters immutable(Parameter[])Function parameters. Initial value: from the refracted function.
returnType immutable(char[])Return type. Initial value: bolts.experimental.refraction.ReturnType!fun.
static_ immutable(bool)If true, prefix generated function with static. Initial value: true if the refracted function is a static *member* function inside a struct, class, interface, or union.
udas immutable(char[][])User defined attributes. Initial value: ParameterAttribute!(fun, parameterIndex..., attributeIndex...).

Methods

NameDescription
argumentMixture () Return the argument list as a string.
argumentMixtureArray () Return the argument list as an array of strings.
attributeMixture () Return the attribute list as a string.
attributeMixtureArray () Return the attribute list as an array of strings.
mixture () Return mixin code for this Function.
withAttributes (value) Return a new Function object with the attributes attribute set to value.
withBody (value) Return a new Function object with the body_ attribute set to value.
withName (value) Return a new Function object with the name attribute set to value.
withParameters (value) Return a new Function object with the parameters attribute set to value.
withParametersAt (index, newParameters) Return a new Function object with newParameters inserted at the specified index in the attributes.
withReturnType (value) Return a new Function object with the returnType attribute set to value.
withStatic (value) Return a new Function object with the static_ attribute set to value.
withUdas (value) Return a new Function object with the udas attribute set to value.