just an idea (!! operator)

deadalnix deadalnix at gmail.com
Thu Jul 12 17:42:06 PDT 2012


On 12/07/2012 22:49, David Piepgrass wrote:
>>> Yeah, I've been planning to try and get this into D one day. Probably
>>> something like:
>>> (a ?: b) -> (auto __tmp = a, __tmp ? __tmp : b)
>>
>> gcc used to have that extension and they dropped it...
>
> But GCC can't control the C++ language spec. Naturally there is a
> reluctance to add nonstandard features. It's a successful feature in C#,
> however, and a lot of people (including me) have also been pestering the
> C# crew for "null dot" (for safely calling methods on object references
> that might be null.)
>
> I don't see why you would use ?: instead of ??, though.

Well C# does use ?? but ?: seems to me used in more languages.


More information about the Digitalmars-d mailing list