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
QTypeInfoMerger< T, Ts > Class Template Reference

\inmodule QtCore More...

#include <qtypeinfo.h>

Collaboration diagram for QTypeInfoMerger< T, Ts >:

Static Public Attributes

static constexpr bool isComplex = ((QTypeInfo<Ts>::isComplex) || ...)
static constexpr bool isRelocatable = ((QTypeInfo<Ts>::isRelocatable) && ...)
static constexpr bool isPointer = false
static constexpr bool isIntegral = false
static constexpr bool isValueInitializationBitwiseZero = false

Detailed Description

template<class T, class... Ts>
class QTypeInfoMerger< T, Ts >

\inmodule QtCore

QTypeInfoMerger merges the QTypeInfo flags of T1, T2... and presents them as a QTypeInfo<T> would do.

Let's assume that we have a simple set of structs:

class B {/*...*/};
class C {/*...*/};
class D {/*...*/};
struct A : public B {
C c;
D d;
};

To create a proper QTypeInfo specialization for A struct, we have to check all sub-components; B, C and D, then take the lowest common denominator and call Q_DECLARE_TYPEINFO with the resulting flags. An easier and less fragile approach is to use QTypeInfoMerger, which does that automatically. So struct A would have the following QTypeInfo definition:

template<> class QTypeInfo<A> : public QTypeInfoMerger<A, B, C, D> {};

Definition at line 108 of file qtypeinfo.h.

Member Data Documentation

◆ isComplex

template<class T, class... Ts>
bool QTypeInfoMerger< T, Ts >::isComplex = ((QTypeInfo<Ts>::isComplex) || ...)
staticconstexpr

Definition at line 112 of file qtypeinfo.h.

◆ isIntegral

template<class T, class... Ts>
bool QTypeInfoMerger< T, Ts >::isIntegral = false
staticconstexpr

Definition at line 115 of file qtypeinfo.h.

◆ isPointer

template<class T, class... Ts>
bool QTypeInfoMerger< T, Ts >::isPointer = false
staticconstexpr

Definition at line 114 of file qtypeinfo.h.

◆ isRelocatable

template<class T, class... Ts>
bool QTypeInfoMerger< T, Ts >::isRelocatable = ((QTypeInfo<Ts>::isRelocatable) && ...)
staticconstexpr

Definition at line 113 of file qtypeinfo.h.

◆ isValueInitializationBitwiseZero

template<class T, class... Ts>
bool QTypeInfoMerger< T, Ts >::isValueInitializationBitwiseZero = false
staticconstexpr

Definition at line 116 of file qtypeinfo.h.


The documentation for this class was generated from the following file: