QList: fix typo in QList(It, It)

Remove scaffolding in the test again.

[ChangeLog][QtCore][QList] Fixed a regression that caused the range
constructor to fail for pure input_iterator's.

Fixes: QTBUG-99036
Change-Id: I72d01a9c44c3862c335d96538f26a453b4c7c554
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 48b75def5d734d8f8ecf2805ba64be6c99aca978)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Marc Mutz 2021-12-08 14:34:25 +01:00 committed by Qt Cherry-pick Bot
parent c721dff3f3
commit b05c9898cc
2 changed files with 1 additions and 13 deletions

View File

@ -276,7 +276,7 @@ public:
template <typename InputIterator, QtPrivate::IfIsInputIterator<InputIterator> = true>
QList(InputIterator i1, InputIterator i2)
{
if constexpr (!std::is_convertible_v<typename std::iterator_traits<Iterator>::iterator_category, std::forward_iterator_tag>) {
if constexpr (!std::is_convertible_v<typename std::iterator_traits<InputIterator>::iterator_category, std::forward_iterator_tag>) {
std::copy(i1, i2, std::back_inserter(*this));
} else {
const auto distance = std::distance(i1, i2);

View File

@ -66,13 +66,6 @@ std::istream &operator>>(std::istream &os, QChar &c)
}
QT_END_NAMESPACE
namespace {
template <typename T>
struct is_qlist : std::false_type {};
template <typename T>
struct is_qlist<QList<T>> : std::true_type {};
}
struct Movable
{
explicit Movable(int i = 0) noexcept
@ -458,11 +451,6 @@ void tst_ContainerApiSymmetry::ranged_ctor_non_associative_impl() const
// from stringsteam (= pure input_iterator)
const Container c5 = [&] {
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) // QTBUG-99036
if constexpr (is_qlist<Container>::value) {
return c4;
} else
#endif
{
std::stringstream ss;
for (auto &v : values1)