C++宏定义不受命名空间的约束

// xxx.h
namespace A
{
#define xxx() xxxxx
}

// 在其他文件中,引入xxx.h文件,使用宏定义时,不需要加命名空间
// yyy.cpp
#include "xxx.h"
// somd code
void func() 
{
    // 正确
    xxx() 
}
原文地址:https://www.cnblogs.com/sea-stream/p/9955813.html