Jump to content

Image of the Day

Everything is fine. 

#screenshotsaturday #indiedev #gamedev https://t.co/98BAKUInyo
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net's newsletters to receive the latest updates and exclusive content.


Sign up now
- - - - -

convertion problem - No conversion from 'A@&' to 'B@' available.

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
1 reply to this topic

#1 FDsagizi   Members   

514
Like
0Likes
Like

Posted 15 February 2013 - 02:38 AM

Hi smile.png

I think variant "b is a" - valid, but compiler say no

 

class A{}
class B : A{}


void startGame( string &param )
{
    A @a;
    B @b;
    
    if( a is b )
    {}
    
    if( b is a ) //  No conversion from 'A@&' to 'B@' available.
    {}
}
 


#2 Andreas Jonsson   Moderators   

4558
Like
0Likes
Like

Posted 15 February 2013 - 07:03 AM

Yes, you're probably right. The compiler should probably try an implicit cast of the first operand if the implicit cast of the second operand is not possible.

 

I'll look into this.


AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.