N.B. this is not "control flow".

On Mon, 10 Nov 2025, 04:36 Anton Kalinin, <[email protected]> wrote:

> Why does the map implementation need to call pair_alloc_type on the passed
> in map allocator prior to calling the rb_tree constructors.
>

Because historically we didn't enforce the rule that the map's allocator
had to be the current type:

https://github.com/gcc-mirror/gcc/blob/d538348556bd05fba13e41cb8497bda2eb086e63/libstdc%2B%2B-v3/include/bits/stl_map.h#L128

I.e. we allowed std::map<int, int, less<int>, allocator<int>>.


>
> https://github.com/gcc-mirror/gcc/blob/master/libstdc%2B%2B-v3/include/bits/stl_map.h#L211
>
> https://github.com/gcc-mirror/gcc/blob/master/libstdc%2B%2B-v3/include/bits/stl_map.h#L246
> etc
>
>
>

Reply via email to