PR78273 fix count to work with partitioning function
authorJonathan Wakely <jwakely@redhat.com>
Wed, 11 Jan 2017 14:44:04 +0000 (14:44 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Wed, 11 Jan 2017 14:44:04 +0000 (14:44 +0000)
commitb091b8dc0b9fdfe157da5a738e8cbb360143fc9e
tree968e331b6db2ff2c777d3680dcf336d9f3ed2dee
parenta92ffb3e945608131f5edf3ec2d6d583e417083b
PR78273 fix count to work with partitioning function

PR libstdc++/78273
* include/bits/stl_map.h (map::count<_Kt>(const _Kt&)): Don't assume
the heterogeneous comparison can only find one match.
* include/bits/stl_set.h (set::count<_Kt>(const _Kt&)): Likewise.
* testsuite/23_containers/map/operations/2.cc: Test count works with
comparison function that just partitions rather than sorting.
* testsuite/23_containers/set/operations/2.cc: Likewise.

From-SVN: r244317
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/stl_map.h
libstdc++-v3/include/bits/stl_set.h
libstdc++-v3/testsuite/23_containers/map/operations/2.cc
libstdc++-v3/testsuite/23_containers/set/operations/2.cc