Visual C++ Express and STL

  • Thread starter Thread starter None
  • Start date Start date
N

None

Hello

Does anyone know if STL containers work with Visual C++ Express?

For example how would one correctly declare a map with a System::String as
a key and another System::String as a value? The following does not work:

std::map<System::String^, System::String^) amap;

I believe gcnew can not be used with 'unmanaged types'.

Thanks very much in advance.
 
None said:
Hello

Does anyone know if STL containers work with Visual C++ Express?

Yes it does.
For example how would one correctly declare a map with a
System::String as a key and another System::String as a value? The
following does not work:

std::map<System::String^, System::String^) amap;

You can't. Use the System::Collections::Generic::Dictionary<K,V> generic
collection instead. "STL.NET", which hasn't been released, would let you do
what you want.

-cd
 
"Carl Daniel [VC++ MVP]"
You can't. Use the System::Collections::Generic::Dictionary<K,V>
generic collection instead. "STL.NET", which hasn't been released,
would let you do what you want.

Once again, thank you very much, Carl.

Take care
 
Back
Top