Template arguments can be deduced in several different contexts, but
in each case a type that is specified in terms of template parameters
(call it
P)
is compared with an actual type (call it
A),
and an attempt is made to find template argument values (a type for a type
parameter, a value for a non-type parameter, or a template for a
template parameter) that will make
P,
after substitution of the deduced values (call it the deduced
A),
compatible with
A.