☰
  • 首页
  • 规则分类
  • 项目介绍
search
•••

程序实现了应由标准库提供的功能

C++-Undefined-Behavior-79
目录 › next › previous

示例:

namespace std
{
    const int& max(const int& a, const int& b) {  // Undefined behavior
        ....
    }
}

示例代码实现的 max 会干扰标准库中的 max,导致未定义的行为。

依据

ISO/IEC 14882:2003 17.1.17-undefined ISO/IEC 14882:2011 17.3.22-undefined
Copyright©2024 360 Security Technology Inc., Licensed under the Apache-2.0 license.