- Have you used a checked STL implementation?
- Did it find bugs you were not expecting?
- Is there one I can try on Linux for free?
views:
125answers:
3
+1
A:
- Microsoft's VC++ implements checking.
- It easily catches places where iterators refer to memory out-of-bounds of the STL container to which it belongs.
- I'm not sure, but I think you should try the Boost C++ library. It has myriad variety of features including concept checking, etc. Heck, its become the basis for the C++0x standard!
themoondothshine
2010-04-02 17:11:13
PS: Using checked STL implementations will cause quite hit on performance, and that what C++ is known for: its performance!
themoondothshine
2010-04-02 17:14:18
@themoondothshine: It also catches when you use begin/end iterators which don't point into the same container.
sbi
2010-04-02 17:20:37
@themoondotshine: You only use checked version in DEBUG mode, right?
Nate
2010-04-02 17:27:30
Yes, that's basically the idea, but you can use it anywhere you like!
themoondothshine
2010-04-02 17:33:12
+1
A:
I have not used it ever, but a quick search shows that STLPort has checked iterators in DEBUG mode.
David Rodríguez - dribeas
2010-04-02 17:31:49
+3
A:
The GNU implementation of the standard C++ library that comes with GCC has checked STL. Just add -D_GLIBCXX_DEBUG
to your command line.
Yes, I've used it. I can't say for sure if it's caught bugs but it gives me more confidence that certain classes of bugs aren't being missed.
Because of performance overhead, we only use checked STL for debug builds.
R Samuel Klatchko
2010-04-02 17:41:11