16 #ifndef OPENKALMAN_GET_SINGULAR_COMPONENT_HPP 17 #define OPENKALMAN_GET_SINGULAR_COMPONENT_HPP 24 template<
typename Arg,
typename Indices>
25 constexpr decltype(
auto)
26 get_singular_component_impl(Arg &&arg, const Indices &indices)
28 using Trait = interface::library_interface<std::decay_t<Arg>>;
33 template<
typename Arg, std::size_t...Ix>
34 constexpr decltype(
auto)
35 get_singular_component_impl(Arg &&arg,
std::index_sequence<Ix...>)
37 auto indices = std::array<std::size_t,
sizeof...(Ix)>{
static_cast<decltype(Ix)
>(0)...};
38 return detail::get_singular_component_impl(std::forward<Arg>(arg), indices);
48 template<
typename Arg>
49 constexpr decltype(
auto)
50 get_singular_component(Arg&& arg)
53 return detail::get_singular_component_impl(std::forward<Arg>(arg), std::vector<std::size_t>{
count_indices(arg), 0});
55 return detail::get_singular_component_impl(std::forward<Arg>(arg), std::make_index_sequence<index_count_v<Arg>>{});
61 #endif //OPENKALMAN_GET_SINGULAR_COMPONENT_HPP constexpr auto count_indices(const T &t)
Get the number of indices available to address the components of an indexible object.
Definition: count_indices.hpp:33
Definition: tuple_reverse.hpp:103
decltype(auto) constexpr get_component(Arg &&arg, const Indices &indices)
Get a component of an object at a particular set of indices.
Definition: get_component.hpp:54
constexpr std::size_t dynamic_size
A constant indicating that a size or index is dynamic.
Definition: global-definitions.hpp:33
Definition: basics.hpp:48