GaitGeneration by Graph Search
読み取り中…
検索中…
一致する文字列を見つけられません
my_expected_concept.h
[詳解]
1
3
4// Copyright(c) 2023-2025 Design Engineering Laboratory, Saitama University
5// Released under the MIT license
6// https://opensource.org/licenses/mit-license.php
7
8#ifndef DESIGNLAB_MY_EXPECTED_CONCEPT_H_
9#define DESIGNLAB_MY_EXPECTED_CONCEPT_H_
10
11#include <concepts>
12#include <type_traits>
13
14#include "my_unexpected.h"
15
17
18// 前方宣言
19template <typename T>
21
25template <typename T>
26concept IsExpected =
27 !std::is_reference_v<T> && !std::is_function_v<T> &&
28 !std::is_same_v<std::remove_cvref_t<T>, std::in_place_t> &&
29 !std::is_same_v<std::remove_cvref_t<T>, unexpected<std::remove_cvref_t<T>>>;
30
31} // namespace designlab::nostd::impl
32
33#endif // DESIGNLAB_MY_EXPECTED_CONCEPT_H_
expected の concept 型 T は参照型ではなく, 関数型でもなく, unexpectedの特殊化でなく,in_place_tの特殊化でもないことを要求する