XIEITE_LIFT(), XIEITE_LIFT_LOCAL(), XIEITE_LIFT_MEMBER()

Defined in header <xieite/pp/lift.hpp>

Wraps a function in a lambda object.


Definitions

#lift
#define XIEITE_LIFT(...) /* []??? { ??? } */
Expands to a lambda expression with no capture-default, a static specifier, and variadic forwarding reference parameters.

#lift-local
#define XIEITE_LIFT_LOCAL(...) /* [&]??? { ??? } */
Expands to a lambda expression with a reference capture-default and variadic forwaring reference parameters.

#lift-member
#define XIEITE_LIFT_MEMBER(...) /* []??? { ??? } */
Same as #lift but calls a member of its first parameter with the rest of its parameters. Expects the user to provide . or ->.


Example

void run(auto fn) {
	fn("Hello, world!");
}

int main() {
	run(XIEITE_LIFT(xieite::dump));
}
Output:
Hello, world!
[View in Compiler Explorer]