5.1. Boost package for array manipulation

The ARRAY_BOOST module extends array operations with temporary array views over fixed-size arrays and C++ handled vectors, emptiness checks, sub-array views, and arithmetic operators on fixed-size arrays.

All functions and symbols are in “array_boost” module, use require to get access to it.

require daslib/array_boost

5.1.1. Temporary arrays

5.1.1.1. temp_array

array_boost::temp_array(arr: auto const implicit ==const) : auto()

Warning

This is unsafe operation.

Creates temporary array from the given object. Important requirements are:

  • object memory is linear

  • each element follows the next one directly, with the stride equal to size of the element

  • object memory does not change within the lifetime of the returned array

Arguments
  • arr : auto implicit!

array_boost::temp_array(arr: auto implicit ==const) : auto()
array_boost::temp_array(data: auto? ==const; lenA: int; a: auto(TT)) : array<TT>()
array_boost::temp_array(data: auto? ==const; lenA: int; a: auto(TT)) : array<TT>()

5.1.2. Empty check

array_boost::empty(v: auto(VecT)) : auto()

returns true if ‘v’ has 0 elements. this also implies that length(v) is defined.

Arguments
  • v : auto(VecT)

5.1.3. Sub-array view

5.1.3.1. array_view

array_boost::array_view(bytes: array<auto(TT)>; offset: int; length: int; blk: block<(var view:array<TT>#):void>) : auto()

creates a view of the array, which is a temporary array that is valid only within the block

Arguments
  • bytes : array<auto(TT)>!

  • offset : int

  • length : int

  • blk : block<(view:array<TT>#):void>

array_boost::array_view(bytes: array<auto(TT)>; offset: int; length: int; blk: block<(view:array<TT>#):void>) : auto()