Different std::flat_map/std::flat_multimap specializations should be able to share same nested classes
Jiang An

Created on 2023-07-24.00:00:00 last changed 1 month ago


Date: 2023-07-29.14:50:03

Proposed resolution:

This wording is relative to N4950.

  1. Add the new paragraph after [flat.map.defn] p1 and [flat.multimap.defn] p1 (twice):

    [Drafting note: The intent is to keep the property that key/mapped types, key/mapped containers, and the comparator type are not the associated types of these nested classes during ADL. ]

    -?- Implementations may define member types containers and value_compare as nested classes of another templated class and introduce them as typedef-names. Implementations shall ensure that these nested classes are not themselves class templates and have the specified names.

Date: 2023-07-24.00:00:00

Per current wording, std::flat_map<K, V, C1, KCont, VCont>::containers and std::flat_multimap<K, V, C2, KCont, VCont>::containers need to be different types since they are specified as nested classes. Likewise, std::flat_map<K, V, C, KCont1, VCont1>::value_compare and std::flat_multimap<K, V, C, KCont2, VCont2>::value_compare also need to be different types.

It may be better to allow implementations to make different std::flat_map/std::flat_multimap specializations share same nested classes.

Date User Action Args
2023-07-29 14:50:03adminsetmessages: + msg13693
2023-07-24 00:00:00admincreate