Where is the definition of some member functions (ex. __gnu_debug::_Safe_iterator_base::_M_detach())?

François Dumont frs.dumont@gmail.com
Sun Nov 20 20:16:16 GMT 2022


On 20/11/22 20:45, Tan, Qiye via Libstdc++ wrote:
> Hi all,
>
> I'm new in C++ who have an interest in the implementation of C++ STL.
> Recently, I tried to implement my own vector template.
Good exercice !
>   However, when I
> implemented my own iterator, I found that I had no idea how to
> detect whether it is dereferencable. Therefore, I began to explore the
> libstdc++, but I found that for some member functions, I can only find the
> declaration but no definition. For example, the 'bool
> __gnu_debug::_Safe_iterator_base::_M_singular(  ) const', 'void
> __gnu_debug::_Safe_iterator_base::_M_detach(  )', etc. They are declared in
> 'libstdc++-v3/include/debug/safe_base.h'. I can guess that '_M_singular'
> may just check if '_M_sequence' is NULL, but I still want to find their
> definition. Can someone help me? Thank you so much.

This is in the .so, all exports are done from the src folder.

For _GLIBCXX_DEBUG mode all implementation is in src/c++11/debug.cc.

François



More information about the Libstdc++ mailing list