mapping: add invert()
Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
parent
c6c7498562
commit
c1616b032e
@ -68,6 +68,16 @@ namespace stdex
|
|||||||
{
|
{
|
||||||
return mapping(from + other.from, to + other.to);
|
return mapping(from + other.from, to + other.to);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Reverses source and destination indexes
|
||||||
|
///
|
||||||
|
void invert()
|
||||||
|
{
|
||||||
|
T tmp = from;
|
||||||
|
from = to;
|
||||||
|
to = tmp;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class T, class AX = std::allocator<mapping<T>>>
|
template <class T, class AX = std::allocator<mapping<T>>>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user