Sign in to follow this  
Miatar

Error at Tutorial Compilation

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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:


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.


Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this