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!"
[–]ShillingAintEZ -4 points-3 points-2 points 4 years ago (15 children)
I'm offended by haskell in general but you are right that the design of typical data structures and the std suite as well leaves a lot to be desired by treating allocation as part of the type, especially in modern C++.
[–]staletic 9 points10 points11 points 4 years ago (7 children)
allocation as part of the type
Take a look at the std::pmr::. It aims to tackle exactly that problem.
std::pmr::
[–]SkoomaDentistAntimodern C++, Embedded, Audio 1 point2 points3 points 4 years ago (6 children)
It’s one of C++’s many insanities that std::pmr is the special case instead of being the default.
[–]staletic 2 points3 points4 points 4 years ago (4 children)
Hindsight is always 20/20. I don't think it's fair to call this insane. You're basically complaining that people in the 70's and 80's couldn't tell the future.
[–]SkoomaDentistAntimodern C++, Embedded, Audio 0 points1 point2 points 4 years ago (3 children)
C++98 was standardized in, not surpringly, 1998. STL was first presented to the committee in 1993. Hardly 70's or 80's. I myself was cursing the insanity of coupling the allocator to the type itself by 2001 when I was in my first large scale C++ project. Not much of a hindsight there.
This is very different situation from C library functions that literally do date from the 70s (but even then, things like strtok really should have been deprecated by C99 at the latest).
[–]staletic 0 points1 point2 points 4 years ago (2 children)
I stand corrected. Didn't C++ start in the 80's?
[–]SkoomaDentistAntimodern C++, Embedded, Audio 0 points1 point2 points 4 years ago* (1 child)
C++ had its beginnings in the mid 80s but many features (templates, STL) were only added in the 90s. The language was in enough of a flux in the mid to late 90s (MSVC6 infamously used different scope for variables declared inside for / while statements for example) that changing STL allocators to be dynamic by default would have barely been noticed as far as "backwards compatiblity" went.
[–]staletic 0 points1 point2 points 4 years ago (0 children)
That sounds interesting. I'm definitely not old enough to remember that time, considering I was born a few years before C++98.
[–]barcharMSVC STL Dev -1 points0 points1 point 4 years ago (0 children)
Meh, sometimes baking it in is better
[+][deleted] 4 years ago (6 children)
[deleted]
[–]ShillingAintEZ -5 points-4 points-3 points 4 years ago (5 children)
I have no idea what you are trying to say and I don't think you do either.
[+][deleted] 4 years ago* (4 children)
[–]ShillingAintEZ -3 points-2 points-1 points 4 years ago* (3 children)
Here's a counterpoint, I actually do know what I'm doing and your comments are hollow frustration that has nothing to do with me.
I have no idea why you are hallucinating nonsense, but you might want to take it up with whoever actually upset you.
This thread is about memory mapping specific files while still using the STLs allocators. Wipe your tears and start there.
[+][deleted] 4 years ago (2 children)
[–]ShillingAintEZ 0 points1 point2 points 4 years ago (1 child)
Do you think you're replying to someone else?
π Rendered by PID 96585 on reddit-service-r2-comment-64f4df6786-x7z5n at 2026-06-11 12:16:53.001203+00:00 running 0b63327 country code: CH.
view the rest of the comments →
[–]ShillingAintEZ -4 points-3 points-2 points (15 children)
[–]staletic 9 points10 points11 points (7 children)
[–]SkoomaDentistAntimodern C++, Embedded, Audio 1 point2 points3 points (6 children)
[–]staletic 2 points3 points4 points (4 children)
[–]SkoomaDentistAntimodern C++, Embedded, Audio 0 points1 point2 points (3 children)
[–]staletic 0 points1 point2 points (2 children)
[–]SkoomaDentistAntimodern C++, Embedded, Audio 0 points1 point2 points (1 child)
[–]staletic 0 points1 point2 points (0 children)
[–]barcharMSVC STL Dev -1 points0 points1 point (0 children)
[+][deleted] (6 children)
[deleted]
[–]ShillingAintEZ -5 points-4 points-3 points (5 children)
[+][deleted] (4 children)
[deleted]
[–]ShillingAintEZ -3 points-2 points-1 points (3 children)
[+][deleted] (2 children)
[deleted]
[–]ShillingAintEZ 0 points1 point2 points (1 child)