命令空间中的函数是否只能通过使用命名空间作用域或using指令来访问?
我遇到一个问题,在命名空间内定义的某些函数可以访问该命名空间的OUTSIDE.我相信应该有一个编译器错误,但我没有在我尝试过的三个不同的编译器中得到一个(VS.NET 2003,VS2010和GCC 4).
这是代码:
namespace N{
typedef struct _some_type *some_type;
struct some_struct { int x; };
void A(void);
void B(int);
void C(some_type*);
void D(some_type);
void E(struct some_struct);
}
using N::some_type;
using N::some_struct;
void TestFunction()
{
some_type foo;
some_struct s;
N::A(); //should compile (and does on VS2003, VS2010, and GCC 4.1.2)
::A(); //shouldn't compile (and doesn't on VS2003, VS2010, and GCC 4.1.2)
A(); //shouldn't compile (and doesn't on VS2003, VS2010, and GCC 4.1.2)
N::B(0); //should compile (and does on VS2003, …Run Code Online (Sandbox Code Playgroud) 来自SUSv4:
如果pid是负数,但不是-1,则应将sig发送到进程组ID等于pid绝对值的所有进程(不包括未指定的系统进程集),并且进程有权发送信号.
据我所知,任何时候都不能有2个或更多具有相同PID的进程.为什么规范要对所有流程说明?
谢谢.