mercredi 4 novembre 2015

How to distinguish unsigned int from uint32_t

I need to find all code which is using as size other than uint32_t. I've made my custom SizeStub type with uint32_t inside. And started code replace. To avoid false alerts on code where I already have uint32_t I've added next operators:

template <typename T>
SizeStub& operator += (const T& in)
{
    static_assert(std::is_same<T, decltype(_value)>::value, "NOT SAME");
    this->_value += in;
    return *this;
}

Also binary operators, etc.

Everything is great. I have compile time alerts for all types except uin32_t and ... unsigned int. So. How to distinguish unsigned int which is not fixed size?

gcc version 4.8.2

P.S. The plan is to replace all SizeStub usage when I'll fix all compile time alerts onto uint32_t.

Aucun commentaire:

Enregistrer un commentaire