2626
2727#include < boost/geometry/util/select_most_precise.hpp>
2828#include < boost/geometry/util/sequence.hpp>
29+ #include < boost/geometry/util/type_traits.hpp>
2930
3031#include < boost/variant/variant_fwd.hpp>
3132
@@ -51,17 +52,18 @@ struct area_result
5152 typedef typename strategy_type::template result_type<Geometry>::type type;
5253};
5354
55+ template <typename Geometry, typename Strategy>
56+ struct area_result <Geometry, Strategy, false >
57+ {
58+ typedef typename Strategy::template result_type<Geometry>::type type;
59+ };
60+
61+
5462template
5563<
5664 typename Geometry,
57- typename Strategy
65+ bool IsGeometry = util::is_geometry<Geometry>::value
5866>
59- struct area_result <Geometry, Strategy, false >
60- : Strategy::template result_type<Geometry>
61- {};
62-
63-
64- template <typename Geometry>
6567struct default_area_result
6668 : area_result
6769 <
@@ -73,15 +75,37 @@ struct default_area_result
7375 >
7476{};
7577
78+ // Workaround for VS2015
79+ #if defined(_MSC_VER) && (_MSC_VER < 1910)
80+ template
81+ <
82+ typename Geometry,
83+ bool IsGeometry = util::is_geometry<Geometry>::value
84+ >
85+ struct coordinate_type
86+ : geometry::coordinate_type<Geometry>
87+ {};
88+ template <typename Geometry>
89+ struct coordinate_type <Geometry, false >
90+ {
91+ typedef int type;
92+ };
93+ template <typename Geometry>
94+ struct default_area_result <Geometry, false >
95+ {
96+ typedef int type;
97+ };
98+ #endif
99+
76100template <typename Curr, typename Next>
77101struct more_precise_coordinate_type
78102 : std::is_same
79103 <
80- typename geometry:: coordinate_type<Curr>::type,
104+ typename coordinate_type<Curr>::type,
81105 typename geometry::select_most_precise
82106 <
83- typename geometry:: coordinate_type<Curr>::type,
84- typename geometry:: coordinate_type<Next>::type
107+ typename coordinate_type<Curr>::type,
108+ typename coordinate_type<Next>::type
85109 >::type
86110 >
87111{};
@@ -119,14 +143,14 @@ struct area_result
119143 : detail::area::area_result<Geometry, Strategy>
120144{};
121145
122- template <typename ...Ts , typename Strategy>
123- struct area_result <boost::variant<Ts... >, Strategy>
146+ template <BOOST_VARIANT_ENUM_PARAMS( typename T) , typename Strategy>
147+ struct area_result <boost::variant<BOOST_VARIANT_ENUM_PARAMS(T) >, Strategy>
124148 : geometry::area_result
125149 <
126150 typename util::select_pack_element
127151 <
128152 detail::area::more_precise_coordinate_type,
129- Ts...
153+ BOOST_VARIANT_ENUM_PARAMS (T)
130154 >::type,
131155 Strategy
132156 >
@@ -137,16 +161,15 @@ struct area_result<Geometry, default_strategy>
137161 : detail::area::default_area_result<Geometry>
138162{};
139163
140- template <typename ...Ts >
141- struct area_result <boost::variant<Ts... >, default_strategy>
142- : geometry::area_result
164+ template <BOOST_VARIANT_ENUM_PARAMS( typename T) >
165+ struct area_result <boost::variant<BOOST_VARIANT_ENUM_PARAMS(T) >, default_strategy>
166+ : detail::area::default_area_result
143167 <
144168 typename util::select_pack_element
145169 <
146170 detail::area::more_precise_default_area_result,
147- Ts...
148- >::type,
149- default_strategy
171+ BOOST_VARIANT_ENUM_PARAMS (T)
172+ >::type
150173 >
151174{};
152175
0 commit comments