macro's rewrite to follow the c++ convention -
I have so how can the following macro rewrite that they really ++ C followed conference? (In C ++, we prefer to use the How can I change the above macro in C ++ conference? Use or < Pre> then typedef ,
const and
inline function).
on macro
#define UBYTE unsigned char #define ULONG unsigned long #define FALSE 0 #define COMPRESS_MAX_COM 0x70000000 #define COMPRESS_MAX_ORG (1024-COMPRESS_OVERRUN) #define MAX_RAW_GROUP (16 * MAX_RAW_ITEM) #define u (x) ((ULONG) x)
typedef or
using (C ++ 11) instead of code> #define for the
constexpr C + Can be defined in + 11.
typedef unsigned four UBYTE; // UBYTE = Using unsigned char; // C ++ 11 typed without long typed; Const unsigned int FALSE = 0; // constexpr intigned int FALSE = 0; // C ++ 11 Constellation COMPRESS_MAX_COM = 0x70000000; Kont Ulong COMPRESS_MAX_ORG = (1024-COMPRESS_OVERRUN); // if COMPRESS_OVERRUN const const is ULONG MAX_RAW_GROUP = (16 * MAX_RAW_ITEM); // if MAX_RAW_ITEM as a pre-defined constants #define u (x) ((ULONG) x) // can it be this
template & lt; Typename T & gt; Ulaan U (Kontt & T) {Return Static_cast & lt; ULong & gt; (X); }
U (some type T) will return to its argument of a raw-ULong type
T .
Comments
Post a Comment