Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Feb 14, 2022

Conversation

Nicholas42
Copy link

Works around #61 for arithmetic types.

Copy link

@MarekR22 MarekR22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Respective test is missing. Copy it from issue report.

Nicholas Schwab added 2 commits February 9, 2022 13:33
The call to operator++ and operator-- is ambiguous when pre- and postfix were inherited from different sources. We can work around this problem by explicitly using those operators when both are present.
Also extended the test for Arithmetic to check this, since I was unsure
if the added layer of inheritance would be a problem.
@Nicholas42
Copy link
Author

Nicholas42 commented Feb 9, 2022

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?

@joboccara joboccara merged commit f05bf96 into joboccara:master Feb 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants