collection_adapter::mapped_type (STL/CLR)

字典的值的类型。

    typedef Value mapped_type;

备注

类型是的同义词模板参数 Value,IDictionary 或 IDictionary<Value>中的专用化;为未定义。

示例

// cliext_collection_adapter_mapped_type.cpp 
// compile with: /clr 
#include <cliext/adapter> 
#include <cliext/map> 
 
typedef cliext::map<wchar_t, int> Mymap; 
typedef cliext::collection_adapter< 
    System::Collections::Generic::IDictionary<wchar_t, int>> Mycoll; 
typedef System::Collections::Generic::KeyValuePair<wchar_t,int> Mypair; 
int main() 
    { 
    Mymap d1; 
    d1.insert(Mymap::make_value(L'a', 1)); 
    d1.insert(Mymap::make_value(L'b', 2)); 
    d1.insert(Mymap::make_value(L'c', 3)); 
    Mycoll c1(%d1); 
 
// display contents " [a 1] [b 2] [c 3]" 
    for each (Mypair elem in c1) 
        { 
        Mycoll::key_type key = elem.Key; 
        Mycoll::mapped_type value = elem.Value; 
        System::Console::Write(" [{0} {1}]", key, value); 
        } 
    System::Console::WriteLine(); 
    return (0); 
    } 
 
  

要求

页眉: </cliext 适配器>

命名空间: cliext

请参见

参考

collection_adapter (STL/CLR)

collection_adapter::key_type (STL/CLR)