Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- /*
- class UInt24_t
- {
- private:
- const int Uint24_t_MAX = 16777215;
- const int Uint24_t_MIN = 0;
- unsigned char value[3];
- public:
- UInt24_t(){};
- UInt24_t(UInt24_t& val)
- {
- *this = val;
- }
- template <typename T>
- UInt24_t(T& val)
- {
- (0xff << 24) | (value[2] << 16)
- | (value[1] << 8)
- | value[0];
- *this = val;
- }
- operator unsigned int(){
- return (0xff << 24) | (value[2] << 16)
- | (value[1] << 8)
- | value[0];
- }
- UInt24_t& operator= (const UInt24_t& input)
- {
- value[0] = input.value[0];
- value[1] = input.value[1];
- value[2] = input.value[2];
- return *this;
- }
- //template<typename T>
- UInt24_t& operator= (unsigned int input)
- {
- value[0] = reinterpret_cast<unsigned char*>(&input)[0];
- value[1] = reinterpret_cast<unsigned char*>(&input)[1];
- value[2] = reinterpret_cast<unsigned char*>(&input)[2];
- return *this;
- }
- UInt24_t operator+(UInt24_t& input)
- {
- unsigned int cock0 = reinterpret_cast<unsigned int>(this*) + static_cast<unsigned int>(input);
- auto cock = UInt24_t(cock0);
- return cock;
- }
- UInt24_t operator- (const UInt24_t& val) const
- {
- return UInt24_t((unsigned int)*this - (unsigned int)val);
- }
- ~UInt24_t();
- };
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement