Sign in to follow this  
ehsan2004

what's the meaning of #define here?

Recommended Posts

Hello there, What's the meaning of #define END_ENGINE_NAMESPACE below: #define DECLARE_ENGINE_NAMESPACE namespace bbe { #define END_ENGINE_NAMESPACE } I know that DECLARE_ENGINE_NAMESPACE would be replaced wth namespace bbe { #define END_ENGINE_NAMESPACE } everytime we use DECLARE_ENGINE_NAMESPACE. The author has used the following code inside the files: DECLARE_ENGINE_NAMESPACE //He has written his code here, for example he has defined a class END_ENGINE_NAMESPACE Is it equivalent with: namespace bbe { //He has written his code here, for example he has defined a class } But if yes, how #define END_ENGINE_NAMESPACE cause it here? Regards, Ehsan

Share this post


Link to post
Share on other sites
Those two #define statements should be on separate lines.

As you've deduced, all these macros are doing is opening and closing a namespace scope. Although justifiable in some niche circumstances -- such as needing to compile as C, which I don't believe to be the case here -- this is, in general, an extremely poor and improper use of macros, so I don't recommend you follow the example set by the author of this code.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this