Registry / utility / tl-function-ref

tl-function-ref

JSON →
library1.0.0vcpkgunverified

A lightweight, non-owning reference to a callable object.

vcpkg install tl-function-ref
INSTALL
IMPORT
SIG · TL-FUNCTION-REF
T
tl-function-ref
utilitycppv1.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

tl/function_ref.hpp
#include <tl/function_ref.hpp>

Use function_ref as a non-owning callable reference

#include <tl/function_ref.hpp> #include <iostream> void call(tl::function_ref<void(int)> f) { f(42); } int main() { auto lambda = [](int x) { std::cout << x << std::endl; }; call(lambda); return 0; }
Debug
Known issues
gotchafunction_ref does not extend the lifetime of the referenced callable; dangling references possible.
fix
Ensure the callable outlives the function_ref.
affects: *
Upgrade
Version history
1.0.0latest on vcpkg
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources

No resource links recorded.

tl-function-ref — pip install tl-function-ref · libregistry