Template Function Pennylane::Util::static_lookup

Function Documentation

template<auto op, class T, size_t size>
constexpr auto Pennylane::Util::static_lookup(const std::array<std::pair<decltype(op), T>, size> &arr) -> T

For lookup from any array of pair whose first elements are GateOperation.

As Util::lookup can be used in constexpr context, this function is redundant (by the standard). But GCC 9 still does not accept Util::lookup in constexpr some cases.

As we now move to GCC>=10, this function is deprecated.