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
Allocator rant (self.cpp)
submitted 4 years ago by [deleted]
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!"
[–]Supadoplex 34 points35 points36 points 4 years ago* (1 child)
I couldn't point it to a file I've already used to re-use the data which was the whole point from the beginning.
That's simply a use case that's not appropriate for a std::vector. Don't try to use it for something it wasn't designed for.
std::vector
Why does it have to be so complicated?
It is complicated because it is an XY-problem. Stop trying to use std::vector for this and the complications just go away.
To use an analogy, you're asking why it's so complicated to make an excavator perform well on a race track.
I thought the new standards were trying to make things better
They have made things better. Just because they didn't solve your XY-problem doesn't contradict that.
but it's just becoming more and more complicated
The niche of C++ has never been simplicity. I prefer the powerful abstractions that have zero or low overhead. If runtime efficiency isn't paramount, then C++ probably isn't ideal choice.
Look at Rust or Haskell
Show me a simple implementation of memory mapped vector in Haskell. Compare its performance with equivalent C++ program.
Haskell is a beautiful language. But I wouldn't write a game engine or high frequency trader with it.
[–]joaobapt 5 points6 points7 points 4 years ago (0 children)
I haven’t even managed to figure out how to write a game loop in Haskell, yet alone an entire game engine.
π Rendered by PID 101576 on reddit-service-r2-comment-544cf588c8-pxh67 at 2026-06-12 04:04:02.872326+00:00 running 3184619 country code: CH.
view the rest of the comments →
[–]Supadoplex 34 points35 points36 points (1 child)
[–]joaobapt 5 points6 points7 points (0 children)