Boost C++ Libraries: Ticket #9386: Compilation error with polygon and multi_array https://svn.boost.org/trac10/ticket/9386 <p> With this piece of code: </p> <pre class="wiki">#include &lt;boost/multi_array.hpp&gt; #include &lt;boost/polygon/polygon.hpp&gt; int main() { typedef boost::polygon::polygon_45_with_holes_data&lt;int&gt; polygon; typedef boost::polygon::polygon_traits&lt;polygon&gt;::point_type point; point centroid; polygon poly; boost::polygon::center(c.centroid, c.poly); } </pre><p> If you include the headers in the following order: </p> <pre class="wiki">#include &lt;boost/multi_array.hpp&gt; #include &lt;boost/polygon/polygon.hpp&gt; </pre><p> ..it breaks, if you reverse them it works: </p> <pre class="wiki">#include &lt;boost/polygon/polygon.hpp&gt; #include &lt;boost/multi_array.hpp&gt; </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9386 Trac 1.4.3 anonymous Wed, 13 Nov 2013 18:55:09 GMT <link>https://svn.boost.org/trac10/ticket/9386#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9386#comment:1</guid> <description> <p> The compilation error is: </p> <p> /usr/local/include/boost/polygon/polygon_traits.hpp:1429:26: error: no match for call to ‘(boost::multi_array_types::extent_gen {aka boost::detail::multi_array::extent_gen&lt;0ul&gt;}) (boost::polygon::rectangle_data&lt;int&gt;&amp;, const boost::polygon::polygon_45_with_holes_data&lt;int&gt;&amp;)’ </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Andrii Sydorchuk</dc:creator> <pubDate>Mon, 18 Nov 2013 23:05:36 GMT</pubDate> <title>owner, status changed https://svn.boost.org/trac10/ticket/9386#comment:2 https://svn.boost.org/trac10/ticket/9386#comment:2 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Lucanus Simonson</span> to <span class="trac-author">Andrii Sydorchuk</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket Andrii Sydorchuk Mon, 18 Nov 2013 23:23:37 GMT <link>https://svn.boost.org/trac10/ticket/9386#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9386#comment:3</guid> <description> <p> The problem here is with ADL (argument dependent lookup). The issues is explained with an example here: <a class="ext-link" href="http://stackoverflow.com/questions/2958648/what-are-the-pitfalls-of-adl"><span class="icon">​</span>http://stackoverflow.com/questions/2958648/what-are-the-pitfalls-of-adl</a>. From what I understood, there is no way to fix this permanently, as I can not rename the Boost.Polygon method because it's part of the public interface. The possible solution will be to use the following directive at the top of your file: #define BOOST_MULTI_ARRAY_NO_GENERATORS 1 </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Andrii Sydorchuk</dc:creator> <pubDate>Mon, 18 Nov 2013 23:31:35 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/9386#comment:4 https://svn.boost.org/trac10/ticket/9386#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">wontfix</span> </li> </ul> <p> I am marking the issue as "wontfix", as it requires the changes to the C++ standard. Here is some additional reading from Dave Abrahams: <a class="ext-link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3490.html"><span class="icon">​</span>http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3490.html</a> </p> Ticket Andrii Sydorchuk Tue, 19 Nov 2013 23:56:03 GMT status, milestone changed; resolution deleted https://svn.boost.org/trac10/ticket/9386#comment:5 https://svn.boost.org/trac10/ticket/9386#comment:5 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">wontfix</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.56.0</span> </li> </ul> <p> I've found the way to fix the issue by changing the order of method definitions inside the Polygon library. Please use the attached patch. </p> Ticket Andrii Sydorchuk Tue, 19 Nov 2013 23:56:43 GMT attachment set https://svn.boost.org/trac10/ticket/9386 https://svn.boost.org/trac10/ticket/9386 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">9386.diff</span> </li> </ul> Ticket Andrii Sydorchuk Tue, 19 Nov 2013 23:59:34 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/9386#comment:6 https://svn.boost.org/trac10/ticket/9386#comment:6 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> Ticket