www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript

c++ - Typedef templates ...

↑ ↓ ← "Matthew Wilson" <matthew stlsoft.org> writes:
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
Jun 20 2003
→ "Walter" <walter digitalmars.com> writes:
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

 typedef templates

 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

 and be first?


 Matthew

Jun 20 2003
→ "Wichetael" <wichetael gmx.net> writes:
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

 typedef templates

 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

 and be first?


 Matthew

Jun 21 2003
"Greg Peet" <admin gregpeet.com> writes:
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

 typedef templates

 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

 and be first?


 Matthew

Jul 01 2003
↑ ↓ → "Matthew Wilson" <matthew stlsoft.org> writes:
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

 typedef templates

 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


 (whenever that is), so you'll _have_ to do it eventually. Why not do it

 and be first?


 Matthew


Jul 01 2003