Boost C++ Libraries: Ticket #8313: const definition of boost::none https://svn.boost.org/trac10/ticket/8313 <p> boost provides an object named boost::none of type boost::none_t. it originally stems from Boost.Optional, but since it is in the root directory, boost/none.hpp, I guess it is there for other uses as well. </p> <p> I tried to use it in the following way, which fails, because of the definition of boost::none: </p> <p> template&lt;class T,class T2=boost::none_t&gt; struct A{ </p> <blockquote> <p> A(T &amp;a,T2 &amp;b=none); </p> </blockquote> <p> }; </p> <p> boost::none is an object defined to be const, so it is not accepted as a non-const reference. I don't see a reason why it has to be const. its value is never used anyway. </p> <p> I'll probably have to use boost::enable_if instead, to enable a "unary" constructor if and only if T2 == boost::none_t </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8313 Trac 1.4.3 Steven Watanabe Wed, 20 Mar 2013 14:51:51 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/8313#comment:1 https://svn.boost.org/trac10/ticket/8313#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">wontfix</span> </li> </ul> <p> You should not use boost::none as an lvalue. </p> Ticket