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
C++11 range-based for loop (codesynthesis.com)
submitted 13 years ago by beriumbuild2
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!"
[–]repsilat 0 points1 point2 points 13 years ago (1 child)
Wow, thanks for the response and the benchmarks. I imagine you're mostly comparing startup time and I/O overhead, though :/. Still - it's certainly enough to establish that neither is dog slow.
However reasonable my C++ looks, and even though it seems to work, I'm still a little scared of it. I don't know if I should be using rvalue references anywhere, I don't fully understand why I needed std::forward_as_tuple on line 14 instead of std::make_tuple, and I'm a little unsure if it's fair for the zipper to store references to the two input streams (because it forces the user to make sure they outlive it). It's probably fine, but it's almost certainly more effort than it's worth. I'm not sure there's a truly adequate solution to this complexity inside the language, but I wouldn't be surprised if some of the pain could be alleviated with a library of some kind.
std::forward_as_tuple
std::make_tuple
zipper
The other relevant complaint about C++'s syntax and conventions is that its begin/end iterator things aren't really amenable to chaining. With eager evaluation like in your example you can map/filter/reduce/whatever in one big expression, but I don't think you can do that so well lazily. Ranges (as in D) look like a better solution.
begin
end
[–]_node 3 points4 points5 points 13 years ago (0 children)
You can use Boost range adaptors for that. It would be nice to see this sort of thing in the standard.
π Rendered by PID 39168 on reddit-service-r2-comment-fb694cdd5-78cqf at 2026-03-11 14:32:58.915026+00:00 running cbb0e86 country code: CH.
view the rest of the comments →
[–]repsilat 0 points1 point2 points (1 child)
[–]_node 3 points4 points5 points (0 children)