diff --git a/common/shared_ptr.hh b/common/shared_ptr.hh index 7c47aa472f2fe6a860a30f0d3c48abc5827ac417..b0e6fc5a852cf99941c73a21d4bf4b1dccdb1cff 100644 --- a/common/shared_ptr.hh +++ b/common/shared_ptr.hh @@ -79,7 +79,10 @@ namespace Dune * pointers reference it. */ inline void deallocate(); - int count() const; + + /** \brief The number of shared_ptrs pointing to the object we point to */ + int use_count() const; + private: /** @brief The object we reference. */ class PointerRep diff --git a/common/test/smartpointertest.cc b/common/test/smartpointertest.cc index 10abf66a96bf14a30598797586e3c921bf5d37e6..ff173fa68bd5577d643ed22fb07d144fe88f1573 100644 --- a/common/test/smartpointertest.cc +++ b/common/test/smartpointertest.cc @@ -19,7 +19,7 @@ int main(){ shared_ptr<double> d(b); *b = 7; } - if(b.count()!=1) { + if(b.use_count()!=1) { std::cout << "Reference count is wrong! "<<__LINE__<<":"<< __FILE__<<std::endl; ret=1; @@ -32,7 +32,7 @@ int main(){ __FILE__<<std::endl; ret=1; } - if(b.count()!=2 || c.count()!=2) { + if(b.use_count()!=2 || c.use_count()!=2) { std::cout << "Reference count is wrong! "<<__LINE__<<":"<< __FILE__<<std::endl; ret=1; @@ -45,7 +45,7 @@ int main(){ } } - if(b.count()!=1) { + if(b.use_count()!=1) { std::cout << "Reference count is wrong! "<<__LINE__<<":"<< __FILE__<<std::endl; ret=1;