#include <py2cpp/dict.hpp>
template<typename Key, typename T>
dict class
Template parameters | |
---|---|
Key | |
T |
Public types
- using value_type = std::pair<const Key, T>
- using key_type = Key
Constructors, destructors, conversion operators
Public functions
- auto contains(const Key& key) const -> bool -> auto
- auto get(const Key& key, const T& default_value) -> T -> auto
- auto begin() > -> auto
- auto end() > -> auto
- auto items() -> Base & -> auto
- auto items() const -> const Base & -> auto
- auto copy() const -> Self -> auto
- auto operator[](const Key& k) const -> const T & -> auto
- auto at(const Key& k) const -> const T & -> auto
- auto operator[](const Key& k) -> T & -> auto
- auto operator=(const Self&) -> Self & -> auto deleted
- auto operator=(Self&&) noexcept -> dict & -> auto defaulted
Function documentation
template<typename Key, typename T>
py:: dict<Key, T>:: dict(std::initializer_list<value_ type> init)
Construct a new dict object.
Parameters | |
---|---|
init in |
template<typename Key, typename T>
auto py:: dict<Key, T>:: contains(const Key& key) const -> bool
Parameters | |
---|---|
key in | |
Returns | true |
template<typename Key, typename T>
auto py:: dict<Key, T>:: get(const Key& key,
const T& default_value) -> T
Parameters | |
---|---|
key in | |
default_value in | |
Returns | T |
template<typename Key, typename T>
auto py:: dict<Key, T>:: begin() >
Returns | auto |
---|
template<typename Key, typename T>
auto py:: dict<Key, T>:: end() >
Returns | auto |
---|
template<typename Key, typename T>
auto py:: dict<Key, T>:: items() -> Base &
Returns | std::unordered_map<Key, T>& |
---|
template<typename Key, typename T>
auto py:: dict<Key, T>:: items() const -> const Base &
Returns | const std::unordered_map<Key, T>& |
---|
template<typename Key, typename T>
auto py:: dict<Key, T>:: copy() const -> Self
Returns | _Self |
---|
template<typename Key, typename T>
auto py:: dict<Key, T>:: operator[](const Key& k) const -> const T &
Returns | _Self& |
---|
template<typename Key, typename T>
auto py:: dict<Key, T>:: at(const Key& k) const -> const T &
Returns | _Self& |
---|
template<typename Key, typename T>
auto py:: dict<Key, T>:: operator[](const Key& k) -> T &
Returns | _Self& |
---|