since this is the C++ forum, why not just write a class that implements the functionality that you require? you could have it still only take 1 byte of storage (ideally) if you only have a char as your only private data member.
here's just the beginning of such a class, still missing much of its functionality:
just an idea, and a bit of code to get you started.Code:#include <iostream> class TinyInt { public: TinyInt(char c); bool operator == (char c); bool operator == (const TinyInt& ti); int GetValue() const { return m_char; } private: char m_char; } std::ostream& operator << (std::ostream& os, const TinyInt& ti) { return os << ti.GetValue(); }