joboccara / NamedType

Implementation of strong types in C++
MIT License
766 stars 85 forks source link

Work around gcc bug with ambiguous post/pre-increment. #67

Closed Nicholas42 closed 2 years ago

Nicholas42 commented 2 years ago

Works around https://github.com/joboccara/NamedType/issues/61 for arithmetic types.

Nicholas42 commented 2 years ago

I added a test case and changed the way I did this while I was at it. I introduced Incrementable and Decrementable as skills, which should always be used if one wants to have both. Before, this was only fixed for Arithmetic. The test case from #61 will still not work, since there is no way around it, if we inherit from Post and Pre without adding the using directive.

Maybe it would be a good idea to add a warning somewhere that one should only use Incrementable if both pre and postincrement is wanted?