Welding metals by means of an electrolyte