Prev: SetMapMode and MouseMove messages
Next: Dumb C question
From: Bo Persson on 18 Jan 2010 12:04 Vladimir Grigoriev wrote: > Thanks, Igor. > However the Standard if I am not mistaken says that there is no any > difference of using typename and class when template parameters are > defined, is there? Correct, but with template template parameters there *is* a difference. Bo Persson > > Vladimir Grigoriev > > "Igor Tandetnik" <itandetnik(a)mvps.org> wrote in message > news:eKlOZ2FmKHA.1536(a)TK2MSFTNGP06.phx.gbl... > Vladimir Grigoriev wrote: >> Why is not compiled the following code in Visual C++ 2005 EE? >> >> template <template <typename T, typename A> typename Container, >> typename T, typename A> >> inline typename Container<T, A>::size_type size( Container<T, A> >> &c ) { >> return ( c.size() ); >> } > > You must use the keyword 'class', not 'typename', with template > template parameters. >
From: Igor Tandetnik on 18 Jan 2010 12:03
Vladimir Grigoriev wrote: > However the Standard if I am not mistaken says that there is no any > difference of using typename and class when template parameters are defined, > is there? .... where the syntax allows both. See the grammar in 14.1p1. Really, given your apparent interest in fine details of the language, I suggest you get a copy of the standard (I have given you the links to free downloads earlier) and learn to read it. -- With best wishes, Igor Tandetnik With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea. It is hard to be sure where they are going to land, and it could be dangerous sitting under them as they fly overhead. -- RFC 1925 |