[all-commits] [llvm/llvm-project] 4ce1d1: [ADT] Add DenseSet::insert_range (#131567)

Kazu Hirata via All-commits all-commits at lists.llvm.org
Mon Mar 17 13:19:33 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4ce1d1f1d90d19fb7094f2dcca3b46fef81c1e27
      https://github.com/llvm/llvm-project/commit/4ce1d1f1d90d19fb7094f2dcca3b46fef81c1e27
  Author: Kazu Hirata <kazu at google.com>
  Date:   2025-03-17 (Mon, 17 Mar 2025)

  Changed paths:
    M llvm/include/llvm/ADT/DenseSet.h
    M llvm/unittests/ADT/DenseSetTest.cpp

  Log Message:
  -----------
  [ADT] Add DenseSet::insert_range (#131567)

This pach adds DenseSet::insert_range, named after
std::map::insert_range from C++23.  The intent is to allow a heavy
operation as the argument like:

  Set.insert_range(Map[Key]);

Without insert_range, we would have to do:

  Set.insert(Map[Key].begin(), Map[Key].end());

or:

  auto &M = Map[Key];
  Set.insert(M.begin(), M.end());

Neither is elegant.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list