1 // Boost.Geometry (aka GGL, Generic Geometry Library)
3 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
4 // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
5 // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
7 // This file was modified by Oracle on 2020.
8 // Modifications copyright (c) 2020 Oracle and/or its affiliates.
9 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
11 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
12 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
14 // Use, modification and distribution is subject to the Boost Software License,
15 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
16 // http://www.boost.org/LICENSE_1_0.txt)
18 #ifndef BOOST_GEOMETRY_UTIL_PROMOTE_FLOATING_POINT_HPP
19 #define BOOST_GEOMETRY_UTIL_PROMOTE_FLOATING_POINT_HPP
22 #include <type_traits>
25 namespace boost { namespace geometry
30 \brief Meta-function converting, if necessary, to "a floating point" type
32 - if input type is integer, type is double
33 - else type is input type
37 template <typename T, typename PromoteIntegerTo = double>
38 struct promote_floating_point
40 typedef std::conditional_t
42 std::is_integral<T>::value,
49 }} // namespace boost::geometry
52 #endif // BOOST_GEOMETRY_UTIL_PROMOTE_FLOATING_POINT_HPP