diff --git a/test/data.h b/test/data.h index c43769e8..14b5f47c 100644 --- a/test/data.h +++ b/test/data.h @@ -152,4 +152,89 @@ std::ostream& operator << (std::ostream& s, const TestDataNDC& rhs) return s; } +//***************************************************************************** +// Movable. +//***************************************************************************** +template +class TestDataM : public etl::instance_count> +{ +public: + + explicit TestDataM(const T& value_) + : value(value_) + , valid(true) + { + } + + TestDataM(TestDataM&& other) + : value(other.value) + , valid(true) + { + other.value = T(); + other.valid = false; + } + + TestDataM& operator =(TestDataM&& other) + { + value = other.value; + valid = true; + + other.value = T(); + other.valid = false; + } + + bool operator < (const TestDataM& other) const + { + return value < other.value; + } + + bool operator > (const TestDataM& other) const + { + return other.value < value; + } + + bool operator <= (const TestDataM& other) const + { + return !(other.value < value); + } + + bool operator >= (const TestDataM& other) const + { + return !(value < other.value); + } + + operator bool() const + { + return valid; + } + + T value; + bool valid; + +private: + + TestDataM(const TestDataM& other) = delete; + TestDataM& operator =(const TestDataM& other) = delete; +}; + +template +bool operator == (const TestDataM& lhs, const TestDataM& rhs) +{ + return lhs.value == rhs.value; +} + +template +bool operator != (const TestDataM& lhs, const TestDataM& rhs) +{ + return lhs.value != rhs.value; +} + +template +std::ostream& operator << (std::ostream& s, const TestDataM& rhs) +{ + s << rhs.value; + return s; +} + + #endif diff --git a/test/vs2017/etl.vcxproj b/test/vs2017/etl.vcxproj index 961afff0..6679be4f 100644 --- a/test/vs2017/etl.vcxproj +++ b/test/vs2017/etl.vcxproj @@ -532,6 +532,7 @@ + diff --git a/test/vs2017/etl.vcxproj.filters b/test/vs2017/etl.vcxproj.filters index 84162b51..161a765b 100644 --- a/test/vs2017/etl.vcxproj.filters +++ b/test/vs2017/etl.vcxproj.filters @@ -720,6 +720,9 @@ ETL\Maths + + Source Files +