diff --git a/libcxx/test/support/MoveOnly.h b/libcxx/test/support/MoveOnly.h --- a/libcxx/test/support/MoveOnly.h +++ b/libcxx/test/support/MoveOnly.h @@ -18,9 +18,6 @@ class MoveOnly { - MoveOnly(const MoveOnly&); - MoveOnly& operator=(const MoveOnly&); - int data_; public: constexpr MoveOnly(int data = 1) : data_(data) {} @@ -29,6 +26,9 @@ TEST_CONSTEXPR_CXX14 MoveOnly& operator=(MoveOnly&& x) {data_ = x.data_; x.data_ = 0; return *this;} + MoveOnly(const MoveOnly&) = delete; + MoveOnly& operator=(const MoveOnly&) = delete; + constexpr int get() const {return data_;} friend constexpr bool operator==(const MoveOnly& x, const MoveOnly& y) @@ -53,18 +53,15 @@ friend void operator,(T t, U u) = delete; }; -namespace std { template <> -struct hash +struct std::hash { typedef MoveOnly argument_type; typedef size_t result_type; constexpr size_t operator()(const MoveOnly& x) const {return x.get();} }; -} - #endif // TEST_STD_VER >= 11 #endif // MOVEONLY_H