【发布时间】:2013-10-18 21:51:52
【问题描述】:
我有一个客户试图在一个过时的编译器上编译,该编译器似乎没有来自 c++11 的 std::sin 和 std::cos。 (他们无法升级) 我正在寻找某种快速修复来拍打标题的顶部,以使 std::sin 指向 sin 等。 我一直在尝试类似
#ifndef std::sin
something something
namespace std{
point sin to outside sin
point cos to outside cos
};
#endif
但我没有运气
有什么建议吗? 谢谢
【问题讨论】:
-
#define std可怕我知道。 -
@john,std 命名空间存在,但 c++11 版本的 sin 和 cos 不在其中。它们只有旧版本,位于命名空间之外。
-
std::sin和std::cos不是来自 C++11,它们从那时起就是 C++ 的一部分。只需包含<cmath>而不是<math.h>。如果该评论是垃圾,那么请让问题更具体一点,这个“过时的编译器”实际上缺少什么。
标签: c++ function c++11 namespaces alias