use proper feature-test macro for inheriting constructors

This commit is contained in:
Mickey Rose 2016-08-03 00:25:48 +02:00
parent 68db7ee224
commit f9d5c3a2f8
2 changed files with 15 additions and 6 deletions

View file

@ -146,13 +146,19 @@ struct geometry : geometry_base<T>
{ {
using coord_type = T; using coord_type = T;
geometry() #if __cpp_inheriting_constructors >= 200802
: geometry_base<T>() {} // empty
using geometry_base<T>::geometry_base;
#else
geometry() = default;
template <typename G> template <typename G>
geometry(G && geom) geometry(G && geom)
: geometry_base<T>(std::forward<G>(geom)) {} : geometry_base<T>(std::forward<G>(geom)) {}
#endif
}; };
template <typename T> template <typename T>

View file

@ -57,15 +57,18 @@ using json_value_base = mapnik::util::variant<value_null,
mapnik::util::recursive_wrapper<json_object> >; mapnik::util::recursive_wrapper<json_object> >;
struct json_value : json_value_base struct json_value : json_value_base
{ {
#if __cpp_inheriting_constructors >= 200802
using json_value_base::json_value_base;
#else
#ifdef _WINDOWS
json_value() = default; json_value() = default;
template <typename T> template <typename T>
json_value(T && val) json_value(T && val)
: json_value_base(std::forward<T>(val)) {} : json_value_base(std::forward<T>(val)) {}
#else
// MSVC 2015 inheriting constructors is not working in this context (support is apparently planned)
using json_value_base::json_value_base;
#endif #endif
}; };