From 9e76ca78708f9a85fd9c26108a4d915a4ae3b805 Mon Sep 17 00:00:00 2001 From: artemp Date: Tue, 8 Jul 2014 18:13:44 +0100 Subject: [PATCH] color : add move ctor --- include/mapnik/color.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/mapnik/color.hpp b/include/mapnik/color.hpp index e1d919df0..cd3e9f58d 100644 --- a/include/mapnik/color.hpp +++ b/include/mapnik/color.hpp @@ -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;