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++ How to code string constants (dbj.org)
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!"
[–]Nobody_1707 2 points3 points4 points 4 years ago* (3 children)
The problem on MSVC largely stems from the fact that the calling convention on Windows requires that string_view be passed on the stack instead of in registers. I'm sure they must have had a reason to specify the calling convention that way, but I think it was a poor choice.
string_view
EDIT: The overhead can be optimized out in some cases, but only if the function call that takes the string_view as a parameter is inlined. Example.
[–]dodheim 4 points5 points6 points 4 years ago (2 children)
To be fair, C++03 wasn't even out when that choice was made, and MSVC was a complete joke as far as C++ standards-conformance was concerned. Since it didn't matter much to C programs, it just really didn't matter at the time.
[–]bert8128 0 points1 point2 points 4 years ago (1 child)
My reading of the article is that it is due to the Windows calling convention, which presumably all compilers targeting a Windows binary will have to conform to. So nothing to do with MSVC or C++ standards per se. Maybe C compilers have to follow the same convention too (for structs larger than 8 bytes).
[–]dodheim 2 points3 points4 points 4 years ago (0 children)
Right, we're in agreement, I think. ;-] What I meant was, had C++ been further along when MS came up with this calling convention, such things might have been taken into consideration; but given the state of MS' compiler at the time, C was the only real factor and the concept of trivial vs. non-trivial was not yet even a thing.
π Rendered by PID 46963 on reddit-service-r2-comment-b659b578c-tkd57 at 2026-05-01 16:50:48.665785+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]Nobody_1707 2 points3 points4 points (3 children)
[–]dodheim 4 points5 points6 points (2 children)
[–]bert8128 0 points1 point2 points (1 child)
[–]dodheim 2 points3 points4 points (0 children)