utils: to_range(): relax constraint

The input range to utils::to_range() should be indeed a range,
but clang has trouble compiling <ranges> which causes it to fail.

Relax the constraint until this is fixed.
This commit is contained in:
Avi Kivity
2020-10-04 10:21:28 +03:00
parent 4159054baf
commit f9129fc1f9

View File

@@ -25,7 +25,13 @@
namespace ranges {
#ifndef __clang__
template <std::ranges::range Container, std::ranges::range Range>
#else
// 'Range' should be constrained to std::ranges::range, but due to
// problems between clang and <ranges>, it cannot be
template <std::ranges::range Container, typename Range>
#endif
Container to(const Range& range) {
return Container(range.begin(), range.end());
}