Re:What If I Don't Actually Like My Users? (2008)
by lifthrasiir on Friday June 03, 2016 @05:34AM
(#11829221)
Even if so, it should have been a separate type. The "elegance" of this design can be complemented by having a better interface. My strawman example:
Now you are almost unable to incorrectly use this interface: `strcmp(a, <, b)` and `strcmp(a, !=, b)` etc. works, `strcmp(a, -, b)` does not compile (because we've casted to `const void*`), `strcmp(a, =, b)` also does not compile (because `_Strcmp()` is not a lvalue). Other incorrect uses will likely result in compile errors, though in possibly more obscure ways.
[ Parent
| on HN ]
There are no comments on this comment yet.