Template Function Pennylane::Util::lookup

Function Documentation

template<typename Key, typename Value, 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