From fb3f0e18a2ada57f98c3b10fab0c13fb2d504ae1 Mon Sep 17 00:00:00 2001 From: Rye Date: Mon, 1 Dec 2025 05:46:57 -0500 Subject: #5078 Replace boost::function with std::function * Replace boost::function usage with std::function for easier debugging and reduced compiler warnings * Remove a few remaining instances of boost::noncopyable that were missed in tests Signed-off-by: Rye --- indra/llcommon/llcallbacklist.h | 9 +++--- indra/llcommon/llcoros.h | 4 +-- indra/llcommon/lldependencies.h | 14 ++++----- indra/llcommon/lldoubledispatch.h | 14 ++++----- indra/llcommon/llerror.cpp | 6 ++-- indra/llcommon/llerrorcontrol.h | 4 +-- indra/llcommon/lleventdispatcher.h | 5 ++-- indra/llcommon/lleventfilter.h | 7 +++-- indra/llcommon/llevents.cpp | 1 - indra/llcommon/llevents.h | 3 -- indra/llcommon/llhandle.h | 6 ++-- indra/llcommon/llinitdestroyclass.h | 4 +-- indra/llcommon/llinitparam.h | 35 +++++++++++++++++----- indra/llcommon/llleaplistener.h | 4 +-- indra/llcommon/llpounceable.h | 5 ++-- indra/llcommon/llptrto.cpp | 39 ++++++++++++------------- indra/llcommon/llptrto.h | 8 ++--- indra/llcommon/llsdparam.cpp | 11 +++---- indra/llcommon/llsdparam.h | 4 +-- indra/llcommon/llsys.cpp | 7 ++--- indra/llcommon/lltreeiterators.h | 10 +++---- indra/llcommon/tests/lleventdispatcher_test.cpp | 1 - indra/llcommon/tests/llprocess_test.cpp | 11 +++++-- indra/llcommon/tests/lltreeiterators_test.cpp | 3 +- 24 files changed, 113 insertions(+), 102 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llcallbacklist.h b/indra/llcommon/llcallbacklist.h index d6c415f7c5..036e575117 100644 --- a/indra/llcommon/llcallbacklist.h +++ b/indra/llcommon/llcallbacklist.h @@ -27,8 +27,9 @@ #ifndef LL_LLCALLBACKLIST_H #define LL_LLCALLBACKLIST_H -#include "llstl.h" -#include +#include "stdtypes.h" + +#include #include class LLCallbackList @@ -59,8 +60,8 @@ protected: callback_list_t mCallbackList; }; -typedef boost::function nullary_func_t; -typedef boost::function bool_func_t; +typedef std::function nullary_func_t; +typedef std::function bool_func_t; // Call a given callable once in idle loop. void doOnIdleOneTime(nullary_func_t callable); diff --git a/indra/llcommon/llcoros.h b/indra/llcommon/llcoros.h index c3820ae987..9df52b6ed5 100644 --- a/indra/llcommon/llcoros.h +++ b/indra/llcommon/llcoros.h @@ -37,7 +37,7 @@ #include "mutex.h" #include "llsingleton.h" #include "llinstancetracker.h" -#include +#include #include #include #include @@ -112,7 +112,7 @@ public: /// stuck with the term "coroutine." typedef boost::fibers::fiber coro; /// Canonical callable type - typedef boost::function callable_t; + typedef std::function callable_t; /** * Create and start running a new coroutine with specified name. The name diff --git a/indra/llcommon/lldependencies.h b/indra/llcommon/lldependencies.h index 47b6fedc7d..a1b5c83caf 100644 --- a/indra/llcommon/lldependencies.h +++ b/indra/llcommon/lldependencies.h @@ -30,6 +30,7 @@ #if ! defined(LL_LLDEPENDENCIES_H) #define LL_LLDEPENDENCIES_H +#include #include #include #include @@ -38,7 +39,6 @@ #include #include #include -#include #include #include "llexception.h" @@ -217,7 +217,7 @@ class LLDependencies: public LLDependenciesBase /// We have various ways to get the dependencies for a given DepNode. /// Rather than having to restate each one for 'after' and 'before' /// separately, pass a dep_selector so we can apply each to either. - typedef boost::function dep_selector; + typedef std::function dep_selector; public: LLDependencies() {} @@ -340,7 +340,7 @@ private: public: /// iterator over value_type entries - typedef boost::transform_iterator, + typedef boost::transform_iterator, typename DepNodeMap::iterator> iterator; /// range over value_type entries typedef boost::iterator_range range; @@ -352,7 +352,7 @@ public: } /// iterator over const_value_type entries - typedef boost::transform_iterator, + typedef boost::transform_iterator, typename DepNodeMap::const_iterator> const_iterator; /// range over const_value_type entries typedef boost::iterator_range const_range; @@ -364,7 +364,7 @@ public: } /// iterator over stored NODEs - typedef boost::transform_iterator, + typedef boost::transform_iterator, typename DepNodeMap::iterator> node_iterator; /// range over stored NODEs typedef boost::iterator_range node_range; @@ -380,7 +380,7 @@ public: } /// const iterator over stored NODEs - typedef boost::transform_iterator, + typedef boost::transform_iterator, typename DepNodeMap::const_iterator> const_node_iterator; /// const range over stored NODEs typedef boost::iterator_range const_node_range; @@ -396,7 +396,7 @@ public: } /// const iterator over stored KEYs - typedef boost::transform_iterator, + typedef boost::transform_iterator, typename DepNodeMap::const_iterator> const_key_iterator; /// const range over stored KEYs typedef boost::iterator_range const_key_range; diff --git a/indra/llcommon/lldoubledispatch.h b/indra/llcommon/lldoubledispatch.h index 25039c3e9c..ad4dc57d58 100644 --- a/indra/llcommon/lldoubledispatch.h +++ b/indra/llcommon/lldoubledispatch.h @@ -30,9 +30,7 @@ #define LL_LLDOUBLEDISPATCH_H #include -#include -#include -#include +#include /** * This class supports function calls which are virtual on the dynamic type of @@ -156,9 +154,9 @@ public: insert(t1, t2, func); if (symmetrical) { - // Use boost::bind() to construct a param-swapping thunk. Don't + // Use std::bind() to construct a param-swapping thunk. Don't // forget to reverse the parameters too. - insert(t2, t1, boost::bind(func, _2, _1)); + insert(t2, t1, std::bind(func, std::placeholders::_2, std::placeholders::_1)); } } @@ -193,7 +191,7 @@ public: insert(Type(), Type(), func, insertion); if (symmetrical) { - insert(Type(), Type(), boost::bind(func, _2, _1), insertion); + insert(Type(), Type(), std::bind(func, std::placeholders::_2, std::placeholders::_1), insertion); } } @@ -271,8 +269,8 @@ private: typename DispatchTable::iterator find(const ParamBaseType& param1, const ParamBaseType& param2) { return std::find_if(mDispatch.begin(), mDispatch.end(), - boost::bind(&EntryBase::matches, _1, - boost::ref(param1), boost::ref(param2))); + std::bind(&EntryBase::matches, std::placeholders::_1, + std::ref(param1), std::ref(param2))); } /// Look up the first matching entry. diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index 3411e9c6bb..b14464382b 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -527,8 +527,8 @@ namespace mFileLevelMap(), mTagLevelMap(), mUniqueLogMessages(), - mCrashFunction(NULL), - mTimeFunction(NULL), + mCrashFunction(nullptr), + mTimeFunction(nullptr), mRecorders(), mShouldLogCallCounter(0) { @@ -1231,7 +1231,7 @@ namespace std::ostringstream message_stream; - if (r->wantsTime() && s->mTimeFunction != NULL) + if (r->wantsTime() && s->mTimeFunction != nullptr) { message_stream << s->mTimeFunction(); } diff --git a/indra/llcommon/llerrorcontrol.h b/indra/llcommon/llerrorcontrol.h index 0a7b3d2046..d254fa5407 100644 --- a/indra/llcommon/llerrorcontrol.h +++ b/indra/llcommon/llerrorcontrol.h @@ -31,7 +31,7 @@ #include "llerror.h" #include "llpointer.h" #include "llrefcount.h" -#include "boost/function.hpp" +#include #include class LLSD; @@ -92,7 +92,7 @@ namespace LLError Control functions. */ - typedef boost::function FatalFunction; + typedef std::function FatalFunction; LL_COMMON_API void setFatalFunction(const FatalFunction&); // The fatal function will be called after an message of LEVEL_ERROR diff --git a/indra/llcommon/lleventdispatcher.h b/indra/llcommon/lleventdispatcher.h index 27cf4c1974..97a60e2829 100644 --- a/indra/llcommon/lleventdispatcher.h +++ b/indra/llcommon/lleventdispatcher.h @@ -33,7 +33,6 @@ #define LL_LLEVENTDISPATCHER_H #include -#include #include #include #include // std::function @@ -316,7 +315,7 @@ public: */ template::value && + std::is_member_function_pointer::value && ! std::is_convertible::value >::type> void add(const std::string& name, const std::string& desc, Method f, @@ -362,7 +361,7 @@ public: */ template::value && + std::is_member_function_pointer::value && ! std::is_convertible::value >::type> void add(const std::string& name, const std::string& desc, Method f, diff --git a/indra/llcommon/lleventfilter.h b/indra/llcommon/lleventfilter.h index d8c7e15a27..8b917c23be 100644 --- a/indra/llcommon/lleventfilter.h +++ b/indra/llcommon/lleventfilter.h @@ -33,7 +33,8 @@ #include "stdtypes.h" #include "lltimer.h" #include "llsdutil.h" -#include + +#include class LLEventTimer; class LLDate; @@ -92,8 +93,8 @@ public: /// construct and connect LLEventTimeoutBase(LLEventPump& source); - /// Callable, can be constructed with boost::bind() - typedef boost::function Action; + /// Callable, can be constructed with std::bind() + typedef std::function Action; /** * Start countdown timer for the specified number of @a seconds. Forward diff --git a/indra/llcommon/llevents.cpp b/indra/llcommon/llevents.cpp index 3c6743eac9..9a5324b598 100644 --- a/indra/llcommon/llevents.cpp +++ b/indra/llcommon/llevents.cpp @@ -44,7 +44,6 @@ #include #include // external library headers -#include #if LL_WINDOWS #pragma warning (push) #pragma warning (disable : 4701) // compiler thinks might use uninitialized var, but no diff --git a/indra/llcommon/llevents.h b/indra/llcommon/llevents.h index 054e57cc6c..18c05a0081 100644 --- a/indra/llcommon/llevents.h +++ b/indra/llcommon/llevents.h @@ -42,9 +42,6 @@ #include #include #include -#include -#include // reference_wrapper -#include #include #include "llsd.h" #include "llsingleton.h" diff --git a/indra/llcommon/llhandle.h b/indra/llcommon/llhandle.h index ceea1d9c48..fd7d32e79a 100644 --- a/indra/llcommon/llhandle.h +++ b/indra/llcommon/llhandle.h @@ -31,8 +31,6 @@ #include "llrefcount.h" #include "llexception.h" #include -#include -#include #include /** @@ -90,7 +88,7 @@ public: LLHandle() : mTombStone(getDefaultTombStone()) {} template - LLHandle(const LLHandle& other, typename boost::enable_if< typename boost::is_convertible >::type* dummy = 0) + LLHandle(const LLHandle& other, typename std::enable_if_t>* dummy = 0) : mTombStone(other.mTombStone) {} @@ -199,7 +197,7 @@ public: } template - LLHandle getDerivedHandle(typename boost::enable_if< typename boost::is_convertible >::type* dummy = 0) const + LLHandle getDerivedHandle(typename std::enable_if_t >* dummy = 0) const { LLHandle downcast_handle; downcast_handle.mTombStone = getHandle().mTombStone; diff --git a/indra/llcommon/llinitdestroyclass.h b/indra/llcommon/llinitdestroyclass.h index 2354c9f2ed..7cc9c6b930 100644 --- a/indra/llcommon/llinitdestroyclass.h +++ b/indra/llcommon/llinitdestroyclass.h @@ -37,7 +37,7 @@ #define LL_LLINITDESTROYCLASS_H #include "llsingleton.h" -#include +#include #include #include #include // std::pair @@ -50,7 +50,7 @@ class LLCallbackRegistry { public: - typedef boost::function func_t; + typedef std::function func_t; void registerCallback(const std::string& name, const func_t& func) { diff --git a/indra/llcommon/llinitparam.h b/indra/llcommon/llinitparam.h index 32d7b17034..b01ea0bfb1 100644 --- a/indra/llcommon/llinitparam.h +++ b/indra/llcommon/llinitparam.h @@ -28,11 +28,12 @@ #ifndef LL_LLPARAM_H #define LL_LLPARAM_H +#include +#include #include #include +#include #include -#include -#include #include #include "llerror.h" @@ -105,6 +106,26 @@ namespace LLTypeTags }; } +namespace ll +{ + // Primary template: general case is false + template + struct is_std_function : std::false_type + { + }; + + // Specialization for std::function + // R is the return type, Args is a parameter pack for argument types + template + struct is_std_function> : std::true_type + { + }; + + // Helper variable template for convenience (C++14 onwards) + template + constexpr bool is_std_function_v = is_std_function::value; +} + namespace LLInitParam { // used to indicate no matching value to a given name when parsing @@ -114,7 +135,7 @@ namespace LLInitParam // wraps comparison operator between any 2 values of the same type // specialize to handle cases where equality isn't defined well, or at all - template ::value > + template || ll::is_std_function_v> struct ParamCompare { static bool equals(const T &a, const T &b) @@ -123,7 +144,7 @@ namespace LLInitParam } }; - // boost function types are not comparable + // boost and std function types are not comparable template struct ParamCompare { @@ -474,7 +495,7 @@ namespace LLInitParam typedef bool (*parser_read_func_t)(Parser& parser, void* output); typedef bool (*parser_write_func_t)(Parser& parser, const void*, name_stack_t&); - typedef boost::function parser_inspect_func_t; + typedef std::function parser_inspect_func_t; typedef std::map parser_read_func_map_t; typedef std::map parser_write_func_map_t; @@ -491,7 +512,7 @@ namespace LLInitParam virtual ~Parser(); - template bool readValue(T& param, typename boost::disable_if >::type* dummy = 0) + template bool readValue(T& param, typename std::enable_if_t>* dummy = 0) { parser_read_func_map_t::iterator found_it = mParserReadFuncs->find(&typeid(T)); if (found_it != mParserReadFuncs->end()) @@ -502,7 +523,7 @@ namespace LLInitParam return false; } - template bool readValue(T& param, typename boost::enable_if >::type* dummy = 0) + template bool readValue(T& param, typename std::enable_if_t >* dummy = 0) { parser_read_func_map_t::iterator found_it = mParserReadFuncs->find(&typeid(T)); if (found_it != mParserReadFuncs->end()) diff --git a/indra/llcommon/llleaplistener.h b/indra/llcommon/llleaplistener.h index 9663e9a22f..f5587d1d68 100644 --- a/indra/llcommon/llleaplistener.h +++ b/indra/llcommon/llleaplistener.h @@ -13,9 +13,9 @@ #define LL_LLLEAPLISTENER_H #include "lleventapi.h" +#include #include #include -#include /// Listener class implementing LLLeap query/control operations. /// See https://jira.lindenlab.com/jira/browse/DEV-31978. @@ -30,7 +30,7 @@ public: * define the signature for a function that will perform that, and make * our constructor accept such a function. */ - typedef boost::function + typedef std::function ConnectFunc; LLLeapListener(const ConnectFunc& connect); ~LLLeapListener(); diff --git a/indra/llcommon/llpounceable.h b/indra/llcommon/llpounceable.h index da47abd8a0..e86098f20b 100644 --- a/indra/llcommon/llpounceable.h +++ b/indra/llcommon/llpounceable.h @@ -37,11 +37,12 @@ #include "llsingleton.h" #include -#include #include #include #include +#include + // Forward declare the user template, since we want to be able to point to it // in some of its implementation classes. template @@ -163,7 +164,7 @@ public: // make read access to mHeld as cheap and transparent as possible operator T () const { return mHeld; } - typename boost::remove_pointer::type operator*() const { return *mHeld; } + typename std::remove_pointer::type operator*() const { return *mHeld; } typename boost::call_traits::value_type operator->() const { return mHeld; } // uncomment 'explicit' as soon as we allow C++11 compilation /*explicit*/ operator bool() const { return bool(mHeld); } diff --git a/indra/llcommon/llptrto.cpp b/indra/llcommon/llptrto.cpp index c4528a47a7..adf636c4d2 100644 --- a/indra/llcommon/llptrto.cpp +++ b/indra/llcommon/llptrto.cpp @@ -31,10 +31,9 @@ // associated header #include "llptrto.h" // STL headers +#include // std headers // external library headers -#include -#include // other Linden headers #include "llmemory.h" @@ -76,27 +75,27 @@ public: int main(int argc, char *argv[]) { // test LLPtrTo<> - BOOST_STATIC_ASSERT((boost::is_same::type, LLPointer >::value)); - BOOST_STATIC_ASSERT((boost::is_same::type, LLPointer >::value)); - BOOST_STATIC_ASSERT((boost::is_same::type, LLPointer >::value)); - BOOST_STATIC_ASSERT((boost::is_same::type, Bar*>::value)); - BOOST_STATIC_ASSERT((boost::is_same::type, SubBar*>::value)); - BOOST_STATIC_ASSERT((boost::is_same::type, int*>::value)); + static_assert((std::is_same_v::type, LLPointer >)); + static_assert((std::is_same_v::type, LLPointer >)); + static_assert((std::is_same_v::type, LLPointer >)); + static_assert((std::is_same_v::type, Bar*>)); + static_assert((std::is_same_v::type, SubBar*>)); + static_assert((std::is_same_v::type, int*>)); // Test LLRemovePointer<>. Note that we remove both pointer variants from // each kind of type, regardless of whether the variant makes sense. - BOOST_STATIC_ASSERT((boost::is_same::type, RCFoo>::value)); - BOOST_STATIC_ASSERT((boost::is_same >::type, RCFoo>::value)); - BOOST_STATIC_ASSERT((boost::is_same::type, RCSubFoo>::value)); - BOOST_STATIC_ASSERT((boost::is_same >::type, RCSubFoo>::value)); - BOOST_STATIC_ASSERT((boost::is_same::type, TSRCFoo>::value)); - BOOST_STATIC_ASSERT((boost::is_same >::type, TSRCFoo>::value)); - BOOST_STATIC_ASSERT((boost::is_same::type, Bar>::value)); - BOOST_STATIC_ASSERT((boost::is_same >::type, Bar>::value)); - BOOST_STATIC_ASSERT((boost::is_same::type, SubBar>::value)); - BOOST_STATIC_ASSERT((boost::is_same >::type, SubBar>::value)); - BOOST_STATIC_ASSERT((boost::is_same::type, int>::value)); - BOOST_STATIC_ASSERT((boost::is_same >::type, int>::value)); + static_assert((std::is_same_v::type, RCFoo>)); + static_assert((std::is_same_v >::type, RCFoo>)); + static_assert((std::is_same_v::type, RCSubFoo>)); + static_assert((std::is_same_v >::type, RCSubFoo>)); + static_assert((std::is_same_v::type, TSRCFoo>)); + static_assert((std::is_same_v >::type, TSRCFoo>)); + static_assert((std::is_same_v::type, Bar>)); + static_assert((std::is_same_v >::type, Bar>)); + static_assert((std::is_same_v::type, SubBar>)); + static_assert((std::is_same_v >::type, SubBar>)); + static_assert((std::is_same_v::type, int>)); + static_assert((std::is_same_v >::type, int>)); return 0; } diff --git a/indra/llcommon/llptrto.h b/indra/llcommon/llptrto.h index b57a1ee7f4..24e312559e 100644 --- a/indra/llcommon/llptrto.h +++ b/indra/llcommon/llptrto.h @@ -35,8 +35,6 @@ #include "llrefcount.h" // LLRefCount #include #include -#include -#include #include // std::shared_ptr, std::unique_ptr #include @@ -58,14 +56,14 @@ struct LLPtrTo /// specialize for subclasses of LLRefCount template -struct LLPtrTo::value >::type> +struct LLPtrTo::value >::type> { typedef LLPointer type; }; /// specialize for subclasses of LLThreadSafeRefCount template -struct LLPtrTo::value >::type> +struct LLPtrTo::value >::type> { typedef LLPointer type; }; @@ -76,7 +74,7 @@ struct LLPtrTo struct LLRemovePointer { - typedef typename boost::remove_pointer::type type; + typedef typename std::remove_pointer::type type; }; /// specialize for LLPointer diff --git a/indra/llcommon/llsdparam.cpp b/indra/llcommon/llsdparam.cpp index 3ae153a67c..caaac3d762 100644 --- a/indra/llcommon/llsdparam.cpp +++ b/indra/llcommon/llsdparam.cpp @@ -30,7 +30,6 @@ // Project includes #include "llsdparam.h" #include "llsdutil.h" -#include "boost/bind.hpp" static LLInitParam::Parser::parser_read_func_map_t sReadFuncs; static LLInitParam::Parser::parser_write_func_map_t sWriteFuncs; @@ -43,8 +42,6 @@ static const LLSD NO_VALUE_MARKER; LLParamSDParser::LLParamSDParser() : Parser(sReadFuncs, sWriteFuncs, sInspectFuncs) { - using boost::bind; - if (sReadFuncs.empty()) { registerParserFuncs(readFlag, &LLParamSDParser::writeFlag); @@ -97,7 +94,7 @@ void LLParamSDParser::readSD(const LLSD& sd, LLInitParam::BaseBlock& block, bool mNameStack.clear(); setParseSilently(silent); - LLParamSDParserUtilities::readSDValues(boost::bind(&LLParamSDParser::submit, this, boost::ref(block), _1, _2), sd, mNameStack); + LLParamSDParserUtilities::readSDValues(std::bind(&LLParamSDParser::submit, this, std::ref(block), std::placeholders::_1, std::placeholders::_2), sd, mNameStack); //readSDValues(sd, block); } @@ -276,14 +273,14 @@ void LLParamSDParserUtilities::readSDValues(read_sd_cb_t cb, const LLSD& sd, LLI } else if (sd.isUndefined()) { - if (!cb.empty()) + if (cb != nullptr) { cb(NO_VALUE_MARKER, stack); } } else { - if (!cb.empty()) + if (cb != nullptr) { cb(sd, stack); } @@ -333,7 +330,7 @@ namespace LLInitParam if (!p.writeValue(mValue, name_stack_range)) { // otherwise read from LLSD value and serialize out to parser (which could be LLSD, XUI, etc) - LLParamSDParserUtilities::readSDValues(boost::bind(&serializeElement, boost::ref(p), _1, _2), mValue, name_stack_range); + LLParamSDParserUtilities::readSDValues(std::bind(&serializeElement, std::ref(p), std::placeholders::_1, std::placeholders::_2), mValue, name_stack_range); } return true; } diff --git a/indra/llcommon/llsdparam.h b/indra/llcommon/llsdparam.h index 21ebb9a258..447ba02327 100644 --- a/indra/llcommon/llsdparam.h +++ b/indra/llcommon/llsdparam.h @@ -29,14 +29,14 @@ #define LL_LLSDPARAM_H #include "llinitparam.h" -#include "boost/function.hpp" +#include #include "llfasttimer.h" struct LL_COMMON_API LLParamSDParserUtilities { static LLSD& getSDWriteNode(LLSD& input, LLInitParam::Parser::name_stack_range_t& name_stack_range); - typedef boost::function read_sd_cb_t; + typedef std::function read_sd_cb_t; static void readSDValues(read_sd_cb_t cb, const LLSD& sd, LLInitParam::Parser::name_stack_t& stack); static void readSDValues(read_sd_cb_t cb, const LLSD& sd); }; diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index 270ca40086..803bab393c 100644 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -51,9 +51,6 @@ #include #include #include -#include -#include -#include #include "llfasttimer.h" using namespace llsd; @@ -722,7 +719,7 @@ public: // Store every integer type as LLSD::Integer. template void add(const LLSD::String& name, const T& value, - typename boost::enable_if >::type* = 0) + typename std::enable_if_t >* = 0) { mStats[name] = LLSD::Integer(value); } @@ -730,7 +727,7 @@ public: // Store every floating-point type as LLSD::Real. template void add(const LLSD::String& name, const T& value, - typename boost::enable_if >::type* = 0) + typename std::enable_if_t >* = 0) { mStats[name] = LLSD::Real(value); } diff --git a/indra/llcommon/lltreeiterators.h b/indra/llcommon/lltreeiterators.h index cef501b987..cc13955d2f 100644 --- a/indra/llcommon/lltreeiterators.h +++ b/indra/llcommon/lltreeiterators.h @@ -60,10 +60,10 @@ #define LL_LLTREEITERATORS_H #include "llptrto.h" +#include #include #include #include -#include #include namespace LLTreeIter @@ -93,7 +93,7 @@ protected: typedef typename LLPtrTo::type ptr_type; /// function that advances from this node to next accepts a node pointer /// and returns another - typedef boost::function func_type; + typedef std::function func_type; typedef SELFTYPE self_type; }; @@ -330,7 +330,7 @@ protected: typedef typename super::ptr_type ptr_type; // The func_type is different for this: from a NODE pointer, we must // obtain a CHILDITER. - typedef boost::function func_type; + typedef std::function func_type; private: typedef std::vector list_type; public: @@ -435,7 +435,7 @@ protected: typedef typename super::ptr_type ptr_type; // The func_type is different for this: from a NODE pointer, we must // obtain a CHILDITER. - typedef boost::function func_type; + typedef std::function func_type; private: // Upon reaching a given node in our pending list, we need to know whether // we've already pushed that node's children, so we must associate a bool @@ -574,7 +574,7 @@ protected: typedef typename super::ptr_type ptr_type; // The func_type is different for this: from a NODE pointer, we must // obtain a CHILDITER. - typedef boost::function func_type; + typedef std::function func_type; private: // We need a FIFO queue rather than a LIFO stack. Use a deque rather than // a vector, since vector can't implement pop_front() efficiently. diff --git a/indra/llcommon/tests/lleventdispatcher_test.cpp b/indra/llcommon/tests/lleventdispatcher_test.cpp index 44f772e322..8b206f7b14 100644 --- a/indra/llcommon/tests/lleventdispatcher_test.cpp +++ b/indra/llcommon/tests/lleventdispatcher_test.cpp @@ -33,7 +33,6 @@ #include #include -#include #include #include diff --git a/indra/llcommon/tests/llprocess_test.cpp b/indra/llcommon/tests/llprocess_test.cpp index 4adfaf54f3..d3d8e54d45 100644 --- a/indra/llcommon/tests/llprocess_test.cpp +++ b/indra/llcommon/tests/llprocess_test.cpp @@ -21,7 +21,6 @@ // external library headers #include "llapr.h" #include "apr_thread_proc.h" -#include #include #include // other Linden headers @@ -264,9 +263,12 @@ static std::string python_out(const std::string& desc, const CONTENT& script) } /// Create a temporary directory and clean it up later. -class NamedTempDir: public boost::noncopyable +class NamedTempDir { public: + NamedTempDir(const NamedTempDir&) = delete; + NamedTempDir& operator=(const NamedTempDir&) = delete; + NamedTempDir(): mPath(NamedTempFile::temp_path()), mCreated(boost::filesystem::create_directories(mPath)) @@ -1095,8 +1097,11 @@ namespace tut ensure_equals("bad child exit code", py.mPy->getStatus().mData, 0); } - struct EventListener: public boost::noncopyable + struct EventListener { + EventListener(const EventListener&) = delete; + EventListener& operator=(const EventListener&) = delete; + EventListener(LLEventPump& pump) { mConnection = diff --git a/indra/llcommon/tests/lltreeiterators_test.cpp b/indra/llcommon/tests/lltreeiterators_test.cpp index 7a2adfd8ba..6734596d25 100644 --- a/indra/llcommon/tests/lltreeiterators_test.cpp +++ b/indra/llcommon/tests/lltreeiterators_test.cpp @@ -32,6 +32,7 @@ // STL headers // std headers +#include #include #include #include @@ -915,7 +916,7 @@ struct WalkExpected: public Expected template typename LLPtrTo::type get_B2b(const typename LLPtrTo::type& root, - const boost::function::type&)>& child_begin) + const std::function::type&)>& child_begin) { typedef typename LLPtrTo::type NodePtr; CHILDITER Bi(child_begin(root)); -- cgit v1.3