From db9f0d19ba4af7a123b24bc5a4ad577c2340dda8 Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Tue, 3 Nov 2015 20:00:20 -0500 Subject: [PATCH] Make Zone move-only --- test/tz_test/zone.pass.cpp | 15 +++++++++++++++ tz.h | 3 +++ 2 files changed, 18 insertions(+) create mode 100644 test/tz_test/zone.pass.cpp diff --git a/test/tz_test/zone.pass.cpp b/test/tz_test/zone.pass.cpp new file mode 100644 index 0000000..eed4698 --- /dev/null +++ b/test/tz_test/zone.pass.cpp @@ -0,0 +1,15 @@ +#include "tz.h" +#include + +int +main() +{ + using namespace std; + using namespace date; + static_assert( is_nothrow_destructible{}, ""); + static_assert(!is_default_constructible{}, ""); + static_assert(!is_copy_constructible{}, ""); + static_assert(!is_copy_assignable{}, ""); + static_assert( is_nothrow_move_constructible{}, ""); + static_assert( is_nothrow_move_assignable{}, ""); +} diff --git a/tz.h b/tz.h index 8bf5c05..162c8a5 100644 --- a/tz.h +++ b/tz.h @@ -201,6 +201,9 @@ private: std::vector zonelets_; public: + Zone(Zone&&) = default; + Zone& operator=(Zone&&) = default; + explicit Zone(const std::string& s); const std::string& name() const {return name_;}