Thiago Adams
2024-11-07 19:16:49 UTC
The differences relate to arrays. I think the standard leaves some
flexibility in the specification, so there may not be a strict right or
wrong - just different approaches. The challenge for creating portable
code is knowing when it will work consistently across different compilers.
Sample
int main() {
constexpr int a[] = {1, 2};
static_assert(a[0] == 1);
}
works in clang but not in gcc
flexibility in the specification, so there may not be a strict right or
wrong - just different approaches. The challenge for creating portable
code is knowing when it will work consistently across different compilers.
Sample
int main() {
constexpr int a[] = {1, 2};
static_assert(a[0] == 1);
}
works in clang but not in gcc