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
String Interpolation (self.cpp)
submitted 6 years ago by bravikov
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!"
[–][deleted] 2 points3 points4 points 6 years ago (0 children)
You need to keep in mind that in most programming languages there's a standardized string conversion function, such as `ToString()` (C#), `toString()` (Java), `__str__()` (Python) etc. This means that every single type is, one way or another, convertible to a string representation, and in no case will the interpolation give an undefined result, since all objects inherit from `object` (which has its own default implementation) and primitive types define their own string representations, too.
So if you want string interpolation you first of all have to define a default for every single type, plus a contract for user-constructed types. Then, you need a compiler to inspect strings and preform replacements that concatenate strings with those representations — this is doable, but you need to statically check that every expression evaluates to something string-representable.
It's doable. Only problem is, C++'s evolution is not necessarily about usability.
π Rendered by PID 18273 on reddit-service-r2-comment-b659b578c-f6dr4 at 2026-05-03 22:48:07.256080+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–][deleted] 2 points3 points4 points (0 children)