added assignment from value, conversion to database_type and appropriate tests
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#include <variant>
|
||||
|
||||
namespace matador::utils {
|
||||
class value;
|
||||
class identifier_serializer {
|
||||
public:
|
||||
virtual ~identifier_serializer() = default;
|
||||
@@ -94,7 +95,6 @@ public:
|
||||
>;
|
||||
|
||||
identifier();
|
||||
|
||||
template<typename Type, std::enable_if_t<is_identifier_supported_v<Type>, int> = 0>
|
||||
explicit identifier(Type &&id)
|
||||
: value_(std::forward<Type>(id)) {
|
||||
@@ -117,17 +117,20 @@ public:
|
||||
}
|
||||
|
||||
identifier& operator=(const std::string &value);
|
||||
|
||||
identifier& operator=(const char *value);
|
||||
|
||||
template<typename Type, std::enable_if_t<is_identifier_supported_v<Type> && std::is_same_v<std::decay_t<Type>, bool>, int> = 0>
|
||||
identifier &operator=(Type &&value) {
|
||||
identifier& operator=(Type &&value) {
|
||||
value_ = std::forward<Type>(value);
|
||||
return *this;
|
||||
}
|
||||
|
||||
~identifier() = default;
|
||||
|
||||
result<void, error> assign(const value &val);
|
||||
|
||||
static result<identifier, error> from_value(const value &val);
|
||||
[[nodiscard]] database_type to_database_type() const;
|
||||
|
||||
bool operator==(const identifier &x) const;
|
||||
bool operator!=(const identifier &x) const;
|
||||
bool operator<(const identifier &x) const;
|
||||
|
||||
Reference in New Issue
Block a user