[odb-users] std::map<Entity, int>

Boris Kolpackov boris at codesynthesis.com
Mon Nov 24 05:07:54 EST 2014


Hi Adnan,

Adnan RIHAN <axel50397 at gmail.com> writes:

> > QMap<QSharedPointer<Product>, uint> cart;

This is not yet supported. I've added an item to the TODO list.

Interestingly, wrapping the pointer into a composite value seems to
work:

#pragma db value
struct ProductKey
{
  QSharedPointer<Product> p;
};

inline bool
operator< (const ProductKey& x, const ProductKey& y) {return x.p < y.p;}

QMap<ProductKey, uint> cart;

Changing map to set should also work.

Boris



More information about the odb-users mailing list