forked from HowardHinnant/date
Make Zone move-only
This commit is contained in:
15
test/tz_test/zone.pass.cpp
Normal file
15
test/tz_test/zone.pass.cpp
Normal 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
3
tz.h
@@ -201,6 +201,9 @@ private:
|
|||||||
std::vector<zonelet> zonelets_;
|
std::vector<zonelet> zonelets_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
Zone(Zone&&) = default;
|
||||||
|
Zone& operator=(Zone&&) = default;
|
||||||
|
|
||||||
explicit Zone(const std::string& s);
|
explicit Zone(const std::string& s);
|
||||||
|
|
||||||
const std::string& name() const {return name_;}
|
const std::string& name() const {return name_;}
|
||||||
|
Reference in New Issue
Block a user