Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Compound Dereference Operators

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 */

Name: Anonymous 2013-10-27 22:43

that's just syntactic sugar, and not used as much

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;

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.

Name: Anonymous 2013-10-28 9:20

>>3
>le pedophile sage

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.

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.

Don't change these.
Name: Email:
Entire Thread Thread List