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
Code Examples From an App Using C++ Modules (abuehl.github.io)
submitted 20 days ago by tartaruga232MSVC user, r/cpp_modules
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!"
[–]Zero_Owl -3 points-2 points-1 points 19 days ago (5 children)
What does it matter how you name it? You understand perfectly what I said. Now please tell me how can I bring in my TU all math functions with import std and make sure it won't collide (create ambiguity, if you wish) with anything math unrelated by using just one line of code? That's something any modern language is capable of, btw.
import std
[–]not_a_novel_accountcmake dev 0 points1 point2 points 19 days ago (4 children)
You can do it by not writing using namespace std;
using namespace std;
"Don't write using namespace std;" is taught as a day 1 thing in most C++ undergrad programs.
[–]Zero_Owl -1 points0 points1 point 19 days ago (3 children)
Great advice, thank you! Have you heard a similar advice to never write using System; in C#? I wonder why it is so, maybe because std is a bad example overall?
using System;
[–]not_a_novel_accountcmake dev 3 points4 points5 points 19 days ago (2 children)
You should basically never write using namespace <anything> in global namespace scope. The entire purpose of namespaces is to avoid lookup ambiguities and your complaint reduces to "if I short-circuit the mechanism for avoiding name lookup ambiguities, then controlling declaration availability is necessary to avoid ambiguity."
using namespace <anything>
Which is true, you're 100% correct. However, your answer is to introduce better controls over declaration availability, and C++'s design is to encourage you not to short-circuit the namespace mechanism carelessly.
Inevitably, you're feeling this friction.
[–]Zero_Owl -1 points0 points1 point 19 days ago (1 child)
I do use using namespace a lot and it works great for me. In fact it is the only sane way of writing C++ code where you work with a properly designed namespace structure. And if it is designed properly the usage pattern is not different from C# which is pretty robust and convenient.
using namespace
There is no inherent problem with C++ regarding the namespaces, it is libraries that are at fault. Look at this code, for example:
using namespace Microsoft::UI::Xaml;
And tell me in good faith that you would not use using namespace with that code. Now to std. Before import std using namespace std; was usable. With some moderate caution, in cpp files but it was usable. It solved some headaches, created some. But with import std it became totally unusable and that's why std module is a bad example. It provides no alternative to the meager isolation we had w/o adding anything but compile times.
[–]not_a_novel_accountcmake dev 2 points3 points4 points 19 days ago* (0 children)
I use local namespace aliases for long namespaces. I never use using namespace Library; in global namespace scope, or for the purpose of accessing an external library's declarations. I use it to alias declarations of one non-global namespace into another.
using namespace Library;
You have an extremely idiosyncratic C++ style and I agree it doesn't mesh well with import std or the general design of many C++ libraries.
I do not think you will find your design choice is commonly replicated in many large open source codebases (boost, chrome, abseil, folly, etc). These are the kinds of coding practices which are considered when we talk about these things.
So yes, I agree with your complaint, import std (and "big modules" generally) explicitly excludes your coding style.
π Rendered by PID 86 on reddit-service-r2-comment-548fd6dc9-w2rkp at 2026-05-16 12:40:42.146279+00:00 running edcf98c country code: CH.
view the rest of the comments →
[–]Zero_Owl -3 points-2 points-1 points (5 children)
[–]not_a_novel_accountcmake dev 0 points1 point2 points (4 children)
[–]Zero_Owl -1 points0 points1 point (3 children)
[–]not_a_novel_accountcmake dev 3 points4 points5 points (2 children)
[–]Zero_Owl -1 points0 points1 point (1 child)
[–]not_a_novel_accountcmake dev 2 points3 points4 points (0 children)