Add SWAP as operator.

This commit is contained in:
Patrick Pelissier committed 2017-03-14 20:21:14 +01:00
1 parent ecf5547c1e
commit 6cdad58bd6
2 files changed
+3

No files matched your search

+1
View File
@@ -302,6 +302,7 @@ Other operators are:
* DEL (&obj) : free the allocated uninitialized object 'obj' (default is free). The object is not cleared before being free.
* INIT\_MOVE(objd, objc): Initialize 'objd' to 'objc' by stealing as resources as possible from 'objc' and then clear 'objc'. It is equivalent to calling INIT\_SET(objd,objc) then CLEAR(objc) (but usually way faster).
* MOVE(objd, objc): Set 'objd' to 'objc' by stealing as resources as possible from 'objc' and then clear 'objc'. It is equivalent to calling SET(objd,objc) then CLEAR(objc) or CLEAR(objd) and then INIT\_MOVE(objd, objc).
* SWAP(objd,objc): Swap the object c and object d contains.
* HASH (obj) --> size_t: return a hash of the object (used for hash table). Default is performing a hash of the memory representation of the object.
* EQUAL(obj1, obj2) --> bool: return true if both objects are equal, false otherwise. Default is using memcmp.
* CMP(obj1, obj2) --> int: return a negative integer if obj1 < obj2, 0 if obj1 = obj2, a positive integer otherwise. Default is C comparison operators.