FR: from-range constructors for Juce containers

Since C++23, standard library containers can be constructed directly from any arbitrary range, allowing usage such as:

auto values = std::views::iota(1, 100)
  | std::ranges::to<std::vector>();

It would be great if Juce containers also supported these constructors. Particularly Array, StringArray, and maybe OwnedArray (but that one’s trickier).

As far as I know, all that’s needed to support this is a constructor with the following signature:

template<typename Range>
Array(
  std::from_range_t, Range&& range);
1 Like