Re: typedef templates

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Oct 17, 2008 at 08:59:07PM -0500, Harmon Nine wrote:
> Hello.
> 
> I've been combing the web to see if/when C++ typedef templates will be
> supported by gcc (example below), without success.  Does anyone know
> if they are supported in gcc 4.3.2 and, if not, what version is slated
> to support them?
> 

It's now called template alias[1] in C++0x, with a slightly changed
syntax (see below).  According to GCC C++0x page[2], this feature hasn't
been worked on yet.

> Thanks.
> -- Harmon
> 
> Example:
> 
> template< typename X, typename Y >
> class foo {
> };
> 
> // typedef template
> template< typename X >
> typedef foo< X, int > bar;
> 

It's now:

template<typename X>
using bar = foo<X, int>;

> bar< double > var; // same as foo< double, int > var;

HTH

[1] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf
[2] http://gcc.gnu.org/projects/cxx0x.html

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux