unqualified-name Questions

1

Solved

Consider // https://godbolt.org/z/z5M9b9jzx #include <memory> #include <cassert> struct B {}; struct D : B {}; int main() { std::shared_ptr<B> b = std::make_shared<D>(); ...
Actually asked 27/5, 2021 at 7:26

2

Solved

C++ has a feature, that in-class-defined friend functions can only be found by ADL (argument dependent lookup): struct Foo { friend void fn(Foo) { } // fn can only be called by ADL, it won't be f...

2

I was reading about template functions and got confused by this problem: #include <iostream> void f(int) { std::cout << "f(int)\n"; } template<typename T> void g(T val) { std...

5

Solved

The teacher in our programming lessons is talking about "unqualified names", but I'm wondering what they really are. I suspect that things such as method names are unqualified, but I'm not certain...
Germanophile asked 15/1, 2015 at 15:14
1

© 2022 - 2024 — McMap. All rights reserved.