Template Function Pennylane::Util::lookup¶
Defined in File ConstantUtil.hpp
Function Documentation¶
-
template<typename Key, typename Value, std::size_t size>
constexpr auto Pennylane::Util::lookup(const std::array<std::pair<Key, Value>, size> &arr, const Key &key) -> Value¶ Lookup key in array of pairs. For a constexpr map-like behavior.
- Template Parameters
Key – Type of keys
Value – Type of values
size – Size of std::array
- Parameters
arr – Array to lookup
key – Key to find