conversion operator

  • Thread starter Thread starter Tony Johansson
  • Start date Start date
T

Tony Johansson

Hi!

If I use Red Gate's .NET Reflector and look into the struct for Double I
find the struct but can't find any
conversion operator ?
Can somebody explain that

There must me several conversion operator in this struct double.

Can I find any conversion operator in any other place in .NET using Red
Gate's .NET Reflector ?

//Tony
 
Tony said:
Hi!

If I use Red Gate's .NET Reflector and look into the struct for Double I
find the struct but can't find any
conversion operator ?
Can somebody explain that

There must me several conversion operator in this struct double.

I haven't really looked into it, but I would not expect to see what
you're looking for. Conversions of primitives, being defined in the
language, may well not show up in the actual class definition, but
instead be handled specifically via the compiler.

Inasmuch as you might see conversions, I would expect to find them
implemented as part of the IConvertible interface, as documented on
MSDN. These do show up in Reflector. That said, these aren't the
conversions that are used for predefined conversions in the language;
the CLR has specific support for those, and that's what you'll see in
the IL when you use them.

Pete
 
Hello,
If I use Red Gate's .NET Reflector and look into the struct for Double I
find the struct but can't find any
conversion operator ?

Or you could try the Convert class :
http://msdn.microsoft.com/en-us/library/system.convert.aspx

You may want to explain what you are looking for. From an ealier message if
you are interested in how C# handles conversions the language specification
should likely have some detailed information about this :
http://msdn.microsoft.com/en-us/library/aa691279(VS.71).aspx
 
Back
Top