libstdc++: LWG 3286 ranges::size is not required to be valid after ...
... a call to ranges::begin on an input range. This implements LWG 3286. The new wording for the single-argument constructor for subrange is implemented by splitting the constructor into two delegating constructors, one constrained by _S_store_size and the other by !_S_store_size. Tested on x86_64-pc-linux-gnu, both added tests fail before the patch and pass with the patch. libstdc++-v3/ChangeLog: LWG 3286 ranges::size is not required to be valid after a call to ranges::begin on an input range * include/std/ranges (subrange::subrange): Split single-argument constructor into two, one constrained by _S_store_size and another by !_S_store_size. (take_view::begin): Call size() before calling ranges::begin(_M_base). * testsuite/std/ranges/adaptors/lwg3286.cc: New test. * testsuite/std/ranges/subrange/lwg3286.cc: New test.
Showing
Please
register
or
sign in
to comment