xentara-workbench-plugin v1.0.1
The Xentara Workbench Plugin Framework
Loading...
Searching...
No Matches
xentara::workbench::bindings::functional::Offset< OffsetType > Class Template Reference

A numeric list callback that increases or decreases the previous value when inserting. More...

#include <xentara/workbench/bindings/functional.hpp>

Public Member Functions

constexpr Offset (OffsetType offset) noexcept
 Constructor.
 
template<utils::tools::Arithmetic Type>
auto operator() (std::span< const Type > values, std::size_t index) const -> Type
 Function call operator.
 

Detailed Description

template<utils::tools::Arithmetic OffsetType>
class xentara::workbench::bindings::functional::Offset< OffsetType >

A numeric list callback that increases or decreases the previous value when inserting.

Constructor & Destructor Documentation

◆ Offset()

template<utils::tools::Arithmetic OffsetType>
constexpr xentara::workbench::bindings::functional::Offset< OffsetType >::Offset ( OffsetType  offset)
constexprnoexcept

Constructor.

Member Function Documentation

◆ operator()()

template<utils::tools::Arithmetic OffsetType>
template<utils::tools::Arithmetic Type>
auto xentara::workbench::bindings::functional::Offset< OffsetType >::operator() ( std::span< const Type >  values,
std::size_t  index 
) const -> Type

Function call operator.

Parameters
valuesThe list of existing values
indexThe index at which the value will be inserted
Returns
This operator will add the offset to the previous value. If there is no previous value, it will subtract the offset from the next value. No guarding against numeric overflow is done.