Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ "::" without class name [duplicate]

I came across the following code structure in C++:

uint32_t AClass::Action(....)
{
..
      status = ::Action(...);
..
}

I am not sure what ::Action() means. Which class does it belongs to? NOTE: the argument list of ::Action(...) is different from AClass::Action(...).

like image 264
drdot Avatar asked Sep 13 '25 12:09

drdot


1 Answers

The leading :: just means that Action here refers to a non-member function in the global namespace, instead of referring to AClass::Action in the current namespace.

like image 159
Sam Estep Avatar answered Sep 15 '25 01:09

Sam Estep