[Assorted-commits] SF.net SVN: assorted: [852] sandbox/trunk/src/cc/typedefs.cc
Brought to you by:
yangzhang
From: <yan...@us...> - 2008-06-04 01:24:36
|
Revision: 852 http://assorted.svn.sourceforge.net/assorted/?rev=852&view=rev Author: yangzhang Date: 2008-06-03 18:24:44 -0700 (Tue, 03 Jun 2008) Log Message: ----------- added typedef test Added Paths: ----------- sandbox/trunk/src/cc/typedefs.cc Added: sandbox/trunk/src/cc/typedefs.cc =================================================================== --- sandbox/trunk/src/cc/typedefs.cc (rev 0) +++ sandbox/trunk/src/cc/typedefs.cc 2008-06-04 01:24:44 UTC (rev 852) @@ -0,0 +1,17 @@ +#include <map> +#include <string> + +using namespace std; + +template<typename T> +class C { + typedef map<string, T*> mymap; + + // This doesn't work: + // typedef mymap::iterator iterator; + + // You need to specify typename! + typedef typename mymap::iterator iterator; +}; + +int main() { return 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |