News for hackers. Stuff that matters.
Re:Sshole by Gibbon1 on Friday November 06, 2026 @06:18AM (#50390961)
I remember mucking with returning multiple values as anonymous structs. It was tantalizing close but no banana.

I think with C23 you got half a banana now. Still can't do it because C23 didn't adopt proposals to allow returns of untagged/anonymous structs.

If you could then you could write

  auto rtn = Foo();
  if(rtn.err) 
    printf("err=%i", rtn.err);
  else
    printf("Foo=%i\n", rtn.foo);

There are no comments on this comment yet.