Skip to content

Instantly share code, notes, and snippets.

@springmeyer
Created September 3, 2014 17:36
Show Gist options
  • Save springmeyer/3e624586fc8fa9d9ffda to your computer and use it in GitHub Desktop.
Save springmeyer/3e624586fc8fa9d9ffda to your computer and use it in GitHub Desktop.
diff --git a/include/mapnik/util/variant.hpp b/include/mapnik/util/variant.hpp
index d6f8002..e74170b 100644
--- a/include/mapnik/util/variant.hpp
+++ b/include/mapnik/util/variant.hpp
@@ -553,13 +553,12 @@ public:
template <typename T, class = typename std::enable_if<
detail::is_valid_type<T, Types...>::value>::type>
VARIANT_INLINE variant(T && val) noexcept
- : type_index(detail::value_traits<T, Types...>::index)
+ : type_index(detail::value_traits<std::remove_reference<T>::type, Types..
{
- constexpr std::size_t index = sizeof...(Types) - detail::value_traits<T,
+ constexpr std::size_t index = sizeof...(Types) - detail::value_traits<std
using target_type = typename detail::select_type<index, Types...>::type;
new (&data) target_type(std::forward<T>(val)); // nothrow
}
-
VARIANT_INLINE variant(variant<Types...> const& old)
: type_index(old.type_index)
{
diff --git a/include/mapnik/value.hpp b/include/mapnik/value.hpp
index 84ccad8..3df89f4 100644
--- a/include/mapnik/value.hpp
+++ b/include/mapnik/value.hpp
@@ -814,9 +814,7 @@ public:
template <typename T>
value ( T const& val)
- : base_() {
- base_ = static_cast<typename detail::mapnik_value_type<T>::type>(val);
- }
+ : base_(typename detail::mapnik_value_type<T>::type(val)) {}
value (value const& other)
: base_(other.base_) {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment