• Advertisement
Sign in to follow this  

comparison of uint& and uint

This topic is 2765 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a C++ class "prop" which has the attribute uint id and an accessor method const uint& getId() const;

registration of the method:
r = engine->RegisterObjectMethod(type, "const uint32& get_id() const", asMETHOD(T, getId), asCALL_THISCALL); assert(r >= 0);

now in AS I try this:
obj.id == 1;

it's actually nested in a condition but you know what I mean. the build returns: line 1: No conversion from 'uint&' to 'uint' available.

I don't get it. why isn't it possbile to compare a const reference with a simple value? Since it's a primitive type I don't think I've done anything wrong here. Please help

uint a = obj.id;

[Edited by - mk1x86 on August 26, 2010 6:55:40 AM]

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement