Reaktoro  v2.11.0
A unified framework for modeling chemically reactive systems
TypeOp.hpp
1 // Reaktoro is a unified framework for modeling chemically reactive systems.
2 //
3 // Copyright © 2014-2024 Allan Leal
4 //
5 // This library is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation; either
8 // version 2.1 of the License, or (at your option) any later version.
9 //
10 // This library is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with this library. If not, see <http://www.gnu.org/licenses/>.
17 
18 #pragma once
19 
20 // C++ includes
21 #include <type_traits>
22 
23 namespace Reaktoro {
24 
25 namespace detail {
26 
27 template<typename T>
28 struct TypeOpRef
29 {
30  using type = T&;
31 };
32 
33 template<typename T>
35 {
36  using type = T const&;
37 };
38 
39 template<typename T>
41 {
42  using type = T;
43 };
44 
45 } // namespace detail
46 
47 template<typename T>
48 using TypeOpRef = typename detail::TypeOpRef<std::decay_t<T>>::type;
49 
50 template<typename T>
51 using TypeOpConstRef = typename detail::TypeOpConstRef<std::decay_t<T>>::type;
52 
53 template<typename T>
54 using TypeOpIdentity = typename detail::TypeOpIdentity<std::decay_t<T>>::type;
55 
56 } // namespace Reaktoro
The namespace containing all components of the Reaktoro library.
Definition: Algorithms.hpp:29
Definition: TypeOp.hpp:35
Definition: TypeOp.hpp:41
Definition: TypeOp.hpp:29