41 #include <QtCore/qglobal.h>
42 #include <QtCore/qcontainerfwd.h>
59 inline constexpr
bool qIsRelocatable = std::is_trivially_copyable_v<T> && std::is_trivially_destructible_v<T>;
109 template <
class T,
class...Ts>
112 static_assert(
sizeof...(Ts) > 0);
120 #define Q_DECLARE_MOVABLE_CONTAINER(CONTAINER) \
121 template <typename ...T> \
122 class QTypeInfo<CONTAINER<T...>> \
127 isIntegral = false, \
129 isRelocatable = true, \
143 #undef Q_DECLARE_MOVABLE_CONTAINER
161 #define Q_DECLARE_TYPEINFO_BODY(TYPE, FLAGS) \
162 class QTypeInfo<TYPE > \
166 isComplex = (((FLAGS) & Q_PRIMITIVE_TYPE) == 0) && !std::is_trivial_v<TYPE>, \
167 isRelocatable = !isComplex || ((FLAGS) & Q_RELOCATABLE_TYPE) || qIsRelocatable<TYPE>, \
169 isIntegral = std::is_integral< TYPE >::value, \
173 #define Q_DECLARE_TYPEINFO(TYPE, FLAGS) \
175 Q_DECLARE_TYPEINFO_BODY(TYPE, FLAGS)
178 template<
typename T>
class QFlags;
192 #define Q_DECLARE_SHARED_IMPL(TYPE, FLAGS) \
193 Q_DECLARE_TYPEINFO(TYPE, FLAGS); \
194 inline void swap(TYPE &value1, TYPE &value2) \
195 noexcept(noexcept(value1.swap(value2))) \
196 { value1.swap(value2); }
197 #define Q_DECLARE_SHARED(TYPE) Q_DECLARE_SHARED_IMPL(TYPE, Q_RELOCATABLE_TYPE)
219 template <
typename,
typename =
void>
221 template <
typename T>
223 typename T::value_type,
224 std::is_convertible<decltype(std::declval<T>().begin() != std::declval<T>().end()), bool>
225 >> : std::true_type {};
231 template <
typename,
typename =
void>
233 template <
typename T>
249 template<
typename T,
bool>
256 std::is_same<T, typename T::value_type>,
257 expand_operator_equal<typename T::value_type>
258 >, expand_operator_equal_tuple<T>> {};
261 template<
typename ...T>
268 template<
typename T1,
typename T2>
270 template<
typename ...T>
272 template<
typename ...T>
276 template <
typename,
typename =
void>
278 template <
typename T>
290 template<
typename T,
bool>
296 std::is_same<T, typename T::value_type>,
297 expand_operator_less_than<typename T::value_type>
298 >, expand_operator_less_than_tuple<T>
301 template<
typename ...T>
308 template<
typename T1,
typename T2>
310 template<
typename ...T>
312 template<
typename ...T>
317 template<
typename T,
typename =
void>
324 template <
typename T>
332 template <
typename Container,
typename T>
340 template <
typename Container,
typename T>
343 template <
typename ...T>
344 using compare_eq_result = std::enable_if_t<std::conjunction_v<QTypeTraits::has_operator_equal<T>...>,
bool>;
346 template <
typename Container,
typename ...T>
349 template <
typename ...T>
350 using compare_lt_result = std::enable_if_t<std::conjunction_v<QTypeTraits::has_operator_less_than<T>...>,
bool>;
352 template <
typename Container,
typename ...T>
364 template <
typename Stream,
typename,
typename =
void>
366 template <
typename Stream,
typename T>
369 template <typename Stream, typename T>
370 inline constexpr bool has_ostream_operator_v = has_ostream_operator<Stream, T>::value;
372 template <typename Stream, typename Container, typename T>
373 using has_ostream_operator_container = std::disjunction<std::is_base_of<Container, T>, QTypeTraits::has_ostream_operator<Stream, T>>;
375 template <typename Stream, typename, typename = void>
376 struct has_istream_operator : std::false_type {};
377 template <typename Stream, typename T>
378 struct has_istream_operator<Stream, T, std::void_t<decltype(detail::reference<Stream>() >> detail::reference<T>())>>
380 template <
typename Stream,
typename T>
382 template <
typename Stream,
typename Container,
typename T>
385 template <
typename Stream,
typename T>
386 inline constexpr
bool has_stream_operator_v = has_ostream_operator_v<Stream, T> && has_istream_operator_v<Stream, T>;
The QDebug class provides an output stream for debugging information.
The QFlags class provides a type-safe way of storing OR-combinations of enum values.
The QHash class is a template class that provides a hash-table-based dictionary.
The QMultiHash class is a convenience QHash subclass that provides multi-valued hashes.
The QQueue class is a generic container that provides a queue.
The QStack class is a template class that provides a stack.
static constexpr bool isIntegral
static constexpr bool isPointer
static constexpr bool isComplex
static constexpr bool isRelocatable
std::conjunction< expand_operator_less_than< T >... > expand_operator_less_than_recursive
std::conjunction< expand_operator_equal< T >... > expand_operator_equal_recursive
const T & const_reference()
std::enable_if_t< std::conjunction_v< QTypeTraits::has_operator_equal< T >... >, bool > compare_eq_result
constexpr bool is_dereferenceable_v
constexpr bool has_operator_equal_v
std::enable_if_t< std::conjunction_v< QTypeTraits::has_operator_equal_container< Container, T >... >, bool > compare_eq_result_container
constexpr bool has_stream_operator_v
std::enable_if_t< std::conjunction_v< QTypeTraits::has_operator_less_than_container< Container, T >... >, bool > compare_lt_result_container
std::enable_if_t< std::conjunction_v< QTypeTraits::has_operator_less_than< T >... >, bool > compare_lt_result
constexpr bool has_istream_operator_v
std::disjunction< std::is_base_of< Container, T >, QTypeTraits::has_operator_equal< T > > has_operator_equal_container
std::disjunction< std::is_base_of< Container, T >, QTypeTraits::has_operator_less_than< T > > has_operator_less_than_container
std::disjunction< std::is_base_of< Container, T >, QTypeTraits::has_istream_operator< Stream, T > > has_istream_operator_container
constexpr bool has_operator_less_than_v
#define QT_WARNING_DISABLE_FLOAT_COMPARE
#define Q_DECLARE_MOVABLE_CONTAINER(CONTAINER)
#define Q_DECLARE_TYPEINFO_BODY(TYPE, FLAGS)
constexpr bool qIsRelocatable