stdex Additional custom or not Standard C++ covered algorithms

Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
stdex::mapping< T > Struct Template Reference

Maps index in source string to index in destination string. More...

`#include <stdex/mapping.hpp>`

## Public Member Functions
| mapping ()
| Constructs a zero to zero mapping.
| mapping (T x)
| Constructs an id mapping.
| mapping (T _from, T _to)
| Constructs a mapping.
bool | operator== (const mapping &other) const
| Are mappings identical?
bool | operator!= (const mapping &other) const
| Are mappings different?
mapping | operator+ (const mapping &other) const
| Adds two mappings by components.
void | invert ()
| Reverses source and destination indexes.

## Public Attributes
T | from
T | to

## Detailed Description

template<class T>
struct stdex::mapping< T >

Maps index in source string to index in destination string.

## Constructor & Destructor Documentation

## ◆ mapping() [1/2]

template<class T >

stdex::mapping< T >::mapping | ( | T | x | ) |
| inline

Constructs an id mapping.

Parameters

  [in] | x | Mapping from and to value

## ◆ mapping() [2/2]

template<class T >

stdex::mapping< T >::mapping | ( | T | _from,
|  | T | _to )
| inline

Constructs a mapping.

Parameters

  [in] | _from | Mapping from value
  [in] | _to | Mapping to value

## Member Function Documentation

## ◆ operator!=()

template<class T >

bool stdex::mapping< T >::operator!= | ( | const mapping< T > & | other | ) | const
| inline

Are mappings different?

Parameters

  [in] | other | Other mapping to compare against

Returns
  true if mappings are different or false otherwise

## ◆ operator+()

template<class T >

mapping stdex::mapping< T >::operator+ | ( | const mapping< T > & | other | ) | const
| inline

Adds two mappings by components.

Parameters

  [in] | other | Second mapping

Returns
  Resulting mapping

## ◆ operator==()

template<class T >

bool stdex::mapping< T >::operator== | ( | const mapping< T > & | other | ) | const
| inline

Are mappings identical?

Parameters

  [in] | other | Other mapping to compare against

Returns
  true if mappings are identical or false otherwise

The documentation for this struct was generated from the following file:

- include/stdex/mapping.hpp