Topic: Why no template<class T> { .... } ?


Author: Francis Glassborow <francis@robinton.demon.co.uk>
Date: 2000/02/18
Raw View
In article <zdv176.950800463@zam475>, B.Mohr <zdv176@zam475.zam.kfa-
juelich.de> writes
>Is there a reason for this or is this an oversight in the standard?

perhaps it did not seem to be a good idea, perhaps no one thought of it,
perhaps we thought programmer should have to learn to use their
development environments :)



Francis Glassborow      Journal Editor, Association of C & C++ Users
64 Southfield Rd
Oxford OX4 1PA          +44(0)1865 246490
All opinions are mine and do not represent those of any organisation

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]






Author: zdv176@zam475.zam.kfa-juelich.de (B.Mohr)
Date: 2000/02/18
Raw View
Hi,

can anyone explain to me why

  template<class T> {
     void func1(T) { ... }
     void func2(T) { ... }
     void func3(T) { ... }
     ...
  }

isn't allowed in Standard C++? If I have to declare more than one thing
extern "C", I can do this by "grouping" them with { } and write extern "C"
just once; so why does it not work for templates?

It looks like I have to repeat template<class T> over and over.

Is there a reason for this or is this an oversight in the standard?

Bernd
--
Bernd Mohr / Research Centre Juelich, ZAM, Germany / B.Mohr@fz-juelich.de

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]