This is the statement from ISO C++ Standard 14.8.2.4 / 3rd :Deducing template arguments from a type
A given type P can be composed from a number of other types, templates,
and non-type values:
— A function type includes the types of each of the function parameters
and the return type.
— A pointer to member type includes the type of the class object pointed
to and the type of the member pointed to.
— A type that is a specialization of a class template (e.g., A<int>)
includes the types, templates, and non-type values referenced by the
template argument list of the specialization.
— An array type includes the array element type and the value of the
array bound.
In most cases, the types, templates, and non-type values that
are used to compose P participate in template argument deduction. That is,they
may be used to determine the value of a template argument, and the value so
determined must be consistent with the values determined elsewhere. In certain
contexts, how ever, the value does not participate in type deduction, but
instead uses the values of template arguments that were either deduced
elsewhere or explicitly specified. If a template parameter is used only in
nondeduced contexts and is not explicitly specified, template argument
deduction fails.
Hi All,I tried Deducing template arguments taking the address of a function template as well as Deducing conversion function template arguments.
In the 4th point ..i know that The compiler cannot deduce the value of a major array bound unless the bound refers to a reference or pointer type. Major array bounds are not part of function parameter types.
Can any one able to explain each and every point with an example please...