On Tue, 17 Aug 2021 at 14:40, Antony Polukhin wrote: > > вт, 17 авг. 2021 г. в 16:37, Jonathan Wakely : > <...> > > Thanks, this is a nice improvement. We can avoid tag dispatching to > > make it simpler though: > > > > @@ -3248,6 +3249,9 @@ namespace __detail > > template > > seed_seq::seed_seq(_InputIterator __begin, _InputIterator __end) > > { > > + if _GLIBCXX17_CONSTEXPR > > (__is_random_access_iter<_InputIterator>::value) > > + _M_v.reserve(std::distance(__begin, __end)); > > + > > for (_InputIterator __iter = __begin; __iter != __end; ++__iter) > > _M_v.push_back(__detail::__mod > __detail::_Shift::__value>(*__iter)); > > > > The call to std::distance is well-formed for input iterators, but we > > won't actually call it unless we have random access iterators. > > > > Unless you see a problem with this that I'm missing, I'll go with that version. > > Looks much better. Thanks! Here's what I've tested and pushed to trunk. Thanks again!