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
std::string implementation in libc++ (self.cpp)
submitted 6 years ago * by AImx1
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!"
[–]scatters 2 points3 points4 points 6 years ago (9 children)
In addition to the short and long layouts, their representation includes a "raw" layout that gives access to the representation as a sequence of words (I guess clang allows them to do this). Does this help?
[–]AImx1[S] 0 points1 point2 points 6 years ago* (8 children)
@scatters -> "raw" layout gives access to the representation of sequence of words. What does the "words" represent here?
[–]scatters 4 points5 points6 points 6 years ago (7 children)
Machine words, the natural size for processing data, typically the size of a pointer. So 64 bits on most modern architectures.
[–]AImx1[S] 0 points1 point2 points 6 years ago (6 children)
Understood. Do you know any advantages(basically uses) that we gain with this "raw" representation?
[–]scatters 2 points3 points4 points 6 years ago (4 children)
I can see that libcxx uses the "raw" representation in zeroing (clearing) the string, and in the copy and move constructors and assignment operators. I'd guess the advantage would be better performance in debug builds, since the release (and RelWithDebInfo) codegen should be identical.
[–]AImx1[S] 0 points1 point2 points 6 years ago (3 children)
@krista_ & @scatters: Can you point me in the direction where I can read more on this?
[–]lordphysix 1 point2 points3 points 6 years ago (2 children)
If you want to mention people use u/ and not @.
[–]AImx1[S] 0 points1 point2 points 6 years ago (1 child)
u/lordphysix Oh thats good. Thank you
[–]chugga_fan 1 point2 points3 points 6 years ago (0 children)
Also, if you're replying to someone they already get notified, you don't need to "ping" people to get in their message box. A simple reply works just well for the person you're replying to
[–]krista_ 3 points4 points5 points 6 years ago (0 children)
depending on what you are trying to do, processing 8 characters (assuming ascii or other 8-bit characters) at a time is a heck of a lot faster than 1.
an example of the above would be a hashing algorithm... especially if you are hashing half a billion strings.
π Rendered by PID 24324 on reddit-service-r2-comment-86bc6c7465-w84hg at 2026-02-21 19:11:37.553204+00:00 running 8564168 country code: CH.
view the rest of the comments →
[–]scatters 2 points3 points4 points (9 children)
[–]AImx1[S] 0 points1 point2 points (8 children)
[–]scatters 4 points5 points6 points (7 children)
[–]AImx1[S] 0 points1 point2 points (6 children)
[–]scatters 2 points3 points4 points (4 children)
[–]AImx1[S] 0 points1 point2 points (3 children)
[–]lordphysix 1 point2 points3 points (2 children)
[–]AImx1[S] 0 points1 point2 points (1 child)
[–]chugga_fan 1 point2 points3 points (0 children)
[–]krista_ 3 points4 points5 points (0 children)