c++11 - upfate to canonical operator= impl
This commit is contained in:
parent
652fa15ec0
commit
2437473e74
1 changed files with 9 additions and 15 deletions
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue