17-03-2025, 09:58 AM
In Rule A3-3-2, there's an example with "class A" which has a non-constexpr, user-defined constructor.
On line 31, we have a compliant example:
However, on line 37 it's no longer compliant:
There seems to be a contradiction here. Either the code is doing value initialization, or it's calling a constructor, but not both. Which one is it?
In other words, it seems like both examples are doing the same thing, so both should either be compliant or non-compliant. Would you agree?
On line 31, we have a compliant example:
Code:
A instance{}; // Compliant - constant (value) initialization
However, on line 37 it's no longer compliant:
Code:
static A a{}; // Non-compliant - A’s default c’tor is not constexpr
There seems to be a contradiction here. Either the code is doing value initialization, or it's calling a constructor, but not both. Which one is it?
In other words, it seems like both examples are doing the same thing, so both should either be compliant or non-compliant. Would you agree?