template<typename Key, typename Value>
class smtrat::VariantMap< Key, Value >
This class is a specialization of std::map
where the keys are of arbitrary type and the values are of type boost::variant
.
There is no point in using this class if the values are no variants. Most probably, it would not compile anyway and fail to do so with a large bunch of compiler errors. To prevent this, we assert that the value type is indeed a boost::variant
.
Additionally to the standard methods inherited from std::map
, it implements three additional methods:
assertType<T>(key, out)
: Asserts that there is a value for the given key and that it has the type T
. If this is not the case, an appropriate error is written to out
.
has<T>(key)
: Checks if there is a value for the given key and if this value has the type T
.
get<T>(key)
: Returns the value for the given key as type T
.
- Template Parameters
-
Key | Type of keys. |
Value | Type of values. |
Definition at line 55 of file VariantMap.h.
template<typename Key , typename Value >
template<typename T , typename Output >
Asserts that the value that is associated with the given key has a specified type.
The assertion holds, if
- there is a value in the map for the given key and
- the stored value has the type
T
. - Template Parameters
-
T | Type that the value should have. |
Output | Type of out. |
- Parameters
-
key | Key. |
out | Functor returning an output stream. |
Definition at line 90 of file VariantMap.h.