Boost C++ Libraries: Ticket #9971: Use constexpr for boost::mpl::c_str::value when possible. https://svn.boost.org/trac10/ticket/9971 <p> Right now boost::mpl::c_str::value is a static const member variable. I think it is a decent idea to add the constexpr keyword here. </p> <p> I have a patch for this issue. Here is an example why it is useful: </p> <pre class="wiki">#include&lt;boost/mpl/string.hpp&gt; int main() { using H = boost::mpl::string&lt;'h'&gt;; static_assert(boost::mpl::c_str&lt;H&gt;::value[0] == 'h', ""); } </pre><p> Without my patch, compiler will complain we could not use c_str::value in constant expression. With my patch, compiler will accept this code. </p> <p> Tested in clang++ 3.4, CentOS 6.3, but I think GCC should works as well. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9971 Trac 1.4.3 ytj000@… Thu, 01 May 2014 11:24:52 GMT attachment set https://svn.boost.org/trac10/ticket/9971 https://svn.boost.org/trac10/ticket/9971 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">patch.diff</span> </li> </ul> <p> Patch </p> Ticket ytj000@… Thu, 01 May 2014 11:25:11 GMT attachment set https://svn.boost.org/trac10/ticket/9971 https://svn.boost.org/trac10/ticket/9971 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">main.cpp</span> </li> </ul> <p> example.cpp </p> Ticket