<div dir="ltr"><div dir="ltr">On Wed, 6 May 2020 at 09:24, Ray Lischner via cfe-users <<a href="mailto:cfe-users@lists.llvm.org">cfe-users@lists.llvm.org</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I am using clang++ 10 with GCC libstdc++ 10 prerelease. I tried <br>
compiling the example from section 24.6.4.1 [range.istream.overview]. It <br>
works with g++ 10 but with clang++ 10 -std=c++20, I get <br>
constraint-failure errors.<br>
<br>
program:<br>
#include <algorithm><br>
#include <iostream><br>
#include <iterator><br>
#include <ranges><br>
#include <sstream><br>
<br>
int main()<br>
{<br>
   using namespace std;<br>
   using namespace ranges;<br>
   auto ints = istringstream{"0 1  2   3     4"};<br>
   ranges::copy(istream_view<int>(ints), ostream_iterator<int>{cout, "-"});<br>
   // prints0-1-2-3-4-<br>
}<br>
<br>
$ clang++ -std=c++20 -o range_istream_overview \<br>
range_istream_overview.cpp<br>
<br>
Gist of the errors is that the istream_view fails the constraints for a <br>
range because ranges::begin() fails its constraint for the <br>
basic_istream_view::begin() member function:<br>
<br>
{ __detail::__decay_copy(__t.begin()) } -> input_or_output_iterator;<br>
<br>
Any ideas what's wrong or how to proceed?<br></blockquote><div><br></div><div>Please could you provide the complete set of diagnostics from the compilation? </div></div></div>