Hello everyone,
Here is my understanding of what Bjarne said in his The C++ Programming Language book. I am not sure whether my understanding is correct? I am somewhat confused about the following statements.
My understanding is,
means if a function call like this,
then compiler can deduce argument type of template function below to A?
Bjarne's original statements are,
--------------------
C.13.4 Deducing Function Template Arguments
A compiler can deduce a type template argument, T or TT , and a nontype
template argument, I, from a template function argument with a type composed of the following constructs:
--------------------
thanks in advance,
George
Here is my understanding of what Bjarne said in his The C++ Programming Language book. I am not sure whether my understanding is correct? I am somewhat confused about the following statements.
My understanding is,
means if a function call like this,
Code:
void func(const A a) // A is a specific type
then compiler can deduce argument type of template function below to A?
Code:
template <class T> func (T a)
Bjarne's original statements are,
--------------------
C.13.4 Deducing Function Template Arguments
A compiler can deduce a type template argument, T or TT , and a nontype
template argument, I, from a template function argument with a type composed of the following constructs:
Code:
T const T volatile T
T* T& T[constant_expression]
type[I] class_template_name<T> class_template_name<I>
T T<T > T<I > T<>
thanks in advance,
George