×
Namespaces

Variants
Actions

IMap与std::map类型转换

From Nokia Developer Wiki
Jump to: navigation, search
SignpostIcon XAML 40.png
WP Metro Icon WP8.png
SignpostIcon Code 52.png
Article Metadata
Compatibility
Platform(s):
Windows Phone 8
Article
Created: Vincent-DEVDIV (30 Jan 2013)
Last edited: hamishwillee (11 Sep 2013)
std::map<int, String^> map1;
map1.insert(std::pair<int, String^>(1, "DevDiver"));
map1.insert(std::pair<int, String^>(2, "DEVDIV"));
IMap<int, String^>^ map2 = ref new Map<int, String^>(map1);
 
std::map<int,String^> map3;
IIterator<IKeyValuePair<int,String^>^>^ iter = map2->First();
do{
map3.insert(std::pair<int,String^>(iter->Current->Key,iter->Current->Value));
}while (iter->MoveNext());
This page was last modified on 11 September 2013, at 06:54.
105 page views in the last 30 days.