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

this assertion should not always yield false here #1

Closed
wants to merge 1 commit into from
Closed

this assertion should not always yield false here #1

wants to merge 1 commit into from

Conversation

robertzk
Copy link

No description provided.

@poletti-marco
Copy link
Contributor

Hi, thank you for the patch, but the code is as intended.
That template definition is only instantiated when the type argument is not of the form T(Types...).
Otherwise the specialization just below applies.
So in this case it's an error. The sizeof is just a trick to pretend that we're checking something depending on the type argument, otherwise the static_assert would be evaluated right away, not delayed at the first attempt of instantiating the non-specialized template definition.

@robertzk
Copy link
Author

Ah -- clever!

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