【发布时间】:2023-03-22 01:51:02
【问题描述】:
我有一个非常简单的问题,但我找不到答案。我想我在使用 boost timer.hpp 时遗漏了一些东西。这是我的代码,不幸的是,它给了我一条错误消息:
#include <boost/timer.hpp>
int main() {
boost::timer t;
}
错误信息如下:
/usr/include/boost/timer.hpp: In member function ‘double boost::timer::elapsed_max() const’:
/usr/include/boost/timer.hpp:59: error: ‘numeric_limits’ is not a member of ‘std’
/usr/include/boost/timer.hpp:59: error: ‘::max’ has not been declared
/usr/include/boost/timer.hpp:59: error: expected primary-expression before ‘double’
/usr/include/boost/timer.hpp:59: error: expected `)' before ‘double’
使用的库是 boost 1.36 (SUSE 11.1)。
提前致谢!
【问题讨论】:
-
附加信息:
elapsed_max是使用std::numeric_limits<std::clock_t>::max()定义的,timer.hpp标头通常间接包含<limits>(尽管如果使用BOOST_NO_LIMITS宏可能会关闭)。我们可以到完整的编译行吗?