From 568507349b8e7173cc7eb1e06fcfafdb749b35dc Mon Sep 17 00:00:00 2001 From: Mickey Rose Date: Thu, 15 Dec 2016 11:51:02 +0100 Subject: [PATCH 1/2] bring C++14 type traits aliases for C++11 support --- include/mapnik/cxx11_support.hpp | 43 ++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 include/mapnik/cxx11_support.hpp diff --git a/include/mapnik/cxx11_support.hpp b/include/mapnik/cxx11_support.hpp new file mode 100644 index 000000000..dafd721dd --- /dev/null +++ b/include/mapnik/cxx11_support.hpp @@ -0,0 +1,43 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2016 Artem Pavlenko + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + *****************************************************************************/ + +#ifndef MAPNIK_CXX11_SUPPORT_HPP +#define MAPNIK_CXX11_SUPPORT_HPP + +#include + +namespace mapnik { +namespace detail { + +template +using conditional_t = typename std::conditional::type; + +template +using decay_t = typename std::decay::type; + +template +using enable_if_t = typename std::enable_if::type; + +} // namespace detail +} // namespace mapnik + +#endif // MAPNIK_CXX11_SUPPORT_HPP From e6ed16e94e0edf50af29b58e110b78a1e1347402 Mon Sep 17 00:00:00 2001 From: Mickey Rose Date: Thu, 15 Dec 2016 11:58:50 +0100 Subject: [PATCH 2/2] make mapnik_value_type_t C++11-friendly --- include/mapnik/value/types.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/mapnik/value/types.hpp b/include/mapnik/value/types.hpp index d1c0c59bd..7682d52b2 100644 --- a/include/mapnik/value/types.hpp +++ b/include/mapnik/value/types.hpp @@ -25,6 +25,7 @@ // mapnik #include +#include #include @@ -34,7 +35,6 @@ #pragma GCC diagnostic pop // stl -#include #include #include @@ -160,13 +160,13 @@ namespace detail { // value_double if T is a floating-point type // T && otherwise -template > +template > using mapnik_value_type_t = - std::conditional_t< + conditional_t< std::is_same::value, value_bool, - std::conditional_t< + conditional_t< std::is_integral
::value, value_integer, - std::conditional_t< + conditional_t< std::is_floating_point
::value, value_double, T && >>>;