Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qttypetraits.h File Reference

(0d047ca713ac66fe8ba94194441cd2e98cb76698)

#include <QtCore/qtconfigmacros.h>
#include <QtCore/qtdeprecationmarkers.h>
#include <optional>
#include <tuple>
#include <type_traits>
#include <utility>
#include <variant>
Include dependency graph for qttypetraits.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  QtPrivate::type_dependent_false< T >
struct  QtPrivate::value_dependent_false< T >
struct  QtPrivate::is_standard_or_extended_integer_type_helper< T >
struct  QtPrivate::is_standard_or_extended_integer_type< T >
struct  QTypeTraits::detail::Promoted< T, U, typename >
struct  QTypeTraits::detail::is_container< typename, typename >
struct  QTypeTraits::detail::is_container< T, std::void_t< typename T::value_type, std::is_convertible< decltype(std::declval< T >().begin() !=std::declval< T >().end()), bool > > >
struct  QTypeTraits::detail::has_operator_equal< typename, typename >
struct  QTypeTraits::detail::has_operator_equal< T, std::void_t< decltype(bool(std::declval< const T & >()==std::declval< const T & >()))> >
struct  QTypeTraits::detail::expand_operator_equal_container< T, bool >
struct  QTypeTraits::detail::expand_operator_equal_container< T, true >
struct  QTypeTraits::detail::expand_operator_equal_tuple< T >
struct  QTypeTraits::detail::expand_operator_equal_tuple< std::optional< T > >
struct  QTypeTraits::detail::expand_operator_equal_tuple< std::pair< T1, T2 > >
struct  QTypeTraits::detail::expand_operator_equal_tuple< std::tuple< T... > >
struct  QTypeTraits::detail::expand_operator_equal_tuple< std::variant< T... > >
struct  QTypeTraits::detail::has_operator_less_than< typename, typename >
struct  QTypeTraits::detail::has_operator_less_than< T, std::void_t< decltype(bool(std::declval< const T & >()< std::declval< const T & >()))> >
struct  QTypeTraits::detail::expand_operator_less_than_container< T, bool >
struct  QTypeTraits::detail::expand_operator_less_than_container< T, true >
struct  QTypeTraits::detail::expand_operator_less_than_tuple< T >
struct  QTypeTraits::detail::expand_operator_less_than_tuple< std::optional< T > >
struct  QTypeTraits::detail::expand_operator_less_than_tuple< std::pair< T1, T2 > >
struct  QTypeTraits::detail::expand_operator_less_than_tuple< std::tuple< T... > >
struct  QTypeTraits::detail::expand_operator_less_than_tuple< std::variant< T... > >
struct  QTypeTraits::is_dereferenceable< T, typename >
struct  QTypeTraits::is_dereferenceable< T, std::void_t< decltype(std::declval< T >().operator->())> >
struct  QTypeTraits::has_operator_equal< T >
struct  QTypeTraits::has_operator_less_than< T >
struct  QTypeTraits::has_operator_compare_three_way< T >
struct  QTypeTraits::has_operator_compare_three_way_with< T, U >
struct  QTypeTraits::has_ostream_operator< Stream, typename, typename >
struct  QTypeTraits::has_ostream_operator< Stream, T, std::void_t< decltype(detail::reference< Stream >()<< detail::const_reference< T >())> >
struct  QTypeTraits::has_istream_operator< Stream, typename, typename >
struct  QTypeTraits::has_istream_operator< Stream, T, std::void_t< decltype(detail::reference< Stream >() > > detail::reference< T >())> >

Namespaces

namespace  QtPrivate
namespace  QTypeTraits
namespace  QTypeTraits::detail

Macros

#define QSEIT_EXCLUDE(X)

Typedefs

template<typename T, typename U>
using QTypeTraits::Promoted = typename detail::Promoted<T, U>::type
template<typename T>
using QTypeTraits::detail::expand_operator_equal = expand_operator_equal_container<T>
template<typename ... T>
using QTypeTraits::detail::expand_operator_equal_recursive = std::conjunction<expand_operator_equal<T>...>
template<typename T>
using QTypeTraits::detail::expand_operator_less_than = expand_operator_less_than_container<T>
template<typename ... T>
using QTypeTraits::detail::expand_operator_less_than_recursive = std::conjunction<expand_operator_less_than<T>...>
template<typename Container, typename T>
using QTypeTraits::has_operator_equal_container = std::disjunction<std::is_base_of<Container, T>, QTypeTraits::has_operator_equal<T>>
template<typename Container, typename T>
using QTypeTraits::has_operator_less_than_container = std::disjunction<std::is_base_of<Container, T>, QTypeTraits::has_operator_less_than<T>>
template<typename ... T>
using QTypeTraits::compare_eq_result = std::enable_if_t<std::conjunction_v<QTypeTraits::has_operator_equal<T>...>, bool>
template<typename Container, typename ... T>
using QTypeTraits::compare_eq_result_container = std::enable_if_t<std::conjunction_v<QTypeTraits::has_operator_equal_container<Container, T>...>, bool>
template<typename ... T>
using QTypeTraits::compare_lt_result = std::enable_if_t<std::conjunction_v<QTypeTraits::has_operator_less_than<T>...>, bool>
template<typename Container, typename ... T>
using QTypeTraits::compare_lt_result_container = std::enable_if_t<std::conjunction_v<QTypeTraits::has_operator_less_than_container<Container, T>...>, bool>
template<typename Stream, typename Container, typename T>
using QTypeTraits::has_ostream_operator_container = std::disjunction<std::is_base_of<Container, T>, QTypeTraits::has_ostream_operator<Stream, T>>
template<typename Stream, typename Container, typename T>
using QTypeTraits::has_istream_operator_container = std::disjunction<std::is_base_of<Container, T>, QTypeTraits::has_istream_operator<Stream, T>>

Functions

template<typename Enum>
QT_BEGIN_NAMESPACE constexpr std::underlying_type_t< EnumqToUnderlying (Enum e) noexcept
template<typename T, typename U = T>
constexpr T qExchange (T &t, U &&newValue) noexcept(std::conjunction_v< std::is_nothrow_move_constructible< T >, std::is_nothrow_assignable< T &, U > >)
 QtPrivate::QSEIT_EXCLUDE (bool)
 QtPrivate::QSEIT_EXCLUDE (char)
 QtPrivate::QSEIT_EXCLUDE (char16_t)
 QtPrivate::QSEIT_EXCLUDE (char32_t)
 QtPrivate::QSEIT_EXCLUDE (wchar_t)
template<typename T>
const T & QTypeTraits::detail::const_reference ()
template<typename T>
T & QTypeTraits::detail::reference ()

Variables

template<typename T>
constexpr bool QtPrivate::is_standard_or_extended_integer_type_v = is_standard_or_extended_integer_type<T>::value
template<typename T>
constexpr bool QTypeTraits::is_dereferenceable_v = is_dereferenceable<T>::value
template<typename T>
constexpr bool QTypeTraits::has_operator_equal_v = has_operator_equal<T>::value
template<typename T>
constexpr bool QTypeTraits::has_operator_less_than_v = has_operator_less_than<T>::value
template<typename T>
constexpr bool QTypeTraits::has_operator_compare_three_way_v = has_operator_compare_three_way<T>::value
template<typename T, typename U>
constexpr bool QTypeTraits::has_operator_compare_three_way_with_v = has_operator_compare_three_way_with<T, U>::value
template<typename Stream, typename T>
constexpr bool QTypeTraits::has_ostream_operator_v = has_ostream_operator<Stream, T>::value
template<typename Stream, typename T>
constexpr bool QTypeTraits::has_istream_operator_v = has_istream_operator<Stream, T>::value
template<typename Stream, typename T>
constexpr bool QTypeTraits::has_stream_operator_v = has_ostream_operator_v<Stream, T> && has_istream_operator_v<Stream, T>

Macro Definition Documentation

◆ QSEIT_EXCLUDE

#define QSEIT_EXCLUDE ( X)
Value:
template <> struct is_standard_or_extended_integer_type_helper<X> : std::false_type {}
#define X(name)

Definition at line 74 of file qttypetraits.h.

Function Documentation

◆ qExchange()

template<typename T, typename U = T>
T qExchange ( T & t,
U && newValue )
constexprnoexcept

Definition at line 52 of file qttypetraits.h.

◆ qToUnderlying()

template<typename Enum>
QT_BEGIN_NAMESPACE constexpr std::underlying_type_t< Enum > qToUnderlying ( Enum e)
constexprnoexcept

Definition at line 29 of file qttypetraits.h.