template<typename Key, typename T>
py::dict class

Public types

using value_type = std::pair<const Key, T>
using key_type = Key

Constructors, destructors, conversion operators

dict()
Construct a new dict object.
dict(std::initializer_list<value_type> init)
Construct a new dict object.
dict(dict<Key, T>&&) defaulted noexcept
Move Constructor (default)
~dict() defaulted
dict(const dict<Key, T>&) defaulted
Construct a new dict object.

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 _1, typename T _2>
py::dict<_1, _2>::dict(std::initializer_list<value_type> init)

Construct a new dict object.

Parameters
init in

template<typename Key _1, typename T _2>
py::dict<_1, _2>::dict(const dict<Key, T>&) defaulted

Construct a new dict object.

Copy through explicitly the public copy() function!!!

template<typename Key _1, typename T _2>
auto py::dict<_1, _2>::contains(const Key& key) const -> bool

Parameters
key in
Returns true

template<typename Key _1, typename T _2>
auto py::dict<_1, _2>::get(const Key& key, const T& default_value) -> T

Parameters
key in
default_value in
Returns T

template<typename Key _1, typename T _2>
auto py::dict<_1, _2>::begin() >

Returns auto

template<typename Key _1, typename T _2>
auto py::dict<_1, _2>::end() >

Returns auto

template<typename Key _1, typename T _2>
auto py::dict<_1, _2>::items() -> Base &

Returns std::unordered_map<Key, T>&

template<typename Key _1, typename T _2>
auto py::dict<_1, _2>::items() const -> const Base &

Returns const std::unordered_map<Key, T>&

template<typename Key _1, typename T _2>
auto py::dict<_1, _2>::copy() const -> Self

Returns _Self

template<typename Key _1, typename T _2>
auto py::dict<_1, _2>::operator[](const Key& k) const -> const T &

Returns _Self&

template<typename Key _1, typename T _2>
auto py::dict<_1, _2>::at(const Key& k) const -> const T &

Returns _Self&

template<typename Key _1, typename T _2>
auto py::dict<_1, _2>::operator[](const Key& k) -> T &

Returns _Self&

template<typename Key _1, typename T _2>
auto py::dict<_1, _2>::operator=(const Self&) -> Self & deleted

Returns _Self&

template<typename Key _1, typename T _2>
auto py::dict<_1, _2>::operator=(Self&&) noexcept -> dict & defaulted

Returns _Self&