STL_MSFT created this revision.
STL_MSFT added reviewers: EricWF, mclow.lists.
STL_MSFT added a subscriber: cfe-commits.
Fix unary_function inheritance assumption.
C++11 didn't require std::hash to derive from std::unary_function. The portable
thing to do is to inspect the typedefs, as the other half of this test was
already doing.
http://reviews.llvm.org/D21872
Files:
test/std/containers/sequences/vector.bool/vector_bool.pass.cpp
Index: test/std/containers/sequences/vector.bool/vector_bool.pass.cpp
===================================================================
--- test/std/containers/sequences/vector.bool/vector_bool.pass.cpp
+++ test/std/containers/sequences/vector.bool/vector_bool.pass.cpp
@@ -41,8 +41,8 @@
{
typedef std::vector<bool, min_allocator<bool>> T;
typedef std::hash<T> H;
- static_assert((std::is_base_of<std::unary_function<T, std::size_t>,
- H>::value), "");
+ static_assert((std::is_same<H::argument_type, T>::value), "" );
+ static_assert((std::is_same<H::result_type, std::size_t>::value), "" );
bool ba[] = {true, false, true, true, false};
T vb(std::begin(ba), std::end(ba));
H h;
Index: test/std/containers/sequences/vector.bool/vector_bool.pass.cpp
===================================================================
--- test/std/containers/sequences/vector.bool/vector_bool.pass.cpp
+++ test/std/containers/sequences/vector.bool/vector_bool.pass.cpp
@@ -41,8 +41,8 @@
{
typedef std::vector<bool, min_allocator<bool>> T;
typedef std::hash<T> H;
- static_assert((std::is_base_of<std::unary_function<T, std::size_t>,
- H>::value), "");
+ static_assert((std::is_same<H::argument_type, T>::value), "" );
+ static_assert((std::is_same<H::result_type, std::size_t>::value), "" );
bool ba[] = {true, false, true, true, false};
T vb(std::begin(ba), std::end(ba));
H h;
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits