Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > member function with no class name specified

Reply
Thread Tools

member function with no class name specified

 
 
jackgoche@googlemail.com
Guest
Posts: n/a
 
      11-16-2006
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

 
Reply With Quote
 
 
 
 
Rolf Magnus
Guest
Posts: n/a
 
      11-16-2006
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:

> 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.

 
Reply With Quote
 
 
 
 
Victor Bazarov
Guest
Posts: n/a
 
      11-16-2006
Rolf Magnus wrote:
> (E-Mail Removed) wrote:
>
>> 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.


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

SomeClassThatHasCheckMember TEST2(blah, BLAH);



V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the correct grammar to make a function call by using static member data which is a pointer to a ordinary class member function? zaeminkr@gmail.com C++ 3 07-06-2007 12:50 PM
member function with no class name specified John Goche C++ 3 11-16-2006 05:36 PM
Nested Class, Member Class, Inner Class, Local Class, Anonymous Class E11 Java 1 10-12-2005 03:34 PM
parse error in gcc but success in vc.net, call a non_template class's template member function from a template class's member function! ken C++ 2 06-28-2005 06:57 AM
Pointer-to-member-function pointing to a member function of an inherited class akiriwas@gmail.com C++ 12 02-11-2005 05:15 PM



Advertisments