member function with no class name specified

J

jackgoche

Hello,

I have come across the following directive but I don't see a class
name specified in front of the ::Check function. Does anyone
know what this means and how the directive is supposed to work?

#define TEST2(aValue, aExpected) ::Check(aValue, aExpected, __LINE__)

Thanks,

JG
 
R

Rolf Magnus

Hello,

I have come across the following directive but I don't see a class
name specified in front of the ::Check function. Does anyone know what
this means

It refers to the Check function in the global namespace. So even if the
and how the directive is supposed to work?

#define TEST2(aValue, aExpected) ::Check(aValue, aExpected, __LINE__)

You can call it from any namespace or any class, and even if that namespace
or class has a Check function of its own, the one in the gobal namespace
will be called.
 
V

Victor Bazarov

Rolf said:
It refers to the Check function in the global namespace. So even if
the


You can call it from any namespace or any class, and even if that
namespace or class has a Check function of its own, the one in the
gobal namespace will be called.

Unless some bloke prepends the macro with the class name for whatever
reason:

SomeClassThatHasCheckMember TEST2(blah, BLAH);

:)

V
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top