wstring comparison is failing

Vladimir Panteleev thecybershadow.lists at gmail.com
Tue Sep 24 00:29:05 UTC 2019


On Monday, 23 September 2019 at 23:22:14 UTC, Brett wrote:
> I guess you are probably right... I was thinking that it would 
> compare up to a null terminator. Seems kinda buggy... maybe the 
> compiler needs to give a warning? After all, compared a fixed 
> size array with a dynamic array then will almost always fail 
> since it is unlikely the sizes will match...
>
> ...rather than failing silently.

It might still be useful for generic code, so a compiler warning 
would probably not be suitable. However, it might be a good idea 
for a linter such as Dscanner, which, unlike the compiler, sees 
types as they are written in the code, not as they are calculated 
through metaprogramming.



More information about the Digitalmars-d-learn mailing list