An open API service indexing awesome lists of open source software.

https://github.com/karenpayneoregon/conversion-operators-csharp

C# - implicit and explicit conversions
https://github.com/karenpayneoregon/conversion-operators-csharp

conversions csharpcore implicit-operators net8

Last synced: 27 days ago
JSON representation

C# - implicit and explicit conversions

Awesome Lists containing this project

README

          

# About

Source code for the following [article](https://dev.to/karenpayneoregon/c-user-defined-explicit-and-implicit-conversion-operators-3ipd) for implicit and explicit conversions (C#)

## References

[User-defined explicit and implicit conversion operators](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/user-defined-conversion-operators)

A *conversion* causes an expression to be converted to, or treated as being of, a particular type; in the former case a conversion may involve a change in representation. Conversions can be *implicit* or *explicit*, and this determines whether an explicit cast is required.

- [Implicit conversions](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/conversions#102-implicit-conversions)
- [Explicit conversions](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/conversions#103-explicit-conversions)
- [Standard conversions](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/conversions#104-standard-conversions)
- [User-defined conversions](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/conversions#105-user-defined-conversions)
- [User-defined explicit conversions](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/conversions#1055-user-defined-explicit-conversions)