I'm looking for a good, fully featured C++ assert macro for VisualStudio. With features like be able to ignore an assert once or always, to be able to break exactly where the macro gets called (and not inside macro code), and getting a stack trace.
Before I have to hunker down and write one, I figured I'd ask if anyone knows about any available ones out there.
Any suggestions?
Thanks!
See Charles Nicholson's blog for a good discussion of an assert
macro. His solution breaks the debugger at the faulting line of code (and not inside the failed assertion handler), and he also solves the problem of not getting warnings about unused variables when assertions are disabled without incurring any runtime costs.
Here's a link to an article I wrote for DDJ that described, among other things, a library that does much of what you're looking for. Although I don't just use macros, I also implement functions in a DLL.
http://www.ddj.com/architect/184406106
The article from a few years ago and, although I have made many additions, I still use it very liberally in my everyday code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With