我想知道 of 的含义是什么,__cerb我发现这似乎是官方 C++ 标准文档中命名的简称。libstdc++g++cerberos
§ 22.3.1 / 3:
[ 示例:iostream
operator<<可以实现为: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; }—结束示例]
为什么 iostreamsentry对象被称为cerberos,cerberos实际上是什么意思?