alpaka
Abstraction Library for Parallel Kernel Acceleration
Loading...
Searching...
No Matches
CopyConstructableDataSource.hpp
Go to the documentation of this file.
1/* Copyright 2025 Simeon Ehrig
2 * SPDX-License-Identifier: MPL-2.0
3 */
4
5#pragma once
6
8
9#include <concepts>
10
12{
13 /** Check whether the copy constructor of the data source `T` respects the const correctness of the data type.
14 *
15 * @details
16 * Data sources have a data type that can be mutable or constant (marked with const). The following copies or
17 * assignments to a new object with the corresponding data type are possible:
18 * - mutable -> mutable
19 * - const -> const
20 * - mutable -> const
21 **/
22 template<typename T>
23 concept CopyConstructableDataSource = requires {
25 /// copy constructor inner mutable -> inner mutable
26 requires std::constructible_from<
29 /// copy constructor inner const -> inner const
30 requires std::constructible_from<
33 /// copy constructor inner mutable -> inner const
34 requires std::constructible_from<
37 /// not allowed: copy constructor inner const -> inner mutable
38 requires !std::constructible_from<
41 /// copy assignment inner mutable -> inner mutable
42 requires std::assignable_from<
45 /// copy assignment inner const -> inner const
46 requires std::assignable_from<
49 /// copy assignment inner mutable -> inner const
50 requires std::assignable_from<
53 /// not allowed: copy assignment inner const -> inner mutable
54 requires !std::assignable_from<
57 };
58} // namespace alpaka::internal::concepts
Check whether the copy constructor of the data source T respects the const correctness of the data ty...
Specialize the trait for DataSource class if the object is copyable.
Definition trait.hpp:67