-
Notifications
You must be signed in to change notification settings - Fork 359
Open
Description
在namespace std
内添加内容是未定义的行为.
namespace std // 建议修改命名空间, 不要放在`std`内
{
class threadpool
{
// ...
};
}
违反 C++ 标准的行为, C++ 标准明文规定:
"The behavior is undefined if any declaration is added to namespace std or to a namespace within std unless otherwise specified."
"向 std 命名空间或其子命名空间添加声明或定义是未定义行为,除非标准明确允许"
相关链接:
🔗 https://en.cppreference.com/w/cpp/language/extending_std
🔗 https://eel.is/c++draft/namespace.std
🔗 https://wiki.sei.cmu.edu/confluence/display/cplusplus/DCL58-CPP.+Do+not+modify+the+standard+namespaces
Metadata
Metadata
Assignees
Labels
No labels