Skip to content

Conversation

@rymut
Copy link

@rymut rymut commented Oct 29, 2024

Implement static assert like funcionality on older compilers, the implementation do not support displaying human redable message, but compilation will fail.

Implementation works in any scope, also multiple uses of assert in the same line works fine.

Only issue is that it will generate warnings under gcc/clang due to use of unnamed struct with no instances.

The way to dissable the warning would be generating struct name using: struct HEDLEY_CONCAT(_hedley_static_assert_, __COUNTER__) { ... } under some compilers.

Implement static assert like funcionality on older compilers.
Implementation do not support message, but compilation will fail.
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.

1 participant