Jump to content
  • Advertisement
Sign in to follow this  
Canberk S

A Question About Passing Objects To Functions

This topic is 2080 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi ! I have written a simple function in a class like this :


class myClass
{

public:
   /* other members */

   double xyz(unsigned int id, unsigned int valIndex, unsigned int tupleIndex) const
   {
      return id * valIndex * tupleIndex;
   }

   bool createScriptingEngine
   {
      /* must-be-done stuff */
      	ScriptingEngine->RegisterGlobalFunction(
	   "double xyz(uint, uint, uint)",
	   asMETHOD(myClass, xyz),
           asCALL_THISCALL_ASGLOBAL,
           this);
      /* other stuff */
   }

   /* other members */

};

After I created an instance of myClass and called createScriptingEngine function. Then when i tried to run the following script :

class ng
{
   /* other members */
   private uint index;
   private uint ngId;	/* id of numgen */
   int getIntTupleElement(uint i)
   {
       return xyz(ngId, index, i);
   }
   /* other members */
}

/* other things */


And I got the error : No matching signatures to 'xyz(uint&, uint&, uint)   . So the questions are : Why do I get this error ? AND How can i fix it ???

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!