diff options
author | Stephan T. Lavavej <stl@exchange.microsoft.com> | 2018-04-12 23:56:10 +0000 |
---|---|---|
committer | Stephan T. Lavavej <stl@exchange.microsoft.com> | 2018-04-12 23:56:10 +0000 |
commit | 3ed719bb63e3363db638a35425c0540337a0f831 (patch) | |
tree | 6b0296a5dc7af25b8a115cadc34cfabaa00d0039 /libcxx/test/support | |
parent | 0f66190aefa0c53648d549738a2bb312a309c2d9 (diff) | |
download | bcm5719-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')
-rw-r--r-- | libcxx/test/support/Counter.h | 4 |
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());} }; } |