graph-v2 icon indicating copy to clipboard operation
graph-v2 copied to clipboard

`size(bfs)` is misleading and breaks the range interface

Open akrzemi1 opened this issue 6 months ago • 0 comments

All the breadth-first (and probably other) views bfs expose function size(bfs) which does not return the number of elements in the represented input range.

static_assert(std::ranges::sized_range<decltype(bfs)>); returns true. std::ranges::distance(bfs) compiles returns a number, but it is not the range size.

This makes the ranges interface break.

I am not sure how useful it is for the users to know how many elements are stored in the internal queue. But if it is, the library should use a different name, such as bfs.queue_size().

akrzemi1 avatar Jun 17 '25 14:06 akrzemi1