Questions tagged [namespaces]
For questions relating to namespaces. Namespaces prevent name collision between different identifiers with the same name.
4 questions
9
votes
0
answers
283
views
Why do using-directives in C++ work the way they do?
There's already a question on StackOverflow regarding this, but I feel like this platform is more appropriate for the question.
Why is it that when a using-directive is used inside a scope in C++, ...
5
votes
3
answers
347
views
Types and variables in a different namespace
What would it take to design a language that permitted construct such as below?
int int = 10;
Such a language would need to be able to infer contextually whether a ...
11
votes
1
answer
288
views
What are the advantages to placing functions in a separate namespace?
In many modern languages, a function is just a specific kind of value that happens to be callable. However, some languages, even if they support first-class functions, assign functions to their own ...
9
votes
3
answers
368
views
What are some approaches to namespacing?
Objective-C didn't have namespaces, so everyone chose a two- or three-letter prefix to stick on everything. This has effects to this day as typenames like NSObject ...