c++11 - upfate to canonical operator= impl

This commit is contained in:
artemp 2015-10-16 12:46:24 +01:00
parent 652fa15ec0
commit 2437473e74

View file

@ -57,22 +57,16 @@ public:
precision_(other.precision_),
primary_key_(other.primary_key_) {}
attribute_descriptor& operator=(attribute_descriptor const& other)
{
if (this == &other)
attribute_descriptor& operator=(attribute_descriptor rhs)
{
using std::swap;
std::swap(name_, rhs.name_);
std::swap(type_, rhs.type_);
std::swap(size_, rhs.size_);
std::swap(precision_, rhs.precision_);
std::swap(primary_key_, rhs.primary_key_);
return *this;
}
else
{
name_=other.name_;
type_=other.type_;
size_=other.size_;
precision_=other.precision_;
primary_key_=other.primary_key_;
return *this;
}
}
std::string const& get_name() const
{