The keyword is typenameprohibited for unqualified names (those that are not preceded ::), even if they are dependent.
C ++ 03 [Section 14.6/5] says
The typename keyword should only apply to qualified names , but these names should not be dependent.
pt depends on T, but it does not matter (in this context).
Delete typenameto compile your code.
source
share