Ginkgo  Generated from pipelines/1589998975 branch based on develop. Ginkgo version 1.10.0
A numerical linear algebra library targeting many-core architectures
std_extensions.hpp
1 // SPDX-FileCopyrightText: 2017 - 2024 The Ginkgo authors
2 //
3 // SPDX-License-Identifier: BSD-3-Clause
4 
5 #ifndef GKO_PUBLIC_CORE_BASE_STD_EXTENSIONS_HPP_
6 #define GKO_PUBLIC_CORE_BASE_STD_EXTENSIONS_HPP_
7 
8 
9 #include <exception>
10 #include <functional>
11 #include <memory>
12 #include <type_traits>
13 
14 #include "ginkgo/core/base/types.hpp"
15 
16 
17 // This header provides implementations of useful utilities introduced into the
18 // C++ standard after C++14 (e.g. C++17 and C++20).
19 // For documentation about these utilities refer to the newer version of the
20 // standard.
21 
22 
23 namespace gko {
29 namespace xstd {
30 namespace detail {
31 
32 
33 template <typename... Ts>
34 struct make_void {
35  using type = void;
36 };
37 
38 
39 } // namespace detail
40 
41 
46 template <typename... Ts>
47 using void_t = typename detail::make_void<Ts...>::type;
48 
49 
50 GKO_DEPRECATED("use std::uncaught_exceptions")
51 inline bool uncaught_exception() noexcept
52 {
53  return std::uncaught_exceptions() > 0;
54 }
55 
56 
57 // Kept for backward compatibility.
58 template <bool B, typename T = void>
59 using enable_if_t = std::enable_if_t<B, T>;
60 
61 
62 // Kept for backward compatibility.
63 template <bool B, typename T, typename F>
64 using conditional_t = std::conditional_t<B, T, F>;
65 
66 
67 // Kept for backward compatibility.
68 template <typename T>
69 using decay_t = std::decay_t<T>;
70 
71 
72 // Kept for backward compatibility.
73 template <typename T>
74 constexpr bool greater(const T&& lhs, const T&& rhs)
75 {
76  return std::greater<void>()(lhs, rhs);
77 }
78 
79 
80 // Kept for backward compatibility.
81 template <typename T>
82 constexpr bool greater_equal(const T&& lhs, const T&& rhs)
83 {
84  return std::greater_equal<void>()(lhs, rhs);
85 }
86 
87 
88 // Kept for backward compatibility.
89 template <typename T>
90 constexpr bool less(const T&& lhs, const T&& rhs)
91 {
92  return std::less<void>()(lhs, rhs);
93 }
94 
95 
96 // Kept for backward compatibility.
97 template <typename T>
98 constexpr bool less_equal(const T&& lhs, const T&& rhs)
99 {
100  return std::less_equal<void>()(lhs, rhs);
101 }
102 
103 
104 template <class... Ts>
105 using conjunction = std::conjunction<Ts...>;
106 
107 
108 } // namespace xstd
109 } // namespace gko
110 
111 
112 #endif // GKO_PUBLIC_CORE_BASE_STD_EXTENSIONS_HPP_
gko
The Ginkgo namespace.
Definition: abstract_factory.hpp:20
gko::solver::initial_guess_mode::rhs
the input is right hand side
gko::xstd::void_t
typename detail::make_void< Ts... >::type void_t
Use the custom implementation, since the std::void_t used in is_matrix_type_builder seems to trigger ...
Definition: std_extensions.hpp:47