kokkos-execution 0.0.1
Loading...
Searching...
No Matches
object.hpp
Go to the documentation of this file.
1// NOLINTBEGIN
2/*
3 * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
4 * Copyright (c) 2025 Robert Leahy. All rights reserved.
5 * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 *
7 * Licensed under the Apache License, Version 2.0 with LLVM Exceptions (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * https://llvm.org/LICENSE.txt
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 */
19
20#pragma once
21
22#include <concepts>
23#include <functional>
24#include <type_traits>
25
27
29
30template <typename Object>
31concept object = std::constructible_from<std::remove_cvref_t<Object>, Object>
32 && std::move_constructible<std::remove_cvref_t<Object>>
33 && std::is_object_v<typename std::remove_cvref_t<Object>::type> && requires(Object o) {
34 {
35 std::invoke((Object&&) o, (typename std::remove_cvref_t<Object>::type*) nullptr)
37 };
38
39template <typename Object, typename Env>
40concept object_in = object<Object> && requires(Object o) {
41 { std::invoke((Object&&) o, (typename std::remove_cvref_t<Object>::type*) nullptr) } -> enter_scope_sender_in<Env>;
42};
43
44template <object Object>
45using type_of_object_t = std::remove_cvref_t<Object>::type;
46
47template <object Object>
48using enter_scope_sender_of_object_t = std::invoke_result_t<Object, type_of_object_t<Object>*>;
49
50} // namespace experimental::execution
51
52// NOLINTEND
std::invoke_result_t< Object, type_of_object_t< Object > * > enter_scope_sender_of_object_t
Definition object.hpp:48
std::remove_cvref_t< Object >::type type_of_object_t
Definition object.hpp:45