cpp-std-fwd icon indicating copy to clipboard operation
cpp-std-fwd copied to clipboard

_GLIBCXX_DEBUG

Open user706 opened this issue 1 year ago • 0 comments

Will not work when defining macro _GLIBCXX_DEBUG, which is a cool feature that enables bounds checking on vector etc. (so instead of undefined behaviour, you will get an exact message about a bounds violation, which is great for e.g. unittests, etc)

Things will then look more or less like this (at least for gcc):

#ifdef _GLIBCXX_DEBUG
namespace std
{
    inline namespace __debug
    {
    template<typename _Tp, typename _Allocator>
    class vector;
    }
}

#else
namespace std {
template<typename _Tp, typename _Alloc>
class vector;
}
#endif

etc.

user706 avatar Nov 06 '24 07:11 user706