template <bool, ::std::size_t... N>
struct IndexOperatorHelper
Defined at line 322 of file ../../third_party/github.com/google/emboss/src/runtime/cpp/emboss_array_view.h
This mess is needed to expand the parameters_ tuple into individual
arguments to the ElementView constructor. If parameters_ has M elements,
then:
IndexOperatorHelper
<false
>::ConstructElement() calls
IndexOperatorHelper
<false
, 0>::ConstructElement(), which calls
IndexOperatorHelper
<false
, 0, 1>::ConstructElement(), and so on, up to
IndexOperatorHelper
<false
, 0, 1, ..., M-1>::ConstructElement(), which calls
IndexOperatorHelper
<true
, 0, 1, ..., M>::ConstructElement()
That last call will resolve to the second, specialized version of
IndexOperatorHelper. That version's ConstructElement() uses
`std::get
<N
>(parameters)...`, which will be expanded into
`std::get
<
0>(parameters), std::get
<
1>(parameters), std::get
<
2>(parameters),
..., std::get
<M
>(parameters)`.
If there are 0 parameters, then operator[]() will call
IndexOperatorHelper
<true
>::ConstructElement(), which still works --
`std::get
<N
>(parameters)...,` will be replaced by ``.
In C++14, a lot of this can be replaced by std::index_sequence_of, and in
C++17 it can be replaced with std::apply and a lambda.
An alternate solution would be to force each parameterized view to have a
constructor that accepts a tuple, instead of individual parameters, but
that (further) complicates the matrix of constructors for view types.
Public Methods
ElementView ConstructElement (const ::std::tuple<ElementViewParameterTypes...> & parameters, BufferType buffer, ::std::size_t index, ::std::size_t size)
Defined at line 323 of file ../../third_party/github.com/google/emboss/src/runtime/cpp/emboss_array_view.h
ElementView UncheckedConstructElement (const ::std::tuple<ElementViewParameterTypes...> & parameters, BufferType buffer, ::std::size_t index)
Defined at line 331 of file ../../third_party/github.com/google/emboss/src/runtime/cpp/emboss_array_view.h