System.SyncObjs.TInterlocked.Exchange

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

class function Exchange(var Target: Pointer; Value: Pointer): Pointer; overload; static; inline;
class function Exchange(var Target: Integer; Value: Integer): Integer; overload; static; inline;
class function Exchange(var Target: Int64; Value: Int64): Int64; overload; static; inline;
class function Exchange(var Target: TObject; Value: TObject): TObject; overload; static; inline;
class function Exchange(var Target: Double; Value: Double): Double; overload; static; inline;
class function Exchange(var Target: Single; Value: Single): Single; overload; static; inline;
class function Exchange<T: class>(var Target: T; Value: T): T; overload; static; inline;

C++

static void * __fastcall Exchange(void * &Target, void * Value)/* overload */;
static int __fastcall Exchange(int &Target, int Value)/* overload */;
static __int64 __fastcall Exchange(__int64 &Target, __int64 Value)/* overload */;
static System::TObject* __fastcall Exchange(System::TObject* &Target, System::TObject* Value)/* overload */;
static double __fastcall Exchange(double &Target, double Value)/* overload */;
static float __fastcall Exchange(float &Target, float Value)/* overload */;
template<typename T> static T __fastcall Exchange(T &Target, T Value)/* overload */;

Properties

Type Visibility Source Unit Parent
function public
System.SyncObjs.pas
System.SyncObjs.hpp
System.SyncObjs TInterlocked

Description

Swaps the value of the two method parameters.

There are seven Exchange overloads and they all swap the value of the Target with Value. The last Exchange method has generic parameters and return type and can receive parameters of any type.

See Also