Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
David Dight committed Jul 16, 2024
1 parent 4fa6521 commit b44f48a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,7 @@ template<typename C, typename Fn, typename... Args> // specialisation for member
requires std::invocable<Fn&&, C, T, Args...>
[[maybe_unused]] constexpr auto for_each_n(int n, Fn&& func, C *obj, Args&&... args);
```
Call supplied invocable for _each bit that is on_. Similar to `std::for_each` except first parameter of your invocable must accept an enum value (passed by `for_each`).
Call supplied invocable for _every bit that is on_. Similar to `std::for_each` except first parameter of your invocable must accept an enum value (passed by `for_each`).
Optionally provide any additional parameters. Works with lambdas, member functions, functions etc. You can limit the number of calls to your
invocable by using the `for_each_n` version with the first parameter being the maximum number to call. The second version of `for_each` and `for_each_n` is intended to be used
when using a member function - the _second_ parameter passed by your call must be the `this` pointer of the object.
Expand All @@ -1044,7 +1044,7 @@ If you wish to pass a `reference` parameter, you must wrap it in `std::ref`.
Returns `std::bind(std::forward<Fn>(func), std::placeholders::_1, std::forward<Args>(args)...)` or
`std::bind(std::forward<Fn>(func), obj, std::placeholders::_1, std::forward<Args>(args)...)` which can be stored or immediately invoked.
To iterate over each bit regardless of whether it is on or not, use `conjure_enum<T>::for_each`.
To iterate over every bit regardless of whether it is on or not, use `conjure_enum<T>::for_each`.
Example using member function:
```c++
Expand Down

0 comments on commit b44f48a

Please sign in to comment.