xte ::rotate_swap ()
Defined in header <xte/func/rotate_swap.hpp> Assigns each argument the value of the next argument. Uses the least number of temporary objects for swapping.
Definition
template <xte ::uz distance =1 >constexpr /* void */ rotate_swap (auto& ...args )XTE_RETURNS (/* ... */ );
distance is how far the next argument from which to get a value is.Example
Output:int a =1 ;int b =2 ;int c =3 ;int d =4 ;xte ::rotate_swap (a ,b ,c ,d );std ::println ("a={}, b={}, c={}, d={}" ,a ,b ,c ,d );
[View in Compiler Explorer]a=2, b=3, c=4, d=1