当我在 Eclipse CDT 中打开我的 C++ Makefile 项目时,每个 std::nan 都带有红色下划线,当我将鼠标悬停在上面时出现此错误:
Invalid arguments '
Candidates are:
__gnu_cxx::enable_if<&0[std::__is_arithmetic<#0>::__value],int>::__type isnan(#0)
'
但是,使用 make + g++,该项目编译完美,没有错误或警告。当我从 std::isnan 中删除 std::时,Eclipse 停止提示,即使我不知道 std 命名空间之外的任何 isnan 函数或宏。可能有什么问题?
最佳答案
我尝试了其他答案。这次他们没有工作(但曾为其他真正不是错误的 eclipse 错误工作)。我所做的是包含正确的 header 和命名空间,然后从 std::isnan 中删除“std::”。结果 - 在 eclipse 中没有错误。
关于c++ - 奇怪的 std::nan 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12984402/