I have a class A
that is non default initializable that I can't modify.
How can I create a length zero std::array containing said class?
This works in both clang and gcc but not MSVC.
#include <array>
struct A {
A(double, int) {};
};
using Empty = std::array<A, 0>;
inline const Empty GetChildren() {
return {};
};
int main(int argc, char **argv) {
const Empty& test(GetChildren());
for (const auto& a : GetChildren()) {}
}