5 ms·
> import std; as default Personally I think he should switch to using namespace std; as default as well. The compiler can warn if you alias the names, and all
by sorenjan 4y ago
> import std; as default
Personally I think he should switch to using namespace std; as default as well. The compiler can warn if you alias the names, and all the std:: in C++ code is just noise and annoying to read and write.
- Koshkin 4y agoBut for backward compatibility you should be able to undo it, then. (Problem is, I don’t think you can.)
- klyrs 4y agoI think you're in a minority here. Off the top of my head, std::get should never be simply `get`. Here's a complete list of symbols that may or may not be defined depending on what you've included. https://en.cppreference.com/w/cpp/symbol_index https://en.cppreference.com/w/cpp/symbol_index
- sorenjan 4y agoOk, maybe bringing everything into the global namespace is a bit of a stretch, but you could at least do the most common ones. Who's going to alias cout or string? As for std::get, while it's a separate issue I think the problem that solves should be solved in a more elegant way if you're trying to reform the language anyway. This is not elegant: std::get<0>(arr) = 1;
- jcelerier 4y agoThere are proposals for a language level version of this - P1061 I think