On 06/28/2012 08:39 PM, Rick Hodgin wrote:
>> Why do you want to bother with a non-standard,
>> unportable extension instead of just writing:
>>
>> inline bool isSystemClosed()
>> { return !isSystemOpen; }
>>
>> Which is simple, conventional, easy to understand
>> and portable.
>>
>> Or in C++ just define a suitable type, instead of
>> needing changes to the core language:
>>
>> struct inv_bool {
>> bool& b;
>> operator bool() const { return !b; }
>> };
>>
>> inv_bool isSystemClosed = { isSystemOpen };
or, better:
inv_bool isSystemClosed(isSystemOpen);
>
> There are certain fundamentals in data processing. The inverse bool
> is one of them. Why not be able to reference it more naturally in
> code utilizing something the compiler already knows about and can
> wield effortlessly?
>
> I've thought more about the syntax, and I see this making more sense:
> bool isSystemOpen[!isSystemClosed];
But why is this new syntax better than
inv_bool isSystemClosed(isSystemOpen);
Andrew.