diff --git a/core/AmArg.cpp b/core/AmArg.cpp index e9db4a6b..1641b760 100644 --- a/core/AmArg.cpp +++ b/core/AmArg.cpp @@ -46,15 +46,6 @@ const char* AmArg::t2str(int type) { } } -AmArg::AmArg(const AmArg& v) - : type(v.type) { - switch (type) { - default: - value = v.value; - break; - } -} - AmArg::AmArg(std::map& v) : type(Undef) { assertStruct(); @@ -240,17 +231,6 @@ const AmArg& AmArg::get(size_t idx) const { return std::get(value)[idx]; } -AmArg& AmArg::operator=(const AmArg& v) { - invalidate(); - type = v.type; - switch (type) { - default: - value = v.value; - break; - } - return *this; -} - AmArg& AmArg::operator[](size_t idx) { assertArray(idx+1); return std::get(value)[idx]; diff --git a/core/AmArg.h b/core/AmArg.h index 8a38386f..f73acea3 100644 --- a/core/AmArg.h +++ b/core/AmArg.h @@ -128,7 +128,8 @@ class AmArg : type(Undef) { } - AmArg(const AmArg& v); + AmArg(const AmArg& v) = default; + AmArg(AmArg&& v) = default; AmArg(const int& v) : type(Int), @@ -197,7 +198,8 @@ class AmArg short getType() const { return type; } - AmArg& operator=(const AmArg& rhs); + AmArg& operator=(const AmArg& rhs) = default; + AmArg& operator=(AmArg&& rhs) = default; #define isArgUndef(a) (AmArg::Undef == a.getType()) #define isArgArray(a) (AmArg::Array == a.getType())