<s>
In	O
the	O
C++	B-Language
programming	I-Language
language	I-Language
,	O
argument-dependent	B-Language
lookup	I-Language
(	O
ADL	O
)	O
,	O
or	O
argument-dependent	B-Language
name	I-Language
lookup	I-Language
,	O
applies	O
to	O
the	O
lookup	B-Application
of	O
an	O
unqualified	O
function	O
name	O
depending	O
on	O
the	O
types	O
of	O
the	O
arguments	O
given	O
to	O
the	O
function	O
call	O
.	O
</s>
<s>
This	O
behavior	O
is	O
also	O
known	O
as	O
Koenig	B-Language
lookup	I-Language
,	O
as	O
it	O
is	O
often	O
attributed	O
to	O
Andrew	O
Koenig	O
,	O
though	O
he	O
is	O
not	O
its	O
inventor	O
.	O
</s>
<s>
During	O
argument-dependent	B-Language
lookup	I-Language
,	O
other	O
namespaces	O
not	O
considered	O
during	O
normal	O
lookup	B-Application
may	O
be	O
searched	O
where	O
the	O
set	O
of	O
namespaces	O
to	O
be	O
searched	O
depends	O
on	O
the	O
types	O
of	O
the	O
function	O
arguments	O
.	O
</s>
<s>
Specifically	O
,	O
the	O
set	O
of	O
declarations	O
discovered	O
during	O
the	O
ADL	O
process	O
,	O
and	O
considered	O
for	O
resolution	O
of	O
the	O
function	O
name	O
,	O
is	O
the	O
union	O
of	O
the	O
declarations	O
found	O
by	O
normal	O
lookup	B-Application
with	O
the	O
declarations	O
found	O
by	O
looking	O
in	O
the	O
set	O
of	O
namespaces	O
associated	O
with	O
the	O
types	O
of	O
the	O
function	O
arguments	O
.	O
</s>
<s>
A	O
common	O
pattern	O
in	O
the	O
C++	B-Language
Standard	I-Language
Library	I-Language
is	O
to	O
declare	O
overloaded	O
operators	O
that	O
will	O
be	O
found	O
in	O
this	O
manner	O
.	O
</s>
<s>
Using	O
<<	O
is	O
equivalent	O
to	O
calling	O
operator	O
<<	O
without	O
the	O
std::	B-Language
qualifier	O
.	O
</s>
<s>
However	O
,	O
in	O
this	O
case	O
,	O
the	O
overload	B-Language
of	O
operator	O
<<	O
that	O
works	O
for	O
string	O
is	O
in	O
the	O
std	B-Language
namespace	I-Language
,	O
so	O
ADL	O
is	O
required	O
for	O
it	O
to	O
be	O
used	O
.	O
</s>
<s>
which	O
it	O
can	O
resolve	O
during	O
normal	O
lookup	B-Application
.	O
</s>
<s>
the	O
const	O
char	O
*	O
overloaded	O
operator	O
<<	O
is	O
a	O
non-member	O
function	O
in	O
the	O
std	B-Language
namespace	I-Language
and	O
,	O
thus	O
,	O
requires	O
ADL	O
for	O
a	O
correct	O
lookup	B-Application
:	O
</s>
<s>
The	O
std	B-Language
namespace	I-Language
overloaded	O
non-member	O
operator	O
<<	O
function	O
to	O
handle	O
strings	O
is	O
another	O
example	O
:	O
</s>
<s>
As	O
Koenig	O
points	O
out	O
in	O
a	O
personal	O
note	O
,	O
without	O
ADL	O
the	O
compiler	O
would	O
indicate	O
an	O
error	O
stating	O
it	O
could	O
not	O
find	O
operator	O
<<	O
as	O
the	O
statement	O
does	O
n't	O
explicitly	O
specify	O
that	O
it	O
is	O
found	O
in	O
the	O
std	B-Language
namespace	I-Language
.	O
</s>
<s>
In	O
the	O
C++	B-Language
Standard	I-Language
Library	I-Language
,	O
several	O
algorithms	O
use	O
unqualified	O
calls	O
to	O
swap	O
from	O
within	O
the	O
std	B-Language
namespace	I-Language
.	O
</s>
<s>
As	O
a	O
result	O
,	O
the	O
generic	O
std::swap	O
function	O
is	O
used	O
if	O
nothing	O
else	O
is	O
found	O
,	O
but	O
if	O
these	O
algorithms	O
are	O
used	O
with	O
a	O
third-party	O
class	O
,	O
Foo	O
,	O
found	O
in	O
another	O
namespace	O
that	O
also	O
contains	O
swap( Foo&	O
,	O
Foo&	O
)	O
,	O
that	O
overload	B-Language
of	O
swap	O
will	O
be	O
used	O
.	O
</s>
<s>
For	O
example	O
,	O
the	O
C++	B-Language
standard	I-Language
library	I-Language
makes	O
extensive	O
use	O
of	O
unqualified	O
calls	O
to	O
std::swap	O
to	O
swap	O
two	O
values	O
.	O
</s>
<s>
In	O
general	O
,	O
over-dependence	O
on	O
ADL	O
can	O
lead	O
to	O
semantic	B-Application
problems	O
.	O
</s>
