Topic: overloading templates was Nobody is interested in questions on template? Why?


Author: wagnermi@Informatik.TU-Muenchen.DE (Wagner Michael)
Date: Thu, 26 Nov 1992 08:54:57 GMT
Raw View
In article <24300@alice.att.com>, bs@alice.att.com (Bjarne Stroustrup) writes:
|>
|>
|>
|> 1. Recursive template? Are you sure?
|> ---> yes, you can have recursive templates. Yes, I'm sure.
|>
|> 2. Can we refer to A<T, S> when we are constructing A<S, T>?
|> ---> Yes, unless T is the same type as S A<S,T> is unrelated to<T,S>
|>
|> 3. Can A<S> and A<S, T> coexist?
|> ---> No, you can't overload class template names.

OH NO, I was waiting for this (3) to happen !
3 + 1 would help me do some CLOS-like things in C++, e.g. generic methods for a
whole bunch of argument types with minimal source code involved.
Bad News, Bad News !

BTW, when templates are not expanded by a preprocessr to individual classes but
directly handled by the compiler, is true generic code generated or some
splitting performed (a la SELF) ?

--
 Mike

-----------------------------------------------------------------------------
Michael Wagner                   internet: wagnermi@informatik.tu-muenchen.de

Technische Universitaet Muenchen (TUM)                      Postfach 20 24 20
Institut fuer Informatik                                   D-W8000 Muenchen 2
Lehrstuhl fuer verteilte Systeme                         Tel: 089-45 05 52-32
Professor Schlichter                                     Fax: 089-45 05 52-22
-----------------------------------------------------------------------------
  < a catchy phrase and some fancy artwork here>