Skip to content

Commit b7ad1c4

Browse files
committed
Added invokable_with concept
1 parent ee64246 commit b7ad1c4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

include/conduit/util/concepts.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#pragma once
22
#include <conduit/util/stdlib_coroutine.hpp>
3+
34
#include <cstddef>
45
#include <type_traits>
6+
#include <utility>
57

68
namespace conduit {
79
// clang-format off
@@ -72,5 +74,10 @@ concept can_co_return = co_result<Result>
7274

7375
template<class Promise>
7476
concept awaitable_promise = awaitable<Promise> && co_promise<Promise>;
77+
78+
template<class Func, class... Args>
79+
concept invokable_with = requires(Func f, Args... args) {
80+
{ f(std::forward<Args>(args)...) };
81+
};
7582
// clang-format on
7683
} // namespace conduit

0 commit comments

Comments
 (0)