<s>
Substitution	B-Language
failure	I-Language
is	I-Language
not	I-Language
an	I-Language
error	I-Language
(	O
SFINAE	B-Language
)	O
is	O
a	O
principle	O
in	O
C++	B-Language
where	O
an	O
invalid	O
substitution	O
of	O
template	B-Application
parameters	O
is	O
not	O
in	O
itself	O
an	O
error	O
.	O
</s>
<s>
David	O
Vandevoorde	O
first	O
introduced	O
the	O
acronym	O
SFINAE	B-Language
to	O
describe	O
related	O
programming	O
techniques	O
.	O
</s>
<s>
Specifically	O
,	O
when	O
creating	O
a	O
candidate	O
set	O
for	O
overload	B-Language
resolution	I-Language
,	O
some	O
(	O
or	O
all	O
)	O
candidates	O
of	O
that	O
set	O
may	O
be	O
the	O
result	O
of	O
instantiated	O
templates	B-Application
with	O
(	O
potentially	O
deduced	O
)	O
template	B-Application
arguments	O
substituted	O
for	O
the	O
corresponding	O
template	B-Application
parameters	O
.	O
</s>
<s>
If	O
an	O
error	O
occurs	O
during	O
the	O
substitution	O
of	O
a	O
set	O
of	O
arguments	O
for	O
any	O
given	O
template	B-Application
,	O
the	O
compiler	O
removes	O
the	O
potential	O
overload	B-Language
from	O
the	O
candidate	O
set	O
instead	O
of	O
stopping	O
with	O
a	O
compilation	O
error	O
,	O
provided	O
the	O
substitution	O
error	O
is	O
one	O
the	O
C++	B-Language
standard	O
grants	O
such	O
treatment	O
.	O
</s>
<s>
If	O
one	O
or	O
more	O
candidates	O
remain	O
and	O
overload	B-Language
resolution	I-Language
succeeds	O
,	O
the	O
invocation	O
is	O
well-formed	O
.	O
</s>
<s>
The	O
following	O
example	O
illustrates	O
a	O
basic	O
instance	O
of	O
SFINAE	B-Language
:	O
</s>
<s>
Although	O
SFINAE	B-Language
was	O
initially	O
introduced	O
to	O
avoid	O
creating	O
ill-formed	O
programs	O
when	O
unrelated	O
template	B-Application
declarations	O
were	O
visible	O
(	O
e.g.	O
,	O
through	O
the	O
inclusion	O
of	O
a	O
header	O
file	O
)	O
,	O
many	O
developers	O
later	O
found	O
the	O
behavior	O
useful	O
for	O
compile-time	O
introspection	O
.	O
</s>
<s>
Specifically	O
,	O
it	O
allows	O
a	O
template	B-Application
to	O
determine	O
certain	O
properties	O
of	O
its	O
template	B-Application
arguments	O
at	O
instantiation	O
time	O
.	O
</s>
<s>
For	O
example	O
,	O
SFINAE	B-Language
can	O
be	O
used	O
to	O
determine	O
if	O
a	O
type	O
contains	O
a	O
certain	O
typedef	O
:	O
</s>
<s>
In	O
C++11	B-Language
,	O
the	O
above	O
code	O
could	O
be	O
simplified	O
to	O
:	O
</s>
<s>
The	O
developers	O
of	O
Boost	B-Language
used	O
SFINAE	B-Language
in	O
boost::enable_if	O
and	O
in	O
other	O
ways	O
.	O
</s>
