Chemical Data Processing Library C++ API - Version 1.4.0
Static Public Member Functions | Static Public Attributes | List of all members
CDPL::Util::MultiMapDefaultValue< ValueType, Allow > Struct Template Reference

Helper supplying the default value returned by Util::MultiMap when a queried key is absent. More...

#include <MultiMap.hpp>

Static Public Member Functions

static const ValueType & get ()
 Returns a const reference to the shared default-constructed value. More...
 

Static Public Attributes

static const ValueType defValue = ValueType()
 The default-constructed value returned for an absent key. More...
 

Detailed Description

template<typename ValueType, bool Allow = true>
struct CDPL::Util::MultiMapDefaultValue< ValueType, Allow >

Helper supplying the default value returned by Util::MultiMap when a queried key is absent.

Template Parameters
ValueTypeThe type of the mapped values.
AllowWhether returning a default value is allowed (true) or shall raise an error (false).

Member Function Documentation

◆ get()

template<typename ValueType , bool Allow = true>
static const ValueType& CDPL::Util::MultiMapDefaultValue< ValueType, Allow >::get ( )
inlinestatic

Returns a const reference to the shared default-constructed value.

Returns
A const reference to the default value.

Member Data Documentation

◆ defValue

template<typename ValueType , bool Allow>
const ValueType CDPL::Util::MultiMapDefaultValue< ValueType, Allow >::defValue = ValueType()
static

The default-constructed value returned for an absent key.


The documentation for this struct was generated from the following file: