Boost C++ Libraries: Ticket #6921: documentation for BOOST_MPL_ASSERT_RELATION inconsistent with implementation https://svn.boost.org/trac10/ticket/6921 <p> Documenation for MPL states that the proper syntax BOOST_MPL_ASSERT_RELATION is: </p> <p> BOOST_MPL_ASSERT_RELATION( x, op, y ); </p> <p> where x and y are integral constants. </p> <p> Given this, the following assert should trap since 8 is not an integral constant </p> <pre class="wiki">BOOST_MPL_ASSERT_RELATION(8, ==, 8); // no assertion </pre><p> But in fact it does not. </p> <p> On the other hand, the following should not trap </p> <pre class="wiki">BOOST_MPL_ASSERT_RELATION( (boost::mpl::integral_c&lt;int, 8&gt;), ==, (boost::mpl::integral_c&lt;int, 8&gt;) ); </pre><p> But in fact it does. </p> <p> So it seems that the documentation doesn't agree with the implementation. </p> <p> Robert Ramey </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6921 Trac 1.4.3 viboes Mon, 29 Oct 2012 02:32:22 GMT <link>https://svn.boost.org/trac10/ticket/6921#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6921#comment:1</guid> <description> <p> I don't think the documentation is referring to the class integral_constant, but to the built-in integral constants/literals. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Robert Ramey</dc:creator> <pubDate>Mon, 29 Oct 2012 05:12:28 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6921#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6921#comment:2</guid> <description> <p> <a href="http://www.boost.org/doc/libs/1_49_0/libs/mpl/doc/refmanual/integral-constant.html">http://www.boost.org/doc/libs/1_49_0/libs/mpl/doc/refmanual/integral-constant.html</a> </p> <p> defines "integral constant" as a concept. </p> <p> <a href="http://www.boost.org/doc/libs/1_49_0/libs/mpl/doc/refmanual/assert-relation.html">http://www.boost.org/doc/libs/1_49_0/libs/mpl/doc/refmanual/assert-relation.html</a> </p> <p> shows </p> <p> Synopsis </p> <p> #define BOOST_MPL_ASSERT_RELATION( x, relation, y ) \ </p> <blockquote> <p> unspecified token sequence \ </p> </blockquote> <p> with parameter x and y required to be "integral constant" </p> <p> The example shows </p> <p> BOOST_MPL_ASSERT_RELATION( sizeof(T), &lt;, sizeof(U) ); </p> <p> which supports your reading. At the very least the document has to be considered confusing and in need of improvement. </p> <p> Robert Ramey </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Mon, 29 Oct 2012 15:18:50 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6921#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6921#comment:3</guid> <description> <p> Actually, I would prefer that the macro be re-implemented to support either usage </p> </description> <category>Ticket</category> </item> </channel> </rss>