开发者

can i use DEBUG_NEW on managed code?

开发者 https://www.devze.com 2023-03-24 09:43 出处:网络
can i use: #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[开发者_如何学运维] = __FILE__;

can i use:

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[开发者_如何学运维] = __FILE__;
#endif

in managed code?

like c# or managed c++?


That should work in C++/CLI just as well as it does in standard C++, which is to say, it's officially not allowed to redefine keyword such as new, but most compilers will let you do it.

With __FILE__ there is no problem, although you probably want to store it in a managed string, if you want to use it from managed code.

0

精彩评论

暂无评论...
验证码 换一张
取 消