diff --git a/applications/test/tmp/Test-tmp.C b/applications/test/tmp/Test-tmp.C index cd9e7083440b01de73c98c96426567e92c1956e2..215459ddaec3fa43be473aa2d00a5d16e9b604eb 100644 --- a/applications/test/tmp/Test-tmp.C +++ b/applications/test/tmp/Test-tmp.C @@ -41,7 +41,7 @@ void printInfo(const tmp<T>& item, const bool verbose = false) << " movable:" << Switch(item.movable()); if (item) { - Info<< " refCount:" << item->count(); + Info<< " refCount:" << item->use_count(); } Info<< " move-constructible:" diff --git a/src/OpenFOAM/db/IOstreams/token/tokenI.H b/src/OpenFOAM/db/IOstreams/token/tokenI.H index fe1a535565797ff2dd9819dfa86476a66951d465..ccea31ef4ff989370c02419f97f4efb3fdae9b57 100644 --- a/src/OpenFOAM/db/IOstreams/token/tokenI.H +++ b/src/OpenFOAM/db/IOstreams/token/tokenI.H @@ -276,7 +276,7 @@ inline void Foam::token::reset() case tokenType::COMPOUND: { - if (data_.compoundPtr->unique()) + if (data_.compoundPtr->refCount::unique()) { delete data_.compoundPtr; } diff --git a/src/OpenFOAM/memory/refCount/refCount.H b/src/OpenFOAM/memory/refCount/refCount.H index 58ef0d0aa8833d3c973f8b086bab642cb174964a..5df795b3e9db5a66e452fc174cf58996e5843533 100644 --- a/src/OpenFOAM/memory/refCount/refCount.H +++ b/src/OpenFOAM/memory/refCount/refCount.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2018 OpenCFD Ltd. + Copyright (C) 2018-2023 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -72,7 +72,7 @@ public: // Member Functions //- Return the current reference count - int count() const noexcept + int use_count() const noexcept { return count_; } diff --git a/src/OpenFOAM/memory/tmp/tmpI.H b/src/OpenFOAM/memory/tmp/tmpI.H index e753f5090cbe1cdecbc453373933df36776086b6..191b44a67f731188ed50121dbc6e709c30cbb365 100644 --- a/src/OpenFOAM/memory/tmp/tmpI.H +++ b/src/OpenFOAM/memory/tmp/tmpI.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2018-2022 OpenCFD Ltd. + Copyright (C) 2018-2023 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -34,9 +34,9 @@ License template<class T> inline void Foam::tmp<T>::incrCount() { - ptr_->operator++(); + ptr_->refCount::operator++(); - if (ptr_->count() > 1) + if (ptr_->refCount::use_count() > 1) { FatalErrorInFunction << "Attempt to create more than 2 tmp's referring to the same" @@ -79,7 +79,7 @@ inline Foam::tmp<T>::tmp(T* p) ptr_(p), type_(PTR) { - if (ptr_ && !ptr_->unique()) + if (ptr_ && !ptr_->refCount::unique()) { FatalErrorInFunction << "Attempted construction of a " @@ -195,7 +195,7 @@ inline Foam::tmp<T>::~tmp() noexcept template<class T> inline bool Foam::tmp<T>::movable() const noexcept { - return (is_pointer() && ptr_ && ptr_->unique()); + return (is_pointer() && ptr_ && ptr_->refCount::unique()); } @@ -246,7 +246,7 @@ inline T* Foam::tmp<T>::ptr() const if (is_pointer()) { - if (!ptr_->unique()) + if (!ptr_->refCount::unique()) { FatalErrorInFunction << "Attempt to acquire pointer to object referred to" @@ -271,13 +271,13 @@ inline void Foam::tmp<T>::clear() const noexcept { if (is_pointer() && ptr_) { - if (ptr_->unique()) + if (ptr_->refCount::unique()) { delete ptr_; } else { - ptr_->operator--(); + ptr_->refCount::operator--(); } ptr_ = nullptr; } @@ -479,7 +479,7 @@ inline void Foam::tmp<T>::operator=(T* p) << this->typeName() << abort(FatalError); } - else if (!p->unique()) + else if (!p->refCount::unique()) { FatalErrorInFunction << "Attempted assignment of a "