C++相談室 part7
■ このスレッドは過去ログ倉庫に格納されています
0767761(=753)
NGNGどっからって……もちろん、shared_ptrの定義から出てきたんですけど。
typedef shared_ptr<T> this_type;
long use_count() const // never throws
{
return pn.use_count();
}
typedef long (this_type::*bool_type)() const;
operator bool_type() const // never throws
{
return px == 0? 0: &this_type::use_count;
}
……メンバ関数ポインタですよね?
こっから、どうやって『参照カウンタの値を返している』んですか?
■ このスレッドは過去ログ倉庫に格納されています