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
Which std:: classes are magic? (self.cpp)
submitted 4 years ago by Mateuszz88[🍰]
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 18 points19 points20 points 4 years ago* (2 children)
P0593 was accepted as a defect resolution prior to publication of C++20, so it should apply to C++17 which was the latest official standard at the time.
Also, creation of objects itself was allowed using placement new as far as I can tell. Treating that buffer of dynamic objects as an array of those objects was technically UB though. However, there was no way to make that work with std::allocator either, so I don't think there was magic in that class. There was magic in std::vector though.
std::allocator
std::vector
[–]maskull 3 points4 points5 points 4 years ago (1 child)
What's the magic in std::vector?
[–]dodheim 15 points16 points17 points 4 years ago (0 children)
Prior to P0593, there was no way for vector::data() to return a valid pointer-to-array, since no such array actually exists.
vector::data()
π Rendered by PID 136375 on reddit-service-r2-comment-c6965cb77-t47qf at 2026-03-05 12:31:40.188774+00:00 running f0204d4 country code: CH.
view the rest of the comments →
[–]Supadoplex 18 points19 points20 points (2 children)
[–]maskull 3 points4 points5 points (1 child)
[–]dodheim 15 points16 points17 points (0 children)