summaryrefslogtreecommitdiffstats
path: root/libcxx/test/support/Counter.h
diff options
context:
space:
mode:
authorStephan T. Lavavej <stl@exchange.microsoft.com>2018-04-12 23:56:10 +0000
committerStephan T. Lavavej <stl@exchange.microsoft.com>2018-04-12 23:56:10 +0000
commit3ed719bb63e3363db638a35425c0540337a0f831 (patch)
tree6b0296a5dc7af25b8a115cadc34cfabaa00d0039 /libcxx/test/support/Counter.h
parent0f66190aefa0c53648d549738a2bb312a309c2d9 (diff)
downloadbcm5719-llvm-3ed719bb63e3363db638a35425c0540337a0f831.tar.gz
bcm5719-llvm-3ed719bb63e3363db638a35425c0540337a0f831.zip
[libcxx] [test] Avoid unary_function.
Replace unary_function inheritance (which was never required, even in C++98) with argument_type and result_type typedefs. This increases portability, as unary_function was removed in C++17 and MSVC has implemented that removal. Fixes D45596. llvm-svn: 329974
Diffstat (limited to 'libcxx/test/support/Counter.h')
-rw-r--r--libcxx/test/support/Counter.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/libcxx/test/support/Counter.h b/libcxx/test/support/Counter.h
index 602f35f7067..4a658c58c06 100644
--- a/libcxx/test/support/Counter.h
+++ b/libcxx/test/support/Counter.h
@@ -45,8 +45,10 @@ namespace std {
template <class T>
struct hash<Counter<T> >
- : public std::unary_function<Counter<T>, std::size_t>
{
+ typedef Counter<T> argument_type;
+ typedef std::size_t result_type;
+
std::size_t operator()(const Counter<T>& x) const {return std::hash<T>(x.get());}
};
}
OpenPOWER on IntegriCloud