473,396 Members | 1,998 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

C++/CLI equivalent to STL vector and deque?

Ian
I would like to port my class library written in standard C++ with STL to
C++/CLI. Several of my classes inherit from std::vector or std::deque.
From what I can see, dot.net does not offer equivalent classes. Is this
really the case or have I missed an entire section of the dot.net
documentation? One could argue ArrayList offers a poor substitute to
std::vector.

I understand an effort was made to port STL to C++/CLI and this would
represent a significant addition to C++/CLI. What is the current status of
STL in C++/CLI?
Thanks,

Ian
Oct 13 '06 #1
9 3651

Ian wrote:
I would like to port my class library written in standard C++ with STL to
C++/CLI. Several of my classes inherit from std::vector or std::deque.
From what I can see, dot.net does not offer equivalent classes. Is this
really the case or have I missed an entire section of the dot.net
documentation? One could argue ArrayList offers a poor substitute to
std::vector.
With .NET 2.0, you've got generics collections :
System::Collections::Generics::List<Tis quite close to std::vector.

On the other hand, there is no real equivalent to deque. The .NET
Collection namespaces are still quite poor when compared to the STL
(they certainly miss the flexibility offered by the container /
algorithm separation of the STL).
Still, some progress has been made in the last version. For example,
complexity for various operations is at least specified for the
generics collections....
>
I understand an effort was made to port STL to C++/CLI and this would
represent a significant addition to C++/CLI. What is the current status of
STL in C++/CLI?
There is a beta version of the so-called "STL.NET" in the last
Community Technical Preview of Orcas.... I don't know wether we will
see a release version of it before Orcas is released...

Arnaud
MVP - VC

Oct 13 '06 #2

Ian wrote:
I would like to port my class library written in standard C++ with STL to
C++/CLI. Several of my classes inherit from std::vector or std::deque.
From what I can see, dot.net does not offer equivalent classes. Is this
really the case or have I missed an entire section of the dot.net
documentation? One could argue ArrayList offers a poor substitute to
std::vector.
..NET collections are indeed a joke compared to STL, but there are some
3rd party libraries that look much better. For instance, look for Power
Collections.

Oct 13 '06 #3

Ian wrote:
I would like to port my class library written in standard C++ with STL to
C++/CLI. Several of my classes inherit from std::vector or std::deque.
From what I can see, dot.net does not offer equivalent classes. Is this
really the case or have I missed an entire section of the dot.net
documentation? One could argue ArrayList offers a poor substitute to
std::vector.
..NET collections are indeed a joke compared to STL, but there are some
3rd party libraries that look much better. For instance, look for Power
Collections.

Oct 13 '06 #4
Nemanja Trifunovic wrote:
Ian wrote:
>I would like to port my class library written in standard C++ with
STL to C++/CLI. Several of my classes inherit from std::vector or
std::deque. From what I can see, dot.net does not offer equivalent
classes. Is this really the case or have I missed an entire
section of the dot.net documentation? One could argue ArrayList
offers a poor substitute to std::vector.

.NET collections are indeed a joke compared to STL, but there are some
3rd party libraries that look much better. For instance, look for
Power Collections.
also check out the C5 collections library (google for it - you'll find it).

-cd
Oct 13 '06 #5
Ian

"Nemanja Trifunovic" <nt*********@hotmail.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
>
Ian wrote:
>I would like to port my class library written in standard C++ with STL to
C++/CLI. Several of my classes inherit from std::vector or std::deque.
From what I can see, dot.net does not offer equivalent classes. Is this
really the case or have I missed an entire section of the dot.net
documentation? One could argue ArrayList offers a poor substitute to
std::vector.

.NET collections are indeed a joke compared to STL, but there are some
3rd party libraries that look much better. For instance, look for Power
Collections.
Hello Nemanja,

Thanks for the recommendation. The question is, how long can we expect
these libraries to be supported? I have already invested a considerable
amount of time in STL with the expectation that MS would continue to support
it. It seems I was wrong. If I make the switch to Power Collections, given
that there is no one group that stands to make money off of it, in your
opinion, is this something that you expect will be around for some time to
come?

Thanks again,

Ian
Oct 13 '06 #6
Ian

"Carl Daniel [VC++ MVP]" <cp*****************************@mvps.org.nospam >
wrote in message news:uW**************@TK2MSFTNGP02.phx.gbl...
Nemanja Trifunovic wrote:
>Ian wrote:
>>I would like to port my class library written in standard C++ with
STL to C++/CLI. Several of my classes inherit from std::vector or
std::deque. From what I can see, dot.net does not offer equivalent
classes. Is this really the case or have I missed an entire
section of the dot.net documentation? One could argue ArrayList

Hello Carl,

My question is the same as that posted for Nemanja. These collections look
interesting but the question is, in your opinion, how long will they be
supported?

Ian
Oct 13 '06 #7
Ian wrote:
"Nemanja Trifunovic" <nt*********@hotmail.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
>>Ian wrote:
>>>I would like to port my class library written in standard C++ with STL to
C++/CLI. Several of my classes inherit from std::vector or std::deque.
From what I can see, dot.net does not offer equivalent classes. Is this
really the case or have I missed an entire section of the dot.net
documentation? One could argue ArrayList offers a poor substitute to
std::vector.

.NET collections are indeed a joke compared to STL, but there are some
3rd party libraries that look much better. For instance, look for Power
Collections.


Hello Nemanja,

Thanks for the recommendation. The question is, how long can we expect
these libraries to be supported? I have already invested a considerable
amount of time in STL with the expectation that MS would continue to support
it. It seems I was wrong. If I make the switch to Power Collections, given
that there is no one group that stands to make money off of it, in your
opinion, is this something that you expect will be around for some time to
come?

Thanks again,

Ian
Ian:

STL is still, and always will be, supported for unmmanaged types. And I
am sure that if MS ever gets stl.net working for managed types they will
continue to support that also.

I too would hesitate to commit myself to a 3rd party collection library,
but then I am hesitating to move to .net also!

David Wilkinson


Oct 13 '06 #8
"Ian" <Ia*******@yahXX.comwrote in message
news:3L********************@wagner.videotron.net.. .
>
"Carl Daniel [VC++ MVP]" <cp*****************************@mvps.org.nospam >
wrote in message news:uW**************@TK2MSFTNGP02.phx.gbl...
>Nemanja Trifunovic wrote:
>>Ian wrote:
I would like to port my class library written in standard C++ with
STL to C++/CLI. Several of my classes inherit from std::vector or
std::deque. From what I can see, dot.net does not offer equivalent
classes. Is this really the case or have I missed an entire
section of the dot.net documentation? One could argue ArrayList


Hello Carl,

My question is the same as that posted for Nemanja. These collections
look interesting but the question is, in your opinion, how long will they
be supported?
Assuming that STL.NET makes it into Orcas (the next version of Visual
Studio - and I fiully expect that it will make it in), then it'll be
supported by MSFT for years and years and years.

As for PowerCollections and C5, they're not officially supported by anyone,
but I suspect that both will have a viable user community that will
promulgate fixes as bugs are found. These are both open source projects, so
you can always choose to support them yourself, assuming you have the
resources. I'm not sure about C5, but I know that PowerCollections comes
with an extensive unit test suite (something like 700 tests) and appears to
be of good quality. You can find more extensive documentation for
PowerCollections in Tod Golding's book "Professional .NET 2.0 Generics" from
Wrox.

That said, I haven't adopted either of those libraries for my own work -
holding out instead for STL.NET and writing/adapting what I need in the
meantime.

-cd
Oct 13 '06 #9
David Wilkinson wrote:
I too would hesitate to commit myself to a 3rd party collection library,
but then I am hesitating to move to .net also!
I would probably be more concerned about WinForms itself. No question
that it will be supported for a while, but after .NET 3.0 and Orcas, it
will be an old, unwanted API, which will only be maintained to support
backwards compatibility. WPF will replace it, and at one moment it will
be highly desirable to migrate GUI to that API. The moment will come
when the GUI that we develop today will be an unwanted baggage. I don't
know, but I feel quite hesitant about starting to design large WinForms
applications, unless I wrap every form very carefully, to detach them
from the actual framework as far as possible. I have to create my own
controls, and I have the feeling I'll soon have to redo that work as
well. I don't worry about particular products, but the reusable
portions. I do have portions that I've been reusing in every project for
the past few years. At one moment it would be nice to settle down with a
..NET windowing API that we can call permanent and we can build around
over the years. I feel so uncertain when programming in WinForms, as I
have no idea how much of that code will be reusable directly in WPF, and
it gives me a sour feeling. I don't worry too much yet, as 99.9% of the
code I use today is unmanaged.

Tom
Oct 16 '06 #10

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

Similar topics

2
by: lf | last post by:
If I want to get a pointer to the initial data element in a vector<double>, does it make any difference whether I use (for vector<double> v) double* pVec1 = &v; or double* pVec2 = &v.front(); ...
29
by: Hagen | last post by:
Hello, in a recent thread "speed of vector vs array" I read about the problem of the slow acces by addressing vector elements by indexing, unfortunately I see no workaround in my case. My...
34
by: Adam Hartshorne | last post by:
Hi All, I have the following problem, and I would be extremely grateful if somebody would be kind enough to suggest an efficient solution to it. I create an instance of a Class A, and...
5
by: yancheng.cheok | last post by:
after reading http://www.codeproject.com/vcpp/stl/vector_vs_deque.asp, i realize that deque has its own speed advantage over vector in all the aspect (except for memory deallocation). does it...
5
by: toton | last post by:
Hi, I want to append one vector after another. so like, vector<intv1; ///put some elements to v2. I have a second vector vector<intv2; ///it has some elements. Now I do v1.reserve(v1.size()...
15
by: Juha Nieminen | last post by:
I'm sure this is not a new idea, but I have never heard about it before. I'm wondering if this could work: Assume that you have a common base class and a bunch of classes derived from it, and...
8
by: t | last post by:
The stack container adaptor uses deque as its default underlying sequential container. I don't understand why since we only add elements and remove elements from one side of a stack. Why isn't...
3
by: escholtz | last post by:
Dear All, I am trying to use the STL-'find' function to find all the locations of a specific repeating element in an unsorted vector/deque. I want the original vector/deque to stay unsorted. It...
1
by: subramanian100in | last post by:
Suppose I have vector<intvi; deque<intdi; list<intli; Suppose all of these containers have some elements. Suppose 'v_iter' is an iterator pointing to some element in 'vi'. Suppose 'v_beg'...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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,...

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.