[A] Added basic operators

This commit is contained in:
seleznevae
2018-11-02 20:06:04 +03:00
parent c0536323d0
commit 927f33f1b8
2 changed files with 76 additions and 1 deletions

View File

@@ -105,6 +105,50 @@ public:
ft_destroy_table(table);
}
/**
* Not implemented yet.
*/
Table(const Table& tbl) = delete;
/**
* Move contstructor.
*/
Table(Table&& tbl)
:table(tbl.table)
{
if (tbl.stream.tellp() >= 0) {
stream << tbl.stream.str();
tbl.stream.str(std::string());
}
tbl.table = 0;
}
/**
* Not implemented yet.
*/
Table& operator=(const Table& tbl) = delete;
/**
* Move assignment operator.
*/
Table& operator=(Table&& tbl)
{
if (&tbl == this)
return *this;
if (tbl.table) {
stream.str(std::string());
if (tbl.stream.tellp() >= 0) {
stream << tbl.stream.str();
tbl.stream.str(std::string());
}
ft_destroy_table(table);
table = tbl.table;
tbl.table = NULL;
}
return *this;
}
/**
* Convert table to string representation.
*