mpc
Haskell-like feature supports in C++
holding.hpp
Go to the documentation of this file.
1
2#pragma once
4
5namespace mpc {
6 template <class>
7 struct holding;
8
9 template <class T>
10 using holding_t = typename holding<std::remove_cvref_t<T>>::type;
11
12 template <class T, class U>
13 struct holding_or : std::type_identity<U> {};
14
15 template <class T, class U>
16 requires requires { typename holding<std::remove_cvref_t<T>>::type; }
17 struct holding_or<T, U> : holding<std::remove_cvref_t<T>> {};
18
19 template <class T, class U>
20 using holding_or_t = typename holding_or<T, U>::type;
21} // namespace mpc
Definition: holding.hpp:13
Definition: holding.hpp:7