a container for dynamically sized arrays with their ending marked by a reserved delimiter value
More...
#include <serdes_format_modifiers.h>
|
| template<size_t max_elements> |
| constexpr | delimited_array (T(&v)[max_elements], const T &d) noexcept |
| | Construct a new delimited array object using a referenced array and referenced delimiter. More...
|
| |
| template<size_t max_elements> |
| constexpr | delimited_array (T(&v)[max_elements], const T &&d) noexcept |
| | Construct a new delimited array object using a referenced array and rvalue delimiter. More...
|
| |
| constexpr | delimited_array (T *v, const T &d, size_t max_elements) noexcept |
| | Construct a new delimited array object using a pointer to an array, a referenced delimiter, and a max size. More...
|
| |
| constexpr | delimited_array (T *v, const T &&d, size_t max_elements) noexcept |
| | Construct a new delimited array object using a pointer to an array, a rvalue delimiter, and a max size. More...
|
| |
| | delimited_array (T &v, const elem_type &d) noexcept |
| | Construct a new delimited array object from a data container with 'T* data()' and 'size_t size()' methods (such as std::array, or std::list) More...
|
| |
| | delimited_array (T &v, const elem_type &&d) noexcept |
| | Construct a new delimited array object from a data container with 'T* data()' and 'size_t size()' methods (such as std::array, or std::list) More...
|
| |
|
|
elem_type * | value |
| | pointer to the head of the array
|
| |
|
const elem_type & | delimiter |
| | reference to a reserved delimiter value marking the end of the array
|
| |
|
const size_t | max_size |
| | maximum size of the array (used for bounds checking)
|
| |
template<typename T>
struct serdes::delimited_array< T >
a container for dynamically sized arrays with their ending marked by a reserved delimiter value
- Template Parameters
-
| T | the type of an array element |
- Examples
- 07_delimited_arrays.cpp, and 14_custom_types.cpp.
◆ elem_type
if the array is from a container with a "P* T.data()" method, elem_type will be P otherwise, elem_type will be T, allowing support for c-arrays (no data method) and std::array, std::list, std::vector, etc. (any c-array abstraction layer with a data() method)
◆ delimited_array() [1/6]
template<typename T >
template<size_t max_elements>
Construct a new delimited array object using a referenced array and referenced delimiter.
- Template Parameters
-
| max_elements | maximum size of the array |
- Parameters
-
| v | reference to the underlying array |
| d | the delimiter value |
◆ delimited_array() [2/6]
template<typename T >
template<size_t max_elements>
Construct a new delimited array object using a referenced array and rvalue delimiter.
- Template Parameters
-
| max_elements | maximum size of the array |
- Parameters
-
| v | reference to the underlying array |
| d | the delimiter value |
◆ delimited_array() [3/6]
Construct a new delimited array object using a pointer to an array, a referenced delimiter, and a max size.
- Parameters
-
| v | pointer to the underlying array |
| d | the delimiter value |
| max_elements | maximum size of the array |
◆ delimited_array() [4/6]
Construct a new delimited array object using a pointer to an array, a rvalue delimiter, and a max size.
- Parameters
-
| v | pointer to the underlying array |
| d | the delimiter value |
| max_elements | maximum size of the array |
◆ delimited_array() [5/6]
Construct a new delimited array object from a data container with 'T* data()' and 'size_t size()' methods (such as std::array, or std::list)
- Parameters
-
| v | reference to the data container whose underlying data should be used as the array |
| d | a reference to the delimiter value |
◆ delimited_array() [6/6]
Construct a new delimited array object from a data container with 'T* data()' and 'size_t size()' methods (such as std::array, or std::list)
- Parameters
-
| v | reference to the data container whose underlying data should be used as the array |
| d | a rvalue reference to the delimiter value |
The documentation for this struct was generated from the following file: