argument-dependent-lookup
Why was argument dependent lookup invented?
Why was argument dependent lookup (ADL) invented? Is it just so we can write cout << stuff instead of std::operator<<(cout, stuff)? If that is the case, why wasn\'t ADL limited to operator[详细]
2023-01-27 10:21 分类:问答ADL with typedefs from another namespace
I have something like this: #include <iostream> namespace N { typedef std::pair<int, double> MyPair;[详细]
2023-01-25 03:22 分类:问答Ambiguous call to templated function due to ADL
I\'ve been bitten by this problem a couple of times and so have my colleagues. When compiling #include <deque>[详细]
2023-01-15 05:12 分类:问答ADL and friend injection
Consider this code: template <int N> struct X { friend void f(X *) {} }; int main() { f((X<0> *)0); // Error?[详细]
2023-01-14 01:24 分类:问答Best lookup match between const char * and const char (& p)[T_Size]
I have two functions : void foo(const char * p) and template<size_t T_Size> void foo(const char (& p)[T_Size]) ;[详细]
2023-01-12 19:19 分类:问答What are the pitfalls of ADL?
Some time ago I read an article that explained several pitfalls of argument dependent lookup, but I cannot find it anymore. It was about gaining access to things that you should not have a开发者_如何转[详细]
2023-01-02 04:49 分类:问答Why doesn't ADL find function templates?
What part of the C++ specification restricts argument dependent lookup from finding function templates in the set of associated namespaces? In other words, why does the last call in main below fail to[详细]
2023-01-02 02:31 分类:问答Range-based for statement definition redundancy
Looking at n3092, in §6.5.4 we find the equivalency for a range-based for loop. It then goes on to say what __begin and __end are equal to. It differentiates between arrays and other types, and I fin[详细]
2022-12-26 19:52 分类:问答What is the preference of function/method/template name resolving in C++?
How does the C++ compiler decide which function/method to call if there are multiple possibilities? In my specific case I have the standard free function of the C++ Run time and I also have a template[详细]
2022-12-20 20:39 分类:问答