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

Provide support for explicit operator bool #79

Merged
merged 2 commits into from
May 26, 2018
Merged

Conversation

kyku
Copy link
Contributor

@kyku kyku commented May 21, 2018

No description provided.

@foonathan
Copy link
Owner

Could you test it with a type that doesn't have a constexpr operator? I think it might be an issue.

@kyku
Copy link
Contributor Author

kyku commented May 21, 2018

Thanks for pointing that out. Using a static_cast(...) seems to solve this problem (tested on GCC 7.3.1 and clang 6.0.0). And so is removing the constexpr. Is that acceptable?

@foonathan
Copy link
Owner

Just to clarify: your code still has constexpr? If it works, I'm fine with leaving at is.

@kyku
Copy link
Contributor Author

kyku commented May 26, 2018

Yes, the updated PR still contains constexpr in explicit operator bool().

@foonathan foonathan merged commit 367f2dc into foonathan:master May 26, 2018
@foonathan
Copy link
Owner

Good, I wasn't sure the PR was updated properly, I remembered issues with constexpr on the strong typedef member functions and was surprised it works.

dvirtz pushed a commit to hunter-packages/type_safe that referenced this pull request Feb 17, 2019
dvirtz pushed a commit to hunter-packages/type_safe that referenced this pull request Feb 17, 2019
saraedum pushed a commit to saraedum/type_safe that referenced this pull request Jul 28, 2019
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.

2 participants