Catch2
Catch2 copied to clipboard
What's the reason Approx is not default constructible?
Title, I saw this when creating an array of Approx
What use cases require an array of such uninitialized objects?
I don't quite remember but I can think of something:
std::array<Catch::Approx, 2> arr; // error
std::generate(arr, ...);
std::array expected = {1., 2.};
REQUIRE(arr == expected);
You could make an std::vector but then, if Approx is completely constexpr, you'd lose constexpr functionality and can no longer use static_assert