diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2021-10-08 13:35:54 +0100 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2021-10-09 00:57:47 +0100 |
commit | 64acc43de1e33616e43b239887a260eb4a51fcc7 (patch) | |
tree | 3ee405bdbd2670a548a32ebc2d3636e16bf1feb6 /gcc | |
parent | 7afb61087d2cb7a6d27463bab5a7567fac69f97a (diff) | |
download | gcc-64acc43de1e33616e43b239887a260eb4a51fcc7.zip gcc-64acc43de1e33616e43b239887a260eb4a51fcc7.tar.gz gcc-64acc43de1e33616e43b239887a260eb4a51fcc7.tar.bz2 |
libstdc++: Avoid instantiation of _Hash_node before it's needed
This is a step towards restoring support for incomplete types in
unordered containers (PR 53339).
We do not need to instantiate the node type to get its value_type
member, because we know that the value type is the first template
parameter. We can deduce that template argument using a custom trait and
a partial specialization for _Hash_node. If we wanted to support custom
hash node types we could still use typename _Tp::value_type in the
primary template of that trait, but that seems unnecessary.
The other change needed is to defer a static assert at class scope, so
that it is done when the types are complete. We must have a complete
type in the destructor, so we can do it there instead.
libstdc++-v3/ChangeLog:
* include/bits/hashtable.h: Move static assertion to destructor.
* include/bits/hashtable_policy.h: Deduce value type from node
type without instantiating it.
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions