mirror of
https://github.com/fmtlib/fmt.git
synced 2025-11-25 11:49:52 +01:00
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:
@@ -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>{}, "");
|
||||
|
||||
Reference in New Issue
Block a user