Possible Duplicate:
What's the purpose of a leading “::” in a C++ method call
This gtest has the example code.
::testing::AssertionResult IsEven(int n) {
if ((n % 2) == 0)
return ::testing::AssertionSuccess();
else
return ::testing::AssertionFailure() << n << " is odd";
}
How does it work? If the namespace is testing, isn't it testing::AssertionResult is the right usage?
The :: prefix refers to the global namespace, so this is like an absolute versus relative path specification.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With