It seems this code works (so it compiles fine), what I'm asking here is: is it guaranteed that sizeof(std::array) is the same as sizeof(equivalent_Carray)?
struct MyClass {
std::array<float, 4> arr;
float carr[4];
std::array<float, 4> cfunction() {
std::array<float, sizeof(carr) / sizeof(float)> out;
return out;
}
std::array<float, 4> function() {
// Is this guaranteed to be the same as sizeof(carr) / sizeof(float)??
std::array<float, sizeof(arr) / sizeof(float)> out;
std::cout << sizeof(arr);
return out;
}
};
int main()
{
MyClass obj;
obj.function();
}