diff options
author | Lars Knoll <lars.knoll@qt.io> | 2020-11-03 09:44:35 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2020-11-03 13:06:14 +0100 |
commit | df57e1ac65911b96d14d0127e6a1fc8e4a13f7e4 (patch) | |
tree | 9eb84b72f871cfc216f002793de135ae88478172 /src/corelib/global | |
parent | d5e913cc60faec5eee173541492fe8d9884a8fc0 (diff) |
Code cleanups
Mark constexpr booleans as inline.
Change-Id: Ib7e0f9d96ff3894b72dcd13c07643ef3b9e6e2c5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/corelib/global')
-rw-r--r-- | src/corelib/global/qtypeinfo.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/corelib/global/qtypeinfo.h b/src/corelib/global/qtypeinfo.h index d7cdb8b5d4..04b918f421 100644 --- a/src/corelib/global/qtypeinfo.h +++ b/src/corelib/global/qtypeinfo.h @@ -55,7 +55,7 @@ class QDebug; */ template <typename T> -static constexpr bool qIsRelocatable = std::is_trivially_copyable_v<T> && std::is_trivially_destructible_v<T>; +inline constexpr bool qIsRelocatable = std::is_trivially_copyable_v<T> && std::is_trivially_destructible_v<T>; /* The catch-all template. @@ -335,17 +335,17 @@ struct is_dereferenceable<T, std::void_t<decltype(std::declval<T>().operator->() : std::true_type {}; template <typename T> -constexpr bool is_dereferenceable_v = is_dereferenceable<T>::value; +inline constexpr bool is_dereferenceable_v = is_dereferenceable<T>::value; template<typename T> struct has_operator_equal : detail::expand_operator_equal<T> {}; template<typename T> -constexpr bool has_operator_equal_v = has_operator_equal<T>::value; +inline constexpr bool has_operator_equal_v = has_operator_equal<T>::value; template<typename T> struct has_operator_less_than : detail::expand_operator_less_than<T> {}; template<typename T> -constexpr bool has_operator_less_than_v = has_operator_less_than<T>::value; +inline constexpr bool has_operator_less_than_v = has_operator_less_than<T>::value; template <typename ...T> using compare_eq_result = std::enable_if_t<std::conjunction_v<QTypeTraits::has_operator_equal<T>...>, bool>; @@ -368,7 +368,7 @@ template <typename Stream, typename T> struct has_ostream_operator<Stream, T, std::void_t<decltype(detail::reference<Stream>() << detail::const_reference<T>())>> : std::true_type {}; template <typename Stream, typename T> -constexpr bool has_ostream_operator_v = has_ostream_operator<Stream, T>::value; +inline constexpr bool has_ostream_operator_v = has_ostream_operator<Stream, T>::value; template <typename Stream, typename, typename = void> struct has_istream_operator : std::false_type {}; @@ -376,10 +376,10 @@ template <typename Stream, typename T> struct has_istream_operator<Stream, T, std::void_t<decltype(detail::reference<Stream>() >> detail::reference<T>())>> : std::true_type {}; template <typename Stream, typename T> -constexpr bool has_istream_operator_v = has_istream_operator<Stream, T>::value; +inline constexpr bool has_istream_operator_v = has_istream_operator<Stream, T>::value; template <typename Stream, typename T> -constexpr bool has_stream_operator_v = has_ostream_operator_v<Stream, T> && has_istream_operator_v<Stream, T>; +inline constexpr bool has_stream_operator_v = has_ostream_operator_v<Stream, T> && has_istream_operator_v<Stream, T>; } |