Thread overview |
---|
November 30, 2001 DM8.23 | ||||
---|---|---|---|---|
| ||||
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 . |
November 30, 2001 Re: DM8.23 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Roland | 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
> .
>
>
|
November 30, 2001 Re: DM8.23 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Roland | 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 > . > |
Copyright © 1999-2021 by the D Language Foundation