added all value constructor to class table

This commit is contained in:
Sascha Kühl 2024-08-22 16:07:10 +02:00
parent 27f6c81da2
commit 43d2f81b95
1 changed files with 10 additions and 1 deletions

View File

@ -14,13 +14,22 @@ struct table
table(const char *name, std::string as = "") // NOLINT(*-explicit-constructor)
: name(name), alias(std::move(as)) {}
table(std::string name, std::string as = "") // NOLINT(*-explicit-constructor)
: name(std::move(name)), alias(std::move(as)) {}
: name(std::move(name))
, alias(std::move(as)) {}
table(std::string name, std::string as, const std::vector<column> &columns)
: name(std::move(name))
, alias(std::move(as))
, columns(columns) {}
table& as(const std::string &a) {
alias = a;
return *this;
}
[[nodiscard]] table as(const std::string &a) const {
return { name, a, columns };
}
std::string name;
std::string alias;