double timestamp = ::a::b::c::NowInSeconds();
Already know the use of :: in varible selection, but what's the meaning of it when it is used at the beginning and followed with a function (with namespace specified) ?
double timestamp = ::a::b::c::NowInSeconds();
Already know the use of :: in varible selection, but what's the meaning of it when it is used at the beginning and followed with a function (with namespace specified) ?
The initial ::
is used to explicitly specify that the name following it is located in the global/default namespace, and not in any other namespace that happens to be in scope. Here's an example of how that might be useful:
int a;
namespace b {
int a;
};
using namespace b;
int main(int, char **)
{
a = 5; // error, reference to 'a' is ambiguous
::a = 5; // ok
}