Original Post
Hi, I have the following console app: Now when I change Foo to a managed type: ref class Foo { ... } and run the same program, I get 5.91378815174249E+276 Anyone know how implicit conversion operators should be implemented with the new C++/CLI syntax? Thx. [edit] Washu: The amazing [ source] and tags strike again! [Edited by - Washu on March 15, 2005 11:21:28 PM]
using namespace System;
class Foo
{
double d;
public:
Foo() : d( 3.14159 ) { }
operator double()
{
return d;
}
};
int main()
{
Foo f;
double e = f;
Console::WriteLine( e ); // outputs 3.14159 and everthing is good!
Console::ReadLine();
}