Boost C++ Libraries: Ticket #7192: [mpl] std::integral_constant support https://svn.boost.org/trac10/ticket/7192 <p> The following reasonable-seeming use of mpl::plus doesn't compile: </p> <pre class="wiki"> #include &lt;utility&gt; #include &lt;boost/mpl/plus.hpp&gt; typedef std::integral_constant&lt;int, 1&gt; one; typedef boost::mpl::plus&lt;one, one&gt;::type two; </pre><p> That's because mpl only works with its own integral constant wrappers, not the standard one. That seems unfortunate to me. Is there any interest in supporting this? </p> <p> Here's the error (from clang trunk with glibc++): </p> <pre class="wiki"> 1&gt; In file included from main.cpp:2: 1&gt; In file included from /home/Eric/boost/org/trunk/boost/mpl/plus.hpp:19: 1&gt; In file included from /home/Eric/boost/org/trunk/boost/mpl/aux_/arithmetic_op.hpp:34: 1&gt; In file included from /home/Eric/boost/org/trunk/boost/mpl/aux_/include_preprocessed.hpp:37: 1&gt; /home/Eric/boost/org/trunk/boost/mpl/aux_/preprocessed/gcc/plus.hpp:60:25: error: no type named 'tag' in 'std::integral_constant&lt;int, 1&gt;' 1&gt; typedef typename T::tag type; 1&gt; ~~~~~~~~~~~~^~~ 1&gt; /home/Eric/boost/org/trunk/boost/mpl/aux_/preprocessed/gcc/plus.hpp:111:20: note: in instantiation of template class 'boost::mpl::plus_tag&lt;std::integral_constant&lt;int, 1&gt; &gt;' requested here 1&gt; typename plus_tag&lt;N1&gt;::type 1&gt; ^ </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7192 Trac 1.4.3 anonymous Sun, 05 Aug 2012 17:10:29 GMT <link>https://svn.boost.org/trac10/ticket/7192#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7192#comment:1</guid> <description> <p> Yes, this should definitely work. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Aleksey Gurtovoy</dc:creator> <pubDate>Sun, 05 Aug 2012 17:13:28 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7192#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7192#comment:2</guid> <description> <p> Replying to <a class="new ticket" href="https://svn.boost.org/trac10/ticket/7192" title="#7192: Feature Requests: [mpl] std::integral_constant support (new)">eric_niebler</a>: </p> <blockquote class="citation"> <p> The following reasonable-seeming use of mpl::plus doesn't compile: </p> <pre class="wiki"> #include &lt;utility&gt; #include &lt;boost/mpl/plus.hpp&gt; typedef std::integral_constant&lt;int, 1&gt; one; typedef boost::mpl::plus&lt;one, one&gt;::type two; </pre><p> That's because mpl only works with its own integral constant wrappers, not the standard one. That seems unfortunate to me. Is there any interest in supporting this? </p> </blockquote> <p> Yes, this should definitely work. </p> </description> <category>Ticket</category> </item> </channel> </rss>