Skip to content

Commit e9aca46

Browse files
committed
Re-Introduce Fn/FnMut/FnOnce as type-erased closures without heap allocs
They are only safe to use as function parameters but will allow more lightweight (for compile time and binary size) receiving of lambdas, even with bound members instead of requiring a template every time.
1 parent 220dd42 commit e9aca46

File tree

4 files changed

+922
-0
lines changed

4 files changed

+922
-0
lines changed

subspace/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ target_sources(subspace PUBLIC
5151
"fn/fn_bind.h"
5252
"fn/fn_defn.h"
5353
"fn/fn_impl.h"
54+
"fn/stackfn_defn.h"
5455
"iter/__private/into_iterator_archetype.h"
5556
"iter/__private/iterator_end.h"
5657
"iter/__private/iterator_loop.h"
@@ -151,6 +152,7 @@ add_executable(subspace_unittests
151152
"construct/into_unittest.cc"
152153
"construct/default_unittest.cc"
153154
"fn/fn_unittest.cc"
155+
"fn/stackfn_unittest.cc"
154156
"iter/iterator_unittest.cc"
155157
"mem/addressof_unittest.cc"
156158
"mem/clone_unittest.cc"

subspace/fn/fn.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@
1717
#include "subspace/fn/fn_bind.h"
1818
#include "subspace/fn/fn_defn.h"
1919
#include "subspace/fn/fn_impl.h"
20+
#include "subspace/fn/stackfn_defn.h"

0 commit comments

Comments
 (0)