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_;
public:
// default ctor
color()
: red_(0xff),
green_(0xff),
@ -60,6 +61,7 @@ public:
alpha_(alpha)
{}
// copy ctor
color(const color& rhs)
: red_(rhs.red_),
green_(rhs.green_),
@ -67,6 +69,13 @@ public:
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);
std::string to_string() const;