From: "Alex Vinokur" Newsgroups: comp.lang.c++,comp.os.msdos.djgpp,gnu.g++.help Subject: Re: Warning : value_type is implicitly a typename (gcc/gpp-3.1) Date: Tue, 13 Aug 2002 17:12:59 +0200 Organization: Scopus Lines: 102 Message-ID: References: NNTP-Posting-Host: gateway.scopus.net (62.90.123.5) X-Trace: fu-berlin.de 1029247932 44300244 62.90.123.5 (16 [79865]) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "André Pönitz" wrote in message news:ajafb5$gv6$8 AT narses DOT hrz DOT tu-chemnitz DOT de... > Alex Vinokur wrote: > > It seems that using template with typedef below causes warnings. > > typedef map >, less > map1_typename; // No problem with gcc-3.1 > > > typedef map1_typename::value_type map1_value_type; > > Have you tried: > > typedef typename map1_typename::value_type map1_value_type; > > ^^^^^^^^ > > here? As silly as it looks, the Standard requires this even if there is > no ambiguity... > > Andre' > > -- > Those who desire to give up Freedom in order to gain Security, > will not have, nor do they deserve, either one. (T. Jefferson) Andre', thank you. It helped me. ============ Windows 2000 DJGPP 2.03 gcc/gpp 3.1 ============ A code below has no problem with gcc/gpp 3.1 ######### C++ code : BEGIN ######### #include #include using namespace std; // -------------- class AAA {}; bool operator< (const AAA& ins1, const AAA& ins2) { return true; } // -------------- template class BBB {}; // -------------- template void foo1 () { typedef map >, less > map1_typename; typedef map1_typename::value_type map1_value_type; pair pair1_insert; map1_typename::iterator map1_pos; // No problem with gcc-3.1 typedef map >, less > map2_typename; typedef typename map2_typename::value_type map2_value_type; pair pair2_insert; typename map2_typename::iterator map2_pos; } // foo1 // -------------- int main () { return 0; } ######### C++ code : END ########### Nevertheless, there is inequality of rights between typedef map >, less > map1_typename; and typedef map >, less > map2_typename; map1_typename does NOT require the 'template' word (because of BBB ? ) map2_typename DOES require the 'template' word (because of BBB ? ) Any explanation ? ==================== Alex Vinokur http://up.to/alexvn http://go.to/alexv_math mailto:alexvn AT bigfoot DOT com mailto:alexvn AT go DOT to ====================