adl

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 find this redundant (aka confusing). It says for arrays types that __begin and __end are what you expect: a pointer to the first and a pointer...

In ADL_Display_ConnectedDisplays_Get() from ATI's ADL Library, the out parameter lpConnections is confusing me

The API defined in the ADL SDK manual reads: int ADL_Display_ConnectedDisplays_Get(int iAdapterIndex, int* lpConnections) They say that lpConnections is the pointer to the bit field indicating whether the output connectors on the specified adapter have devices physically attached to them. This information is exactly what I want but no...

ADL and friend injection

Consider this code: template <int N> struct X { friend void f(X *) {} }; int main() { f((X<0> *)0); // Error? } compilers seem to heavily disagree. (MSVC08/10 says no, GCC<4.5 says yes, but 4.5 says no, sun 5.1 says yes, intel 11.1 says yes too but comeau says no (both are EDG)). According to "C++ Templates - The complete guide": ...

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> #include <boost/algorithm/string/find.hpp> #include <boost/operators.hpp> template< class Rng, class T > typename boost::range_iterator<Rng>::type find( Rng& rng, T const& t ) { return std::find( boost::begin(rng), bo...