www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript

c++ - DM8.23

↑ ↓ ← Roland <rv ronetech.com> writes:
Not a problem, just for information:

//header

MyClass {
public:
    .
    void useMyFunction(..);
    int myFunction();
    .
};

//-----------------
//CPP

    void MyClass::useMyFunction() {
        .
        if (myFunction) {           //<--------  i forgot to put the
parenthesis after myFunction and it compiles with DM823: is it normal ?
            .
        }
        .
}

I must signal that i just realize that myFunction never uses *this
pointer and could be static.
command line: sc .. -r -mx -o+time -5 -a4 -c ..
    .

Roland
    .
Nov 30 2001
→ Damian <damiandixon netscape.net> writes:
Roland,

I suspect the compiler should give an error...

I tried the code on HP's compiler 'aCC' and got the following error:

# Nonstatic member function "int MyClass::myFunction()" is used 
incorrectly (must be either called or used to form a pointer to member).

Regards,
Damian

Roland wrote:

 Not a problem, just for information:
 
 //header
 
 MyClass {
 public:
     .
     void useMyFunction(..);
     int myFunction();
     .
 };
 
 //-----------------
 //CPP
 
     void MyClass::useMyFunction() {
         .
         if (myFunction) {           //<--------  i forgot to put the
 parenthesis after myFunction and it compiles with DM823: is it normal ?
             .
         }
         .
 }
 
 I must signal that i just realize that myFunction never uses *this
 pointer and could be static.
 command line: sc .. -r -mx -o+time -5 -a4 -c ..
     .
 
 Roland
     .
 
 

Nov 30 2001
→ "Walter" <walter digitalmars.com> writes:
It's interpreted as a pointer to a member function. -Walter

"Roland" <rv ronetech.com> wrote in message
news:3C076D27.3799691F ronetech.com...
 Not a problem, just for information:

 file://header

 MyClass {
 public:
     .
     void useMyFunction(..);
     int myFunction();
     .
 };

 file://-----------------
 file://CPP

     void MyClass::useMyFunction() {
         .
         if (myFunction) {           file://<--------  i forgot to put the
 parenthesis after myFunction and it compiles with DM823: is it normal ?
             .
         }
         .
 }

 I must signal that i just realize that myFunction never uses *this
 pointer and could be static.
 command line: sc .. -r -mx -o+time -5 -a4 -c ..
     .

 Roland
     .

Nov 30 2001