Enforce LWG DR 2566 requirement for container adaptors
authorJonathan Wakely <jwakely@redhat.com>
Thu, 14 Feb 2019 14:10:12 +0000 (14:10 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Thu, 14 Feb 2019 14:10:12 +0000 (14:10 +0000)
commit1138a19dfe5029e6ead3bb26bb344bddce9f24f0
tree1224e15bd9662936e0ecc5037eacc49dc8414fb8
parentaffd7d477acb4a19dd588e51e6d5597679d0391d
Enforce LWG DR 2566 requirement for container adaptors

Although there is no good use for stack<int, deque<double>> or similar
types with a mismatched value_type, it's possible somebody is doing that
and getting away with it currently. This patch only enforces the new
requirement for C++17 and later. During stage 1 we should consider
enforcing it for C++11 and C++14.

* doc/xml/manual/intro.xml: Document LWG 2566 status.
* include/bits/stl_queue.h (queue, priority_queue): Add static
assertions to enforce LWG 2566 requirement on value_type.
* include/bits/stl_stack.h (stack): Likewise.

From-SVN: r268877
libstdc++-v3/ChangeLog
libstdc++-v3/doc/xml/manual/intro.xml
libstdc++-v3/include/bits/stl_queue.h
libstdc++-v3/include/bits/stl_stack.h