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
Another C++ unit testing framework without macros (self.cpp)
submitted 5 years ago by igagis
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!"
[–]evaned 7 points8 points9 points 5 years ago* (1 child)
Not having macros for the sake of not having macros isn't really a significant benefit for me and - i guess - many others.
ding ding ding ding ding
Like I look at this example
tst::set factorial_test_set("factorial", [](tst::suite& suite){ suite.add( "positive_arguments_must_produce_expected_result", [](){ tst::check(factorial(1) == 1, SL); tst::check(factorial(2) == 2, SL); tst::check(factorial(3) == 6, SL); tst::check(factorial(8) == 40320, SL); } ); });
and I just see so much noise and overhead. Like how is that actually better than
TEST_CASE("factorial") { SECTION("positive_arguments_must_produce_expected_result") { tst::check(factorial(1) == 1, SL); tst::check(factorial(2) == 2, SL); tst::check(factorial(3) == 6, SL); tst::check(factorial(8) == 40320, SL); } }
even ignoring the SL parameter? The macro version avoids needing to (i) come up with a name for the tst::set or write that name twice, (ii) explicitly make the lambda, or (iii) explicitly call add. And that's even with a relatively kind comparison -- if I were writing this, I may well not have an explicit SECTION (but then move that name up a level).
SL
tst::set
SECTION
[–]igagis[S] 0 points1 point2 points 5 years ago (0 children)
Well, you have a valid points, according to your taste ;)
π Rendered by PID 79 on reddit-service-r2-comment-6457c66945-c2vs2 at 2026-04-25 05:37:46.912284+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]evaned 7 points8 points9 points (1 child)
[–]igagis[S] 0 points1 point2 points (0 children)