Re: [announcement] SYSAPI and SYSSVC for Windows

From: Georg Bauhaus (sb463ba_at_l1-hrz.uni-duisburg.de)
Date: 12/21/03


Date: Sun, 21 Dec 2003 04:24:49 +0000 (UTC)

Ekkehard Morgenstern <ekkehard.morgenstern@onlinehome.de> wrote:
:> 7. formal derived type parameter for generics;
:
: False. Of course you can use derived classes or other types in templates.

I think this is about "type requirements", not uses.

generic
   type D is new T with private;
package P is
...

like

class P [D -> T] is ...

in Eiffel.

AFAIK, you cannot write
template<typename D> class P {
...
and nothing else and then expect items passed for D to be of
a conforming T type.
If I have understood some hints on Bjarne Stroustrup's web pages
this can be achieved in C++ as well, using suitable identifiers
and template computations.



Relevant Pages

  • Re: Java vs C++, A Newbies perspective.
    ... That's what Java Generics do. ... is to write templates for code, which are expanded to different code ... Every pure type constraint on code using C++ templates is ...
    (comp.lang.java.programmer)
  • Re: C# generic containers from a "C++ perspective"
    ... templates can solve but generics do not. ... The single-threaded symbolic optimizer from FFTW would currently be ... The error reporting from generics is much better than templates. ... Or do you want to cast the ints to floats? ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: C# generic containers from a "C++ perspective"
    ... My point is that .NET languages ... already have better ways to solve that problem, independently of generics. ... The error reporting from generics is much better than templates. ... even wrote dozens of painstakingly hand-optimized routines and chose ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Delphi to Visual Studio Conversion Project
    ... Templates are in fact really compiled at the moment they are used. ... what the constraints specify, i.e. you can only cast the type to ... When you compile the generics, all the capabilites are already tested ... compiler checked before use. ...
    (borland.public.delphi.non-technical)
  • Re: C# generic containers from a "C++ perspective"
    ... expressed as an interface implementation. ... Whatever the reason, if there's no interface, C# generics can't do ... templates are better solved by other techniques, ... Last I checked we were comparing C++ templates to .NET generics. ...
    (microsoft.public.dotnet.languages.csharp)