Advertisement

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

Started by December 28, 2012 08:15 AM
2 comments, last by WitchLord 11 years, 11 months ago

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

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

Advertisement

Val reg:

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

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

This topic is closed to new replies.

Advertisement