Am 22.04.2012 20:52, schrieb Jason McKesson:
[..]
> Should this C++ code compile? I think ADL requires it to, but I'm not certain.
>
> template<class T>
> int t(T i)
> {
> return f(i);
> }
>
> struct a{};
>
> int f(a i)
> {
> return 0;
> }
>
> int main()
> {
> a b;
> return t(b);
> }
Yes, this clearly is supposed to work according to ADL rules. All recent
compilers I know of (including gcc 4.8) accept this example as they should.
HTH& Greetings from Bremen,
Daniel Krügler