typedef with template arguments... 
Author Message
 typedef with template arguments...

Hi...

Is it somehow possible to declare a typedef locally within
a template class, including a template argument? Sorta:

template <class K, class V, ..> class Foo {
  ..

Quote:
}

// Specialized use...
template <class K> class Bar {
private:
  // Normal way to write it...
  Foo<K, int, ..>* foo;
  ..

Quote:
}

Can I make a type alias which includes the K template
argument inside the class - sorta???...

typedef Foo<K,int,..> SpecializedFoo;

???

Regards, Gunni Rode



Sun, 31 Oct 2004 02:30:11 GMT  
 typedef with template arguments...
No: this is not currently possible in C++. I say currently because typedef
templates are one of the new language features that have been proposed for
inclusion in the revised C++ Standard.

--
Jonathan Caves
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.


Quote:
> Hi...

> Is it somehow possible to declare a typedef locally within
> a template class, including a template argument? Sorta:

> template <class K, class V, ..> class Foo {
>   ..
> }

> // Specialized use...
> template <class K> class Bar {
> private:
>   // Normal way to write it...
>   Foo<K, int, ..>* foo;
>   ..
> }

> Can I make a type alias which includes the K template
> argument inside the class - sorta???...

> typedef Foo<K,int,..> SpecializedFoo;

> ???

> Regards, Gunni Rode



Sun, 31 Oct 2004 05:07:07 GMT  
 typedef with template arguments...


Quote:
> No: this is not currently possible in C++. I say currently because typedef
> templates are one of the new language features that have been proposed for
> inclusion in the revised C++ Standard.

This is probably the single best language feature being considered IMO.  I
can't wait for it to be implemented.


Sun, 31 Oct 2004 05:18:45 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Template parameter conflicts with typedef in template argument

2. template arguments used within a template function - how?

3. explicit template arguments to function templates

4. typedef name/argument [Is this legal C?]

5. VC 7.1 seems to ignore typedef in template

6. VC++ 7.0 bug with typedef & template instantiation

7. typedef with template classes

8. How to combine typedef with template

9. templates, ::, and typedef

10. vector template and typedef

11. comp error: typedef + template

12. typedef to a template class

 

 
Powered by phpBB® Forum Software