Jump to content

View more

Image of the Day

#ld38 #screenshotsaturday Mimosa Fizz action gif #2 https://t.co/TUzdppvfUL
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now
- - - - -

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

4: Adsense

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   

514
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.


#2 Andreas Jonsson   Moderators   

4630
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   

514
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   

4630
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.