I want to create an unsigned arithmetic type that can hold a maximum size of 360. Without having to create a method.
It should be in such a manner that:
returns 359, instead of 255, or 65535 or whatever max value the type I base my type on can hold.Code:typedef uint8_t radius; radius rotation = 0; radius foo (radius rotation) { return --rotation; }
Any ideas on how to tackle this?
Thanks.