Document number: P0508R0


Howard E. Hinnant
2016-11-10

Wording for GB 58

Note that the wording below goes slightly beyond the scope of GB 58 by removing insert_return_type from multimap, multiset, unordered_multimap, and unordered_multiset. It was a mistake to put insert_return_type into these containers, and it is unused in these containers.

Proposed Wording

  1. Add a new section after 23.1.1 Node handles [container.node]:

    23.1.2 Insert return type [container.insert_return_type]

    The associative containers with unique keys, and the unordered containers with unique keys have a member function insert that returns a nested type insert_return_type. That return type is a specialization of the type specified in this section.

    template <class Iterator, class NodeType>
    struct INSERT_RETURN_TYPE
    {
        Iterator position;
        bool     inserted;
        NodeType node;
    };
    

    The name INSERT_RETURN_TYPE is exposition only. INSERT_RETURN_TYPE has the template parameters, data members, and special members specified above. It has no base classes or members other than those specified.

  2. Remove the row from Table 86 — Associative container requirements [associative.reqmts] that describes X::insert_return_type.

  3. Remove the row from Table 87 — Unordered associative container requirements [unord.req] that describes X::insert_return_type.

  4. Modify the synopsis of map in [map.overview]:

    using node_type              = unspecified;
    using insert_return_type     = unspecified; INSERT_RETURN_TYPE<iterator, node_type>;
    
  5. Modify the synopsis of set in [set.overview]:

    using node_type              = unspecified;
    using insert_return_type     = unspecified; INSERT_RETURN_TYPE<iterator, node_type>;
    
  6. Modify the synopsis of unordered_map in [unord.map.overview]:

    using node_type              = unspecified;
    using insert_return_type     = unspecified; INSERT_RETURN_TYPE<iterator, node_type>;
    
  7. Modify the synopsis of unordered_set in [unord.set.overview]:

    using node_type              = unspecified;
    using insert_return_type     = unspecified; INSERT_RETURN_TYPE<iterator, node_type>;