• Advertisement
Sign in to follow this  

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

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

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

Share this post


Link to post
Share on other sites
Advertisement

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.

Share this post


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

  • Advertisement