Re: What doe sthis line mean?
- From: Arnaud Meurgues <news.arnaud@xxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 24 Mar 2006 16:55:41 +0100
Daniel wrote:
m_verts = new GraphicsBuffer<PositionColored>( 3 );
Can someone explain what the < > bit id for? i have never seen this sue of
the < symbol and dont know what it does. Thanks.
This is a generic class (like template classes in C++). This is a way to
build a set of classes parameterized by a type.
The most common use of these kinds of classes are containers. Instead of
using the same container class for storing Apples and Potatoes, you can
define a generic container that can manipulate Apples or Potatoes,
according to a type parameter : Container<Apple> will store Apples and
Container<Potatoes> will store Potatoes.
This allow to detect errors (like inserting a Potatoe into an Apples
container) at compilation time instead of getting an error at runtime.
You can find a more detailed explanation there :
http://www.developer.com/net/net/article.php/2229511
--
Arnaud
.
- References:
- What doe sthis line mean?
- From: Daniel
- What doe sthis line mean?
- Prev by Date: Mouse / Keyboard Events when using SimpleFramwork on a windows form
- Next by Date: Re: Debugging Shader programs
- Previous by thread: What doe sthis line mean?
- Next by thread: Mouse / Keyboard Events when using SimpleFramwork on a windows form
- Index(es):
Relevant Pages
|