Opened 9 years ago
Closed 8 years ago
#9811 closed Bugs (fixed)
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()':
| Reported by: | Owned by: | viboes | |
|---|---|---|---|
| Milestone: | Boost 1.56.0 | Component: | chrono |
| Version: | Boost 1.54.0 | Severity: | Problem |
| Keywords: | Cc: |
Description (last modified by )
I am using QNX SDB660 GCC 4.7.3 to create QNX C++ project. It is very simple like that.
#include <boost/thread/recursive_mutex.hpp>
int main(int argc, char *argv[]) {
return EXIT_SUCCESS;
}
It reports the following error.
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<float, true>::lowest()':
boost/chrono/duration.hpp:355:56: error: call to non-constexpr function 'static std::numeric_limits<float>::_Ty std::numeric_limits<float>::max()'
boost/chrono/duration.hpp: In static member function 'static constexpr double boost::chrono::detail::chrono_numeric_limits<double, true>::lowest()':
boost/chrono/duration.hpp:363:57: error: call to non-constexpr function 'static std::numeric_limits<double>::_Ty std::numeric_limits<double>::max()'
boost/chrono/duration.hpp: In static member function 'static constexpr long double boost::chrono::detail::chrono_numeric_limits<long double, true>::lowest()':
boost/chrono/duration.hpp:371:61: error: call to non-constexpr function 'static std::numeric_limits<long double>::_Ty std::numeric_limits<long double>::max()'
Is it QNX related or general bug for boost?
Change History (10)
comment:1 by , 9 years ago
| Component: | None → chrono |
|---|---|
| Owner: | set to |
comment:2 by , 9 years ago
| Description: | modified (diff) |
|---|
comment:3 by , 9 years ago
| Description: | modified (diff) |
|---|
comment:4 by , 9 years ago
comment:5 by , 9 years ago
An alternative could be to define BOOST_CHRONO_LIB_CONSTEXPR if not already defined
#ifndef BOOST_CHRONO_LIB_CONSTEXPR #if defined( BOOST_NO_CXX11_NUMERIC_LIMITS ) #define BOOST_CHRONO_LIB_CONSTEXPR #elif defined(_LIBCPP_VERSION) && !defined(_LIBCPP_CONSTEXPR) #define BOOST_CHRONO_LIB_CONSTEXPR #else #define BOOST_CHRONO_LIB_CONSTEXPR BOOST_CONSTEXPR #endif #endif
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?
comment:6 by , 9 years ago
comment:7 by , 9 years ago
| Milestone: | To Be Determined → Boost 1.56.0 |
|---|
comment:9 by , 8 years ago
comment:10 by , 8 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.

The definition of
template <> struct chrono_numeric_limits<float,true> { static BOOST_CHRONO_LIB_CONSTEXPR float lowest() BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW { return -(std::numeric_limits<float>::max) (); } };where
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
?