Minsky
minsky::ConstMap< K, V > Struct Template Reference

#include <constMap.h>

Inheritance diagram for minsky::ConstMap< K, V >:
Inheritance graph
Collaboration diagram for minsky::ConstMap< K, V >:
Collaboration graph

Public Member Functions

 ConstMap ()
 
template<class T >
 ConstMap (const T &x)
 
template<class T , class U >
 ConstMap (const T &x, const U &y)
 
operator[] (const K &k) const
 

Detailed Description

template<class K, class V>
struct minsky::ConstMap< K, V >

Definition at line 26 of file constMap.h.

Constructor & Destructor Documentation

◆ ConstMap() [1/3]

template<class K, class V>
minsky::ConstMap< K, V >::ConstMap ( )
inline

Definition at line 28 of file constMap.h.

28 {}

◆ ConstMap() [2/3]

template<class K, class V>
template<class T >
minsky::ConstMap< K, V >::ConstMap ( const T &  x)
inlineexplicit

Definition at line 30 of file constMap.h.

30 : std::map<K,V>(x) {}

◆ ConstMap() [3/3]

template<class K, class V>
template<class T , class U >
minsky::ConstMap< K, V >::ConstMap ( const T &  x,
const U &  y 
)
inline

Definition at line 32 of file constMap.h.

32 : std::map<K,V>(x,y) {}

Member Function Documentation

◆ operator[]()

template<class K, class V>
V minsky::ConstMap< K, V >::operator[] ( const K &  k) const
inline

Definition at line 35 of file constMap.h.

35  {
36  typename std::map<K,V>::const_iterator i=this->find(k);
37  if (i!=this->end())
38  return i->second;
39  else
40  return V();
41  }

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