Re: Collections Improvement

From: UAError (null_at_null.null)
Date: 06/08/04


Date: Tue, 08 Jun 2004 11:29:04 -0400


"Disillusioned_01" <none@none.com> wrote:

>Anyboby aware of any MS initiative to provide an c++ STL
>stle Lib withc# Generics coming in .net 2.0!?(I guessed it)
>

There will be a generics version of the collections in the

System.Collections.Generics

namespace ,that much was suggested in Juval Lowy's article
"An Introduction to C# Generics" from August 2003

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/csharp_generics.asp

but nothing approaching the STL.

Generic Containers should perform better and are inherently
typesafe (no casting required).

You have to keep in mind that generics are not templates. If
I understand it correctly generics are not a feature of the
implementation language but of the IL - it would follow that
the generic data type is only expanded once the IL is
compiled to native code - delaying the potential bloat as
long as possible.

Generics only allow types as template parameters - so some
of the meta-programming stunts that Alexandrescu pulled in
his LOKI library just aren't possible with generics.

Meanwhile some people having been using this 'freeware
template-based code generator'

http://www.ericjsmith.net/codesmith/

to fill their needs.

Anyway read the above article and judge for yourself.



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: Performance bei Vergleichoperationen
    ... C++ Templates eben mit den Generics nicht mithalten können, ... Templates sind IMHO bei Definiton das mächtigere Tool, ... zum Beispiel Laufzeit-Fehler ergeben - was C# in diesen Szenarien ...
    (microsoft.public.de.german.entwickler.dotnet.csharp)
  • 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)