Thanks, currently I use
dbs((int)v.count());
and it works....but it's ugly and easy to forget to cast. The problem is I have a 32bit box and I don't experience the compile error when writing
dbs(v.count());
but my tool is publicy released to wider audience, with any kind of system. BTW the compile error was found by an user and reported to me. So I really would like to have a dbs(x) macro that prints _anything_ 'x' is without always remember to cast to int/uint the size_t values.
Thanks
Marco
P.S: I cannot subclass QVariant because key 'd' internal variable is private. I was thinking at template specialization, something like:
template<typename T>class MyVariant {
public:
MyVariant(T x) : v(x){}
QString toString() { return v.toString(); }
private:
QVariant v;
};
template<>class MyVariant<size_t> {
public:
MyVariant(size_t x) : v((uint)x){}
QString toString() { return v.toString(); }
private:
QVariant v;
};
But in this case I need to pass the type when instancing the template or as macro parameter.
Any ideas??
Thanks
Marco





Reply With Quote
Bookmarks