[llvm-bugs] [Bug 38722] New: [C++17] std::map::insert_or_assign w/ hint violate complexity requirements

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Aug 27 07:54:03 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=38722

            Bug ID: 38722
           Summary: [C++17] std::map::insert_or_assign w/ hint violate
                    complexity requirements
           Product: libc++
           Version: 7.0
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: kariya_mitsuru at hotmail.com
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com

The current implementations of std::map::insert_or_assign w/ hint
(const_iterator argument) ignore hint.

I think that they violate complexity requirements.

The C++17 standard [map.modifiers] p.14 and p.18 says,

Complexity: The same as emplace and emplace_hint, respectively.

and, Complexity column of emplace_hint in [associative.reqmts] table 90 says,

logarithmic in general, but amortized constant if the element is inserted right
before p

cf. https://wandbox.org/permlink/SvAYpldPEpx711TD

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180827/5099f0e3/attachment-0001.html>


More information about the llvm-bugs mailing list