Template Function Pennylane::Util::reverse_pairs

Function Documentation

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

Swap positions of elements in each pair.

Template Parameters
  • T – Type of first elements

  • U – Type of second elements

  • size – Size of the array

Parameters

arr – Array to reverse

Returns

reversed array