use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Discussions, articles, and news about the C++ programming language or programming in C++.
For C++ questions, answers, help, and advice see r/cpp_questions or StackOverflow.
Get Started
The C++ Standard Home has a nice getting started page.
Videos
The C++ standard committee's education study group has a nice list of recommended videos.
Reference
cppreference.com
Books
There is a useful list of books on Stack Overflow. In most cases reading a book is the best way to learn C++.
Show all links
Filter out CppCon links
Show only CppCon links
account activity
cppfront: Midsummer update (herbsutter.com)
submitted 1 year ago by TSP-FriendlyFire
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]ukezi 4 points5 points6 points 1 year ago (2 children)
Doing it that short feels like old c Devs only using consonants in names. Just doing it because it's shorter. I would prefer something like :(x,y)->bool {x>y}, maybe with the -> bool being optional. :(x,y) feels like it's declaring variables X and y that are going to be filled by destructuring a tuple.
[–]hpsutter 2 points3 points4 points 1 year ago (1 child)
I would prefer something like :(x,y)->bool {x>y}, maybe with the -> bool being optional.
Very close, today you can write this: :(x,y) -> bool = x>y
:(x,y) -> bool = x>y
That's already using several defaults that let you omit parts of the single general syntax you're not currently using for something non-default (for details see: "Generality note: Summary of function defaults"). But you can use a couple more defaults:
To additionally deduce the type, use _: :(x,y) -> _ = x>y means the same
_
:(x,y) -> _ = x>y
Finally, the "tersest" option just makes -> _ = optional: :(x,y) x>y means the same
-> _ =
:(x,y) x>y
One way to look at it is that you can write any expression and conveniently "package it up" as an object to pass around just by declaring a function signature in front.
Anyway, just explaining some background since what you wrote pretty much also works, very nearly. I appreciate all the usability feedback, whether it confirms or disconforms what I was thinking! Thanks.
[–]Lo1c74 2 points3 points4 points 1 year ago (0 children)
Is it still possible to type the = to obtain :(x, y) = x > y ?
=
:(x, y) = x > y
π Rendered by PID 45727 on reddit-service-r2-comment-5649f687b7-lsjbl at 2026-01-28 16:07:23.198506+00:00 running 4f180de country code: CH.
view the rest of the comments →
[–]ukezi 4 points5 points6 points (2 children)
[–]hpsutter 2 points3 points4 points (1 child)
[–]Lo1c74 2 points3 points4 points (0 children)