Udostępnij za pośrednictwem


collection_adapter::mapped_type (STL/CLR)

The type of a dictionary value.

    typedef Value mapped_type;

Remarks

The type is a synonym for the template parameter Value, in a specialization for IDictionary or IDictionary<Value>; otherwise it is not defined.

Example

// 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); 
    } 
 
 [a 1] [b 2] [c 3]

Requirements

Header: <cliext/adapter>

Namespace: cliext

See Also

Reference

collection_adapter (STL/CLR)

collection_adapter::key_type (STL/CLR)