[all-commits] [llvm/llvm-project] ec04e2: Allow SmallPtrSet to be used with a std::insert_it...

Aaron Ballman via All-commits all-commits at lists.llvm.org
Fri Feb 5 13:13:21 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ec04e2850adc044d84c840d7c48ebe3291ec47f7
      https://github.com/llvm/llvm-project/commit/ec04e2850adc044d84c840d7c48ebe3291ec47f7
  Author: Aaron Ballman <aaron at aaronballman.com>
  Date:   2021-02-05 (Fri, 05 Feb 2021)

  Changed paths:
    M llvm/include/llvm/ADT/SmallPtrSet.h
    M llvm/unittests/ADT/SmallPtrSetTest.cpp

  Log Message:
  -----------
  Allow SmallPtrSet to be used with a std::insert_iterator

Currently, the SmallPtrSet type allows inserting elements but it does
not support inserting elements with a positional hint. The lack of this
signature means that you cannot use SmallPtrSet with
std::insert_iterator or std::inserter(), which makes some code
constructs more awkward. This adds an overload of insert() that can be
used in these scenarios.

The positional hint is unused by SmallPtrSet and the call is equivalent
to calling insert() without a hint.




More information about the All-commits mailing list