Compound Dereference Operators
1
Name:
Anonymous
2013-10-27 22:33
Anyone else thought they should've included these in the C/C++ standard? I mean, we already have += -= >>= and all the rest...
a .= b /* a = a.b */
a ->= b /* a = a->b */
2
Name:
Anonymous
2013-10-27 22:43
that's just syntactic sugar, and not used as much
3
Name:
Anonymous
2013-10-28 7:29
Also less useful because generally a and a->b won't have the same type. I guess it'd be nice for cdring down a linked list, like list ->= next;
4
Name:
Cudder
!MhMRSATORI!fR8duoqGZdD/iE5
2013-10-28 7:53
>>3
For linked lists, trees, and other linky structures, it's very useful. Wouldn't be hard to add to the parser either. I'm surprised GCC doesn't have them already.
5
Name:
Anonymous
2013-10-28 9:20
6
Name:
L. A. Calculus
!!wKyoNUUHDOmjW7I
2013-10-28 9:48
WHY DONT U JUST USE SHORTER VARIABLE NAMES LIKE 'np'? DIS SHIT'S ONLY USEFUL FOR SELF-REFERENTIAL STRUCTURES.
7
Name:
Anonymous
2013-10-29 3:40
>>3
It's not any worse than punning void pointers. Anyway mixed mode arithmetic allows you to do weird stuff too (consider
int i; double d; i *= d;).
>>4
->= would be useful.
.= however seems pretty pointless (ha) since you can't nest structures recursively.
Newer Posts