callonce
Install
Docs
Reference
API
Examples
Downloads
Blog
Contact
??federation.sister-sites??

Run it once. Keep the result.

callonce wraps any C++ callable, executes it at most once per argument set, and caches what it returns. std::call_once with a return value, a reset, an argument-sensitive cache, and a choice of a zero-overhead or a lock-free policy. Header-only, MIT, C++20.

One wrapper, every callable One wrapper, every callable A single class template — memoized_invoke — takes free and member functions, lambdas, functors, std::function and std::bind_front results. CTAD deduces everything; there are no manual template arguments.Pick your synchronisation Pick your synchronisation single_threaded is a bare enum with no overhead. lock_free is an atomic CAS plus C++20 atomic::wait — exactly one thread runs the callable, the rest block until the value is ready.MIT licensed MIT licensed Permissive, no strings attached. Use it in commercial or open-source projects. The full text ships in the source archive and in the header itself.Version 1.0.0 Version 1.0.0 C++20, one header, no dependencies beyond the standard library. Builds standalone with CMake, embeds via add_subdirectory, or comes in through Conan.
callonce
Independent Embedded Systems Engineer & C++ Developer — Munich, Germany.
LinkedInXingGitHub
??footer.col_nav??
Home
Install
Docs
Reference
API
Examples
Downloads
Blog
Contact
??footer.col_contact??
📍Munich, Germany
✉demiralp@fedem.eu
📞+49 1523 640 34 50
🌐https://callonce.fedem.eu
??federation.sister-sites??
fedemcparse
© 2010–2026 Fehmi Demiralp
Legal Notice
·
Privacy Policy
·
Cookies
??footer.made_with.prefix?? ♥??footer.made_with.middle?? ??footer.made_with.wt????footer.made_with.suffix??
/legacy-cpanel