diff options
| author | Rye <rye@alchemyviewer.org> | 2025-11-28 13:49:27 -0500 |
|---|---|---|
| committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2025-11-30 19:22:22 +0200 |
| commit | afb1f4d692bb593b3f200d490dd3f8fdeab8d279 (patch) | |
| tree | 3910d355ec29253ed18761fafdb16e0a99e4e4e7 /indra/llcommon | |
| parent | b3a1b099aa5ce7c02ccdb0fa5bc3d55ced989e5e (diff) | |
Replace boost noncopyable and undefined function usage with modern c++ deleted operator and constructor
Diffstat (limited to 'indra/llcommon')
| -rw-r--r-- | indra/llcommon/llapr.h | 10 | ||||
| -rw-r--r-- | indra/llcommon/lldeadmantimer.h | 9 | ||||
| -rw-r--r-- | indra/llcommon/llevents.h | 1 | ||||
| -rw-r--r-- | indra/llcommon/llmutex.h | 9 | ||||
| -rw-r--r-- | indra/llcommon/llpounceable.h | 7 | ||||
| -rw-r--r-- | indra/llcommon/llprocess.h | 7 | ||||
| -rw-r--r-- | indra/llcommon/llprocinfo.h | 8 | ||||
| -rw-r--r-- | indra/llcommon/llqueuedthread.h | 6 | ||||
| -rw-r--r-- | indra/llcommon/llrefcount.h | 1 | ||||
| -rw-r--r-- | indra/llcommon/llsingleton.h | 6 |
10 files changed, 37 insertions, 27 deletions
diff --git a/indra/llcommon/llapr.h b/indra/llcommon/llapr.h index 693cd7c01f..11e474b5dd 100644 --- a/indra/llcommon/llapr.h +++ b/indra/llcommon/llapr.h @@ -33,7 +33,6 @@ #include <sys/param.h> // Need PATH_MAX in APR headers... #endif -#include <boost/noncopyable.hpp> #include "llwin32headers.h" #include "apr_thread_proc.h" #include "apr_getopt.h" @@ -145,7 +144,7 @@ private: // 2, a global pool. // -class LL_COMMON_API LLAPRFile : boost::noncopyable +class LL_COMMON_API LLAPRFile { // make this non copyable since a copy closes the file private: @@ -153,9 +152,12 @@ private: LLVolatileAPRPool *mCurrentFilePoolp ; //currently in use apr_pool, could be one of them: sAPRFilePoolp, or a temp pool. public: - LLAPRFile() ; + LLAPRFile(); LLAPRFile(const std::string& filename, apr_int32_t flags, LLVolatileAPRPool* pool = NULL); - ~LLAPRFile() ; + ~LLAPRFile(); + + LLAPRFile(const LLAPRFile&) = delete; + LLAPRFile& operator=(const LLAPRFile&) = delete; apr_status_t open(const std::string& filename, apr_int32_t flags, LLVolatileAPRPool* pool = NULL, S32* sizep = NULL); apr_status_t open(const std::string& filename, apr_int32_t flags, bool use_global_pool); //use gAPRPoolp. diff --git a/indra/llcommon/lldeadmantimer.h b/indra/llcommon/lldeadmantimer.h index 3f10420d41..19d65b78b6 100644 --- a/indra/llcommon/lldeadmantimer.h +++ b/indra/llcommon/lldeadmantimer.h @@ -99,13 +99,10 @@ public: /// during updates. If false, cpu usage data isn't /// collected and will be zero if queried. LLDeadmanTimer(F64 horizon, bool inc_cpu); + ~LLDeadmanTimer() = default; - ~LLDeadmanTimer() - {} - -private: - LLDeadmanTimer(const LLDeadmanTimer &); // Not defined - void operator=(const LLDeadmanTimer &); // Not defined + LLDeadmanTimer(const LLDeadmanTimer &) = delete; + LLDeadmanTimer& operator=(const LLDeadmanTimer&) = delete; public: /// Get the current time. Zero-basis for this time diff --git a/indra/llcommon/llevents.h b/indra/llcommon/llevents.h index 4bf1fa07a2..054e57cc6c 100644 --- a/indra/llcommon/llevents.h +++ b/indra/llcommon/llevents.h @@ -41,7 +41,6 @@ #include <boost/signals2.hpp> #include <boost/bind.hpp> -#include <boost/utility.hpp> // noncopyable #include <boost/optional/optional.hpp> #include <boost/visit_each.hpp> #include <boost/ref.hpp> // reference_wrapper diff --git a/indra/llcommon/llmutex.h b/indra/llcommon/llmutex.h index 62943845a5..f3615a1270 100644 --- a/indra/llcommon/llmutex.h +++ b/indra/llcommon/llmutex.h @@ -29,7 +29,6 @@ #include "stdtypes.h" #include "llthread.h" -#include <boost/noncopyable.hpp> #include "mutex.h" #include <shared_mutex> @@ -249,7 +248,7 @@ private: * The constructor handles the lock, and the destructor handles * the unlock. Instances of this class are <b>not</b> thread safe. */ -class LL_COMMON_API LLScopedLock : private boost::noncopyable +class LL_COMMON_API LLScopedLock { public: /** @@ -265,6 +264,12 @@ public: */ ~LLScopedLock(); + /* + * @brief Non-copyable constructor and operator + */ + LLScopedLock(const LLScopedLock&) = delete; + LLScopedLock& operator=(const LLScopedLock&) = delete; + /** * @brief Check lock. */ diff --git a/indra/llcommon/llpounceable.h b/indra/llcommon/llpounceable.h index 0421ce966a..da47abd8a0 100644 --- a/indra/llcommon/llpounceable.h +++ b/indra/llcommon/llpounceable.h @@ -36,7 +36,6 @@ #define LL_LLPOUNCEABLE_H #include "llsingleton.h" -#include <boost/noncopyable.hpp> #include <boost/call_traits.hpp> #include <boost/type_traits/remove_pointer.hpp> #include <boost/utility/value_init.hpp> @@ -139,7 +138,7 @@ private: // LLPounceable<T> is for an LLPounceable instance on the heap or the stack. // LLPounceable<T, LLPounceableStatic> is for a static LLPounceable instance. template <typename T, class TAG=LLPounceableQueue> -class LLPounceable: public boost::noncopyable +class LLPounceable { private: typedef LLPounceableTraits<T, TAG> traits; @@ -158,6 +157,10 @@ public: mEmpty(empty) {} + // Non-copyable + LLPounceable(const LLPounceable&) = delete; + LLPounceable& operator=(const LLPounceable&) = delete; + // make read access to mHeld as cheap and transparent as possible operator T () const { return mHeld; } typename boost::remove_pointer<T>::type operator*() const { return *mHeld; } diff --git a/indra/llcommon/llprocess.h b/indra/llcommon/llprocess.h index d19f480c4a..0c71cfc415 100644 --- a/indra/llcommon/llprocess.h +++ b/indra/llcommon/llprocess.h @@ -32,7 +32,6 @@ #include "llexception.h" #include "apr_thread_proc.h" #include <boost/optional.hpp> -#include <boost/noncopyable.hpp> #include <iosfwd> // std::ostream #if LL_WINDOWS @@ -66,7 +65,7 @@ typedef std::shared_ptr<LLProcess> LLProcessPtr; * indra/llcommon/tests/llprocess_test.cpp for an example of waiting for * child-process termination in a standalone test context. */ -class LL_COMMON_API LLProcess: public boost::noncopyable +class LL_COMMON_API LLProcess { LOG_CLASS(LLProcess); public: @@ -541,6 +540,10 @@ public: static std::string basename(const std::string& path); static std::string getline(std::istream&); + // Non-copyable + LLProcess(const LLProcess&) = delete; + LLProcess& operator=(const LLProcess&) = delete; + private: /// constructor is private: use create() instead LLProcess(const LLSDOrParams& params); diff --git a/indra/llcommon/llprocinfo.h b/indra/llcommon/llprocinfo.h index 5955799812..0fc8b9dbe4 100644 --- a/indra/llcommon/llprocinfo.h +++ b/indra/llcommon/llprocinfo.h @@ -51,10 +51,10 @@ public: typedef U64 time_type; /// Relative microseconds private: - LLProcInfo(); // Not defined - ~LLProcInfo(); // Not defined - LLProcInfo(const LLProcInfo &); // Not defined - void operator=(const LLProcInfo &); // Not defined + LLProcInfo() = delete; + ~LLProcInfo() = delete; + LLProcInfo(const LLProcInfo&) = delete; + LLProcInfo& operator=(const LLProcInfo&) = delete; public: /// Get accumulated system and user CPU time in diff --git a/indra/llcommon/llqueuedthread.h b/indra/llcommon/llqueuedthread.h index 02d3a96fcc..de50b8ae95 100644 --- a/indra/llcommon/llqueuedthread.h +++ b/indra/llcommon/llqueuedthread.h @@ -117,11 +117,11 @@ public: virtual ~LLQueuedThread(); virtual void shutdown(); -private: // No copy constructor or copy assignment - LLQueuedThread(const LLQueuedThread&); - LLQueuedThread& operator=(const LLQueuedThread&); + LLQueuedThread(const LLQueuedThread&) = delete; + LLQueuedThread& operator=(const LLQueuedThread&) = delete; +private: virtual bool runCondition(void); virtual void run(void); virtual void startThread(void); diff --git a/indra/llcommon/llrefcount.h b/indra/llcommon/llrefcount.h index 3a253d8fa6..93ca7d1d00 100644 --- a/indra/llcommon/llrefcount.h +++ b/indra/llcommon/llrefcount.h @@ -26,7 +26,6 @@ #ifndef LLREFCOUNT_H #define LLREFCOUNT_H -#include <boost/noncopyable.hpp> #include <boost/intrusive_ptr.hpp> #include "llatomic.h" diff --git a/indra/llcommon/llsingleton.h b/indra/llcommon/llsingleton.h index b5659e053c..3fba8602ee 100644 --- a/indra/llcommon/llsingleton.h +++ b/indra/llcommon/llsingleton.h @@ -25,7 +25,6 @@ #ifndef LLSINGLETON_H #define LLSINGLETON_H -#include <boost/noncopyable.hpp> #include <boost/unordered_set.hpp> #include <initializer_list> #include <list> @@ -43,11 +42,14 @@ #pragma warning(disable : 4506) // no definition for inline function #endif -class LLSingletonBase: private boost::noncopyable +class LLSingletonBase { public: class MasterList; + LLSingletonBase(const LLSingletonBase&) = delete; + LLSingletonBase& operator=(const LLSingletonBase&) = delete; + private: // All existing LLSingleton instances are tracked in this master list. typedef std::list<LLSingletonBase*> list_t; |
