16 #ifndef OPENKALMAN_ACCESS_AT_HPP 17 #define OPENKALMAN_ACCESS_AT_HPP 22 #include "../interfaces/library_interface.hpp" 36 #ifdef __cpp_lib_concepts 37 template<indexible Arg, index_collection_for<Arg> Indices> requires
38 (not empty_object<Arg>) and
40 constexpr values::
value decltype(auto)
42 template<
typename Arg,
typename Indices, std::enable_if_t<
43 index_collection_for<Indices, Arg> and (not empty_object<Arg>) and
45 constexpr decltype(
auto)
50 if (not in_bounds)
throw std::out_of_range {
"One or more indices out of range."};
51 return access(std::forward<Arg>(arg), indices);
59 #ifdef __cpp_lib_concepts 61 (not empty_object<Arg>) and
65 template<
typename Arg,
typename...I, std::enable_if_t<indexible<Arg> and (... and values::index<I>) and
66 (not empty_object<Arg>) and
68 constexpr decltype(
auto)
72 return access_at(std::forward<Arg>(arg), std::array<std::size_t,
sizeof...(I)>{std::move(i)...});
decltype(auto) constexpr access_at(Arg &&arg, const Indices &indices)
Access a component of an indexible object at a given set of indices, with bounds checking.
Definition: access_at.hpp:47
Definition for index_collection_for.
constexpr bool indexible
T is a multidimensional array type.
Definition: indexible.hpp:32
decltype(auto) constexpr get_pattern_collection(T &&t)
Get the coordinates::pattern_collection associated with indexible object T.
Definition: get_pattern_collection.hpp:59
constexpr bool value
T is a fixed or dynamic value that is reducible to a number.
Definition: value.hpp:45
Definition for dimension_size_of_index_is.
The root namespace for OpenKalman.
Definition: basics.hpp:34
decltype(auto) constexpr access(Arg &&arg, const Indices &indices)
Access a component of an indexible object at a given set of indices.
Definition: access.hpp:74
Inclusion file for collections.
Definition for index_dimension_of.
constexpr bool size_compares_with
T and U are sizes that compare in a particular way based on parameter comp.
Definition: size_compares_with.hpp:98
Definition for empty_object.
constexpr detail::dimensions_adaptor dimensions
a std::ranges::range_adaptor_closure for the dimensions of a pattern_collection.
Definition: dimensions.hpp:149
constexpr bool index
T is an index value.
Definition: index.hpp:62
The minimum number of indices needed to access all the components of an object (i.e., the rank or order).
Definition: index_count.hpp:34