Reputation: 1215
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++?
Upvotes: 1
Views: 131
Reputation: 283694
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.
Upvotes: 1