I was wondering what __cerb means libstdc++ of g++ , and I found out that this seems to be a short name for cerberos , as stated in the official C ++ cerberos paper.
§ 22.3.1 / 3:
[Example: iostream operator<< can be implemented as:
template <class charT, class traits> basic_ostream<charT,traits>& operator<< (basic_ostream<charT,traits>& s, Date d) { // !!!!!!!!!! typename basic_ostream<charT,traits>::sentry cerberos(s); // <--- !! HERE !! // !!!!!!!!!! if (cerberos) { ios_base::iostate err = ios_base::iostate::goodbit; tm tmbuf; d.extract(tmbuf); use_facet<time_put<charT,ostreambuf_iterator<charT,traits> > >( s.getloc()).put(s, s, s.fill(), err, &tmbuf, 'x'); s.setstate(err); // might throw } return s; }
- end of example]
Why are iostream sentry objects called cerberos , and what does cerberos mean?
c ++ iostream naming-conventions naming
helami
source share