Basically, there is a class Foo
defined in namespace np
:
//Foo.h
namespace np {
class Foo {
public:
static void static_member();
...
}
...
}
I wanted to reference the static member in other sources, say src.cc
//src.cc
#include "Foo.h"
using np::Foo::static_member;
...
static_member()
...
after launching compiler, it complained:
error: using declaration cannot refer to class member
However, it worked when I changed the line to np::Foo::static_member()
. So, what are proper ways to omit the interminable scope prefixes?