https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86977

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to João Neto from comment #2)
> Hi Jonathan! Thanks for the quick reply!
> 
> Two follow-up questions:
> 
> (1) Shouldn't it be also flagged as an error in `gcc-6` and `gcc-7` with
> `-std=c++17`?

No because the static assertion was only added in gcc 8.

> (2) How can I reliably find the node-type allocated by the map if I'd want
> to use `-std=c++17`? Isn't it implementation-defined?

(In reply to João Neto from comment #3)
> Please ignore my stupidity. c++17 has a `node_type`

No, that's nothing to do with it.

Read the error message! Or read comment 1!

The allocator's value type must be the same as the container's VALUE TYPE. Not
its node type. I really don't know how to make the static assertion any
clearer.

The container's value_type is std::pair<const K, V>.

Reply via email to