File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -187,8 +187,8 @@ template<info meta> using type_of = /* unspecified */;
187
187
* typeid(apply<variant>([] { return vector{meta<int>}; })));
188
188
* @endcode
189
189
*/
190
- template <template <class ...> class T, class Expr >
191
- [[nodiscard]] constexpr auto apply (Expr expr);
190
+ template <template <class ...> class T>
191
+ [[nodiscard]] constexpr auto apply (concepts::invocable auto expr);
192
192
```
193
193
194
194
```cpp
Original file line number Diff line number Diff line change @@ -36,6 +36,8 @@ template<size_t N> using make_index_sequence =
36
36
namespace concepts {
37
37
template<class TRange>
38
38
concept range = requires(TRange range) { range.begin(); range.end(); };
39
+ template<class Fn, class... TArgs>
40
+ concept invocable = requires (Fn fn, TArgs... args) { fn(args...); };
39
41
} // namespace concepts
40
42
41
43
/**
@@ -166,7 +168,7 @@ using type_of = typename decltype(get(detail::meta_type<meta>{}))::value_type;
166
168
* @endcode
167
169
*/
168
170
template<template<class...> class T>
169
- [[nodiscard]] constexpr auto apply(auto expr) {
171
+ [[nodiscard]] constexpr auto apply(concepts::invocable auto expr) {
170
172
constexpr concepts::range auto range = expr();
171
173
return [range]<size_t... Ns>(utility::index_sequence<Ns...>) {
172
174
return T<type_of<range[Ns]>...>{};
You can’t perform that action at this time.
0 commit comments