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
Copy file name to clipboardExpand all lines: README.md
+11-2Lines changed: 11 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,9 +10,10 @@ It contains:
10
10
-`for_{types,values,range}`: Compile time for loops for types, values or ranges
11
11
-`polymorphic_allocator`: Like `std::pmr::polymorphic_allocator` but with static dispatch
12
12
-`limit_allocator`: Allocator wrapper that limits the amount of memory that is allowed to be allocated
13
+
-`DICE_MEMFN`: Macro to pass member functions like free functions as argument.
13
14
-`pool` & `pool_allocator`: Arena/pool allocator optimized for a limited number of known allocation sizes.
14
15
-`DICE_DEFER`/`DICE_DEFER_TO_SUCCES`/`DICE_DEFER_TO_FAIL`: On-the-fly RAII for types that do not support it natively (similar to go's `defer` keyword)
15
-
-`overloaded`: Composition for `std::variant` visitor lambdas
16
+
-`overloaded` and `match`: Batteries for `std::variant`(and also `dtl::variant2`. Compose re-usable visitors with `overload` or apply a single-use visitor directly with `match`.
16
17
-`flex_array`: A combination of `std::array`, `std::span` and a `vector` with small buffer optimization
17
18
-`tuple_algorithms`: Some algorithms for iterating tuples
18
19
-`fmt_join`: A helper to join elements of a range with a separator for use with `std::format` alike [fmt::join](https://fmt.dev/latest/api/#range-and-tuple-formatting)
@@ -73,6 +74,11 @@ Which means: vtables will not work (because they use absolute pointers) and ther
73
74
Allocator wrapper that limits the amount of memory that can be allocated through the inner allocator.
74
75
If the limit is exceeded it will throw `std::bad_alloc`.
75
76
77
+
### `DICE_MEMFN`
78
+
DICE_MEMFN is a convenience macro that makes it easy to pass member functions as argument, e.g., to range adaptors.
79
+
It eliminates boilerplate code by creating a lambda that captures this and perfectly forwards
80
+
arguments to your member function.
81
+
76
82
### `pool_allocator`
77
83
A memory arena/pool allocator with configurable allocation sizes. This is implemented
78
84
as a collection of pools with varying allocation sizes. Allocations that do not
@@ -83,7 +89,7 @@ A mechanism similar to go's `defer` keyword, which can be used to defer some act
83
89
The primary use-case for this is on-the-fly RAII-like resource management for types that do not support RAII (for example C types).
84
90
Usage examples can be found [here](examples/examples_defer.cpp).
85
91
86
-
### `tuple algorthims`
92
+
### `tuple algorithms`
87
93
Some algorithms for iterating tuples, for example `tuple_fold` a fold/reduce implementation for tuples.
88
94
89
95
### `fmt_join`
@@ -109,6 +115,9 @@ Like `std::variant` but specifically optimized for usage with two types/variants
109
115
The internal representation is a `union` of the two types plus a 1 byte (3 state) discriminant.
110
116
Additionally, `visit` does not involve any virtual function calls.
111
117
118
+
### `overload` / `match`
119
+
Things that are missing around `std::variant` and visitors in the standard library. Implementation of the common `overload` pattern to create re-usable visitors. Also, comes with a `match` function that allows you to declare the visitor directly inline when applying it.
120
+
112
121
### `type_traits.hpp`
113
122
Things that are missing in the standard library `<type_traits>` header.
0 commit comments