 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Gary Wessle Guest
|
Posted: Thu Oct 26, 2006 9:10 am Post subject: conditional compilation |
|
|
Hi
I need to create an object of her_t OR his_t inside a namespace. the
choice should be decided based on a macro. did the following
accomplish this?
thank you.
// macro
// uncomment ONLY ONE of the 2 lines below
#define HIS
//#define HER
namespace s_inf
{
....
#ifdef HIS
his_t conn; // FXGame OR FXTrade
#endif
#ifdef HER
her_t conn;
#endif
....
}
the above created his_t and NOT her_t object. right?
// place in a ".h" file and #include it in ".cpp" file and use the
object "conn". |
|
| Back to top |
|
 |
Leo Guest
|
Posted: Thu Oct 26, 2006 9:10 am Post subject: Re: conditional compilation |
|
|
Yeah, It will.
When you start compiling, your code is done.
Gary Wessle wrote:
| Quote: | Hi
I need to create an object of her_t OR his_t inside a namespace. the
choice should be decided based on a macro. did the following
accomplish this?
thank you.
// macro
// uncomment ONLY ONE of the 2 lines below
#define HIS
//#define HER
namespace s_inf
{
...
#ifdef HIS
his_t conn; // FXGame OR FXTrade
#endif
#ifdef HER
her_t conn;
#endif
...
}
the above created his_t and NOT her_t object. right?
// place in a ".h" file and #include it in ".cpp" file and use the
object "conn". |
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|