Codesnippets > Inline / 3rd party

Close GLbasic name space.

(1/1)

mentalthink:
Hi guys I have a doubt because I don't understand too much the Inline Documentation (for the language not for the explanation).

When I use Inline, automatically namespace GLBasic is closed?¿, if not how I have to do for leave __GLBASIC__ without usefull.

I read something similar to this.

Inline
{ using name space __cplus_plus__


}namespace __GLBASIC__ // for turn again to GLbasic namespace.

thanks.

kanonet:
I dont understand your question, you already posted the answer. When you start INLINE you are still in namespace __GLBASIC__, if you want to leave it, you do so with simply writing }, if you are done with your stuff, you need to reopen the namespace before you call ENDINLINE. So it looks this way:

--- Code: GLBasic ---INLINE
} // closed namespace __GLBASIC__, you probably are in global namespace now

// do that stuff here, that you dont want to be inside GLBasic namespace

namespace __GLBASIC__ { // reopen GLBasic namespace
ENDINLINEBTW you rarely need to do this, most INLINE stuff that you probably do, can savely be done inside GLBasic namespace. I usually just opend my own namespace inside __GBASIC__, which also works fine.

mentalthink:
Ok Kanonet thanks I don't know when you put "}" closed the namespace, I think you have to do something like closenamespace or use another...
I'm very newbie with C++

Thanks a lot for the clarify me.
 

kanonet:
What are you doing, that you need to close the namespace? Like I said, in most cases you can just use C++ code in INLINE without closing the namespace.

mentalthink:
Nothing interesting Kano, only is for learning.
I read in somebooks mix namespaces can be a bad practice  , how I comment I'm learning C++ (I'm not profesional programmer)  and is really interesting mix it with GLbasic.

Thanks again.

Navigation

[0] Message Index

Go to full version