<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1276" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi Bing, <BR><BR>The support/requirement for the
"typename" keyword <BR>varies largely among compilers. <BR><BR>To be more
precise: <BR><BR>1) VC++ 6.0 Just don't care, <BR> if
you miss the use of "typename", the compiler <BR> will not
complaint. If you add "typename", the <BR> compiler will simply
ignore the keyword. <BR><BR>2) VC++ 7.0 (.NET) Will require it. <BR><BR>3)
Gcc up to 3.2 requires the use of "typename" <BR> and will complaint
when you miss it. However <BR> it tolerates the use of
implicit typenames. <BR><BR>4) Gcc 3.3 if quite stringent. It requires
"typename" <BR> and does not tolerate implicite typenames anymore.
<BR><FONT size=2></FONT>
<DIV class=moz-text-flowed lang=x-western
style="FONT-SIZE: 13px; FONT-FAMILY: -moz-fixed"><BR><BR>So, you better start
using "typename" as required <BR>by the C++ standard. <BR><BR>In general the
rule is: typename is required when <BR>you are in a templated class and you are
trying to <BR>access types (traits) from a classes that depends <BR>on the
template paramters. <BR><BR><BR>For example: <BR><BR><BR>template <class
T> <BR>class A <BR>{ <BR> typedef typename T::Pointer
TPointer; <BR>}; <BR><BR><BR><BR>There is a very particular occassion in which
is was not <BR>possible to unify the use of "typename" between multiple
<BR>compilers. This is when traits of one class are used as <BR>default template
paramters. For this very special case we </DIV>
<DIV class=moz-text-flowed lang=x-western
style="FONT-SIZE: 13px; FONT-FAMILY: -moz-fixed">were forced to introduce the
macro ITK_TYPENAME. <BR><BR><BR>You will find the use of "typename" all over the
toolkit <BR>code and the applications. That will help you to get familiar
<BR>with the cases in which this keyword is expected. <BR><BR><BR>Regards,
<BR><BR><BR> Luis <BR><BR><BR>--------------------- <BR>Bing Jian
wrote: <BR></DIV>
<BLOCKQUOTE class=moz-text-flowed lang=x-western
style="FONT-SIZE: 13px; FONT-FAMILY: -moz-fixed" type="cite">Hi,
<BR> It's an another C++ issue about usage of typename. <BR>I
write and debug my ITK program in visual studio, but <BR>finally I have to
move it to Sun and Linux, then compile <BR>the code using g++. Seems g++ is
always complaining <BR>about my usage of typename. I have to add typename
<BR>at some places and remove typename at other locations. <BR>Even the
program finally compiles, I get lots of warnings <BR>like
<BR> warning: implicit typename is deprecated <BR> Do
you guys have any experience on that? Thanks!
<BR><BR><BR></BLOCKQUOTE></FONT></DIV></BODY></HTML>