Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


- - - - -

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


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   -  Reputation: 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.
    {}
}
 


Sponsor:

#2 Andreas Jonsson   Moderators   -  Reputation: 3416

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.



PARTNERS