Merge pull request #1363 from avasiliev/master

Updated copy/move operations for some types, https://nda.ya.ru/3TWvPE
This commit is contained in:
alexey-milovidov 2017-10-17 19:04:17 +03:00 committed by GitHub
commit 9183c3f897
3 changed files with 7 additions and 30 deletions

View File

@ -89,19 +89,8 @@ public:
{
}
LocalDate(const LocalDate & x)
{
operator=(x);
}
LocalDate & operator= (const LocalDate & x)
{
m_year = x.m_year;
m_month = x.m_month;
m_day = x.m_day;
return *this;
}
LocalDate(const LocalDate &) noexcept = default;
LocalDate & operator= (const LocalDate &) noexcept = default;
LocalDate & operator= (time_t time)
{

View File

@ -95,22 +95,8 @@ public:
init(data, length);
}
LocalDateTime(const LocalDateTime & x)
{
operator=(x);
}
LocalDateTime & operator= (const LocalDateTime & x)
{
m_year = x.m_year;
m_month = x.m_month;
m_day = x.m_day;
m_hour = x.m_hour;
m_minute = x.m_minute;
m_second = x.m_second;
return *this;
}
LocalDateTime(const LocalDateTime &) noexcept = default;
LocalDateTime & operator= (const LocalDateTime &) noexcept = default;
LocalDateTime & operator= (time_t time)
{

View File

@ -25,6 +25,7 @@ public:
bool is_null;
Null() : is_null(true) {}
Null(Null<T> &&) noexcept = default;
Null(NullType data) : is_null(true) {}
explicit Null(const T & data_) : data(data_), is_null(false) {}
@ -42,8 +43,9 @@ public:
return data;
}
Null<T> & operator= (Null<T> &&) noexcept = default;
Null<T> & operator= (const Null<T> &) = default;
Null<T> & operator= (const T & data_) { is_null = false; data = data_; return *this; }
Null<T> & operator= (const Null<T> & other) { is_null = other.is_null; data = other.data; return *this; }
Null<T> & operator= (const NullType other) { is_null = true; data = T(); return *this; }
bool isNull() const { return is_null; }