New issue
Advanced search Search tips

Issue 682254 link

Starred by 2 users

Issue metadata

Status: Untriaged
Owner: ----
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocked on:
issue 671759



Sign in to add a comment

Improve flat_set interface.

Reported by dyaros...@yandex-team.ru, Jan 18 2017

Issue description

This task is a followup to https://bugs.chromium.org/p/chromium/issues/detail?id=671759

We currently do not implement:
 * templated versions of lookup algorithms, introduced for std::set in C++14 (requires implementing less<>).

We might want to:
 * expose underlying_type in the interface (including some form of efficient conversions to and from) instead of allocator.
 * expose extract method, that returns key_type (unlike node_type from c++17) to improve interface for move only elements of sets.
 

Comment 1 by rbyers@chromium.org, Jan 18 2017

Blockedon: 671759
Components: Internals>Core
Labels: TE-NeedsTriageHelp
Status: Untriaged (was: Unconfirmed)
Project Member

Comment 4 by bugdroid1@chromium.org, Jul 22 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/99a394d8dfee489d2a45308681f2bbbbf28ee6f8

commit 99a394d8dfee489d2a45308681f2bbbbf28ee6f8
Author: dyaroshev <dyaroshev@yandex-team.ru>
Date: Sat Jul 22 19:10:35 2017

Improving flat containers interface.

This patch adds a few features to base::flat_set/base::flat_map.

1) C++14 overloads of search operations.
  Now count, find, equal_range, lower_bound, upper_bound accept any type comparable
  with key_type if the comparison is transparent. Comparison is considered to be
  transparent if it has `is_transparent` member typedef
  (http://en.cppreference.com/w/cpp/utility/functional/less_void)
  We removed non-templated versions, because they were mainly for backward
  compatibility in extremely rare cases.

2) Templated version of erase.
  This version was in the  original proposal but later was removed as a result of a
  bug report, because it changed overload resolution for `erase(iterator)`. We
  provide an explicit  `erase(iterator)` overload that addresses this issue.

BUG=682254
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel

Review-Url: https://codereview.chromium.org/2944523002
Cr-Commit-Position: refs/heads/master@{#488865}

[modify] https://crrev.com/99a394d8dfee489d2a45308681f2bbbbf28ee6f8/ash/fast_ink/fast_ink_view.h
[modify] https://crrev.com/99a394d8dfee489d2a45308681f2bbbbf28ee6f8/base/BUILD.gn
[modify] https://crrev.com/99a394d8dfee489d2a45308681f2bbbbf28ee6f8/base/bind_internal.h
[modify] https://crrev.com/99a394d8dfee489d2a45308681f2bbbbf28ee6f8/base/containers/README.md
[modify] https://crrev.com/99a394d8dfee489d2a45308681f2bbbbf28ee6f8/base/containers/flat_map.h
[modify] https://crrev.com/99a394d8dfee489d2a45308681f2bbbbf28ee6f8/base/containers/flat_map_unittest.cc
[modify] https://crrev.com/99a394d8dfee489d2a45308681f2bbbbf28ee6f8/base/containers/flat_set.h
[modify] https://crrev.com/99a394d8dfee489d2a45308681f2bbbbf28ee6f8/base/containers/flat_set_unittest.cc
[modify] https://crrev.com/99a394d8dfee489d2a45308681f2bbbbf28ee6f8/base/containers/flat_tree.h
[modify] https://crrev.com/99a394d8dfee489d2a45308681f2bbbbf28ee6f8/base/containers/flat_tree_unittest.cc
[modify] https://crrev.com/99a394d8dfee489d2a45308681f2bbbbf28ee6f8/base/template_util.h
[modify] https://crrev.com/99a394d8dfee489d2a45308681f2bbbbf28ee6f8/base/template_util_unittest.cc
[rename] https://crrev.com/99a394d8dfee489d2a45308681f2bbbbf28ee6f8/base/test/move_only_int.h
[modify] https://crrev.com/99a394d8dfee489d2a45308681f2bbbbf28ee6f8/cc/output/direct_renderer.cc
[modify] https://crrev.com/99a394d8dfee489d2a45308681f2bbbbf28ee6f8/cc/output/direct_renderer.h
[modify] https://crrev.com/99a394d8dfee489d2a45308681f2bbbbf28ee6f8/cc/tiles/checker_image_tracker_unittest.cc
[modify] https://crrev.com/99a394d8dfee489d2a45308681f2bbbbf28ee6f8/components/exo/layer_tree_frame_sink_holder.h
[modify] https://crrev.com/99a394d8dfee489d2a45308681f2bbbbf28ee6f8/components/viz/service/display/surface_aggregator.cc
[modify] https://crrev.com/99a394d8dfee489d2a45308681f2bbbbf28ee6f8/content/browser/devtools/protocol/target_auto_attacher.cc
[modify] https://crrev.com/99a394d8dfee489d2a45308681f2bbbbf28ee6f8/ui/events/blink/input_handler_proxy.cc

I think that we can probably close this bug:
- We have an efficient conversion from underlying_type (even though we don't expose the typedef, which we probably should).
- We have templated lookup functions.
Project Member

Comment 7 by bugdroid1@chromium.org, Sep 11 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8f3698fdcba9b8fd9c7461f6e57522307b1cecc8

commit 8f3698fdcba9b8fd9c7461f6e57522307b1cecc8
Author: jdoerrie <jdoerrie@chromium.org>
Date: Mon Sep 11 11:13:28 2017

Add C++17 std::map APIs to base::flat_map

This change adds the C++17 APIs |insert_or_assign| and |try_emplace|
from std::map to base::flat_map. Further details can be found in the
standardization proposal N4279.

Bug: 682254
Change-Id: I24c707bde578fc9086182004bb3e1efe8836e563
Reviewed-on: https://chromium-review.googlesource.com/647747
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Reviewed-by: Brett Wilson <brettw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#500882}
[modify] https://crrev.com/8f3698fdcba9b8fd9c7461f6e57522307b1cecc8/base/containers/flat_map.h
[modify] https://crrev.com/8f3698fdcba9b8fd9c7461f6e57522307b1cecc8/base/containers/flat_map_unittest.cc
[modify] https://crrev.com/8f3698fdcba9b8fd9c7461f6e57522307b1cecc8/base/containers/flat_tree.h

Project Member

Comment 8 by bugdroid1@chromium.org, 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

Project Member

Comment 9 by bugdroid1@chromium.org, Oct 19

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/39afe0030be589b22cfb0bdda281a0cc0778058d

commit 39afe0030be589b22cfb0bdda281a0cc0778058d
Author: jdoerrie <jdoerrie@chromium.org>
Date: Fri Oct 19 17:05:15 2018

[base] Implement base::flat_tree::contains()

This change implements base::flat_tree::contains(). This mirrors C++20,
which introduces contains() to the associative containers in the STL.
See P0458R2 [1] for further details.

[1] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0458r2.html

Bug: 682254
Change-Id: I4af8ce4fadd4647f7021d374bee4316c110c277d
Reviewed-on: https://chromium-review.googlesource.com/c/1288434
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Cr-Commit-Position: refs/heads/master@{#601196}
[modify] https://crrev.com/39afe0030be589b22cfb0bdda281a0cc0778058d/base/containers/flat_map.h
[modify] https://crrev.com/39afe0030be589b22cfb0bdda281a0cc0778058d/base/containers/flat_set.h
[modify] https://crrev.com/39afe0030be589b22cfb0bdda281a0cc0778058d/base/containers/flat_tree.h
[modify] https://crrev.com/39afe0030be589b22cfb0bdda281a0cc0778058d/base/containers/flat_tree_unittest.cc

Sign in to add a comment