Re: I think this is a bug...



"Peter Oliphant" <poliphant@xxxxxxxxxxxxxxxx> wrote

>
> value struct Test_Struct
> {
> long x ;
> } ;
>
[..]
> Test_Struct info ;
>
> Test_Method( info ) ; // shouldn't compile, but does!!!
> Test_Method( %info ) ; // ok
> }
>
> void Test_Method( Test_Struct^ info ) {}
> } ;
I think it's feature. That's "implicit boxing". There's
a boxing conversion from every V to V^ to support
certain types of polymorphism.

For instance, you couldn't write
Console::WriteLine( info );
without it.

You can think of every Value type having a magic
member
value struct V { V^ operator() const; };

Now there's a conversion sequence from gclvalue V
to Object^ via the boxing conversion followed by
the base class handle conversion.

-hg


.



Relevant Pages


Loading