◆ as_map
| using metal::as_map = typedef metal::apply< metal::lambda<metal::map>, metal::transform<metal::lambda<metal::as_pair>, metal::as_list<val> >> |
#include <metal/map/map.hpp>
Description
Constructs a Map out of any Value that is a specialization of a template class or union whose template parameters are all themselves specializations of template classes or unions that take exactly two template parameters, the first Values of which are all distinct.
Usage
For any Value val
- Returns
- : Map
Example
See Also
- See also
- map
◆ at_key
| using metal::at_key = typedef typename detail::_at_key<seq, key>::type |
#include <metal/map/at_key.hpp>
Description
Retrieves the value associated with some key in a Map.
Usage
- Returns
- : Value
- Semantics:
- If
massociates keysk_1, ..., k, ..., k_nto valuesv_1, ..., v, ..., v_n, thenusing result = v;
Example
See Also
- See also
- map, has_key, insert_key, erase_key
◆ erase_key
| using metal::erase_key = typedef metal::erase<seq, metal::order<seq, key> > |
#include <metal/map/erase_key.hpp>
Description
Removes the entry associated with some key in a Map.
Usage
- Returns
- : Map
- Semantics:
- If
massociates keysk_1, ..., k, ..., k_nto valuesv_1, ..., v, ..., v_n, then
Example
See Also
- See also
- map, has_key, at_key, insert_key
◆ has_key
| using metal::has_key = typedef metal::contains<metal::keys<seq>, key> |
#include <metal/map/has_key.hpp>
Description
Checks whether a Map contains an entry with some key.
Usage
- Returns
- : Number
- Semantics:
- If
mcontains an entry with keyk, thenotherwiseusing result = metal::true_;using result = metal::false_;
Example
See Also
- See also
- map, at_key, insert_key, erase_key
◆ insert_key
| using metal::insert_key = typedef metal::if_< metal::not_<metal::has_key<seq, key> >, metal::append<seq, metal::pair<key, val> >> |
#include <metal/map/insert_key.hpp>
Description
Inserts a new entry in a Map.
Usage
For any Map m and Values k and v
- Precondition
- :
kis not contained inmetal::keys<m>
- Returns
- : Map
- Semantics:
- If
massociates keysk_1, ..., k_nto valuesv_1, ..., v_n, then
Example
See Also
◆ is_map
| using metal::is_map = typedef typename detail::_is_map<val>::type |
#include <metal/map/map.hpp>
Description
Checks whether some Value is a Map.
Usage
For any Value val
- Returns
- : Number
- Semantics:
- If
valis a Map, thenotherwiseusing result = metal::true_;using result = metal::false_;
Example
See Also
◆ keys
| using metal::keys = typedef metal::if_<metal::is_map<seq>, metal::transform<metal::lambda<metal::first>, seq> > |
#include <metal/map/keys.hpp>
Description
Returns a List of keys contained in a Map.
Usage
For any Map m
- Returns
- : List
- Semantics:
- If
massociates keysk_1, ..., k_nto valuesv_1, ..., v_n, thenusing result = metal::list<k_1, ..., k_n>;
Example
See Also
◆ map
| using metal::map = typedef metal::if_<metal::is_map<metal::list<pairs...> >, metal::list<pairs...> > |
◆ order
| using metal::order = typedef metal::at_key<metal::transpose<metal::pair<metal::keys<seq>, metal::indices<seq> >>, key> |
#include <metal/map/order.hpp>
Description
Returns the index of a key in a Map.
Usage
- Returns
- : Number
- Semantics:
- If
mcontains an entry with keykat indexidx, thenusing result = idx;
Example
See Also
- See also
- map
◆ values
| using metal::values = typedef metal::if_<metal::is_map<seq>, metal::transform<metal::lambda<metal::second>, seq> > |
#include <metal/map/values.hpp>
Description
Returns a List of values contained in a Map.
Usage
For any Map m
- Returns
- : List
- Semantics:
- If
massociates keysk_1, ..., k_nto valuesv_1, ..., v_n, thenusing result = metal::list<v_1, ..., v_n>;