This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of New status.

4233. The helper lambda of std::erase for hive should specify return type as bool

Section: 23.3.9.6 [hive.erasure] Status: New Submitter: Hewill Kang Opened: 2025-03-24 Last modified: 2025-03-27

Priority: Not Prioritized

View all issues with New status.

Discussion:

This is a follow up to LWG 4135(i), which incidentally adds a default template parameter for U to be consistent with other erase functions, which is editorial since the declaration already has it.

Proposed resolution:

This wording is relative to N5008.

  1. Modify 23.3.9.6 [hive.erasure] as indicated:

    template<class T, class Allocator, class U = T>
      typename hive<T, Allocator>::size_type
        erase(hive<T, Allocator>& c, const U& value);
    

    -1- Effects: Equivalent to:

    return erase_if(c, [&](const auto& elem) -> bool { return elem == value; });