Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
June 20, 2003 Typedef templates ... | ||||
---|---|---|---|---|
| ||||
Walter Do you fancy being the first (unless Comeau have beat you to it) to support typedef templates (http://www.cuj.com/documents/s=7976/cujcexp2012sutter/)? This would be a noteworthy achievement! template< typename T1 , typename T2 > struct typedef_template_class { }; template <typename T1> typedef typedef_template_class<T1, long> typedef_template_typedef; void typedef_template_fn() { typedef_template_class<int, long> a; typedef_template_typedef<int> b; a == b; // Same type, so can assign } VC++ 7.1 recognises the construct but informs the command line that "a typedef template is illegal", which suggests it'll be in the next release (whenever that is), so you'll _have_ to do it eventually. Why not do it now and be first? Matthew |
June 21, 2003 Re: Typedef templates ... | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matthew Wilson | It's a good idea. -Walter "Matthew Wilson" <matthew@stlsoft.org> wrote in message news:bd04tn$a18$1@digitaldaemon.com... > Walter > > Do you fancy being the first (unless Comeau have beat you to it) to support > typedef templates (http://www.cuj.com/documents/s=7976/cujcexp2012sutter/)? > This would be a noteworthy achievement! > > template< typename T1 > , typename T2 > > > struct typedef_template_class > { > }; > > template <typename T1> > typedef typedef_template_class<T1, long> typedef_template_typedef; > > void typedef_template_fn() > { > typedef_template_class<int, long> a; > typedef_template_typedef<int> b; > > a == b; // Same type, so can assign > } > > VC++ 7.1 recognises the construct but informs the command line that "a typedef template is illegal", which suggests it'll be in the next release (whenever that is), so you'll _have_ to do it eventually. Why not do it now > and be first? > > > Matthew > > |
June 21, 2003 Re: Typedef templates ... | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matthew Wilson | I would very dearly like to see that supported, it should prove very useful in some particular projects. Regards, Remko van der Vossen "Matthew Wilson" <matthew@stlsoft.org> wrote in message news:bd04tn$a18$1@digitaldaemon.com... > Walter > > Do you fancy being the first (unless Comeau have beat you to it) to support > typedef templates (http://www.cuj.com/documents/s=7976/cujcexp2012sutter/)? > This would be a noteworthy achievement! > > template< typename T1 > , typename T2 > > > struct typedef_template_class > { > }; > > template <typename T1> > typedef typedef_template_class<T1, long> typedef_template_typedef; > > void typedef_template_fn() > { > typedef_template_class<int, long> a; > typedef_template_typedef<int> b; > > a == b; // Same type, so can assign > } > > VC++ 7.1 recognises the construct but informs the command line that "a typedef template is illegal", which suggests it'll be in the next release (whenever that is), so you'll _have_ to do it eventually. Why not do it now > and be first? > > > Matthew > > |
July 01, 2003 Re: Typedef templates ... | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matthew Wilson | I just read article. That would be rather nifty indeed: The ability to generalize the generalized! "Matthew Wilson" <matthew@stlsoft.org> wrote in message news:bd04tn$a18$1@digitaldaemon.com... > Walter > > Do you fancy being the first (unless Comeau have beat you to it) to support > typedef templates (http://www.cuj.com/documents/s=7976/cujcexp2012sutter/)? > This would be a noteworthy achievement! > > template< typename T1 > , typename T2 > > > struct typedef_template_class > { > }; > > template <typename T1> > typedef typedef_template_class<T1, long> typedef_template_typedef; > > void typedef_template_fn() > { > typedef_template_class<int, long> a; > typedef_template_typedef<int> b; > > a == b; // Same type, so can assign > } > > VC++ 7.1 recognises the construct but informs the command line that "a typedef template is illegal", which suggests it'll be in the next release (whenever that is), so you'll _have_ to do it eventually. Why not do it now > and be first? > > > Matthew > > |
July 01, 2003 Re: Typedef templates ... | ||||
---|---|---|---|---|
| ||||
Posted in reply to Greg Peet | The weird thing is, the first template I ever tried to write (way back in who know's when) was a typedef template. When I finally worked out why it didn't compile, I was stunned to learn that typedef templates were not in the language. eight or so years later and we're still waiting ... It'd be cool if DMC++ could be the first compiler to support it. "Greg Peet" <admin@gregpeet.com> wrote in message news:bdt3go$unp$1@digitaldaemon.com... > I just read article. That would be rather nifty indeed: The ability to generalize the generalized! > > "Matthew Wilson" <matthew@stlsoft.org> wrote in message news:bd04tn$a18$1@digitaldaemon.com... > > Walter > > > > Do you fancy being the first (unless Comeau have beat you to it) to > support > > typedef templates > (http://www.cuj.com/documents/s=7976/cujcexp2012sutter/)? > > This would be a noteworthy achievement! > > > > template< typename T1 > > , typename T2 > > > > > struct typedef_template_class > > { > > }; > > > > template <typename T1> > > typedef typedef_template_class<T1, long> typedef_template_typedef; > > > > void typedef_template_fn() > > { > > typedef_template_class<int, long> a; > > typedef_template_typedef<int> b; > > > > a == b; // Same type, so can assign > > } > > > > VC++ 7.1 recognises the construct but informs the command line that "a typedef template is illegal", which suggests it'll be in the next release > > (whenever that is), so you'll _have_ to do it eventually. Why not do it > now > > and be first? > > > > > > Matthew > > > > > > |
Copyright © 1999-2021 by the D Language Foundation