mercredi 3 février 2016

Is there a way to add conversion operators to primitive types?

Is there a way to add conversion operators to primitive types?

For example:

Someclass x = (Someclass)7; //or even implicit casting

I know that it's possible to make a ctor in someclass that accepts an int, but is there a way to add a conversion operator to int instead?

Aucun commentaire:

Enregistrer un commentaire