Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • Vb
Sub Swap(Of T)(ByRef a As T, ByRef b As T)
  Dim tmp as T
  tmp = a
  a = b
  b = tmp 
End Sub

Generic swap routine
procedure swap(a, b: in out Integer)
is
    temp : Integer;
begin
    temp := a;
    a := b;
    b := temp;
end swap;

New implementation...
programming-idioms.org