Boost C++ Libraries: Ticket #13539: Boost Polygon - MSVC 2017 - Ambiguous call to size() function https://svn.boost.org/trac10/ticket/13539 <p> We are currently switching our compiler from MSVC 2012 to MSVC 2017. Now I have problems compiling out application using Boost Polygon. I get the following error: </p> <p> c:\khand\win64\include\boost\polygon\polygon_traits.hpp(606): error C2668: "boost::polygon::size": ambiguous call to overloaded function c:\khand\win64\include\boost\polygon\polygon_traits.hpp(467): note: could be "unsigned <span class="underline">int64 boost::polygon::size&lt;polygon_type&gt;(const T &amp;)" </span></p> <blockquote> <p> with [ </p> <blockquote> <p> polygon_type=DESIGN::GTL::Polygon, T=DESIGN::GTL::Polygon </p> </blockquote> <p> ] </p> </blockquote> <p> C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.13.26128\include\xutility(1611): note: or "unsigned <span class="underline">int64 std::size&lt;polygon_type&gt;(const _Container &amp;)" [bei der Verwendung der argumentbezogenen Suche gefunden] </span></p> <blockquote> <p> with [ </p> <blockquote> <p> polygon_type=DESIGN::GTL::Polygon, _Container=DESIGN::GTL::Polygon </p> </blockquote> <p> ] </p> </blockquote> <p> In size() function in polygon_traits.hpp conflicts with the now in C++ standard contained std::size(). </p> <p> I could solve the problem by using the completed name boost:polygon::size() in polygon_traits.hpp. Please see appended diff. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/13539 Trac 1.4.3 Kai Benndorf <kai.benndorf@…> Wed, 25 Apr 2018 10:57:36 GMT <link>https://svn.boost.org/trac10/ticket/13539#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13539#comment:1</guid> <description> <p> It was not possible to append a file, so the diff comes here: </p> <pre class="wiki">Index: polygon_traits.hpp =================================================================== --- polygon_traits.hpp (revision 511) +++ polygon_traits.hpp (working copy) @@ -603,7 +603,7 @@ polygon_type&gt;::type &amp; convolve(polygon_type&amp; polygon, const point_type&amp; point) { std::vector&lt;typename std::iterator_traits&lt;typename polygon_traits&lt;polygon_type&gt;::iterator_type&gt;::value_type&gt; points; - points.reserve(size(polygon)); + points.reserve(boost::polygon::size(polygon)); for(typename polygon_traits&lt;polygon_type&gt;::iterator_type iter = begin_points(polygon); iter != end_points(polygon); ++iter) { points.push_back(*iter); @@ -689,7 +689,7 @@ typename enable_if&lt; typename is_any_mutable_polygon_without_holes_type&lt;polygon_type&gt;::type, polygon_type&gt;::type &amp; scale_up(polygon_type&amp; polygon, typename coordinate_traits&lt;typename polygon_traits&lt;polygon_type&gt;::coordinate_type&gt;::unsigned_area_type factor) { std::vector&lt;typename std::iterator_traits&lt;typename polygon_traits&lt;polygon_type&gt;::iterator_type&gt;::value_type&gt; points; - points.reserve(size(polygon)); + points.reserve(boost::polygon::size(polygon)); for(typename polygon_traits&lt;polygon_type&gt;::iterator_type iter = begin_points(polygon); iter != end_points(polygon); ++iter) { points.push_back(*iter); @@ -728,7 +728,7 @@ polygon_type&gt;::type &amp; scale_down(polygon_type&amp; polygon, typename coordinate_traits&lt;typename polygon_traits&lt;polygon_type&gt;::coordinate_type&gt;::unsigned_area_type factor) { std::vector&lt;typename std::iterator_traits&lt;typename polygon_traits&lt;polygon_type&gt;::iterator_type&gt;::value_type&gt; points; - points.reserve(size(polygon)); + points.reserve(boost::polygon::size(polygon)); for(typename polygon_traits&lt;polygon_type&gt;::iterator_type iter = begin_points(polygon); iter != end_points(polygon); ++iter) { points.push_back(*iter); @@ -903,7 +903,7 @@ polygon_type&gt;::type &amp; scale(polygon_type&amp; polygon, double factor) { std::vector&lt;typename std::iterator_traits&lt;typename polygon_traits&lt;polygon_type&gt;::iterator_type&gt;::value_type&gt; points; - points.reserve(size(polygon)); + points.reserve(boost::polygon::size(polygon)); for(typename polygon_traits&lt;polygon_type&gt;::iterator_type iter = begin_points(polygon); iter != end_points(polygon); ++iter) { points.push_back(*iter); </pre> </description> <category>Ticket</category> </item> </channel> </rss>