|
Barretenberg
The ZK-SNARK library at the core of Aztec
|
A template class for a reference array. Behaves as if std::array<T&, N> was possible. More...
#include <ref_array.hpp>
Classes | |
| class | iterator |
| Nested iterator class for RefArray, based on indexing into the pointer array. Provides semantics similar to what would be expected if std::array<T&, N> was possible. More... | |
Public Member Functions | |
| RefArray ()=default | |
| RefArray (const std::array< T *, N > &ptr_array) | |
| RefArray (std::array< T, N > &arr) | |
| template<typename... Ts> | |
| RefArray (T &first, Ts &... refs) | |
| T & | operator[] (std::size_t idx) const |
| std::array< T, N > | get_copy () |
| Get a copy of the underlying data. Use carefully, as it allocates new data for the data pointed to by the elements in the RefArray. | |
| constexpr std::size_t | size () const |
| iterator | begin () const |
| Returns an iterator to the beginning of the RefArray. | |
| iterator | end () const |
| Returns an iterator to the end of the RefArray. | |
| T ** | get_storage () |
| T *const * | get_storage () const |
Private Attributes | |
| T * | storage [N] |
A template class for a reference array. Behaves as if std::array<T&, N> was possible.
This class provides a fixed-size array of pointers to elements of type T, exposed as references. It offers random access to its elements and provides an iterator class for traversal.
| T | The type of elements stored in the array. |
| N | The size of the array. |
Definition at line 22 of file ref_array.hpp.
|
default |
|
inline |
Definition at line 25 of file ref_array.hpp.
|
inline |
Definition at line 31 of file ref_array.hpp.
|
inline |
Definition at line 38 of file ref_array.hpp.
|
inline |
Returns an iterator to the beginning of the RefArray.
Definition at line 123 of file ref_array.hpp.
|
inline |
Returns an iterator to the end of the RefArray.
Definition at line 129 of file ref_array.hpp.
|
inline |
Get a copy of the underlying data. Use carefully, as it allocates new data for the data pointed to by the elements in the RefArray.
Definition at line 63 of file ref_array.hpp.
|
inline |
Definition at line 131 of file ref_array.hpp.
|
inline |
Definition at line 132 of file ref_array.hpp.
|
inline |
Definition at line 42 of file ref_array.hpp.
|
inlineconstexpr |
Definition at line 117 of file ref_array.hpp.
|
private |
Definition at line 137 of file ref_array.hpp.