std::vector doesn't support erase(const_iterator) on linux
Reported by
dyaros...@yandex-team.ru,
Dec 26 2016
|
|||||
Issue description
C++11 supports insert/erase with const_iterator.
However, it fails on linux:
error: no matching member function for call to 'erase'
v.erase(v.cbegin());
~~^~~~~
../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/stl_vector.h:986:7: note: candidate function not viable: no known conversion from '__normal_iterator<const_pointer, [...]>' to '__normal_iterator<pointer, [...]>' for 1st argument
erase(iterator __position);
^
../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/stl_vector.h:1007:7: note: candidate function not viable: requires 2 arguments, but 1 was provided
erase(iterator __first, iterator __last);
,
Feb 6 2017
,
Feb 6 2017
,
Apr 4 2017
Unfortunately this is still not fixed with GCC 4.8. It looks like we have to wait for GCC 4.9: https://gcc.gnu.org/onlinedocs/gcc-4.9.0/libstdc++/api/a01523_source.html#l01129
,
Apr 4 2017
@jdoerrie Can you please tell me, which compiler versions do we use? GCC 6.3 is already out..
,
Apr 4 2017
When you filed this bug we used the Debian Wheezy sysroot using GCC 4.6 (as you can see from the path in the compilation error). However, just last week we upgraded to Debian Jessie ( http://crbug.com/701894 ) using GCC 4.8. This means we now can use more C++11 features like std::map::emplace, but std::vector::erase(const_iterator) is still not supported.
,
Apr 6 2018
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Apr 11 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/6af2a7536303e85f7be418c736d41d894378498f commit 6af2a7536303e85f7be418c736d41d894378498f Author: jdoerrie <jdoerrie@chromium.org> Date: Wed Apr 11 07:23:58 2018 [base] Remove GCC 4.8 Workaround in base::flat_tree This change removes a GCC 4.8 work around the lack of std::vector::erase(const_iterator) from base::flat_tree. Bug: 682254, 677044 Change-Id: I8bd13851baa58c8cecd64c02c50bd999357afac4 Reviewed-on: https://chromium-review.googlesource.com/1005074 Reviewed-by: vmpstr <vmpstr@chromium.org> Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org> Cr-Commit-Position: refs/heads/master@{#549809} [modify] https://crrev.com/6af2a7536303e85f7be418c736d41d894378498f/base/containers/flat_tree.h
,
Apr 11 2018
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by krajshree@chromium.org
, Dec 27 2016Labels: TE-NeedsTriageHelp