Make Zone move-only

This commit is contained in:
Howard Hinnant 2015-11-03 20:00:20 -05:00
parent f19e7f22c7
commit db9f0d19ba
2 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,15 @@
#include "tz.h"
#include <type_traits>
int
main()
{
using namespace std;
using namespace date;
static_assert( is_nothrow_destructible<Zone>{}, "");
static_assert(!is_default_constructible<Zone>{}, "");
static_assert(!is_copy_constructible<Zone>{}, "");
static_assert(!is_copy_assignable<Zone>{}, "");
static_assert( is_nothrow_move_constructible<Zone>{}, "");
static_assert( is_nothrow_move_assignable<Zone>{}, "");
}

3
tz.h
View File

@ -201,6 +201,9 @@ private:
std::vector<zonelet> zonelets_;
public:
Zone(Zone&&) = default;
Zone& operator=(Zone&&) = default;
explicit Zone(const std::string& s);
const std::string& name() const {return name_;}