No subject


Thu Mar 29 20:50:10 PDT 2007


The types of template parameters are deduced for a particular template
instantiation by comparing the template argument with the corresponding
template parameter.

For each template parameter, the following rules are applied in order
until a type is deduced for each parameter:

1. If there is no type specialization for the parameter, the type of
the parameter is set to the template argument.

  (S, T : S) -> (B, T : S)

2. If the type specialization is dependent on a type parameter, the
type of that parameter is set to be the corresponding part of the type
argument.

  (B, T : S) -> (B, T : B)

3. If after all the type arguments are examined there are any type
parameters left with no type assigned, they are assigned types
corresponding to the template argument in the same position in the
TemplateArgumentList.

  (B, T : B) -> (B, D)

4. If applying the above rules does not result in exactly one type for
each template parameter, then it is an error.

  ok?


-- 



More information about the Digitalmars-d-bugs mailing list