473,761 Members | 9,480 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C# 2.0 Generics

I assume that 2.0 will be rolled out with VS.NET 2004. Does anybody know if
MS is planning to ship an STL package with it?
Nov 15 '05 #1
9 3031
Chuck,

While I can not say for sure, I would doubt it. There are a number of
things that differ between generics and templates, some of which are
implemented in STL which can not be implemented with generics. Because of
this alone, I would think that there wouldn't be something of this nature
distributed when generics is released.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Chuck Bowling" <ch**********@s bcglobal-NO-SPAM.net> wrote in message
news:Oj******** ******@TK2MSFTN GP09.phx.gbl...
I assume that 2.0 will be rolled out with VS.NET 2004. Does anybody know if MS is planning to ship an STL package with it?

Nov 15 '05 #2
n!
> While I can not say for sure, I would doubt it. There are a number of
things that differ between generics and templates, some of which are
implemented in STL which can not be implemented with generics. Because of
this alone, I would think that there wouldn't be something of this nature
distributed when generics is released.


It depends on what you mean you qualify as stl? If he's just referring to
templated collections, then Microsoft are adding generic collection to the
base class library in the System.Collecti ons.Generic namespace. Including
generic versions of Dictionary, List, Queue and Stack. Though the
names\namespace s may change before release, there will be genric
collections.

n!
Nov 15 '05 #3
Chuck,

There is no such a thing like "C# Generics", there are (will be) Generics
for .NET.
That means that .NET Generics are cross-language while STL like Templates
are language specific.
Template instances are compile-time generated/specialized, once emitted to
an assembly the template ceases to exist, that means:
- that you can't instantiate a template from another assembly (MSIL code
library).
- that each language would need his own template source code package.

If you really need STL support, I would suggest you take look at the
upcoming C++ CLI, this version will support both Templates and Generics in
mixed mode assemblies,

Willy.
"Chuck Bowling" <ch**********@s bcglobal-NO-SPAM.net> wrote in message
news:Oj******** ******@TK2MSFTN GP09.phx.gbl...
I assume that 2.0 will be rolled out with VS.NET 2004. Does anybody know if MS is planning to ship an STL package with it?

Nov 15 '05 #4
Thanks for your help Nicholas.

I'm not really interested in the structural differences between templates
and generics. I just want to be able to stick one of my objects into a
generic stack, queue or list without having to rewrite a custom version of
the collection for each object.

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in
message news:OI******** ******@TK2MSFTN GP10.phx.gbl...
Chuck,

While I can not say for sure, I would doubt it. There are a number of
things that differ between generics and templates, some of which are
implemented in STL which can not be implemented with generics. Because of
this alone, I would think that there wouldn't be something of this nature
distributed when generics is released.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Chuck Bowling" <ch**********@s bcglobal-NO-SPAM.net> wrote in message
news:Oj******** ******@TK2MSFTN GP09.phx.gbl...
I assume that 2.0 will be rolled out with VS.NET 2004. Does anybody know

if
MS is planning to ship an STL package with it?


Nov 15 '05 #5

"n!" <nf********@nom ailplease.com> wrote in message
news:OH******** ********@TK2MSF TNGP10.phx.gbl. ..
While I can not say for sure, I would doubt it. There are a number of things that differ between generics and templates, some of which are
implemented in STL which can not be implemented with generics. Because of this alone, I would think that there wouldn't be something of this nature distributed when generics is released.


It depends on what you mean you qualify as stl? If he's just referring to
templated collections, then Microsoft are adding generic collection to the
base class library in the System.Collecti ons.Generic namespace. Including
generic versions of Dictionary, List, Queue and Stack. Though the
names\namespace s may change before release, there will be genric
collections.


Excellent... thanks n!.

This is exactly the information i was looking for...
Nov 15 '05 #6
Thank you for clarifying Willy.

I understand what C++ templates are and how to use them. As far as .NET
goes, all I want is that same functionality. While it's nice to know that
Generics are actually a characteristic of the CLI layer it doesn't get me
any closer to implementing a generic stack to use with my programs... ;)
"Willy Denoyette [MVP]" <wi************ *@pandora.be> wrote in message
news:uL******** ******@TK2MSFTN GP10.phx.gbl...
Chuck,

There is no such a thing like "C# Generics", there are (will be) Generics
for .NET.
That means that .NET Generics are cross-language while STL like Templates
are language specific.
Template instances are compile-time generated/specialized, once emitted to
an assembly the template ceases to exist, that means:
- that you can't instantiate a template from another assembly (MSIL code
library).
- that each language would need his own template source code package.

If you really need STL support, I would suggest you take look at the
upcoming C++ CLI, this version will support both Templates and Generics in
mixed mode assemblies,

Willy.
"Chuck Bowling" <ch**********@s bcglobal-NO-SPAM.net> wrote in message
news:Oj******** ******@TK2MSFTN GP09.phx.gbl...
I assume that 2.0 will be rolled out with VS.NET 2004. Does anybody know

if
MS is planning to ship an STL package with it?


Nov 15 '05 #7
Actually - at the PDC in LA recently the C# team did mention STL.NET which
is probsbly an STL-like extention written with C#2.0 generics, over and
above the simple collections that'll ship with .NET2.0

My 2c
Rob.

"Chuck Bowling" <ch**********@s bcglobal-NO-SPAM.net> wrote in message
news:Oj******** ******@TK2MSFTN GP09.phx.gbl...
I assume that 2.0 will be rolled out with VS.NET 2004. Does anybody know if MS is planning to ship an STL package with it?

Nov 15 '05 #8
Cool... Looks like I'm gonna have to wait for VC 2004 before I lay out some
cash...

"Robert Hooker" <rh*****@rhooke r.com> wrote in message
news:ec******** ******@TK2MSFTN GP11.phx.gbl...
Actually - at the PDC in LA recently the C# team did mention STL.NET which
is probsbly an STL-like extention written with C#2.0 generics, over and
above the simple collections that'll ship with .NET2.0

My 2c
Rob.

"Chuck Bowling" <ch**********@s bcglobal-NO-SPAM.net> wrote in message
news:Oj******** ******@TK2MSFTN GP09.phx.gbl...
I assume that 2.0 will be rolled out with VS.NET 2004. Does anybody know

if
MS is planning to ship an STL package with it?


Nov 15 '05 #9
Robert,
Actually - at the PDC in LA recently the C# team did mention STL.NET which
is probsbly an STL-like extention written with C#2.0 generics, over and
above the simple collections that'll ship with .NET2.0


STL.NET is a C++ template library, written in and for C++, not C#. See
PDC session TLS310 or

http://blogs.gotdotnet.com/branbray/...c-88bfd61b65cf

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 15 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

27
2462
by: Bernardo Heynemann | last post by:
How can I use Generics? How can I use C# 2.0? I already have VS.NET 2003 Enterprise Edition and still can´t use generics... I´m trying to make a generic collection myCollection<vartype> and still no can do... Any info would be great!
2
3104
by: Mr.Tickle | last post by:
So whats the deal here regarding Generics in the 2004 release and templates currently in C++?
23
2550
by: Luc Vaillant | last post by:
I need to initialise a typed parameter depending of its type in a generic class. I have tried to use the C++ template form as follow, but it doesn't work. It seems to be a limitation of generics vs C++ templates. Does anyone knows a workaround to do this ? Thx : public class C<T> { private T myValue;
12
2744
by: Michael S | last post by:
Why do people spend so much time writing complex generic types? for fun? to learn? for use? I think of generics like I do about operator overloading. Great to have as a language-feature, as it defines the language more completely. Great to use.
5
2921
by: anders.forsgren | last post by:
This is a common problem with generics, but I hope someone has found the best way of solving it. I have these classes: "Fruit" which is a baseclass, and "Apple" which is derived. Further I have an "AppleBasket" which is a class that contains a collection of apples. So, some code: class Fruit{ }
11
2501
by: herpers | last post by:
Hello, I probably don't see the obvious, but maybe you can help me out of this mess. The following is my problem: I created two classes NormDistribution and DiscDistribution. Both classes provide an implemation of the operator +. Now I want to write another generic class Plan<DType>, which can
9
5986
by: sloan | last post by:
I'm not the sharpest knife in the drawer, but not a dummy either. I'm looking for a good book which goes over Generics in great detail. and to have as a reference book on my shelf. Personal Experience Only, Please. ...
1
2438
by: Vladimir Shiryaev | last post by:
Hello! Exception handling in generics seems to be a bit inconsistent to me. Imagine, I have "MyOwnException" class derived from "ApplicationException". I also have two classes "ThrowInConstructor" and "ThrowInFoo". First one throws "MyOwnException" in constructor, second one in "Foo()" method. There is a "GenericCatch" generics class able to accept "ThrowInConstructor" and "ThrowInFoo" as type parameter "<T>". There are two methods in...
7
3257
by: SpotNet | last post by:
Hello NewsGroup, Reading up on Generics in the .NET Framework 2.0 using C# 2005 (SP1), I have a question on the application of Generics. Knowingly, Generic classes are contained in the System.Collections.Generic namespace. Literature I have read on this ties generics in with collections, hence articulate their examples as such. That's fine, I understand what is being said. My question is more towards the application and implementation...
13
3837
by: rkausch | last post by:
Hello everyone, I'm writing because I'm frustrated with the implementation of C#'s generics, and need a workaround. I come from a Java background, and am currently writing a portion of an application that needs implementations in both Java and C#. I have the Java side done, and it works fantastic, and the C# side is nearly there. The problem I'm running into has to do with the differences in implementations of Generics between the two...
0
9531
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10115
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9905
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9775
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8780
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6609
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3881
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3456
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2752
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.