what is the meaning of STL.NET

  • Thread starter Thread starter KevinLee
  • Start date Start date
K

KevinLee

I found that the STL.NET published with VS Beta2, but what is the meaning of
STL.NET.

Is it just a simple wrapper to replace the old std stl?
I can find nothing new but the keyword 'Generate' to replace 'Template',and
the keyword 'gcnew' to replace 'new'.

So, could you tell me what's the meaning of STL.NET.
I really think it is still very ugly.
 
KevinLee a écrit :
I found that the STL.NET published with VS Beta2, but what is the meaningof
STL.NET.
Is it just a simple wrapper to replace the old std stl?
Not exactly. It's a version of the STL that is compatible with .NET
CLI/C++ code : More precisely, STL.NET container can contains gc
objects : Hence you can do:
map<String^, MyObject^> MyMap; for example.

See
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvs05/html/stl-netprimer.asp
for a presentation on the subject.
I can find nothing new but the keyword 'Generate' to replace 'Template',and
the keyword 'gcnew' to replace 'new'.

So, could you tell me what's the meaning of STL.NET.
I really think it is still very ugly.
What do you mean by "still" very ugly? Why?


Arnaud
MVP - VC
 
KevinLee said:
I found that the STL.NET published with VS Beta2, but what is the
meaning of STL.NET.

Is it just a simple wrapper to replace the old std stl?

It is not a simple wrapper, and it is not a replacement, it is an
addition.

Visual C++ supports to different C++ languages:

- ISO Standard C++, including the C++ standard library
- ECMA C++/CLR, with STL.NET

These are two different languages, that just looks similar (and with
similar names).

I can find nothing new but the keyword 'Generate' to replace
'Template',and the keyword 'gcnew' to replace 'new'.

C++/CLR also has a 'generic' keyword, which is totally different from
'template'. It's another language, just like Java or C#.
So, could you tell me what's the meaning of STL.NET.
I really think it is still very ugly.

To get stl support for managed C++, just like the C++ standrad library
supports it for native C++.


Bo Persson
 
KevinLee said:
Is it just a simple wrapper to replace the old std stl?

It's a wrapper around .NET containers. The idea is that C++ programmers
are very used to the STL and its syntax. We find it easy and familiar.
STL.NET allows us to access managed containers with a close-to-STL syntax.
I really think it is still very ugly.

What's ugly, STL or .NET? If you find STL ugly, don't use STL.NET, use
..NET containers directly. If you find MC++ ugly, learn the new C++/CLI
syntax.

Tom
 
To add to what others have said, note that STL.NET (or STL/CLI) is not a CLI
wrapper around STL, it's a full implementation in managed code that uses
generics and templates.
 
Back
Top