Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

- - - - -

There is no copy operator for the type 'Val' available.


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
3 replies to this topic

#1 FDsagizi   Members   -  Reputation: 395

Like
0Likes
Like

Posted 28 December 2012 - 02:15 AM

Hi!smile.png

 

if i change this code ( Val &in ) 

 

r=en->RegisterObjectBehaviour("Val", asBEHAVE_CONSTRUCT,  "void f(const Val &in )",asFUNCTION(CopyConstructVal), asCALL_CDECL_OBJLAST); assert( r >= 0 );

 

to ( Val & )

 

r=en->RegisterObjectBehaviour("Val", asBEHAVE_CONSTRUCT,  "void f(const Val & )",asFUNCTION(CopyConstructVal), asCALL_CDECL_OBJLAST); assert( r >= 0 );

 

i have error: There is no copy operator for the type 'Val' available.

 

 

on this script code:

Val GetVal()
{
    Val ret = ...

    return ret; // error.
}

 

At revision: 1524


Edited by Andreas Jonsson, 30 December 2012 - 08:36 AM.


Sponsor:

#2 Andreas Jonsson   Moderators   -  Reputation: 2311

Like
0Likes
Like

Posted 28 December 2012 - 08:07 AM

Thanks. This is obviously something I need to correct. :)

 

How is Val registered? Is it an asOBJ_VALUE or asOBJ_REF? Do you use asEP_ALLOW_UNSAFE_REFERENCES?


AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

#3 FDsagizi   Members   -  Reputation: 395

Like
0Likes
Like

Posted 28 December 2012 - 08:17 PM

Val reg:

 

 

r=en->RegisterObjectType( "Val", sizeof(Val), asOBJ_VALUE | asOBJ_APP_CLASS_CDK ); assert( r >= 0 );
 
yes i use - asEP_ALLOW_UNSAFE_REFERENCES


#4 Andreas Jonsson   Moderators   -  Reputation: 2311

Like
0Likes
Like

Posted 29 December 2012 - 11:39 AM

Thanks. 

 

I've fixed this problem in revision 1526. Both forms should now be recognized as copy constructors.


AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game




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