diff options
author | Lars Knoll <lars.knoll@qt.io> | 2020-06-05 12:39:58 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2020-07-08 14:13:55 +0200 |
commit | 16bc995fd1eba4f7485226f319e7736ca19040bc (patch) | |
tree | 75107f4854f97a4f0a5c340ab872d9a6a8a2d89c /src/gui/kernel/qplatformdrag.cpp | |
parent | b038575a8995378b07e7c82cedc219c1ae40b167 (diff) |
Add type traits to safely determine the existence of comparison operators
Containers often define an operator==() or operator<() which is very useful
for generic code. But those operators can usually not be instantiated if
the template argument doesn't implement the operator.
This sometimes leads to the compiler trying all possible template expansions
and implicit conversions for the type, giving extremely long error
messages. The traits support can be used to safely constrain those
operators.
Being able to safely detect this will also allow us to fold the comparison
support that is currently a large cludge for user types directly into
QMetaType.
Change-Id: Ib84afb5348c3eb0be5161d6ba9d5fe237709c65f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/gui/kernel/qplatformdrag.cpp')
0 files changed, 0 insertions, 0 deletions