Boost C++ Libraries: Ticket #9811: boost/boost/chrono/duration.hpp:355:56: error: call to non-constexpr function 'static std::numeric_limits<float>::_Ty std::numeric_limits<float>::max()' /home/zosun/input_service/inputservices-core-service/other/boost/boost/chrono/duration.hpp: In static member function 'static constexpr double boost::chrono::detail::chrono_numeric_limits<double, true>::lowest()': https://svn.boost.org/trac10/ticket/9811 <p> I am using QNX SDB660 GCC 4.7.3 to create QNX C++ project. It is very simple like that. </p> <pre class="wiki">#include &lt;boost/thread/recursive_mutex.hpp&gt; int main(int argc, char *argv[]) { return EXIT_SUCCESS; } </pre><p> It reports the following error. </p> <pre class="wiki">In file included from boost/chrono/time_point.hpp:33:0, from boost/thread/lock_types.hpp:22, from boost/thread/pthread/recursive_mutex.hpp:13, from boost/thread/recursive_mutex.hpp:16, from /home/test/number/number.cc:1: boost/chrono/duration.hpp: In static member function 'static constexpr float boost::chrono::detail::chrono_numeric_limits&lt;float, true&gt;::lowest()': boost/chrono/duration.hpp:355:56: error: call to non-constexpr function 'static std::numeric_limits&lt;float&gt;::_Ty std::numeric_limits&lt;float&gt;::max()' boost/chrono/duration.hpp: In static member function 'static constexpr double boost::chrono::detail::chrono_numeric_limits&lt;double, true&gt;::lowest()': boost/chrono/duration.hpp:363:57: error: call to non-constexpr function 'static std::numeric_limits&lt;double&gt;::_Ty std::numeric_limits&lt;double&gt;::max()' boost/chrono/duration.hpp: In static member function 'static constexpr long double boost::chrono::detail::chrono_numeric_limits&lt;long double, true&gt;::lowest()': boost/chrono/duration.hpp:371:61: error: call to non-constexpr function 'static std::numeric_limits&lt;long double&gt;::_Ty std::numeric_limits&lt;long double&gt;::max()' </pre><p> Is it QNX related or general bug for boost? </p> <p> <a class="missing wiki">Thanks/Zongjun</a> </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9811 Trac 1.4.3 Steven Watanabe Fri, 28 Mar 2014 14:39:29 GMT component changed; owner set https://svn.boost.org/trac10/ticket/9811#comment:1 https://svn.boost.org/trac10/ticket/9811#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">viboes</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">chrono</span> </li> </ul> Ticket viboes Fri, 18 Apr 2014 18:46:18 GMT description changed https://svn.boost.org/trac10/ticket/9811#comment:2 https://svn.boost.org/trac10/ticket/9811#comment:2 <ul> <li><strong>description</strong> modified (<a href="/trac10/ticket/9811?action=diff&amp;version=2">diff</a>) </li> </ul> Ticket viboes Fri, 18 Apr 2014 18:46:52 GMT description changed https://svn.boost.org/trac10/ticket/9811#comment:3 https://svn.boost.org/trac10/ticket/9811#comment:3 <ul> <li><strong>description</strong> modified (<a href="/trac10/ticket/9811?action=diff&amp;version=3">diff</a>) </li> </ul> Ticket viboes Sat, 19 Apr 2014 07:02:31 GMT <link>https://svn.boost.org/trac10/ticket/9811#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9811#comment:4</guid> <description> <p> The definition of </p> <pre class="wiki"> template &lt;&gt; struct chrono_numeric_limits&lt;float,true&gt; { static BOOST_CHRONO_LIB_CONSTEXPR float lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW { return -(std::numeric_limits&lt;float&gt;::max) (); } }; </pre><p> where </p> <pre class="wiki">#if defined( BOOST_NO_CXX11_NUMERIC_LIMITS ) #define BOOST_CHRONO_LIB_CONSTEXPR #elif defined(_LIBCPP_VERSION) &amp;&amp; !defined(_LIBCPP_CONSTEXPR) #define BOOST_CHRONO_LIB_CONSTEXPR #else #define BOOST_CHRONO_LIB_CONSTEXPR BOOST_CONSTEXPR #endif </pre><p> Please, could you tell me which macro is defined for the library that I can check so that BOOST_CHRONO_LIB_CONSTEXPR is defined as </p> <pre class="wiki"> #define BOOST_CHRONO_LIB_CONSTEXPR </pre><p> ? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sat, 19 Apr 2014 07:04:51 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9811#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9811#comment:5</guid> <description> <p> An alternative could be to define BOOST_CHRONO_LIB_CONSTEXPR if not already defined </p> <pre class="wiki">#ifndef BOOST_CHRONO_LIB_CONSTEXPR #if defined( BOOST_NO_CXX11_NUMERIC_LIMITS ) #define BOOST_CHRONO_LIB_CONSTEXPR #elif defined(_LIBCPP_VERSION) &amp;&amp; !defined(_LIBCPP_CONSTEXPR) #define BOOST_CHRONO_LIB_CONSTEXPR #else #define BOOST_CHRONO_LIB_CONSTEXPR BOOST_CONSTEXPR #endif #endif </pre><p> Now the user could define BOOST_CHRONO_LIB_CONSTEXPR if its c++ std library doesn't supports constexpr for numeric_limits. What do you think? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sat, 19 Apr 2014 09:58:47 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9811#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9811#comment:6</guid> <description> <p> <a class="ext-link" href="https://github.com/boostorg/chrono/commit/e84030154dfe3953b0ba396730291baa7d33c0e2"><span class="icon">​</span>https://github.com/boostorg/chrono/commit/e84030154dfe3953b0ba396730291baa7d33c0e2</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sat, 19 Apr 2014 09:59:28 GMT</pubDate> <title>milestone changed https://svn.boost.org/trac10/ticket/9811#comment:7 https://svn.boost.org/trac10/ticket/9811#comment:7 <ul> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.56.0</span> </li> </ul> Ticket viboes Sun, 27 Apr 2014 13:15:08 GMT <link>https://svn.boost.org/trac10/ticket/9811#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9811#comment:8</guid> <description> <p> Does the possibility to define BOOST_CHRONO_LIB_CONSTEXPR satisfy you? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sun, 27 Apr 2014 13:51:25 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9811#comment:9 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9811#comment:9</guid> <description> <p> <a class="ext-link" href="https://github.com/boostorg/chrono/commit/f66235d6b80838f7bf03118789af4b399cecd012"><span class="icon">​</span>https://github.com/boostorg/chrono/commit/f66235d6b80838f7bf03118789af4b399cecd012</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sun, 08 Jun 2014 10:21:41 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/9811#comment:10 https://svn.boost.org/trac10/ticket/9811#comment:10 <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">fixed</span> </li> </ul> Ticket