Yes, it takes a bit to figure out what's going on. Probably not worth the savings of space.
-
-
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Yes. What do I win?
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Yes, I would expand it into several statements for clarity.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
I'm always tempted to do this sort of thing, but I almost always regret lvalue ternary op and chained assignment.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
I’m kind of impressed that compiles. Wouldn’t that need the ternary to be an rvalue in order to be assignable-to?
-
error: lvalue required as left operand of assignment last = (boolval?next:first) = link; GCC no likey, but I did!
End of conversation
New conversation -
-
-
Too readable. Try: Node **prev=&first; ... prev=&(*prev=link)->next;
-
(prev is last. Don't know why I switched the name when I started writing the tweet.)
End of conversation
New conversation -
-
-
Yes. And I don't think the spec guarantees those assignments happen in the needed order.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
I thought ?: didn't return an lvalue (that it's just a compiler extension)?
-
If both options are lvalues then the result is one too. Case 4 here I think: http://en.cppreference.com/w/cpp/language/operator_other#Conditional_operator …
- Show replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.