Skip to content
A lightweight, non-owning reference to a callable.
C++ CMake
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cmake Do CMake properly May 1, 2019
docs Docs Nov 24, 2017
include/tl Merge branch 'master' into cmake_love Jun 25, 2019
tests Merge branch 'master' into cmake_love Jun 25, 2019
.appveyor.yml Do CMake properly May 1, 2019
.gitignore Initial commit Nov 23, 2017
.gitmodules Do CMake properly May 1, 2019
.travis.yml
CMakeLists.txt Use FetchContent Jun 25, 2019
COPYING Initial commit Nov 23, 2017
README.md Update README.md Apr 29, 2019
standardese.config Docs Nov 24, 2017

README.md

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.


CC0

To the extent possible under law, Simon Brand has waived all copyright and related or neighboring rights to the function_ref library. This work is published from: United Kingdom.

You can’t perform that action at this time.