diff options
| author | Marc Mutz <marc.mutz@qt.io> | 2023-02-08 16:23:42 +0100 |
|---|---|---|
| committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2023-02-09 18:55:37 +0100 |
| commit | da8fa2d08e3b21d81255f982a9e26ba127585be4 (patch) | |
| tree | eac28af870e172cd2ba5ee50f7c1f204d6719034 /src/plugins/sqldrivers/mysql/qsql_mysql.cpp | |
| parent | 3a3b76e040ec800e1f3214803c051afacfdb0f7b (diff) | |
QRhi: fix potential ODR issue (operators for foreign types)
We mustn't define operators or hash functions for types we don't own,
esp. not in a header file, because when someone else gets the same
idea, we have an ODR violation, unless they get it token-for-token the
same as our implementation.
One option would be to replace the QHash with an STL container. Those
can take per-container Hash and Equal function objects, so we wouldn't
need to declare the global ones.
But let's use a wrapper around the type on which we define the missing
operators instead.
As a drive-by, rename the arguments to the idiomatic lhs/rhs/key, from
a/b/s.
Change-Id: Ibbc2083bcd7423c5d443a0ca1b820cbecb241865
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/plugins/sqldrivers/mysql/qsql_mysql.cpp')
0 files changed, 0 insertions, 0 deletions
