Jump to content

  • Log In with Google      Sign In   
  • Create Account

- - - - -

Overloaded functions


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 Malmer   Members   -  Reputation: 122

Like
Likes
Like

Posted 12 June 2004 - 03:44 AM

How do I deal with functions that have two of the same? Like this:
CMyClass::DoStuff( float x ); 
and
CMyClass::DoStuff( int x, int y, int z ); 
When doing a RegisterObjectMethod using the nice little asMETHOD macro like this: asMETHOD( CMyClass::DoStuff ) I get this error when compiling:
error C2440: ''type cast'' : cannot convert from ''overloaded-function'' to ''void (__thiscall asCDummy::* )(void)''
        None of the functions with this name in scope match the target type
 
Sollutions?

Sponsor:

#2 Andreas Jonsson   Moderators   -  Reputation: 3455

Like
Likes
Like

Posted 12 June 2004 - 05:13 AM

You need to cast the function to right type so that the compiler knows which one to choose.

(void CMyClass::*(float))CMyClass::DoStuff
(void CMyClass::*(int, int, int))CMyClass::DoStuff



__________________________________________________________
www.AngelCode.com - game development and more...
AngelScript - free scripting library - Tower - free puzzle game

[edited by - WitchLord on June 12, 2004 12:31:54 PM]




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS