Skip to content

A lightweight, non-owning reference to a callable.

License

Notifications You must be signed in to change notification settings

stfkolev/function_ref

Repository files navigation

function_ref

A lightweight non-owning reference to a callable.

Clang + GCC: Linux Build Status MSVC: Windows Build Status

Use tl::function_ref instead of std::function whenever you don't need to own the callable. The most common case for this is function parameters which aren't stored anywhere:

void foo (function_ref<int(int)> func) {
    std::cout << "Result is " << func(21); //42
}

foo([](int i) { return i*2; });

Full documentation available here.

About

A lightweight, non-owning reference to a callable.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published