astar666
asked on
Tvoid? tCIDLib?
I am not much of a c++ programmer, but I am reading http://www.edm2.com/0405/enumeration.html. Here we have some code from that article:
// A macro to generate the standard enum functions
#define StdEnumTricks(eEnumType) \
inline void operator++(eEnumType& eVal) \
{ \
eVal = eEnumType(eVal+1); \
} \
\
inline void operator++(eEnumType& eVal, int) \
{ \
eVal = eEnumType(eVal+1); \
} \
\
inline void operator--(eEnumType& eVal) \
{ \
eVal = eEnumType(eVal-1); \
} \
\
inline tCIDLib::TVoid operator--(eEnumType& eVal, int) \
{ \
eVal = eEnumType(eVal-1); \
} \
\
inline eEnumType eEnumMax(eEnumType) \
{ \
return eEnumType##_Max; \
} \
\
inline eEnumType eEnumMin(eEnumType) \
{ \
return eEnumType##_Min; \
Notice the tCIDLIB::Tvoid.
What is going on here? What is TVoid used for? Is the library reference portable? I will be using gcc.
// A macro to generate the standard enum functions
#define StdEnumTricks(eEnumType) \
inline void operator++(eEnumType& eVal) \
{ \
eVal = eEnumType(eVal+1); \
} \
\
inline void operator++(eEnumType& eVal, int) \
{ \
eVal = eEnumType(eVal+1); \
} \
\
inline void operator--(eEnumType& eVal) \
{ \
eVal = eEnumType(eVal-1); \
} \
\
inline tCIDLib::TVoid operator--(eEnumType& eVal, int) \
{ \
eVal = eEnumType(eVal-1); \
} \
\
inline eEnumType eEnumMax(eEnumType) \
{ \
return eEnumType##_Max; \
} \
\
inline eEnumType eEnumMin(eEnumType) \
{ \
return eEnumType##_Min; \
Notice the tCIDLIB::Tvoid.
What is going on here? What is TVoid used for? Is the library reference portable? I will be using gcc.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.