Iros
 
Loading...
Searching...
No Matches
common_error.h
Go to the documentation of this file.
1#pragma once
2
3#include "di/meta/algorithm.h"
4#include "di/meta/common.h"
5#include "di/meta/core.h"
7#include "di/util/declval.h"
10
11namespace di::meta {
12template<typename T, typename U>
14
15namespace detail {
16 template<typename T, typename U>
17 concept HasCustomCommonError = requires { typename CustomCommonError<T, U>::Type; };
18
19 template<typename... Types>
21
22 template<typename T>
24
25 template<typename... Ts, typename... Us>
26 struct CommonErrorHelper<Variant<Ts...>, Variant<Us...>>
27 : TypeConstant<AsTemplate<Variant, Unique<List<Ts..., Us...>>>> {};
28
29 template<typename... Ts, typename U>
30 struct CommonErrorHelper<Variant<Ts...>, U> : CommonErrorHelper<Variant<Ts...>, Variant<U>> {};
31
32 template<typename T, typename... Us>
33 struct CommonErrorHelper<T, Variant<Us...>> : CommonErrorHelper<Variant<Us...>, T> {};
34
35 template<typename T, typename U>
38
39 template<typename T, typename U>
40 requires(!HasCustomCommonError<T, U> && concepts::CommonWith<T, U>)
41 struct CommonErrorHelper<T, U> : TypeConstant<CommonType<T, U>> {};
42
43 template<typename T>
45
46 template<typename T, typename U>
48
49 template<typename T, typename U>
52
53 template<typename T, typename U>
56
57 template<typename T, typename U, typename W, typename... Rest>
58 requires(requires { typename CommonErrorHelper<T, U>::Type; })
61}
62
63template<typename... Types>
64requires(requires { typename detail::CommonErrorHelper<Types...>::Type; })
66}
67
68namespace di::concepts {
69template<typename T, typename U>
74}
Definition variant_forward_declaration.h:6
Definition common_error.h:70
Definition common.h:208
Definition operations.h:99
Definition core.h:114
Definition common_error.h:47
Definition common_error.h:44
Definition common_error.h:17
Definition any_storable.h:9
Definition const_sentinel.h:8
Definition merge_interfaces.h:6
detail::CommonErrorHelper< Types... >::Type CommonError
Definition common_error.h:65
T::Type Type
Definition core.h:26
detail::CommonTypeHelper< Types... >::Type CommonType
Definition common.h:62
StatusCode< Erased< long > > Error
Definition error.h:8
auto declval() -> meta::AddRValueReference< T >
Definition declval.h:8
Definition common_error.h:13
Definition core.h:18
Definition common_error.h:20