Boost C++ Libraries: Ticket #10920: Boost error from XlC11. 01 using BOOST 1.53 in union https://svn.boost.org/trac10/ticket/10920 <p> Hi All, </p> <p> We are trying to compile sample boost code to demonstrate union on Aix64: Testcase: <a href="http://www.boost.org/doc/libs/1_55_0/libs/geometry/doc/html/geometry/reference/algorithms/union_.html">http://www.boost.org/doc/libs/1_55_0/libs/geometry/doc/html/geometry/reference/algorithms/union_.html</a> </p> <p> Following are the details of compiler Xlc Version:Version: 11.01.0000.0011 OS version:6100-06-05-1115 Boost version:1.53 </p> <p> It throws errors: "/usr/vacpp/include/vector.t", line 163.36: 1540-0716 (S) The template argument "std::vector&lt;boost_1_53_0::geometry::model::ring&lt;boost_1_53_0::geometry::model::d2::point_xy&lt;double,boost_1_53_0::geometry::cs::cartesian&gt;,1,1,std::vector&lt;boost_1_53_0::geometry::model::ring&lt;boost_1_53_0::geometry::model::d2::point_xy&lt;double,boost_1_53_0::geometry::cs::cartesian&gt;,1,1,std::vector&lt;boost_1_53_0::geometry::model::ring&lt;boost_1_53_0::geometry::mod..." does not match the template parameter "template class Container". "test.cpp", line 12.5: 1540-0700 (I) The previous message was produced while processing "_Ucopy". "test.cpp", line 12.5: 1540-0700 (I) The previous message was produced while processing "class std::vector&lt;boost_1_53_0::geometry::model::ring&lt;boost_1_53_0::geometry::model::d2::point_xy&lt;double,boost_1_53_0::geometry::cs::cartesian&gt;,1,1,std::vector&lt;boost_1_53_0::geometry::model::ring&lt;boost_1_53_0::geometry::model::d2::point_xy&lt;double,snps_boost_1_53_0::geometry::cs::cartesian&gt;,1,1,std::vector,std::allocator&gt;,std::allocator&lt;boost_1_53_0::geometry::model::ring&lt;boost_1_53_0::geometry::model:...". "/usr/vacpp/include/vector.t", line 163.36: 1540-1174 (S) The member "template pointer _Ucopy(_It, _It, pointer)" is not declared as a template in its containing class definition. "test.cpp", line 12.5: 1540-0700 (I) The previous message was produced while processing "_Ucopy". "test.cpp", line 12.5: 1540-0700 (I) The previous message was produced while processing "class std::vector&lt;boost_1_53_0::geometry::model::ring&lt;boost_1_53_0::geometry::model::d2::point_xy&lt;double,boost_1_53_0::geometry::cs::cartesian&gt;,1,1,std::vector,std::allocator&gt;,std::allocator&lt;boost_1_53_0::geometry::model::ring&lt;boost_1_53_0::geometry::model::d2::point_xy&lt;double,snps_boost_1_53_0::geometry::cs::cartesian&gt;,1,1,std::vector,std::allocator&gt; &gt; &gt;". "/boost/boost/geometry/geometries/polygon.hpp", line 69.7: 1540-0700 (I) The previous message was produced while processing "class boost_1_53_0::geometry::model::polygon&lt;boost_1_53_0::geometry::model::d2::point_xy&lt;double,boost_1_53_0::geometry::cs::cartesian&gt;,1,1,std::vector,std::vector,std::allocator,std::allocator&gt;". "test.cpp", line 12.5: 1540-0700 (I) The previous message was produced while processing "main()". "/usr/vacpp/include/vector.t", line 163.36: 1540-0716 (S) The template argument "std::vector&lt;boost_1_53_0::geometry::model::polygon&lt;snps_boost_1_53_0::geometry::model::d2::point_xy&lt;double,boost_1_53_0::geometry::cs::cartesian&gt;,1,1,std::vector&lt;boost_1_53_0::geometry::model::polygon&lt;boost_1_53_0::geometry::model::d2::point_xy&lt;double,boost_1_53_0::geometry::cs::cartesian&gt;,1,1,std::vector&lt;boost_1_53_0::geometry::model::polygon&lt;boost_1_53_0::geom..." does not match the template parameter "template class <a class="missing wiki">PointList</a>". "/usr/vacpp/include/vector.t", line 163.36: 1540-0700 (I) The previous message was produced while processing "_Ucopy". "/usr/vacpp/include/vector.t", line 163.36: 1540-0700 (I) The previous message was produced while processing "class std::vector&lt;boost_1_53_0::geometry::model::polygon&lt;boost_1_53_0::geometry::model::d2::point_xy&lt;double,boost_1_53_0::geometry::cs::cartesian&gt;,1,1,std::vector&lt;boost_1_53_0::geometry::model::polygon&lt;snps_boost_1_53_0::geometry::model::d2::point_xy&lt;double,boost_1_53_0::geometry::cs::cartesian&gt;,1,1,std::vector,std::vector,std::allocator,std::allocator&gt;,std::allocator&lt;boost_1_53_0::geometry::model::polygon...". "/remote/ports/aix/xlcpp11_1_aix53/usr/vacpp/include/vector.t", line 163.36: 1540-1174 (S) The member "template pointer _Ucopy(_It, _It, pointer)" is not declared as a template in its containing class definition. "test.cpp", line 25.26: 1540-0700 (I) The previous message was produced while processing "_Ucopy". "test.cpp", line 25.26: 1540-0700 (I) The previous message was produced while processing "class std::vector&lt;boost_1_53_0::geometry::model::polygon&lt;boost_1_53_0::geometry::model::d2::point_xy&lt;double,boost_1_53_0::geometry::cs::cartesian&gt;,1,1,std::vector,std::vector,std::allocator,std::allocator&gt;,std::allocator&lt;boost_1_53_0::geometry::model::polygon&lt;boost_1_53_0::geometry::model::d2::point_xy&lt;double,boost_1_53_0::geometry::cs::cartesian&gt;,1,1,std::vector,std::vector,std::allocator,std::allocator&gt; &gt; &gt;". "test.cpp", line 12.5: 1540-0700 (I) The previous message was produced while processing "main()". </p> <p> Is this a known bug ? Please help us in case a patch is available. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10920 Trac 1.4.3 awulkiew Tue, 13 Jan 2015 18:37:48 GMT <link>https://svn.boost.org/trac10/ticket/10920#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10920#comment:1</guid> <description> <p> Hi, </p> <p> I personally am not aware of this problem. I have no access to an AIX machine. </p> <p> Is the code in test.cpp exactly the same as on the page? Or have you tried the example contained in <code>BOOST_ROOT/libs/geometry/doc/src/examples/algorithms/union.cpp</code> (<a class="ext-link" href="https://github.com/boostorg/geometry/blob/boost-1.53.0/doc/src/examples/algorithms/union.cpp"><span class="icon">​</span>https://github.com/boostorg/geometry/blob/boost-1.53.0/doc/src/examples/algorithms/union.cpp</a>) ? </p> <p> Could you try to find what exactly fails to compile. Is it <code>model::polygon</code>, <code>read_wkt</code> or <code>union_</code>? Are you able to compile the <code>bg::model::polygon</code> properly? For example: </p> <pre class="wiki"> typedef boost::geometry::model::d2::point_xy&lt;double&gt; point; typedef boost::geometry::model::polygon&lt;point&gt; polygon; polygon p; </pre><p> If it was ok and you tried to add other things from the example, when does the code stop to compile? </p> <p> Could you provide more info or contact the developers on the mailing list (<a class="ext-link" href="http://lists.boost.org/mailman/listinfo.cgi/geometry"><span class="icon">​</span>http://lists.boost.org/mailman/listinfo.cgi/geometry</a>)? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Mon, 19 Jan 2015 17:37:19 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/10920 https://svn.boost.org/trac10/ticket/10920 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">union.txt</span> </li> </ul> Ticket anonymous Mon, 19 Jan 2015 17:41:36 GMT <link>https://svn.boost.org/trac10/ticket/10920#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10920#comment:2</guid> <description> <p> Hi, </p> <p> read_wkt is not causing the problem. </p> <p> These four line: </p> <p> typedef boost::geometry::model::polygon&lt;boost::geometry::model::d2::point_xy&lt;double&gt; &gt; polygon; </p> <blockquote> <p> polygon green, blue; </p> <blockquote> <p> std::vector&lt;polygon&gt; output; </p> </blockquote> </blockquote> <blockquote> <p> boost::geometry::union_(green, blue, output); </p> </blockquote> <p> Please find the attachment union.txt for full error message. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Barend Gehrels</dc:creator> <pubDate>Wed, 21 Jan 2015 19:20:22 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/10920#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10920#comment:3</guid> <description> <p> Apparently the geometry::model::ring class itself does not compile: </p> <pre class="wiki">"/remote/ports/aix/xlcpp11_1_aix53/usr/vacpp/include/vector.t", line 163.36: 1540-0716 (S) The template argument "std::vector&lt;boost_1_53_0::geometry::model::ring &lt;boost_1_53_0::geometry::model::d2::point_xy &lt;double,boost_1_53_0::geometry::cs::cartesian&gt;,1,1, std::vector&lt;boost_1_53_0::geometry::model::ring &lt;boost_1_53_0::geometry::model::d2::point_xy &lt;double,boost_1_53_0::geometry::cs::cartesian&gt;,1,1, std::vector&lt;boost_1_53_0::geometry::model::ring &lt;boost_1_53_0::geometry::mod..." does not match the template parameter "template class Container". </pre><p> What kind of STL is used by AIX? Is it compliant? Can you maybe use stlport? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>awulkiew</dc:creator> <pubDate>Mon, 23 Mar 2015 17:58:02 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/10920#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10920#comment:4</guid> <description> <p> I'm guessing that at this point we shouldn't change the definition of a <code>model::ring&lt;&gt;</code> and <code>model::polygon&lt;&gt;</code>. So we are unable to fix it on our side. </p> <p> But those types (<code>model::ring</code>, <code>model::polygon</code>) are just the default ones implemented for the users convenience. Boost.Geometry allows to use any user-defined type as long as it's adapted to one of the Geometry concepts. See: </p> <ul><li><a href="http://www.boost.org/doc/libs/1_57_0/libs/geometry/doc/html/geometry/reference/concepts.html">http://www.boost.org/doc/libs/1_57_0/libs/geometry/doc/html/geometry/reference/concepts.html</a> </li></ul><p> and in particular: </p> <ul><li><a href="http://www.boost.org/doc/libs/1_57_0/libs/geometry/doc/html/geometry/reference/concepts/concept_ring.html">http://www.boost.org/doc/libs/1_57_0/libs/geometry/doc/html/geometry/reference/concepts/concept_ring.html</a> </li><li><a href="http://www.boost.org/doc/libs/1_57_0/libs/geometry/doc/html/geometry/reference/concepts/concept_polygon.html">http://www.boost.org/doc/libs/1_57_0/libs/geometry/doc/html/geometry/reference/concepts/concept_polygon.html</a> </li></ul><p> You could implement your own ring and polygon types, adapt them to Boost.Geometry concepts and use with the algorithms. Consider one of the methods below: </p> <p> USE MACRO FOR ADAPTATION </p> <p> You could use one of the <code>REGISTER_XXX</code> macros which generates the adaptation code automatically, see: </p> <ul><li><a href="http://www.boost.org/doc/libs/1_57_0/libs/geometry/doc/html/geometry/reference/adapted/register.html">http://www.boost.org/doc/libs/1_57_0/libs/geometry/doc/html/geometry/reference/adapted/register.html</a> </li></ul><p> and in particular: </p> <ul><li><a href="http://www.boost.org/doc/libs/1_57_0/libs/geometry/doc/html/geometry/reference/adapted/register/boost_geometry_register_ring.html">http://www.boost.org/doc/libs/1_57_0/libs/geometry/doc/html/geometry/reference/adapted/register/boost_geometry_register_ring.html</a> </li><li><a href="http://www.boost.org/doc/libs/1_57_0/libs/geometry/doc/html/geometry/reference/adapted/register/boost_geometry_register_ring_templated.html">http://www.boost.org/doc/libs/1_57_0/libs/geometry/doc/html/geometry/reference/adapted/register/boost_geometry_register_ring_templated.html</a> </li></ul><p> It could look as simple as this: </p> <pre class="wiki">typedef boost::geometry::model::d2::point_xy&lt;double&gt; point_2d; struct ring_2d : public std::vector&lt;point_2d&gt; {} BOOST_GEOMETRY_REGISTER_RING(ring_2d) </pre><p> ADAPT YOUR OWN TYPE MANUALLY </p> <p> The most simple way of doing it would be to copy the contents of Boost.Geometry files defining the models, e.g. see: </p> <ul><li><a class="ext-link" href="https://github.com/boostorg/geometry/blob/master/include/boost/geometry/geometries/ring.hpp"><span class="icon">​</span>https://github.com/boostorg/geometry/blob/master/include/boost/geometry/geometries/ring.hpp</a> </li><li><a class="ext-link" href="https://github.com/boostorg/geometry/blob/master/include/boost/geometry/geometries/polygon.hpp"><span class="icon">​</span>https://github.com/boostorg/geometry/blob/master/include/boost/geometry/geometries/polygon.hpp</a> </li></ul><p> Then remove unneeded template parameters (e.g. <code>Container</code> for <code>ring</code> and <code>PointList</code>,<code>RingList</code> for <code>polygon</code>) and internally use e.g. <code>std::vector&lt;&gt;</code> everywhere instead. Then adapt this type properly, so remove the template parameters also from traits' specializations below, etc. </p> </description> <category>Ticket</category> </item> </channel> </rss>