std::get() is a function template to get element at the given index. It accepts index value as non-type template argument and an array whose length is constexpr value as input and does the bound checking at compile time. For example:

std::array<int, 5> items{1, 2, 3, 4, 5};
 
std::cout << std::get<4>(items) << '\n'; // should compile
std::cout << std::get<5>(items) << '\n'; // should raise compile error

What actually this function does it, it does a static_assert on index and length of given array at compile time. Something like below:

template <std::size_t index, typename T, std::size_t U>
const T &get_element(const std::array<T, U> &arr)
{
    static_assert(index < arr.size());
    return arr[index];
}
 
std::cout << get_element<4>(items) << '\n';

References

  1. https://www.learncpp.com/cpp-tutorial/stdarray-length-and-indexing/