Error at Tutorial Compilation
New to AS. Trying to compile Tutorial. Gets Error at RegisterSTDString(engine);
[BCC32 Error] scriptstdstring.cpp(430): E2335 Overloaded 'operator string::=' ambiguous in this context
[BCC32 Error] scriptstdstring.cpp(431): E2335 Overloaded 'operator string::+=' ambiguous in this context
[BCC32 Error] scriptstdstring.cpp(441): E2335 Overloaded 'string::resize' ambiguous in this context
[BCC32 Error] scriptstdstring.cpp(446): E2335 Overloaded 'string::resize' ambiguous in this context
C++ Builder 2010. Can anyone help?
This is strange. The method pointers are fully specified with the asMETHODPR macro on these lines, there shouldn't be any ambiguity at all here.
Does the C++ Builder manual say how you're supposed to take the address of overloaded class methods? There may be a slight syntax difference for the C++ Builder.
Currently the asMETHODPR macro uses the following syntax to get the correct class method:
Where r is the return type, c is the class name, p is the parameter list, and m is the method name. For the resize method for example you would get:
As far as I know this is the correct way of taking the address of a class method with overloads.
Does the C++ Builder manual say how you're supposed to take the address of overloaded class methods? There may be a slight syntax difference for the C++ Builder.
Currently the asMETHODPR macro uses the following syntax to get the correct class method:
static_cast<r (c::*)p>(&c::m)
Where r is the return type, c is the class name, p is the parameter list, and m is the method name. For the resize method for example you would get:
static_cast<void (string::*)(size_t)>(&string::resize)
As far as I know this is the correct way of taking the address of a class method with overloads.
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
Popular Topics
Advertisement