mirror of
https://github.com/Ed94/gencpp.git
synced 2024-12-22 15:54:45 -08:00
Fixed swap fn
This commit is contained in:
parent
a37c3f63c2
commit
b1de5b1ac7
@ -146,7 +146,7 @@ namespace gen {
|
|||||||
|
|
||||||
// Bits
|
// Bits
|
||||||
|
|
||||||
#define bit( Value ) ( 1 << Value )
|
#define bit( Value ) ( 1 << (Value) )
|
||||||
#define bitfield_is_equal( Type, Field, Mask ) ( (Type(Mask) & Type(Field)) == Type(Mask) )
|
#define bitfield_is_equal( Type, Field, Mask ) ( (Type(Mask) & Type(Field)) == Type(Mask) )
|
||||||
|
|
||||||
// Casting
|
// Casting
|
||||||
@ -230,7 +230,7 @@ while(0);
|
|||||||
#define size_of( x ) ( sw )( sizeof( x ) )
|
#define size_of( x ) ( sw )( sizeof( x ) )
|
||||||
|
|
||||||
template< class Type >
|
template< class Type >
|
||||||
void swap( Type a, Type b )
|
void swap( Type& a, Type& b )
|
||||||
{
|
{
|
||||||
Type tmp = a;
|
Type tmp = a;
|
||||||
a = b;
|
a = b;
|
||||||
|
Loading…
Reference in New Issue
Block a user