Re: implicit cast operator funny-ness



Thanks for the trouble Jon, I appreciate it.

I suppose it is one of those things that make sense if you think about
it... The compiler does not know when of the million possible implicit
conversions that might exist to classes that all might impliment the
specific interface you are thinking of, to use:

interface IB
{
}

class B1 : IB
{
}

class B2 : IB
{
}

class A
{
public static implicit B1( A a ) { };
public static implicit B2( A a ) { };
}

so assigning A to an IB will cause who knows what, right?

Regards,
Pieter

.



Relevant Pages

  • Re: intent(in)
    ... > in program/module or the interface block if I have gotten ... Explicit is when you supply the information to the compiler. ... case of a variable type, you have a type declaration statement; ... Implicit is when the compiler deduces the information implicitly. ...
    (comp.lang.fortran)
  • RESULT attribute not working
    ... BIND RESULT ... IMPLICIT NONE ... Having this interface block verbatim in the calling program, ... IntelC Compiler for applications running on Intel64, ...
    (comp.lang.fortran)
  • Re: MFC and c++ problems
    ... compiler to generate code that is architecturally nonsensical. ... So a design in which a control has any syntactic knowledge of any container of itself ... GetParent->SendMessage is the interface of choice, ...
    (microsoft.public.vc.mfc)
  • Re: Win32 API and gfortran
    ... write out a module containing only interface blocks and compile the ... that the /iface switches and ATTRIBUTES directives change the compiler ... arguments are passed in the normal Fortran way ...
    (comp.lang.fortran)
  • Re: Using early-bound interface on a late-bound object
    ... > the compiler determines which interfaces to use, ... > supports the declared interface. ... >> help if someone can point me to some authoritative document or reference ... within customer shops when they mirrored this 'division' to keep their ...
    (microsoft.public.vb.general.discussion)