We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f9b7c54 commit 1c4417dCopy full SHA for 1c4417d
docs/index.md
@@ -36,7 +36,17 @@ public:
36
R <a href='doc_function_ref.html#tl::function_ref-R(Args...)-::operator()(Args...)const'>operator()</a>(Args... args) const;
37
};</code></pre>
38
39
-Specialization for function types.
+A lightweight non-owning reference to a callable.
40
+
41
+Example usage:
42
43
+``` cpp
44
+void foo (function_ref<int(int)> func) {
45
+ std::cout << "Result is " << func(21); //42
46
+}
47
48
+foo([](int i) { return i*2; });
49
+```
50
51
### Copy constructor `tl::function_ref<R(Args...)>::function_ref`<a id="tl::function_ref-R(Args...)-::function_ref(constfunction_ref-R(Args...)-&)"></a>
52
0 commit comments