I have a class with a member of type uint8 and when I try to output it to an ostream it displays as it’s char representation. I would prefer it’s int representation so I need to static_cast(myStruct.member) each time which is a bit cumbersome and potentially error-prone. Any ideas?
Share
Implement
operator<<on your class and define the cast there. Seems to me like you are violating encapsulation.