E
eiji
Hi folks,
I hope this is not "off topic"!
Consider the next code:
/* Declarations of types that could become platform-dependent */
#define MyChar char
#define MyInt int
#define MyUnsLong unsigned long
#define MyShort short
#define MyCharPtr MyChar *
#define MyBoolean int
class Base
{
public:
inline Base() {};
inline ~Base() {};
#ifdef DEBUG_MODE
inline void* operator new(size_t size, char* aFile, int aLine);
inline void* operator new[](size_t size, char* aFile, int aLine);
#else
inline void* operator new(size_t size);
inline void* operator new[](size_t size);
#endif
inline void operator delete(void* object);
inline void operator delete[](void* object);
};
Most of you know java quit good, so there is "java.lang.Object" and
classes are inheriant to this one.
So when and how would this become interessting for my c++-design? Why
should I design my classes in that way?
Another thing are the #define (for cross-plattform-stuff).
Code becomes worse dealing with these MyChar's but could it be
necessary to build cross-platform code in that way?
Any advice in dealing with such designes?
Today I'm a win-developer(scientific education stuff), so there is not
so much cross-plattform knowledge.
I hope this is not "off topic"!
Consider the next code:
/* Declarations of types that could become platform-dependent */
#define MyChar char
#define MyInt int
#define MyUnsLong unsigned long
#define MyShort short
#define MyCharPtr MyChar *
#define MyBoolean int
class Base
{
public:
inline Base() {};
inline ~Base() {};
#ifdef DEBUG_MODE
inline void* operator new(size_t size, char* aFile, int aLine);
inline void* operator new[](size_t size, char* aFile, int aLine);
#else
inline void* operator new(size_t size);
inline void* operator new[](size_t size);
#endif
inline void operator delete(void* object);
inline void operator delete[](void* object);
};
Most of you know java quit good, so there is "java.lang.Object" and
classes are inheriant to this one.
So when and how would this become interessting for my c++-design? Why
should I design my classes in that way?
Another thing are the #define (for cross-plattform-stuff).
Code becomes worse dealing with these MyChar's but could it be
necessary to build cross-platform code in that way?
Any advice in dealing with such designes?
Today I'm a win-developer(scientific education stuff), so there is not
so much cross-plattform knowledge.