Boost C++ Libraries: Ticket #7381: C++11 compliance: unresolved symbol when assigning a constexpr duration to a non-const local variable https://svn.boost.org/trac10/ticket/7381 <p> When assigning a template static value member of type constexpr boost::chrono::duration to a non-const local variable </p> <pre class="wiki"> template &lt;int Val, typename Type&gt; struct dummy { typedef Type type; static constexpr type value{static_cast&lt;type&gt;(Val)}; }; void aTest(){ auto z3 = dummy2&lt;7,boost::chrono::hours&gt;::value; } </pre><p> There is an unresolved symbol link error. </p> <p> The reason is that the boost::chrono::duration copy constructor must be =default on c++11 so that the type can be used as a constexpr. </p> <p> Removing the following declaration in boost/chrono/duration </p> <pre class="wiki"> BOOST_CONSTEXPR duration(const duration&amp; rhs) : rep_(rhs.rep_) {} // = default; </pre><p> solves the issue. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7381 Trac 1.4.3 viboes Sun, 16 Sep 2012 07:56:51 GMT status changed https://svn.boost.org/trac10/ticket/7381#comment:1 https://svn.boost.org/trac10/ticket/7381#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket viboes Sun, 16 Sep 2012 08:03:33 GMT component changed https://svn.boost.org/trac10/ticket/7381#comment:2 https://svn.boost.org/trac10/ticket/7381#comment:2 <ul> <li><strong>component</strong> <span class="trac-field-old">thread</span> → <span class="trac-field-new">chrono</span> </li> </ul> Ticket viboes Sun, 16 Sep 2012 08:28:26 GMT milestone changed; keywords set https://svn.boost.org/trac10/ticket/7381#comment:3 https://svn.boost.org/trac10/ticket/7381#comment:3 <ul> <li><strong>keywords</strong> constexpr duration added </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.52.0</span> </li> </ul> <p> Committed in trunk revision <a class="changeset" href="https://svn.boost.org/trac10/changeset/80536" title="Chrono: remove duration copy constructor so default applies: issue #7381">[80536]</a>. </p> Ticket viboes Tue, 09 Oct 2012 23:21:42 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/7381#comment:4 https://svn.boost.org/trac10/ticket/7381#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Merged <a class="changeset" href="https://svn.boost.org/trac10/changeset/80714" title="Chrono: merge from trunk fix for #7381">[80714]</a> </p> Ticket