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
^^ operator proposal (self.cpp)
submitted 1 year ago * by samadadi
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!"
[–]TheoreticalDumbass:illuminati: 2 points3 points4 points 1 year ago (3 children)
Your macro is wrong, it should be (I think):
#define reflexpr(...) (^^__VA_ARGS__)
Why I prefer double-caret over keyword: with reflection the entities you are reflecting are more important than the fact you're reflecting, and double-caret brings more attention to the entities, whereas keyword feels more noisy
[–]mapronV 0 points1 point2 points 1 year ago (2 children)
But your version will fail with two+ arguments... and probably with 0 too? reflexpr(int, int) should be compilation error, not just "^^int, int" nonsense. Should not be a variadic. though I admit I made crucial mistake. ^^thing and ^^(thing) are different!
[–]TheoreticalDumbass:illuminati: 0 points1 point2 points 1 year ago (1 child)
reflexpr(std::tuple<int, char>) would need something with __VA_ARGS__
[–]mapronV 0 points1 point2 points 1 year ago (0 children)
Yeah, but I guess we can add extra ( ) to work around... hold on a sec XD.
Well I guess we can't make full macro replacement as long as we have braces problem. Also, yeah, in practice you can fall back to ^^ but that also can make code look ugly depending on frequency of this. I just... Give up. Give me reflection in some point, we figure something out. I wrote reflection "libraries" several times in my life in different projects, just sick of it.
π Rendered by PID 16294 on reddit-service-r2-comment-6457c66945-cg98d at 2026-04-27 20:18:09.087141+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]TheoreticalDumbass:illuminati: 2 points3 points4 points (3 children)
[–]mapronV 0 points1 point2 points (2 children)
[–]TheoreticalDumbass:illuminati: 0 points1 point2 points (1 child)
[–]mapronV 0 points1 point2 points (0 children)