Check range_begin is dereferenceable (#3964)

Fixes issue #3839
An Eigen 3.4 2x2 matrix has a begin member function that returns void
Be more strict checking that the result of calling *begin() is valid
See input_or_output_iterator concept notes about void
This commit is contained in:
Justin Riddell
2024-05-21 00:11:07 +01:00
committed by GitHub
parent 706eabd5e5
commit b81761068b
2 changed files with 12 additions and 6 deletions

View File

@@ -742,3 +742,9 @@ TEST(ranges_test, movable_only_istream_iter_join) {
EXPECT_EQ("1, 2, 3, 4, 5",
fmt::format("{}", fmt::join(std::move(first), last, ", ")));
}
struct not_range {
void begin() const {}
void end() const {}
};
static_assert(!fmt::is_formattable<not_range>{}, "");