Function 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.

Prototype

auto before(alias Hook)(
  string parameter_name
);

Parameters

NameDescription
Hook function/method symbol to run before attributed function/method
parameter_name name in attributed function/method parameter list to bind result to

Returns

internal attribute struct that embeds supplied information

Example

int genID() { return 42; }

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

Authors

Михаил Страшун

Copyright

© 2013 RejectedSoftware e.K.

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.