STL in debug mode?

M

Matthias

Hi,

I have just read in another thread (didn't want to hijack it) that STL
containers may operate more safe in "debug builds". Are we talking about
a debug build when the _DEBUG flag is set (on gcc)? I have grep'ed for
_DEBUG in all files of my STL implementation but couldn't come up with
anything.
How do I enable the STL to work in debug mode?

I am using the GNU C++ implementation, gcc 3.4.3.
 
I

Ivan Vecerina

Matthias said:
I have just read in another thread (didn't want to hijack it) that STL
containers may operate more safe in "debug builds". Are we talking about a
debug build when the _DEBUG flag is set (on gcc)?
This is an implementation-specific feature. It will typically require
compiling (your application, and eventually library files) with a specific
macro defined.
STLport (www.stlport.org) had pioneered the implementation of such a
debug mode, with extensive range checking, validation of all iterators
and ranges, etc. It can be used with a wide range of compilers.
I have grep'ed for _DEBUG in all files of my STL implementation but
couldn't come up with anything.
How do I enable the STL to work in debug mode?

I think some vendors/platforms have started to include functionality
similar to that of STLport. But I don't know about gcc.
You probably should ask about its status on a platform-specific forum...

Ivan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top