Boost C++ Libraries: Ticket #8969: boost::geometry::model::point single argument constructor should be explicit https://svn.boost.org/trac10/ticket/8969 <p> In boost/geometry/geometries/point.hpp, the function: </p> <p> point::point(<a class="missing wiki">CoordinateType</a> const &amp; v0, <a class="missing wiki">CoordinateType</a> const &amp; v1 = 0, <a class="missing wiki">CoordinateType</a> const &amp; v2 = 0) </p> <p> has default arguments. Because there is a single argument case, we can use this function for implicit conversion. This is probably not the desired behavior. As a result, any numerical type can be implicitly converted to a point whether you meant to or not. Adding the "explicit" keyword resolves the issue. </p> <p> Example: </p> <pre class="wiki">namespace bgm = boost::geometry::model; namespace bgc = boost::geometry::cs; bgm::point&lt;double, 2, bgc::cartesian&gt; ll(0.0, 0.0); // lower left bgm::point&lt;double, 2, bgc::cartesian&gt; ur(100.0, 100.0); // upper right bgm::box&lt;bgm::point&lt;double, 2, bgc::cartesian&gt; &gt; myBox(11,ur); // Oops! literal 11, not "ll". But it will compile! </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8969 Trac 1.4.3 Barend Gehrels Sat, 17 Aug 2013 20:04:40 GMT <link>https://svn.boost.org/trac10/ticket/8969#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8969#comment:1</guid> <description> <p> Agreed, thanks. Done. Will be released in 1.55 </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Barend Gehrels</dc:creator> <pubDate>Sat, 17 Aug 2013 20:05:32 GMT</pubDate> <title>status, version, milestone changed; resolution set https://svn.boost.org/trac10/ticket/8969#comment:2 https://svn.boost.org/trac10/ticket/8969#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>version</strong> <span class="trac-field-old">Boost 1.54.0</span> → <span class="trac-field-new">Boost 1.55.0</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.55.0</span> </li> </ul> Ticket