before

Marks function/method for usage with AttributedFunction.

Former will call a Hook before calling attributed function/method and provide its return value as input parameter.

before
(
alias Hook
)

Parameters

Hook

function/method symbol to run before attributed function/method

parameter_name string

name in attributed function/method parameter list to bind result to

Return Value

Type: auto

internal attribute struct that embeds supplied information

Examples

int genID() { return 42; }

@before!genID("id")
void foo(int id, double something) {}

Meta