Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
using directives: qualified lookup rules are different from unqualified lookup rules
//clang 3.8.0 #include <iostream> namespace A { // To simplify this example, you can comment out this f. void f(int) { std::cout << "A::f()\n"; } namespace B { void f() { std::cout << "A::B::f()\n"; } } namespace C { using namespace B; void g() { f(); } // A::B::f, as A::f takes an int } } int main() { A::C::g(); // Calls A::B::f, because the QUALIFIED lookup rules for using directives // are totally different from the UNQUALIFIED lookup rules! A::C::f(); }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Variable declarations in while loop conditions are also C++-only.
marquee text in C++
Segment Tree Impl
Test bitfields with unnamed union
Dynamic call
Ordered Graphs
Test titlu
HerbSutter-Virtuality
Magic, why 1 2?
Example
Please log in to post a comment.