#include <partial-mapping.h>
Collaboration diagram for partial_mapping:
Public Types | |
typedef T1 | argument_type |
typedef T2 | result_type |
typedef map_table_type::iterator | iterator |
typedef map_table_type::const_iterator | const_iterator |
Public Methods | |
partial_mapping (const T2 &def=T2()) | |
const T2 & | set_default (const T2 &t2) |
int | size_of_dom () const |
bool | defined (const T1 &t1) const |
bool | undefined (const T1 &t1) const |
const T2 & | default_value () const |
const_iterator | begin () const |
const_iterator | end () const |
T2 & | operator[] (T1 const &t1) |
T2 const & | operator() (T1 const &t1) const |
partial_mapping<T1,T2> is a model of Adaptable Unary Function.
Template parameters:
hash<T1>
is defined. equal_to<T1>
is defined.If pm is of type partial_mapping<T1,T2>, t1 of type T1 and t2 of type T2, then
statement of the form: t2 = pm[t1] would mean that the value of pm(t1) gets undefined if pm.undefined(t1) == true before! This is prohibited by returning a proxy in operator[] which only can be assigned to (i.e. occur only on the left side of an assignment).
Test directory for partial_mapping
Definition at line 58 of file partial-mapping.h.
|
Definition at line 61 of file partial-mapping.h. |
|
Definition at line 62 of file partial-mapping.h. |
|
Definition at line 105 of file partial-mapping.h. |
|
Definition at line 106 of file partial-mapping.h. Referenced by begin, end, and operator(). |
|
Definition at line 91 of file partial-mapping.h. |
|
Definition at line 93 of file partial-mapping.h. |
|
Definition at line 97 of file partial-mapping.h. |
|
Definition at line 98 of file partial-mapping.h. |
|
Definition at line 99 of file partial-mapping.h. Referenced by operator[]. |
|
Definition at line 101 of file partial-mapping.h. |
|
Definition at line 109 of file partial-mapping.h. References const_iterator. |
|
Definition at line 110 of file partial-mapping.h. References const_iterator. |
|
Definition at line 115 of file partial-mapping.h. References undefined. |
|
Definition at line 120 of file partial-mapping.h. References const_iterator. |