diff options
Diffstat (limited to 'libcxx/test/support/Counter.h')
-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 eb6e04e72ef..602f35f7067 100644 --- a/libcxx/test/support/Counter.h +++ b/libcxx/test/support/Counter.h @@ -12,6 +12,8 @@ #include <functional> // for std::hash +#include "test_macros.h" + struct Counter_base { static int gConstructed; }; template <typename T> @@ -22,7 +24,7 @@ public: Counter(const T &data) : data_(data) { ++gConstructed; } Counter(const Counter& rhs) : data_(rhs.data_) { ++gConstructed; } Counter& operator=(const Counter& rhs) { ++gConstructed; data_ = rhs.data_; return *this; } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#if TEST_STD_VER >= 11 Counter(Counter&& rhs) : data_(std::move(rhs.data_)) { ++gConstructed; } Counter& operator=(Counter&& rhs) { ++gConstructed; data_ = std::move(rhs.data_); return *this; } #endif |