The parameter or print
function is a forwarding reference because the range can change while being iterated, but the current value is l-value reference:
#include <string>
#include <vector>
#include <ranges>
#include <iostream>
template <class R, class Value>
concept range_over = std::ranges::range<R> &&
std::same_as<std::ranges::range_value_t<R>, Value>;
template <range_over<std::string> Range>
void print(Range&& range)
{
for (const std::string& val : range)
{
std::cout << val << std::endl;
}
}