38. Boost package for array manipulation

The array_boost module implements collection of array manipulation routines.

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

require daslib/array_boost

38.1. Temporary arrays

temp_array(arr: auto implicit ==const)

temp_array returns auto

Warning

This is unsafe operation.

argument

argument type

arr

auto implicit!

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

temp_array(arr: auto const implicit ==const)

temp_array returns auto

Warning

This is unsafe operation.

argument

argument type

arr

auto const implicit!

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

temp_array(data: auto? ==const; lenA: int const; a: auto(TT) const)

temp_array returns array<TT>

Warning

This is unsafe operation.

argument

argument type

data

auto?!

lenA

int const

a

auto(TT) const

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

temp_array(data: auto? const ==const; lenA: int const; a: auto(TT) const)

temp_array returns array<TT> const

Warning

This is unsafe operation.

argument

argument type

data

auto? const!

lenA

int const

a

auto(TT) const

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

38.2. Empty check

empty(v: auto(VecT) const)

empty returns auto

argument

argument type

v

auto(VecT) const

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

38.3. Uncategorized

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

array_view returns auto

argument

argument type

bytes

array<auto(TT)> const!

offset

int const

length

int const

blk

block<(view:array<TT> const#):void> const

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

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

array_view returns auto

argument

argument type

bytes

array<auto(TT)>!

offset

int const

length

int const

blk

block<(view:array<TT>#):void> const

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