You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
9
+
10
+
```cpp
11
+
voidfoo (function_ref<int(int)> func) {
12
+
std::cout << "Result is " << func(21); //42
13
+
}
14
+
15
+
foo([](int i) { return i*2; });
16
+
```
17
+
18
+
Full documentation available [here](https://function-ref.tartanllama.xyz/).
0 commit comments