diff options
Diffstat (limited to 'libcxx/test/std/utilities/function.objects/unord.hash')
4 files changed, 19 insertions, 12 deletions
diff --git a/libcxx/test/std/utilities/function.objects/unord.hash/enum.pass.cpp b/libcxx/test/std/utilities/function.objects/unord.hash/enum.pass.cpp index b5cd6f8454d..4dbd7b0d810 100644 --- a/libcxx/test/std/utilities/function.objects/unord.hash/enum.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/unord.hash/enum.pass.cpp @@ -33,11 +33,12 @@ template <class T> void test() { - static_assert((std::is_base_of<std::unary_function<T, std::size_t>, - std::hash<T> >::value), ""); + typedef std::hash<T> H; + static_assert((std::is_same<H::argument_type, T>::value), "" ); + static_assert((std::is_same<H::result_type, std::size_t>::value), "" ); typedef typename std::underlying_type<T>::type under_type; - std::hash<T> h1; + H h1; std::hash<under_type> h2; for (int i = 0; i <= 5; ++i) { diff --git a/libcxx/test/std/utilities/function.objects/unord.hash/floating.pass.cpp b/libcxx/test/std/utilities/function.objects/unord.hash/floating.pass.cpp index 988950d4dc9..f1f198f2359 100644 --- a/libcxx/test/std/utilities/function.objects/unord.hash/floating.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/unord.hash/floating.pass.cpp @@ -28,9 +28,11 @@ template <class T> void test() { - static_assert((std::is_base_of<std::unary_function<T, std::size_t>, - std::hash<T> >::value), ""); - std::hash<T> h; + typedef std::hash<T> H; + static_assert((std::is_same<typename H::argument_type, T>::value), "" ); + static_assert((std::is_same<typename H::result_type, std::size_t>::value), "" ); + H h; + std::size_t t0 = h(0.); std::size_t tn0 = h(-0.); std::size_t tp1 = h(0.1); diff --git a/libcxx/test/std/utilities/function.objects/unord.hash/integral.pass.cpp b/libcxx/test/std/utilities/function.objects/unord.hash/integral.pass.cpp index e5f7ca61624..7cd9f15e93d 100644 --- a/libcxx/test/std/utilities/function.objects/unord.hash/integral.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/unord.hash/integral.pass.cpp @@ -27,9 +27,11 @@ template <class T> void test() { - static_assert((std::is_base_of<std::unary_function<T, std::size_t>, - std::hash<T> >::value), ""); - std::hash<T> h; + typedef std::hash<T> H; + static_assert((std::is_same<typename H::argument_type, T>::value), "" ); + static_assert((std::is_same<typename H::result_type, std::size_t>::value), "" ); + H h; + for (int i = 0; i <= 5; ++i) { T t(i); diff --git a/libcxx/test/std/utilities/function.objects/unord.hash/pointer.pass.cpp b/libcxx/test/std/utilities/function.objects/unord.hash/pointer.pass.cpp index e4e011295c9..a48394495e2 100644 --- a/libcxx/test/std/utilities/function.objects/unord.hash/pointer.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/unord.hash/pointer.pass.cpp @@ -27,9 +27,11 @@ template <class T> void test() { - static_assert((std::is_base_of<std::unary_function<T, std::size_t>, - std::hash<T> >::value), ""); - std::hash<T> h; + typedef std::hash<T> H; + static_assert((std::is_same<typename H::argument_type, T>::value), "" ); + static_assert((std::is_same<typename H::result_type, std::size_t>::value), "" ); + H h; + typedef typename std::remove_pointer<T>::type type; type i; type j; |