I try to define a QMap which it's key is a C++ structure.
struct ProcInfo_S
{
quint8 tech = 0;
quint8 direction = 0;
quint8 category = 0;
};
QMap<ProcInfo_S, uint64_t> G;
G[{2,3,4}] = 2;
But when I compile this code, I get the following compile error:
error: no match for ‘operator<’ (operand types are ‘const MainWindow::MainWindow(QWidget*)::ProcInfo_S’
The order of the elements in the map is determined by calling
operator<
of the keys. From documentation:One way to implement it is for example: