2019-06-25 11:27:52 +00:00
|
|
|
template<typename T>
|
|
|
|
class TRACKER_NAME__
|
2012-11-05 04:34:23 +00:00
|
|
|
{
|
2012-11-15 06:42:00 +00:00
|
|
|
public:
|
2019-06-25 11:27:52 +00:00
|
|
|
T value;
|
2012-11-05 04:34:23 +00:00
|
|
|
|
2019-06-25 11:27:52 +00:00
|
|
|
inline T *operator&()
|
2012-11-09 22:31:02 +00:00
|
|
|
{
|
2019-06-25 11:27:52 +00:00
|
|
|
TRACKER_HOOK_((uintptr_t) & this->value);
|
|
|
|
return &this->value;
|
2012-11-09 22:31:02 +00:00
|
|
|
}
|
2012-11-05 04:34:23 +00:00
|
|
|
|
2019-06-25 11:27:52 +00:00
|
|
|
inline T operator++()
|
2012-11-09 22:31:02 +00:00
|
|
|
{
|
2019-06-25 11:27:52 +00:00
|
|
|
TRACKER_HOOK_((uintptr_t) & this->value);
|
|
|
|
return ++this->value;
|
2012-11-09 22:31:02 +00:00
|
|
|
}
|
|
|
|
|
2019-06-25 11:27:52 +00:00
|
|
|
inline T operator++(int)
|
2012-11-09 22:31:02 +00:00
|
|
|
{
|
2019-06-25 11:27:52 +00:00
|
|
|
TRACKER_HOOK_((uintptr_t) & this->value);
|
|
|
|
return this->value++;
|
2012-11-09 22:31:02 +00:00
|
|
|
}
|
|
|
|
|
2019-06-25 11:27:52 +00:00
|
|
|
inline T operator--()
|
2012-11-09 22:31:02 +00:00
|
|
|
{
|
2019-06-25 11:27:52 +00:00
|
|
|
TRACKER_HOOK_((uintptr_t) & this->value);
|
|
|
|
return --this->value;
|
2012-11-09 22:31:02 +00:00
|
|
|
}
|
|
|
|
|
2019-06-25 11:27:52 +00:00
|
|
|
inline T operator--(int)
|
2012-11-09 22:31:02 +00:00
|
|
|
{
|
2019-06-25 11:27:52 +00:00
|
|
|
TRACKER_HOOK_((uintptr_t) & this->value);
|
|
|
|
return this->value--;
|
2012-11-09 22:31:02 +00:00
|
|
|
}
|
|
|
|
|
2019-06-25 11:27:52 +00:00
|
|
|
template <typename Tt> inline T operator=(Tt operand)
|
|
|
|
{
|
|
|
|
TRACKER_HOOK_((uintptr_t) & this->value);
|
|
|
|
return this->value = (T)operand;
|
|
|
|
}
|
2012-11-09 22:31:02 +00:00
|
|
|
|
2019-06-25 11:27:52 +00:00
|
|
|
template <typename Tt> inline T operator+=(Tt operand)
|
|
|
|
{
|
|
|
|
TRACKER_HOOK_((uintptr_t) & this->value);
|
|
|
|
return this->value += (T)operand;
|
|
|
|
}
|
2012-11-09 22:31:02 +00:00
|
|
|
|
2019-06-25 11:27:52 +00:00
|
|
|
template <typename Tt> inline T operator-=(Tt operand)
|
|
|
|
{
|
|
|
|
TRACKER_HOOK_((uintptr_t) & this->value);
|
|
|
|
return this->value -= (T)operand;
|
|
|
|
}
|
2012-11-09 22:31:02 +00:00
|
|
|
|
2019-06-25 11:27:52 +00:00
|
|
|
template <typename Tt> inline T operator*=(Tt operand)
|
|
|
|
{
|
|
|
|
TRACKER_HOOK_((uintptr_t) & this->value);
|
|
|
|
return this->value *= (T)operand;
|
|
|
|
}
|
2012-11-09 22:31:02 +00:00
|
|
|
|
2019-06-25 11:27:52 +00:00
|
|
|
template <typename Tt> inline T operator/=(Tt operand)
|
|
|
|
{
|
|
|
|
TRACKER_HOOK_((uintptr_t) & this->value);
|
|
|
|
return this->value /= (T)operand;
|
|
|
|
}
|
2012-11-26 08:26:04 +00:00
|
|
|
|
2019-06-25 11:27:52 +00:00
|
|
|
template <typename Tt> inline T operator|=(Tt operand)
|
|
|
|
{
|
|
|
|
TRACKER_HOOK_((uintptr_t) & this->value);
|
|
|
|
return this->value |= (T)operand;
|
|
|
|
}
|
2012-11-05 04:34:23 +00:00
|
|
|
|
2019-06-25 11:27:52 +00:00
|
|
|
template <typename Tt> inline T operator&=(Tt operand)
|
|
|
|
{
|
|
|
|
TRACKER_HOOK_((uintptr_t) & this->value);
|
|
|
|
return this->value &= (T)operand;
|
|
|
|
}
|
2012-11-09 22:31:02 +00:00
|
|
|
|
2019-06-25 11:27:52 +00:00
|
|
|
template <typename Tt> inline T operator^=(Tt operand)
|
|
|
|
{
|
|
|
|
TRACKER_HOOK_((uintptr_t) & this->value);
|
|
|
|
return this->value ^= (T)operand;
|
|
|
|
}
|
2012-11-05 04:34:23 +00:00
|
|
|
|
2019-06-25 11:27:52 +00:00
|
|
|
template <typename Tt> inline T operator<<=(Tt operand)
|
|
|
|
{
|
|
|
|
TRACKER_HOOK_((uintptr_t) & this->value);
|
|
|
|
return this->value <<= (T)operand;
|
|
|
|
}
|
2012-11-09 22:31:02 +00:00
|
|
|
|
2019-06-25 11:27:52 +00:00
|
|
|
template <typename Tt> inline T operator>>=(Tt operand)
|
|
|
|
{
|
|
|
|
TRACKER_HOOK_((uintptr_t) & this->value);
|
|
|
|
return this->value >>= (T)operand;
|
|
|
|
}
|
2012-11-05 04:34:23 +00:00
|
|
|
|
2019-06-25 11:27:52 +00:00
|
|
|
inline operator T() const { return this->value; }
|
2012-11-26 08:26:04 +00:00
|
|
|
|
2019-06-25 11:27:52 +00:00
|
|
|
inline T cast() const { return this->value; }
|
2018-01-13 22:15:07 +00:00
|
|
|
|
2019-06-25 11:27:52 +00:00
|
|
|
struct is_signed
|
|
|
|
{
|
|
|
|
static constexpr bool value = std::is_signed<T>::value;
|
|
|
|
};
|
|
|
|
struct is_unsigned
|
|
|
|
{
|
|
|
|
static constexpr bool value = std::is_unsigned<T>::value;
|
|
|
|
};
|
2018-01-13 22:15:07 +00:00
|
|
|
};
|