Home All Groups Group Topic Archive Search About

CLR class correspondant to std::vector<> or CArray<>?

Author
23 Sep 2006 1:29 PM
Hyun-jik Bae
What is the CLR class correspondant to std::vector<> or CArray<>?
I looked for how to resize object[] (aka array<object> in C++/CLI), but I
cannot find it yet.
Please reply. Thanks in advance.

Hyun-jik Bae

Author
23 Sep 2006 2:33 PM
Lloyd Dupont
What about System.Collection.Generic.List<T> ???

Show quote
"Hyun-jik Bae" <imays_NOSPAM_@paran.com> wrote in message
news:uvq0ORx3GHA.2596@TK2MSFTNGP06.phx.gbl...
> What is the CLR class correspondant to std::vector<> or CArray<>?
> I looked for how to resize object[] (aka array<object> in C++/CLI), but I
> cannot find it yet.
> Please reply. Thanks in advance.
>
> Hyun-jik Bae
>
Author
23 Sep 2006 2:46 PM
Kevin Spencer
The equivalent of an MFC Template is a Generic class. There is no equivalent
for std::vector<>, as arrays are declared by their individual types:

string[] strings = new string[1];
System.Data.DataTable[] tables;

There are generic static methods in the System.Array class that can be used
on arrays of any type, however.

As for the CArray<> Template, I would think that the equivalent would be
System.Collections.ObjectModel.Collection<T>. This is a generic Collection
which has basically the same functionality.

--
HTH,

Kevin Spencer
Microsoft MVP
Software Composer
http://unclechutney.blogspot.com

A watched clock never boils.

Show quote
"Hyun-jik Bae" <imays_NOSPAM_@paran.com> wrote in message
news:uvq0ORx3GHA.2596@TK2MSFTNGP06.phx.gbl...
> What is the CLR class correspondant to std::vector<> or CArray<>?
> I looked for how to resize object[] (aka array<object> in C++/CLI), but I
> cannot find it yet.
> Please reply. Thanks in advance.
>
> Hyun-jik Bae
>

AddThis Social Bookmark Button