Skip to content

Commit 6759b66

Browse files
Update README.md
1 parent 22464a2 commit 6759b66

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@ BM_for_each 144 ns 82.6 ns 8173558
9595
### `mlib::transform`
9696
`mlib::transform` is a `constexpr` function takes a given tuple, `t` and a given function `f` that transforms one of the elements inside of the tuple. An example invocation of `mlib::transfrom` looks like this:
9797
```C++
98-
std::tuple<int, char, bool> t{42, 'c', true};
98+
std::tuple t{1, 4, 7, 'c', true, false};
9999
mlib::transform(t, [](auto& t){return decltype(t)(static_cast<int>(t));});
100100
```
101-
This invokation, has a tuple t: `std::tuple<int, char, bool>` and then transforms that tuple using the `[](auto& t){return decltype(t)(static_cast<int>(t));};`, and does so accordingly.
101+
This invokation, has a tuple t: `std::tuple<int, char, bool>` and then transforms that tuple using the `[](auto t) { return (static_cast<int>(t)) + 1; };`, and does so accordingly.
102102
103103
`mlib::transform`'s implementation looks like this:
104104
```C++

0 commit comments

Comments
 (0)