From 121e5b59b0c30bb5020c0431a1f322b4d51f628e Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Wed, 18 Sep 2013 20:14:50 -0700 Subject: [PATCH] mapnik::value: avoid extra copy of value_unicode_string + define copy and assignment --- include/mapnik/value.hpp | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/include/mapnik/value.hpp b/include/mapnik/value.hpp index 33de4dd1e..18979d8df 100644 --- a/include/mapnik/value.hpp +++ b/include/mapnik/value.hpp @@ -814,8 +814,31 @@ public: value () : base_(value_null()) {} - template value(T _val_) - : base_(_val_) {} + value(value_integer val) + : base_(val) {} + + value(value_double val) + : base_(val) {} + + value(value_bool val) + : base_(val) {} + + value(value_null val) + : base_(val) {} + + value(value_unicode_string const& val) + : base_(val) {} + + value (value const& other) + : base_(other.base_) {} + + value & operator=( value const& other) + { + if (this == &other) + return *this; + base_ = other.base_; + return *this; + } bool operator==(value const& other) const {