Jump to content
  • Advertisement
Sign in to follow this  
mk1x86

comparison of uint& and uint

This topic is 2852 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

EDIT:
uint a = obj.id;
works

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

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!