This should compile with C++20 but it doesn’t. (The uninitialized value error is incorrect since the value is only written to while it is uninitialized)
constexpr auto create(int a, int b, int c) -> vector
v.a_ = a;
v.a_ = b;
v.a_ = c;
constexpr vector v = create(3,4,4);
I talked with engineering, but they believe the compiler error message is correct.
v.a_ = a; involves calling
operator on the uninitialized
std::array subobject. It’s the call to the member function that is problematic and resulting in the error.
Thank you for your reply. I’ll see what can be done about it. For now, I guess initializing it makes sense.