// Boost.Geometry // Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland. // This file was modified by Oracle on 2020. // Modifications copyright (c) 2020 Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_GEOMETRY_ALGORITHMS_AREA_RESULT_HPP #define BOOST_GEOMETRY_ALGORITHMS_AREA_RESULT_HPP #include #include #include #include #include #include #include #include #include #include #include namespace boost { namespace geometry { #ifndef DOXYGEN_NO_DETAIL namespace detail { namespace area { template < typename Geometry, typename Strategy, bool IsUmbrella = strategies::detail::is_umbrella_strategy::value > struct area_result { typedef decltype(std::declval().area(std::declval())) strategy_type; typedef typename strategy_type::template result_type::type type; }; template struct area_result { typedef typename Strategy::template result_type::type type; }; template < typename Geometry, bool IsGeometry = util::is_geometry::value > struct default_area_result : area_result < Geometry, typename geometry::strategies::area::services::default_strategy < Geometry >::type > {}; // Workaround for VS2015 #if defined(_MSC_VER) && (_MSC_VER < 1910) template < typename Geometry, bool IsGeometry = util::is_geometry::value > struct coordinate_type : geometry::coordinate_type {}; template struct coordinate_type { typedef int type; }; template struct default_area_result { typedef int type; }; #endif template struct more_precise_coordinate_type : std::is_same < typename coordinate_type::type, typename geometry::select_most_precise < typename coordinate_type::type, typename coordinate_type::type >::type > {}; template struct more_precise_default_area_result : std::is_same < typename default_area_result::type, typename geometry::select_most_precise < typename default_area_result::type, typename default_area_result::type >::type > {}; }} // namespace detail::area #endif //DOXYGEN_NO_DETAIL /*! \brief Meta-function defining return type of area function \ingroup area \note The return-type is defined by Geometry and Strategy */ template < typename Geometry, typename Strategy = default_strategy > struct area_result : detail::area::area_result {}; template struct area_result, Strategy> : geometry::area_result < typename util::select_pack_element < detail::area::more_precise_coordinate_type, BOOST_VARIANT_ENUM_PARAMS(T) >::type, Strategy > {}; template struct area_result : detail::area::default_area_result {}; template struct area_result, default_strategy> : detail::area::default_area_result < typename util::select_pack_element < detail::area::more_precise_default_area_result, BOOST_VARIANT_ENUM_PARAMS(T) >::type > {}; }} // namespace boost::geometry #endif // BOOST_GEOMETRY_ALGORITHMS_AREA_RESULT_HPP