XIEITE_LIFT(), XIEITE_LIFT_LOCAL(), XIEITE_LIFT_ONE(), XIEITE_LIFT_LOCAL_ONE()

Defined in header <xieite/lift.hpp>
(header-only: <xieite/pp/lift.hpp>)


Wraps a function in a lambda object.


Definitions

#0
#define XIEITE_LIFT(...) /* ... */
Expands to a lambda with no capture-default and variadic parameters.

#1
#define XIEITE_LIFT_LOCAL(...) /* ... */
Expands to a lambda with a reference capture-default and variadic parameters.

#2
#define XIEITE_LIFT_ONE(...) /* ... */
Expands to a lambda with no capture-default and one parameter.

#3
#define XIEITE_LIFT_LOCAL_ONE(...) /* ... */
Expands to a lambda with a reference capture-default and one parameter.


Example

#include <xieite/fwd.hpp>
#include <xieite/lift.hpp>
import std;

void run(auto&& fn) {
	std::invoke(XIEITE_FWD(fn), "Hello, world!\n");
}

int main() {
	run(XIEITE_LIFT(std::printf));
}
Output:
Hello, world!
View in Compiler Explorer