color : add move ctor
This commit is contained in:
parent
04facd3542
commit
9e76ca7870
1 changed files with 9 additions and 0 deletions
|
@ -46,6 +46,7 @@ private:
|
||||||
std::uint8_t alpha_;
|
std::uint8_t alpha_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
// default ctor
|
||||||
color()
|
color()
|
||||||
: red_(0xff),
|
: red_(0xff),
|
||||||
green_(0xff),
|
green_(0xff),
|
||||||
|
@ -60,6 +61,7 @@ public:
|
||||||
alpha_(alpha)
|
alpha_(alpha)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
// copy ctor
|
||||||
color(const color& rhs)
|
color(const color& rhs)
|
||||||
: red_(rhs.red_),
|
: red_(rhs.red_),
|
||||||
green_(rhs.green_),
|
green_(rhs.green_),
|
||||||
|
@ -67,6 +69,13 @@ public:
|
||||||
alpha_(rhs.alpha_)
|
alpha_(rhs.alpha_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
// move ctor
|
||||||
|
color(color && rhs)
|
||||||
|
: red_(std::move(rhs.red_)),
|
||||||
|
green_(std::move(rhs.green_)),
|
||||||
|
blue_(std::move(rhs.blue_)),
|
||||||
|
alpha_(std::move(rhs.alpha_)) {}
|
||||||
|
|
||||||
color( std::string const& str);
|
color( std::string const& str);
|
||||||
|
|
||||||
std::string to_string() const;
|
std::string to_string() const;
|
||||||
|
|
Loading…
Reference in a new issue