Commit a089aa8a authored by Jose Dapena Paz's avatar Jose Dapena Paz Committed by Commit Bot

libstdc++: explicitly declare default constructor of WTF::DequeIterator

Using std::minmax_element on a WTF::Deque iterator with libstdc++ from
GCC 5+ fails to compile:
/usr/include/c++/9/bits/stl_algo.h:3334:24: error: no matching function for call to ‘WTF::DequeIterator<int, 0, WTF::PartitionAllocator>::DequeIterator(<brace-enclosed initializer list>)’
 3334 |       _ForwardIterator __min{}, __max{};

This is because it will try to create an iterator of the DequeIterator
type with no parameters (or with an empty list of initializers), but
that constructor is not available. So this changeset adds it.

Bug: 957519

Change-Id: I95e54a2fd95b19c0d439e9067105b7e388bdea61
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2051932Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: José Dapena Paz <jdapena@igalia.com>
Cr-Commit-Position: refs/heads/master@{#740842}
parent a148e5ed
......@@ -236,6 +236,7 @@ class DequeIterator : public DequeIteratorBase<T, inlineCapacity, Allocator> {
typedef T& reference;
typedef std::bidirectional_iterator_tag iterator_category;
DequeIterator() = default;
DequeIterator(Deque<T, inlineCapacity, Allocator>* deque, wtf_size_t index)
: Base(deque, index) {}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment