mapping: add invert()

Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
Simon Rozman 2024-04-25 15:16:12 +02:00
parent c6c7498562
commit c1616b032e

View File

@ -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>>>