color : add move ctor

This commit is contained in:
artemp 2014-07-08 18:13:44 +01:00
parent 04facd3542
commit 9e76ca7870

View file

@ -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;