On 2/5/2018 3:18 PM, Timon Gehr wrote:
Neither byte nor dchar are C types.

"byte" is a C "signed char". On Posix systems, a dchar maps to wchar_t, although wchar_t is a typedef not a distinct type. It's a bit complicated :-)


The overloading rules are fine, but byte should not implicitly convert to char/dchar, and char should not implicitly convert to byte.

Maybe not, but casting back and forth between them is ugly. Pascal works this way, and it was one of the things I wound up hating about Pascal, all those ORD and CHR casts.

A reasonable case could be made for getting rid of all implicit conversions. But those are there for a reason - it makes writing code more natural and easy. It allows generic code to work without special casing. And the cost of it is sometimes you might make a mistake.

Reply via email to