nodepp icon indicating copy to clipboard operation
nodepp copied to clipboard

Improvement request for C++ namespaces usage inside Nodepp

Open lsergiy opened this issue 7 months ago • 2 comments

Dear Enmanuel and Nodepp dev. team! Nodepp defines some macros like coBegin in macros.h and they invoke functions from namespaces:

#define coBegin  do { switch(_state_) { case 0:; coroutine::getno(-2);

Above namespace coroutine is used without it's parent namespace nodepp. This automatically means I can only use such macros in my project only when I have using namespace nodepp; directive. Nodepp simply forces me to do using namespace nodepp;. I think this is incorrect and may lead to potential conflict of names with other libraries and other parts of my code in future. I think it's more correct to ask Nodepp to use full namespace specifications in publicly exposed macros:

#define coBegin  do { switch(_state_) { case 0:; nodepp::coroutine::getno(-2);

Same is related to coDelay, coErrno, coGoto, coEnd, coStop and may be more. I suspect you can find all of them by searching coroutine:: and process:: texts in macros.h`.

lsergiy avatar Apr 09 '26 14:04 lsergiy

thanks for pointing that out, now solved in nodepp V1.4.1_0 commit

EDBCREPO avatar Apr 09 '26 15:04 EDBCREPO

Fixed! Thanks!

lsergiy avatar Apr 09 '26 17:04 lsergiy