Template Function Pennylane::Util::getElementIndexInVector¶
Defined in File Util.hpp
Function Documentation¶
-
template<typename T>
inline std::size_t Pennylane::Util::getElementIndexInVector(const std::vector<T> &vec, const T &element)¶ Get the index of an element in a vector.
- Template Parameters
T – Data type.
- Parameters
vec – Vector to check.
element – Element to find.
- Throws
Error – if the element is not found in the vector.
- Returns
std::size_t Index of the found element.
api/function_Util_8hpp_1aa245df31f81e87a3f1f7bde93954bcab
Download Python script
Download Notebook
View on GitHub