pachanga wrote:
The funny thing about garbage collector is that that was the main
issues about C# vs C++..
That is wrong (in other words a hoax). For example here is what has been
written in TC++PL on this matter (since 1997):
"C.9.1 Automatic Garbage Collection
When this regular approach isn’t sufficient, the programmer might use a
memory manager that finds unreferenced objects and reclaims their memory
in which to store new objects. This is usually called automatic garbage
collection, or simply garbage collection. Naturally, such a memory
manager is called a garbage collector.
The fundamental idea of garbage collection is that an object that is no
longer referred to in a program will not be accessed again, so its
memory can be safely reused for some new object. For example:
void f()
{
int* p = new int;
p = 0;
char* q = new char;
}
Here, the assignment p=0 makes the int unreferenced so that its memory
can be used for some other new object. Thus, the char might be allocated
in the same memory as the int so that q holds the value that p
originally had.
The standard does not require that an implementation supply a garbage
collector, but garbage collectors are increasingly used for C++ in areas
where their costs compare favorably to those of manual management of
free store. When comparing costs, consider the run time, memory usage,
reliability, portability, monetary cost of programming, monetary cost of
a garbage collector, and predictability of performance."
That aside, .NET's garbage collector (and more generally the CLI's), is
available to all the languages using it and not of C#, so you can write
C++ .NET garbage collected applications since VS 2002.
In other words the GC is not part of C#, but of CLI.
Also in .NET 2.0 and afterwards (and with the upcoming C++/CLI), C++
becomes the systems programming language of .NET (and CLI).
Some references mentioning why C++ becomes the systems programming
language of .NET and why it is better:
http://microsoft.sitestream.com/Tech...V333_Sutte.ppt http://www.accu.org/conference/prese...keynote%29.pdf
Also check this new article:
http://msdn.microsoft.com/msdnmag/is...s/default.aspx
And a page of mine:
http://www23.brinkster.com/noicys/cppcli.htm
--
Ioannis Vranos
http://www23.brinkster.com/noicys