diff options
213 files changed, 546 insertions, 549 deletions
diff --git a/indra/llcharacter/llmotion.cpp b/indra/llcharacter/llmotion.cpp index bc9f578660..a51857c9a1 100644 --- a/indra/llcharacter/llmotion.cpp +++ b/indra/llcharacter/llmotion.cpp @@ -51,8 +51,8 @@ LLMotion::LLMotion( const LLUUID &id ) : mSendStopTimestamp(F32_MAX), mResidualWeight(0.f), mFadeWeight(1.f), - mDeactivateCallback(NULL), - mDeactivateCallbackUserData(NULL) + mDeactivateCallback(nullptr), + mDeactivateCallbackUserData(nullptr) { for (S32 i=0; i<3; ++i) memset(&mJointSignature[i][0], 0, sizeof(U8) * LL_CHARACTER_MAX_ANIMATED_JOINTS); diff --git a/indra/llcharacter/llvisualparam.h b/indra/llcharacter/llvisualparam.h index 3caddb9c62..8d2c4a3723 100644 --- a/indra/llcharacter/llvisualparam.h +++ b/indra/llcharacter/llvisualparam.h @@ -30,7 +30,8 @@ #include "v3math.h" #include "llstring.h" #include "llxmltree.h" -#include <boost/function.hpp> + +#include <functional> class LLPolyMesh; class LLXmlTreeNode; @@ -104,7 +105,7 @@ LL_ALIGN_PREFIX(16) class LLVisualParam { public: - typedef boost::function<LLVisualParam*(S32)> visual_param_mapper; + typedef std::function<LLVisualParam*(S32)> visual_param_mapper; LLVisualParam(); virtual ~LLVisualParam(); 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 <boost/function.hpp> +#include "stdtypes.h" + +#include <functional> #include <list> class LLCallbackList @@ -59,8 +60,8 @@ protected: callback_list_t mCallbackList; }; -typedef boost::function<void ()> nullary_func_t; -typedef boost::function<bool ()> bool_func_t; +typedef std::function<void ()> nullary_func_t; +typedef std::function<bool ()> 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 <boost/function.hpp> +#include <functional> #include <string> #include <exception> #include <queue> @@ -112,7 +112,7 @@ public: /// stuck with the term "coroutine." typedef boost::fibers::fiber coro; /// Canonical callable type - typedef boost::function<void()> callable_t; + typedef std::function<void()> 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 <functional> #include <string> #include <vector> #include <set> @@ -38,7 +39,6 @@ #include <boost/iterator/transform_iterator.hpp> #include <boost/iterator/indirect_iterator.hpp> #include <boost/range/iterator_range.hpp> -#include <boost/function.hpp> #include <boost/bind.hpp> #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<const typename DepNode::dep_set&(const DepNode&)> dep_selector; + typedef std::function<const typename DepNode::dep_set&(const DepNode&)> dep_selector; public: LLDependencies() {} @@ -340,7 +340,7 @@ private: public: /// iterator over value_type entries - typedef boost::transform_iterator<boost::function<value_type(DepNodeMapEntry&)>, + typedef boost::transform_iterator<std::function<value_type(DepNodeMapEntry&)>, typename DepNodeMap::iterator> iterator; /// range over value_type entries typedef boost::iterator_range<iterator> range; @@ -352,7 +352,7 @@ public: } /// iterator over const_value_type entries - typedef boost::transform_iterator<boost::function<const_value_type(const DepNodeMapEntry&)>, + typedef boost::transform_iterator<std::function<const_value_type(const DepNodeMapEntry&)>, typename DepNodeMap::const_iterator> const_iterator; /// range over const_value_type entries typedef boost::iterator_range<const_iterator> const_range; @@ -364,7 +364,7 @@ public: } /// iterator over stored NODEs - typedef boost::transform_iterator<boost::function<NODE&(DepNodeMapEntry&)>, + typedef boost::transform_iterator<std::function<NODE&(DepNodeMapEntry&)>, typename DepNodeMap::iterator> node_iterator; /// range over stored NODEs typedef boost::iterator_range<node_iterator> node_range; @@ -380,7 +380,7 @@ public: } /// const iterator over stored NODEs - typedef boost::transform_iterator<boost::function<const NODE&(const DepNodeMapEntry&)>, + typedef boost::transform_iterator<std::function<const NODE&(const DepNodeMapEntry&)>, typename DepNodeMap::const_iterator> const_node_iterator; /// const range over stored NODEs typedef boost::iterator_range<const_node_iterator> const_node_range; @@ -396,7 +396,7 @@ public: } /// const iterator over stored KEYs - typedef boost::transform_iterator<boost::function<const KEY&(const DepNodeMapEntry&)>, + typedef boost::transform_iterator<std::function<const KEY&(const DepNodeMapEntry&)>, typename DepNodeMap::const_iterator> const_key_iterator; /// const range over stored KEYs typedef boost::iterator_range<const_key_iterator> 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 <list> -#include <boost/function.hpp> -#include <boost/bind.hpp> -#include <boost/ref.hpp> +#include <functional> /** * 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<Type1>(), Type<Type2>(), func, insertion); if (symmetrical) { - insert(Type<Type2>(), Type<Type1>(), boost::bind(func, _2, _1), insertion); + insert(Type<Type2>(), Type<Type1>(), 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 <functional> #include <string> class LLSD; @@ -92,7 +92,7 @@ namespace LLError Control functions. */ - typedef boost::function<void(const std::string&)> FatalFunction; + typedef std::function<void(const std::string&)> 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 <boost/fiber/fss.hpp> -#include <boost/function_types/is_member_function_pointer.hpp> #include <boost/function_types/is_nonmember_callable_builtin.hpp> #include <boost/iterator/transform_iterator.hpp> #include <functional> // std::function @@ -316,7 +315,7 @@ public: */ template<typename Method, typename InstanceGetter, typename = typename std::enable_if< - boost::function_types::is_member_function_pointer<Method>::value && + std::is_member_function_pointer<Method>::value && ! std::is_convertible<InstanceGetter, LLSD>::value >::type> void add(const std::string& name, const std::string& desc, Method f, @@ -362,7 +361,7 @@ public: */ template<typename Method, typename InstanceGetter, typename = typename std::enable_if< - boost::function_types::is_member_function_pointer<Method>::value && + std::is_member_function_pointer<Method>::value && ! std::is_convertible<InstanceGetter, LLSD>::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 <boost/function.hpp> + +#include <functional> 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<void()> Action; + /// Callable, can be constructed with std::bind() + typedef std::function<void()> 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 <cmath> #include <cctype> // external library headers -#include <boost/range/iterator_range.hpp> #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 <boost/signals2.hpp> #include <boost/bind.hpp> #include <boost/optional/optional.hpp> -#include <boost/visit_each.hpp> -#include <boost/ref.hpp> // reference_wrapper -#include <boost/type_traits/is_pointer.hpp> #include <boost/static_assert.hpp> #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 <stdexcept> -#include <boost/type_traits/is_convertible.hpp> -#include <boost/utility/enable_if.hpp> #include <boost/throw_exception.hpp> /** @@ -90,7 +88,7 @@ public: LLHandle() : mTombStone(getDefaultTombStone()) {} template<typename U> - LLHandle(const LLHandle<U>& other, typename boost::enable_if< typename boost::is_convertible<U*, T*> >::type* dummy = 0) + LLHandle(const LLHandle<U>& other, typename std::enable_if_t<std::is_convertible_v<U*, T*>>* dummy = 0) : mTombStone(other.mTombStone) {} @@ -199,7 +197,7 @@ public: } template <typename U> - LLHandle<U> getDerivedHandle(typename boost::enable_if< typename boost::is_convertible<U*, T*> >::type* dummy = 0) const + LLHandle<U> getDerivedHandle(typename std::enable_if_t<std::is_convertible_v<U*, T*> >* dummy = 0) const { LLHandle<U> 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 <boost/function.hpp> +#include <functional> #include <typeinfo> #include <vector> #include <utility> // std::pair @@ -50,7 +50,7 @@ class LLCallbackRegistry { public: - typedef boost::function<void()> func_t; + typedef std::function<void()> 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 <functional> +#include <type_traits> #include <vector> #include <list> +#include <unordered_map> #include <boost/function.hpp> -#include <boost/type_traits/is_convertible.hpp> -#include <boost/type_traits/is_enum.hpp> #include <boost/unordered_map.hpp> #include "llerror.h" @@ -105,6 +106,26 @@ namespace LLTypeTags }; } +namespace ll +{ + // Primary template: general case is false + template<typename T> + 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<typename R, typename... Args> + struct is_std_function<std::function<R(Args...)>> : std::true_type + { + }; + + // Helper variable template for convenience (C++14 onwards) + template<typename T> + constexpr bool is_std_function_v = is_std_function<T>::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 <typename T, bool IS_BOOST_FUNCTION = boost::is_convertible<T, boost::function_base>::value > + template <typename T, bool IS_BOOST_FUNCTION = std::is_constructible_v<T, boost::function_base> || ll::is_std_function_v<T>> 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<typename T> struct ParamCompare<T, true> { @@ -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<void (name_stack_t&, S32, S32, const possible_values_t*)> parser_inspect_func_t; + typedef std::function<void (name_stack_t&, S32, S32, const possible_values_t*)> parser_inspect_func_t; typedef std::map<const std::type_info*, parser_read_func_t> parser_read_func_map_t; typedef std::map<const std::type_info*, parser_write_func_t> parser_write_func_map_t; @@ -491,7 +512,7 @@ namespace LLInitParam virtual ~Parser(); - template <typename T> bool readValue(T& param, typename boost::disable_if<boost::is_enum<T> >::type* dummy = 0) + template <typename T> bool readValue(T& param, typename std::enable_if_t<!std::is_enum_v<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 <typename T> bool readValue(T& param, typename boost::enable_if<boost::is_enum<T> >::type* dummy = 0) + template <typename T> bool readValue(T& param, typename std::enable_if_t<std::is_enum_v<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 <functional> #include <map> #include <string> -#include <boost/function.hpp> /// 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<LLBoundListener(LLEventPump&, const std::string& listener)> + typedef std::function<LLBoundListener(LLEventPump&, const std::string& listener)> 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 <boost/call_traits.hpp> -#include <boost/type_traits/remove_pointer.hpp> #include <boost/utility/value_init.hpp> #include <boost/unordered_map.hpp> #include <boost/signals2/signal.hpp> +#include <type_traits> + // Forward declare the user template, since we want to be able to point to it // in some of its implementation classes. template <typename T, class TAG> @@ -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<T>::type operator*() const { return *mHeld; } + typename std::remove_pointer<T>::type operator*() const { return *mHeld; } typename boost::call_traits<T>::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 <type_traits> // std headers // external library headers -#include <boost/type_traits/is_same.hpp> -#include <boost/static_assert.hpp> // 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<LLPtrTo<RCFoo>::type, LLPointer<RCFoo> >::value)); - BOOST_STATIC_ASSERT((boost::is_same<LLPtrTo<RCSubFoo>::type, LLPointer<RCSubFoo> >::value)); - BOOST_STATIC_ASSERT((boost::is_same<LLPtrTo<TSRCFoo>::type, LLPointer<TSRCFoo> >::value)); - BOOST_STATIC_ASSERT((boost::is_same<LLPtrTo<Bar>::type, Bar*>::value)); - BOOST_STATIC_ASSERT((boost::is_same<LLPtrTo<SubBar>::type, SubBar*>::value)); - BOOST_STATIC_ASSERT((boost::is_same<LLPtrTo<int>::type, int*>::value)); + static_assert((std::is_same_v<LLPtrTo<RCFoo>::type, LLPointer<RCFoo> >)); + static_assert((std::is_same_v<LLPtrTo<RCSubFoo>::type, LLPointer<RCSubFoo> >)); + static_assert((std::is_same_v<LLPtrTo<TSRCFoo>::type, LLPointer<TSRCFoo> >)); + static_assert((std::is_same_v<LLPtrTo<Bar>::type, Bar*>)); + static_assert((std::is_same_v<LLPtrTo<SubBar>::type, SubBar*>)); + static_assert((std::is_same_v<LLPtrTo<int>::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<LLRemovePointer<RCFoo*>::type, RCFoo>::value)); - BOOST_STATIC_ASSERT((boost::is_same<LLRemovePointer< LLPointer<RCFoo> >::type, RCFoo>::value)); - BOOST_STATIC_ASSERT((boost::is_same<LLRemovePointer<RCSubFoo*>::type, RCSubFoo>::value)); - BOOST_STATIC_ASSERT((boost::is_same<LLRemovePointer< LLPointer<RCSubFoo> >::type, RCSubFoo>::value)); - BOOST_STATIC_ASSERT((boost::is_same<LLRemovePointer<TSRCFoo*>::type, TSRCFoo>::value)); - BOOST_STATIC_ASSERT((boost::is_same<LLRemovePointer< LLPointer<TSRCFoo> >::type, TSRCFoo>::value)); - BOOST_STATIC_ASSERT((boost::is_same<LLRemovePointer<Bar*>::type, Bar>::value)); - BOOST_STATIC_ASSERT((boost::is_same<LLRemovePointer< LLPointer<Bar> >::type, Bar>::value)); - BOOST_STATIC_ASSERT((boost::is_same<LLRemovePointer<SubBar*>::type, SubBar>::value)); - BOOST_STATIC_ASSERT((boost::is_same<LLRemovePointer< LLPointer<SubBar> >::type, SubBar>::value)); - BOOST_STATIC_ASSERT((boost::is_same<LLRemovePointer<int*>::type, int>::value)); - BOOST_STATIC_ASSERT((boost::is_same<LLRemovePointer< LLPointer<int> >::type, int>::value)); + static_assert((std::is_same_v<LLRemovePointer<RCFoo*>::type, RCFoo>)); + static_assert((std::is_same_v<LLRemovePointer< LLPointer<RCFoo> >::type, RCFoo>)); + static_assert((std::is_same_v<LLRemovePointer<RCSubFoo*>::type, RCSubFoo>)); + static_assert((std::is_same_v<LLRemovePointer< LLPointer<RCSubFoo> >::type, RCSubFoo>)); + static_assert((std::is_same_v<LLRemovePointer<TSRCFoo*>::type, TSRCFoo>)); + static_assert((std::is_same_v<LLRemovePointer< LLPointer<TSRCFoo> >::type, TSRCFoo>)); + static_assert((std::is_same_v<LLRemovePointer<Bar*>::type, Bar>)); + static_assert((std::is_same_v<LLRemovePointer< LLPointer<Bar> >::type, Bar>)); + static_assert((std::is_same_v<LLRemovePointer<SubBar*>::type, SubBar>)); + static_assert((std::is_same_v<LLRemovePointer< LLPointer<SubBar> >::type, SubBar>)); + static_assert((std::is_same_v<LLRemovePointer<int*>::type, int>)); + static_assert((std::is_same_v<LLRemovePointer< LLPointer<int> >::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 <boost/intrusive_ptr.hpp> #include <boost/shared_ptr.hpp> -#include <boost/type_traits/is_base_of.hpp> -#include <boost/type_traits/remove_pointer.hpp> #include <memory> // std::shared_ptr, std::unique_ptr #include <type_traits> @@ -58,14 +56,14 @@ struct LLPtrTo /// specialize for subclasses of LLRefCount template <class T> -struct LLPtrTo<T, typename std::enable_if< boost::is_base_of<LLRefCount, T>::value >::type> +struct LLPtrTo<T, typename std::enable_if< std::is_base_of<LLRefCount, T>::value >::type> { typedef LLPointer<T> type; }; /// specialize for subclasses of LLThreadSafeRefCount template <class T> -struct LLPtrTo<T, typename std::enable_if< boost::is_base_of<LLThreadSafeRefCount, T>::value >::type> +struct LLPtrTo<T, typename std::enable_if< std::is_base_of<LLThreadSafeRefCount, T>::value >::type> { typedef LLPointer<T> type; }; @@ -76,7 +74,7 @@ struct LLPtrTo<T, typename std::enable_if< boost::is_base_of<LLThreadSafeRefCoun template <typename PTRTYPE> struct LLRemovePointer { - typedef typename boost::remove_pointer<PTRTYPE>::type type; + typedef typename std::remove_pointer<PTRTYPE>::type type; }; /// specialize for LLPointer<SOMECLASS> 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<LLInitParam::Flag>(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<LLSD>(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 <functional> #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<void (const LLSD&, LLInitParam::Parser::name_stack_t&)> read_sd_cb_t; + typedef std::function<void (const LLSD&, LLInitParam::Parser::name_stack_t&)> 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 <boost/circular_buffer.hpp> #include <boost/lexical_cast.hpp> #include <boost/range.hpp> -#include <boost/utility/enable_if.hpp> -#include <boost/type_traits/is_integral.hpp> -#include <boost/type_traits/is_float.hpp> #include "llfasttimer.h" using namespace llsd; @@ -722,7 +719,7 @@ public: // Store every integer type as LLSD::Integer. template <class T> void add(const LLSD::String& name, const T& value, - typename boost::enable_if<boost::is_integral<T> >::type* = 0) + typename std::enable_if_t<std::is_integral_v<T> >* = 0) { mStats[name] = LLSD::Integer(value); } @@ -730,7 +727,7 @@ public: // Store every floating-point type as LLSD::Real. template <class T> void add(const LLSD::String& name, const T& value, - typename boost::enable_if<boost::is_float<T> >::type* = 0) + typename std::enable_if_t<std::is_floating_point_v<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 <functional> #include <vector> #include <deque> #include <boost/iterator/iterator_facade.hpp> -#include <boost/function.hpp> #include <boost/static_assert.hpp> namespace LLTreeIter @@ -93,7 +93,7 @@ protected: typedef typename LLPtrTo<NODE>::type ptr_type; /// function that advances from this node to next accepts a node pointer /// and returns another - typedef boost::function<ptr_type(const ptr_type&)> func_type; + typedef std::function<ptr_type(const ptr_type&)> 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<CHILDITER(const ptr_type&)> func_type; + typedef std::function<CHILDITER(const ptr_type&)> func_type; private: typedef std::vector<ptr_type> 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<CHILDITER(const ptr_type&)> func_type; + typedef std::function<CHILDITER(const ptr_type&)> 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<CHILDITER(const ptr_type&)> func_type; + typedef std::function<CHILDITER(const ptr_type&)> 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 <stdexcept> #include <boost/bind.hpp> -#include <boost/function.hpp> #include <boost/range.hpp> #include <boost/lambda/lambda.hpp> 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 <boost/function.hpp> #include <boost/algorithm/string/find_iterator.hpp> #include <boost/algorithm/string/finder.hpp> // 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 <functional> #include <iostream> #include <sstream> #include <string> @@ -915,7 +916,7 @@ struct WalkExpected<LLTreeIter::BFS>: public Expected template <class NODE, typename CHILDITER> typename LLPtrTo<NODE>::type get_B2b(const typename LLPtrTo<NODE>::type& root, - const boost::function<CHILDITER(const typename LLPtrTo<NODE>::type&)>& child_begin) + const std::function<CHILDITER(const typename LLPtrTo<NODE>::type&)>& child_begin) { typedef typename LLPtrTo<NODE>::type NodePtr; CHILDITER Bi(child_begin(root)); diff --git a/indra/llcorehttp/_httpoprequest.cpp b/indra/llcorehttp/_httpoprequest.cpp index 1edc6f52ee..9704486791 100644 --- a/indra/llcorehttp/_httpoprequest.cpp +++ b/indra/llcorehttp/_httpoprequest.cpp @@ -153,7 +153,7 @@ HttpOpRequest::HttpOpRequest() mPolicyRetryLimit(HTTP_RETRY_COUNT_DEFAULT), mPolicyMinRetryBackoff(HttpTime(HTTP_RETRY_BACKOFF_MIN_DEFAULT)), mPolicyMaxRetryBackoff(HttpTime(HTTP_RETRY_BACKOFF_MAX_DEFAULT)), - mCallbackSSLVerify(NULL) + mCallbackSSLVerify(nullptr) { // *NOTE: As members are added, retry initialization/cleanup // may need to be extended in @see prepareRequest(). diff --git a/indra/llcorehttp/_httpservice.cpp b/indra/llcorehttp/_httpservice.cpp index 5880fb7e87..a8660decc3 100644 --- a/indra/llcorehttp/_httpservice.cpp +++ b/indra/llcorehttp/_httpservice.cpp @@ -27,7 +27,6 @@ #include "_httpservice.h" #include <boost/bind.hpp> -#include <boost/function.hpp> #include "_httpoperation.h" #include "_httprequestqueue.h" diff --git a/indra/llcorehttp/_refcounted.h b/indra/llcorehttp/_refcounted.h index de2e3fe85c..63684b5e2c 100644 --- a/indra/llcorehttp/_refcounted.h +++ b/indra/llcorehttp/_refcounted.h @@ -31,12 +31,9 @@ #include "linden_common.h" #include "fix_macros.h" -#include <boost/thread.hpp> #include <boost/intrusive_ptr.hpp> - #include "llatomic.h" - namespace LLCoreInt { diff --git a/indra/llcorehttp/httprequest.h b/indra/llcorehttp/httprequest.h index db5d5fa096..f7516f127a 100644 --- a/indra/llcorehttp/httprequest.h +++ b/indra/llcorehttp/httprequest.h @@ -237,7 +237,7 @@ public: /// Prototype for policy based callbacks. The callback methods will be executed /// on the worker thread so no modifications should be made to the HttpHandler object. - typedef boost::function<HttpStatus(const std::string &, const HttpHandler::ptr_t &, void *)> policyCallback_t; + typedef std::function<HttpStatus(const std::string &, const HttpHandler::ptr_t &, void *)> policyCallback_t; /// Set a policy option for a global or class parameter at /// startup time (prior to thread start). diff --git a/indra/llinventory/lllandmark.h b/indra/llinventory/lllandmark.h index 75596dc287..75520195ec 100644 --- a/indra/llinventory/lllandmark.h +++ b/indra/llinventory/lllandmark.h @@ -28,8 +28,8 @@ #ifndef LL_LLLANDMARK_H #define LL_LLLANDMARK_H +#include <functional> #include <map> -#include <boost/function.hpp> #include "llframetimer.h" #include "lluuid.h" #include "v3dmath.h" @@ -41,7 +41,7 @@ class LLLandmark { public: // for calling back interested parties when a region handle comes back. - typedef boost::function<void(const LLUUID& region_id, const U64& region_handle)> region_handle_callback_t; + typedef std::function<void(const LLUUID& region_id, const U64& region_handle)> region_handle_callback_t; ~LLLandmark() {} diff --git a/indra/llinventory/llsettingsbase.cpp b/indra/llinventory/llsettingsbase.cpp index d7a94d61a5..031029531c 100644 --- a/indra/llinventory/llsettingsbase.cpp +++ b/indra/llinventory/llsettingsbase.cpp @@ -598,7 +598,7 @@ bool LLSettingsBase::Validator::verify(LLSD &data, U32 flags) return false; } - if (!mVerify.empty() && !mVerify(data[mName], flags)) + if (mVerify != nullptr && !mVerify(data[mName], flags)) { LL_WARNS("SETTINGS") << "Setting '" << mName << "' fails validation." << LL_ENDL; return false; diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index e8160b1503..20979bd98e 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -288,7 +288,7 @@ public: public: static const U32 VALIDATION_PARTIAL; - typedef boost::function<bool(LLSD &, U32)> verify_pr; + typedef std::function<bool(LLSD &, U32)> verify_pr; Validator(std::string name, bool required, LLSD::Type type, verify_pr verify = verify_pr(), LLSD defval = LLSD()) : mName(name), diff --git a/indra/llmessage/llavatarnamecache.h b/indra/llmessage/llavatarnamecache.h index fe51355207..0ddaee2aa1 100644 --- a/indra/llmessage/llavatarnamecache.h +++ b/indra/llmessage/llavatarnamecache.h @@ -42,7 +42,7 @@ class LLAvatarNameCache : public LLSingleton<LLAvatarNameCache> ~LLAvatarNameCache(); public: typedef boost::signals2::signal<void (void)> use_display_name_signal_t; - typedef boost::function<void (const LLUUID id, const LLAvatarName& av_name)> account_name_changed_callback_t; + typedef std::function<void (const LLUUID id, const LLAvatarName& av_name)> account_name_changed_callback_t; // Import/export the name cache to file. bool importFile(std::istream& istr); diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp index 4980e0a1da..56dfaef873 100644 --- a/indra/llmessage/llcachename.cpp +++ b/indra/llmessage/llcachename.cpp @@ -600,7 +600,7 @@ std::string LLCacheName::buildLegacyName(const std::string& complete_name) // This is a little bit kludgy. LLCacheNameCallback is a slot instead of a function pointer. // The reason it is a slot is so that the legacy get() function below can bind an old callback -// and pass it as a slot. The reason it isn't a boost::function is so that trackable behavior +// and pass it as a slot. The reason it isn't a std::function is so that trackable behavior // doesn't get lost. As a result, we have to bind the slot to a signal to call it, even when // we call it immediately. -Steve // NOTE: Even though passing first and last name is a bit of extra overhead, it eliminates the diff --git a/indra/llmessage/llcircuit.cpp b/indra/llmessage/llcircuit.cpp index 8f9c02bdca..c2b1a2f069 100644 --- a/indra/llmessage/llcircuit.cpp +++ b/indra/llmessage/llcircuit.cpp @@ -71,8 +71,8 @@ LLCircuitData::LLCircuitData(const LLHost &host, TPACKETID in_id, mPacketsOutID(0), mPacketsInID(in_id), mHighestPacketID(in_id), - mTimeoutCallback(NULL), - mTimeoutUserData(NULL), + mTimeoutCallback(nullptr), + mTimeoutUserData(nullptr), mTrusted(false), mbAllowTimeout(true), mbAlive(true), diff --git a/indra/llmessage/llcoproceduremanager.cpp b/indra/llmessage/llcoproceduremanager.cpp index 99b40e0877..0e5725baf3 100644 --- a/indra/llmessage/llcoproceduremanager.cpp +++ b/indra/llmessage/llcoproceduremanager.cpp @@ -155,8 +155,8 @@ LLCoprocedureManager::~LLCoprocedureManager() // Shutting down, just log it LL_WARNS() << "Exception during ~LLCoprocedureManager(): " << e.what() << LL_ENDL; } - mPropertyQueryFn.clear(); - mPropertyDefineFn.clear(); + mPropertyQueryFn = nullptr; + mPropertyDefineFn = nullptr; mPoolMap.clear(); } diff --git a/indra/llmessage/llcoproceduremanager.h b/indra/llmessage/llcoproceduremanager.h index 485333657c..f6f9a5783b 100644 --- a/indra/llmessage/llcoproceduremanager.h +++ b/indra/llmessage/llcoproceduremanager.h @@ -41,10 +41,10 @@ class LLCoprocedureManager : public LLSingleton < LLCoprocedureManager > virtual ~LLCoprocedureManager(); public: - typedef boost::function<U32(const std::string &)> SettingQuery_t; - typedef boost::function<void(const std::string &, U32, const std::string &)> SettingUpdate_t; + typedef std::function<U32(const std::string &)> SettingQuery_t; + typedef std::function<void(const std::string &, U32, const std::string &)> SettingUpdate_t; - typedef boost::function<void(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t &, const LLUUID &id)> CoProcedure_t; + typedef std::function<void(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t &, const LLUUID &id)> CoProcedure_t; /// Places the coprocedure on the queue for processing. /// diff --git a/indra/llmessage/llcorehttputil.cpp b/indra/llmessage/llcorehttputil.cpp index 28d9339bcf..b24e5e4fcc 100644 --- a/indra/llmessage/llcorehttputil.cpp +++ b/indra/llmessage/llcorehttputil.cpp @@ -57,7 +57,7 @@ namespace inline bool getBoolSetting(const std::string &keyname) { - if (!mBoolSettingGet || mBoolSettingGet.empty()) + if (mBoolSettingGet == nullptr) return(false); return mBoolSettingGet(HTTP_LOGBODY_KEY); } @@ -69,7 +69,7 @@ void setPropertyMethods(BoolSettingQuery_t queryfn, BoolSettingUpdate_t updatefn mBoolSettingGet = queryfn; mBoolSettingPut = updatefn; - if (mBoolSettingPut && !mBoolSettingPut.empty()) + if (mBoolSettingPut != nullptr) { mBoolSettingPut(HTTP_LOGBODY_KEY, false, "Log the entire HTTP body in the case of an HTTP error."); } @@ -1236,9 +1236,9 @@ void HttpCoroutineAdapter::callbackHttpGet(const std::string &url, LLCore::HttpR /*static*/ void HttpCoroutineAdapter::messageHttpGet(const std::string &url, const std::string &success, const std::string &failure) { - completionCallback_t cbSuccess = (success.empty()) ? NULL : + completionCallback_t cbSuccess = (success.empty()) ? nullptr : static_cast<completionCallback_t>(boost::bind(&logMessageSuccess, "HttpCoroutineAdapter", url, success)); - completionCallback_t cbFailure = (failure.empty()) ? NULL : + completionCallback_t cbFailure = (failure.empty()) ? nullptr : static_cast<completionCallback_t>(boost::bind(&logMessageFail, "HttpCoroutineAdapter", url, failure)); callbackHttpGet(url, cbSuccess, cbFailure); } @@ -1286,9 +1286,9 @@ void HttpCoroutineAdapter::callbackHttpPost(const std::string &url, LLCore::Http /*static*/ void HttpCoroutineAdapter::messageHttpPost(const std::string &url, const LLSD &postData, const std::string &success, const std::string &failure) { - completionCallback_t cbSuccess = (success.empty()) ? NULL : + completionCallback_t cbSuccess = (success.empty()) ? nullptr : static_cast<completionCallback_t>(boost::bind(&logMessageSuccess, "HttpCoroutineAdapter", url, success)); - completionCallback_t cbFailure = (failure.empty()) ? NULL : + completionCallback_t cbFailure = (failure.empty()) ? nullptr : static_cast<completionCallback_t>(boost::bind(&logMessageFail, "HttpCoroutineAdapter", url, failure)); callbackHttpPost(url, postData, cbSuccess, cbFailure); diff --git a/indra/llmessage/llcorehttputil.h b/indra/llmessage/llcorehttputil.h index 111fa6a1a0..3dbfd6f00d 100644 --- a/indra/llmessage/llcorehttputil.h +++ b/indra/llmessage/llcorehttputil.h @@ -58,8 +58,8 @@ namespace LLCoreHttpUtil { /// Allow access to to the property settings methods. -typedef boost::function<bool(const std::string &)> BoolSettingQuery_t; -typedef boost::function<void(const std::string &, bool, const std::string &)> BoolSettingUpdate_t; +typedef std::function<bool(const std::string &)> BoolSettingQuery_t; +typedef std::function<void(const std::string &, bool, const std::string &)> BoolSettingUpdate_t; void setPropertyMethods(BoolSettingQuery_t queryfn, BoolSettingUpdate_t updatefn); @@ -585,21 +585,21 @@ public: /// should match this form. /// @sa callbackHttpGet /// @sa callbackHttpPost - typedef boost::function<void(const LLSD &)> completionCallback_t; + typedef std::function<void(const LLSD &)> completionCallback_t; - static void callbackHttpGet(const std::string &url, LLCore::HttpRequest::policy_t policyId, completionCallback_t success = NULL, completionCallback_t failure = NULL); - static void callbackHttpGet(const std::string &url, completionCallback_t success = NULL, completionCallback_t failure = NULL) + static void callbackHttpGet(const std::string &url, LLCore::HttpRequest::policy_t policyId, completionCallback_t success = nullptr, completionCallback_t failure = nullptr); + static void callbackHttpGet(const std::string &url, completionCallback_t success = nullptr, completionCallback_t failure = nullptr) { callbackHttpGet(url, LLCore::HttpRequest::DEFAULT_POLICY_ID, success, failure); } - static void callbackHttpPost(const std::string &url, LLCore::HttpRequest::policy_t policyId, const LLSD &postData, completionCallback_t success = NULL, completionCallback_t failure = NULL); - static void callbackHttpPost(const std::string &url, const LLSD &postData, completionCallback_t success = NULL, completionCallback_t failure = NULL) + static void callbackHttpPost(const std::string &url, LLCore::HttpRequest::policy_t policyId, const LLSD &postData, completionCallback_t success = nullptr, completionCallback_t failure = nullptr); + static void callbackHttpPost(const std::string &url, const LLSD &postData, completionCallback_t success = nullptr, completionCallback_t failure = nullptr) { callbackHttpPost(url, LLCore::HttpRequest::DEFAULT_POLICY_ID, postData, success, failure); } - static void callbackHttpDel(const std::string &url, LLCore::HttpRequest::policy_t policyId, completionCallback_t success = NULL, - completionCallback_t failure = NULL); + static void callbackHttpDel(const std::string& url, LLCore::HttpRequest::policy_t policyId, completionCallback_t success = nullptr, + completionCallback_t failure = nullptr); /// Generic Get and post routines for HTTP via coroutines. /// These static methods do all required setup for the GET or POST operation. diff --git a/indra/llmessage/llexperiencecache.cpp b/indra/llmessage/llexperiencecache.cpp index c8e0d8a671..149741b9f9 100644 --- a/indra/llmessage/llexperiencecache.cpp +++ b/indra/llmessage/llexperiencecache.cpp @@ -35,7 +35,6 @@ #include <set> #include <map> #include <boost/tokenizer.hpp> -#include <boost/concept_check.hpp> //========================================================================= namespace LLExperienceCacheImpl @@ -320,7 +319,7 @@ void LLExperienceCache::requestExperiencesCoro(LLCoreHttpUtil::HttpCoroutineAdap void LLExperienceCache::requestExperiences() { - if (mCapability.empty()) + if (mCapability == nullptr) { LL_WARNS("ExperienceCache") << "Capability query method not set." << LL_ENDL; return; @@ -538,7 +537,7 @@ void LLExperienceCache::get(const LLUUID& key, LLExperienceCache::ExperienceGetF //========================================================================= void LLExperienceCache::fetchAssociatedExperience(const LLUUID& objectId, const LLUUID& itemId, ExperienceGetFn_t fn) { - if (mCapability.empty()) + if (mCapability == nullptr) { LL_WARNS("ExperienceCache") << "Capability query method not set." << LL_ENDL; return; @@ -550,7 +549,7 @@ void LLExperienceCache::fetchAssociatedExperience(const LLUUID& objectId, const void LLExperienceCache::fetchAssociatedExperience(const LLUUID& objectId, const LLUUID& itemId, std::string url, ExperienceGetFn_t fn) { - if (mCapability.empty()) + if (mCapability == nullptr) { LL_WARNS("ExperienceCache") << "Capability query method not set." << LL_ENDL; return; @@ -600,8 +599,10 @@ void LLExperienceCache::fetchAssociatedExperienceCoro(LLCoreHttpUtil::HttpCorout failure["error"] = -1; failure["message"] = "no experience"; } - if (fn && !fn.empty()) + if (fn != nullptr) + { fn(failure); + } return; } @@ -612,7 +613,7 @@ void LLExperienceCache::fetchAssociatedExperienceCoro(LLCoreHttpUtil::HttpCorout //------------------------------------------------------------------------- void LLExperienceCache::findExperienceByName(const std::string text, int page, ExperienceGetFn_t fn) { - if (mCapability.empty()) + if (mCapability == nullptr) { LL_WARNS("ExperienceCache") << "Capability query method not set." << LL_ENDL; return; @@ -655,7 +656,7 @@ void LLExperienceCache::findExperienceByNameCoro(LLCoreHttpUtil::HttpCoroutineAd //------------------------------------------------------------------------- void LLExperienceCache::getGroupExperiences(const LLUUID &groupId, ExperienceGetFn_t fn) { - if (mCapability.empty()) + if (mCapability == nullptr) { LL_WARNS("ExperienceCache") << "Capability query method not set." << LL_ENDL; return; @@ -743,7 +744,7 @@ void LLExperienceCache::regionExperiencesCoro(LLCoreHttpUtil::HttpCoroutineAdapt //------------------------------------------------------------------------- void LLExperienceCache::getExperiencePermission(const LLUUID &experienceId, ExperienceGetFn_t fn) { - if (mCapability.empty()) + if (mCapability == nullptr) { LL_WARNS("ExperienceCache") << "Capability query method not set." << LL_ENDL; return; @@ -767,7 +768,7 @@ void LLExperienceCache::getExperiencePermission(const LLUUID &experienceId, Expe void LLExperienceCache::setExperiencePermission(const LLUUID &experienceId, const std::string &permission, ExperienceGetFn_t fn) { - if (mCapability.empty()) + if (mCapability == nullptr) { LL_WARNS("ExperienceCache") << "Capability query method not set." << LL_ENDL; return; @@ -797,7 +798,7 @@ void LLExperienceCache::setExperiencePermission(const LLUUID &experienceId, cons void LLExperienceCache::forgetExperiencePermission(const LLUUID &experienceId, ExperienceGetFn_t fn) { - if (mCapability.empty()) + if (mCapability == nullptr) { LL_WARNS("ExperienceCache") << "Capability query method not set." << LL_ENDL; return; @@ -841,7 +842,7 @@ void LLExperienceCache::experiencePermissionCoro(LLCoreHttpUtil::HttpCoroutineAd //------------------------------------------------------------------------- void LLExperienceCache::getExperienceAdmin(const LLUUID &experienceId, ExperienceGetFn_t fn) { - if (mCapability.empty()) + if (mCapability == nullptr) { LL_WARNS("ExperienceCache") << "Capability query method not set." << LL_ENDL; return; @@ -873,7 +874,7 @@ void LLExperienceCache::getExperienceAdminCoro(LLCoreHttpUtil::HttpCoroutineAdap //------------------------------------------------------------------------- void LLExperienceCache::updateExperience(LLSD updateData, ExperienceGetFn_t fn) { - if (mCapability.empty()) + if (mCapability == nullptr) { LL_WARNS("ExperienceCache") << "Capability query method not set." << LL_ENDL; return; diff --git a/indra/llmessage/llexperiencecache.h b/indra/llmessage/llexperiencecache.h index 81e904107f..4b344347d5 100644 --- a/indra/llmessage/llexperiencecache.h +++ b/indra/llmessage/llexperiencecache.h @@ -35,7 +35,7 @@ #include "llsd.h" #include "llcorehttputil.h" #include <boost/signals2.hpp> -#include <boost/function.hpp> +#include <functional> class LLSD; class LLUUID; @@ -46,8 +46,8 @@ class LLExperienceCache: public LLSingleton < LLExperienceCache > LLSINGLETON(LLExperienceCache); public: - typedef boost::function<std::string(const std::string &)> CapabilityQuery_t; - typedef boost::function<void(const LLSD &)> ExperienceGetFn_t; + typedef std::function<std::string(const std::string &)> CapabilityQuery_t; + typedef std::function<void(const LLSD &)> ExperienceGetFn_t; void setCapabilityQuery(CapabilityQuery_t queryfn); void cleanup(); @@ -108,7 +108,7 @@ private: virtual void initSingleton() override; - typedef boost::function<LLSD(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t &, LLCore::HttpRequest::ptr_t, std::string)> permissionInvoker_fn; + typedef std::function<LLSD(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t &, LLCore::HttpRequest::ptr_t, std::string)> permissionInvoker_fn; // Callback types for get() typedef boost::signals2::signal < void(const LLSD &) > callback_signal_t; diff --git a/indra/llmessage/lltransfertargetfile.h b/indra/llmessage/lltransfertargetfile.h index 43189eb388..cca0ea8d04 100644 --- a/indra/llmessage/lltransfertargetfile.h +++ b/indra/llmessage/lltransfertargetfile.h @@ -37,8 +37,8 @@ public: LLTransferTargetParamsFile() : LLTransferTargetParams(LLTTT_FILE), - mCompleteCallback(NULL), - mUserData(NULL) + mCompleteCallback(nullptr), + mUserData(nullptr) {} void setFilename(const std::string& filename) { mFilename = filename; } void setCallback(LLTTFCompleteCallback cb, void *user_data) { mCompleteCallback = cb; mUserData = user_data; } diff --git a/indra/llmessage/lltransfertargetvfile.cpp b/indra/llmessage/lltransfertargetvfile.cpp index fcf853845b..bbc2ddf4cc 100644 --- a/indra/llmessage/lltransfertargetvfile.cpp +++ b/indra/llmessage/lltransfertargetvfile.cpp @@ -41,8 +41,8 @@ void LLTransferTargetVFile::updateQueue(bool shutdown) LLTransferTargetParamsVFile::LLTransferTargetParamsVFile() : LLTransferTargetParams(LLTTT_VFILE), mAssetType(LLAssetType::AT_NONE), - mCompleteCallback(NULL), - mRequestDatap(NULL), + mCompleteCallback(nullptr), + mRequestDatap(nullptr), mErrCode(0) { } diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp index 2a619dab98..e2937490ba 100644 --- a/indra/llmessage/message.cpp +++ b/indra/llmessage/message.cpp @@ -1162,7 +1162,7 @@ S32 LLMessageSystem::sendMessage(const LLHost &host) { LLSD message = mLLSDMessageBuilder->getMessage(); - UntrustedCallback_t cb = NULL; + UntrustedCallback_t cb = nullptr; if ((mSendReliable) && (mReliablePacketParams.mCallback)) { cb = boost::bind(mReliablePacketParams.mCallback, mReliablePacketParams.mCallbackData, _1); @@ -1359,7 +1359,7 @@ S32 LLMessageSystem::sendMessage( return 0; } - UntrustedCallback_t cb = NULL; + UntrustedCallback_t cb = nullptr; if ((mSendReliable) && (mReliablePacketParams.mCallback)) { cb = boost::bind(mReliablePacketParams.mCallback, mReliablePacketParams.mCallbackData, _1); @@ -4049,8 +4049,10 @@ void LLMessageSystem::sendUntrustedSimulatorMessageCoro(std::string url, std::st LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); - if ((callback) && (!callback.empty())) + if (callback != nullptr) + { callback((status) ? LL_ERR_NOERR : LL_ERR_TCP_TIMEOUT); + } } diff --git a/indra/llmessage/message.h b/indra/llmessage/message.h index 30945cac51..14cdc48a07 100644 --- a/indra/llmessage/message.h +++ b/indra/llmessage/message.h @@ -28,6 +28,7 @@ #define LL_MESSAGE_H #include <cstring> +#include <functional> #include <set> #if LL_LINUX @@ -55,7 +56,6 @@ #include "llmessagesenderinterface.h" #include "llstoredmessage.h" -#include "boost/function.hpp" #include "llpounceable.h" #include "llcoros.h" #include LLCOROS_MUTEX_HEADER @@ -826,7 +826,7 @@ public: void receivedMessageFromTrustedSender(); private: - typedef boost::function<void(S32)> UntrustedCallback_t; + typedef std::function<void(S32)> UntrustedCallback_t; void sendUntrustedSimulatorMessageCoro(std::string url, std::string message, LLSD body, UntrustedCallback_t callback); diff --git a/indra/llplugin/llpluginprocessparent.h b/indra/llplugin/llpluginprocessparent.h index 334f1411af..ea604ca8d7 100644 --- a/indra/llplugin/llpluginprocessparent.h +++ b/indra/llplugin/llpluginprocessparent.h @@ -30,7 +30,6 @@ #define LL_LLPLUGINPROCESSPARENT_H #include <queue> -#include <boost/enable_shared_from_this.hpp> #include "llapr.h" #include "llprocess.h" diff --git a/indra/llprimitive/llmodelloader.h b/indra/llprimitive/llmodelloader.h index 335d809386..8acc75b1be 100644 --- a/indra/llprimitive/llmodelloader.h +++ b/indra/llprimitive/llmodelloader.h @@ -29,7 +29,7 @@ #include "llmodel.h" #include "llthread.h" -#include <boost/function.hpp> +#include <functional> #include <list> class LLJoint; @@ -57,25 +57,25 @@ public: // Callback with loaded model data and loaded LoD // - typedef boost::function<void (scene&, model_list&, S32, void*)> load_callback_t; + typedef std::function<void (scene&, model_list&, S32, void*)> load_callback_t; // Function to provide joint lookup by name // (within preview avi skeleton, for example) // - typedef boost::function<LLJoint* (const std::string&, void*)> joint_lookup_func_t; + typedef std::function<LLJoint* (const std::string&, void*)> joint_lookup_func_t; // Func to load and associate material with all it's textures, // returned value is the number of textures loaded // intentionally non-const so func can modify material to // store platform-specific data // - typedef boost::function<U32 (LLImportMaterial&, void*)> texture_load_func_t; + typedef std::function<U32 (LLImportMaterial&, void*)> texture_load_func_t; // Callback to inform client of state changes // during loading process (errors will be reported // as state changes here as well) // - typedef boost::function<void (U32, void*)> state_callback_t; + typedef std::function<void (U32, void*)> state_callback_t; typedef enum { diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h index 24ba4d6deb..d19825d9ca 100644 --- a/indra/llrender/llgl.h +++ b/indra/llrender/llgl.h @@ -29,6 +29,7 @@ // This file contains various stuff for handling gl extensions and other gl related stuff. +#include <functional> #include <string> #include <boost/unordered_map.hpp> #include <list> @@ -230,8 +231,6 @@ void clear_glerror(); */ -#include "boost/function.hpp" - class LLGLState { public: @@ -279,7 +278,7 @@ public: class LLGLEnableFunc : LLGLState { public: - LLGLEnableFunc(LLGLenum state, bool enable, boost::function<void()> func) + LLGLEnableFunc(LLGLenum state, bool enable, std::function<void()> func) : LLGLState(state, enable) { if (enable) diff --git a/indra/llrender/lluiimage.h b/indra/llrender/lluiimage.h index 7988243a89..7dde84f295 100644 --- a/indra/llrender/lluiimage.h +++ b/indra/llrender/lluiimage.h @@ -30,14 +30,15 @@ #include "v4color.h" #include "llpointer.h" #include "llrefcount.h" -#include "llrefcount.h" #include "llrect.h" -#include <boost/function.hpp> -#include <boost/signals2.hpp> #include "llinitparam.h" #include "lltexture.h" #include "llrender2dutils.h" +#include <boost/signals2.hpp> + +#include <type_traits> + extern const LLColor4 UI_VERTEX_COLOR; class LLUIImage : public LLRefCount @@ -119,7 +120,7 @@ namespace LLInitParam class ParamValue<LLUIImage*> : public CustomParamValue<LLUIImage*> { - typedef boost::add_reference<boost::add_const<LLUIImage*>::type>::type T_const_ref; + typedef std::add_lvalue_reference<std::add_const<LLUIImage*>::type>::type T_const_ref; typedef CustomParamValue<LLUIImage*> super_t; public: Optional<std::string> name; diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index d2534b3939..0048c44189 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -190,7 +190,7 @@ LLButton::LLButton(const LLButton::Params& p) // Note: flashing should be allowed in settings.xml (boolean key "EnableButtonFlashing"). S32 flash_count = p.button_flash_count.isProvided()? p.button_flash_count : 0; F32 flash_rate = p.button_flash_rate.isProvided()? p.button_flash_rate : 0.0f; - mFlashingTimer = new LLFlashTimer ((LLFlashTimer::callback_t)NULL, flash_count, flash_rate); + mFlashingTimer = new LLFlashTimer((LLFlashTimer::callback_t) nullptr, flash_count, flash_rate); } else { diff --git a/indra/llui/llbutton.h b/indra/llui/llbutton.h index 890e7c2d1e..f530eceb4b 100644 --- a/indra/llui/llbutton.h +++ b/indra/llui/llbutton.h @@ -153,7 +153,7 @@ public: ~LLButton(); // For backward compatability only - typedef boost::function<void(void*)> button_callback_t; + typedef std::function<void(void*)> button_callback_t; void addImageAttributeToXML(LLXMLNodePtr node, const std::string& imageName, const LLUUID& imageID,const std::string& xmlTagName) const; diff --git a/indra/llui/llcallbackmap.h b/indra/llui/llcallbackmap.h index 07775dc30f..3115606d91 100644 --- a/indra/llui/llcallbackmap.h +++ b/indra/llui/llcallbackmap.h @@ -29,13 +29,13 @@ #include <map> #include <string> -#include <boost/function.hpp> +#include <functional> class LLCallbackMap { public: // callback definition. - typedef boost::function<void* (void* data)> callback_t; + typedef std::function<void* (void* data)> callback_t; typedef std::map<std::string, LLCallbackMap> map_t; typedef map_t::iterator map_iter_t; @@ -48,8 +48,8 @@ public: return (void*)panel; } - LLCallbackMap() : mCallback(NULL), mData(NULL) { } - LLCallbackMap(callback_t callback, void* data = NULL) : mCallback(callback), mData(data) { } + LLCallbackMap() : mCallback(nullptr), mData(nullptr) {} + LLCallbackMap(callback_t callback, void* data = nullptr) : mCallback(callback), mData(data) {} callback_t mCallback; void* mData; diff --git a/indra/llui/llclipboard.h b/indra/llui/llclipboard.h index 12d8233e0a..9f9cc3e54d 100644 --- a/indra/llui/llclipboard.h +++ b/indra/llui/llclipboard.h @@ -27,8 +27,6 @@ #ifndef LL_LLCLIPBOARD_H #define LL_LLCLIPBOARD_H -#include <boost/function.hpp> - #include "llstring.h" #include "lluuid.h" #include "llsingleton.h" diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp index f3876ef695..ae676251ff 100644 --- a/indra/llui/llcombobox.cpp +++ b/indra/llui/llcombobox.cpp @@ -1009,7 +1009,7 @@ void LLComboBox::setKeystrokeOnEsc(bool enable) void LLComboBox::onTextEntry(LLLineEditor* line_editor) { - if (mTextEntryCallback != NULL) + if (mTextEntryCallback != nullptr) { (mTextEntryCallback)(line_editor, LLSD()); } @@ -1029,7 +1029,7 @@ void LLComboBox::onTextEntry(LLLineEditor* line_editor) mList->deselectAllItems(); mLastSelectedIndex = -1; } - if (mTextChangedCallback != NULL) + if (mTextChangedCallback != nullptr) { (mTextChangedCallback)(line_editor, LLSD()); } @@ -1077,7 +1077,7 @@ void LLComboBox::onTextEntry(LLLineEditor* line_editor) // RN: presumably text entry updateSelection(); } - if (mTextChangedCallback != NULL) + if (mTextChangedCallback != nullptr) { (mTextChangedCallback)(line_editor, LLSD()); } diff --git a/indra/llui/llcombobox.h b/indra/llui/llcombobox.h index 8be3eb57e4..d6ea1202d3 100644 --- a/indra/llui/llcombobox.h +++ b/indra/llui/llcombobox.h @@ -36,7 +36,6 @@ #include "llrect.h" #include "llscrolllistctrl.h" #include "lllineeditor.h" -#include <boost/function.hpp> // Classes diff --git a/indra/llui/lldockablefloater.cpp b/indra/llui/lldockablefloater.cpp index 19ae03cdf9..c20e5a806c 100644 --- a/indra/llui/lldockablefloater.cpp +++ b/indra/llui/lldockablefloater.cpp @@ -77,7 +77,7 @@ LLDockableFloater::~LLDockableFloater() bool LLDockableFloater::postBuild() { // Remember we should force docking when the floater is opened for the first time - if (mIsDockedStateForcedCallback != NULL && mIsDockedStateForcedCallback()) + if (mIsDockedStateForcedCallback != nullptr && mIsDockedStateForcedCallback()) { mForceDocking = true; } diff --git a/indra/llui/lldockablefloater.h b/indra/llui/lldockablefloater.h index 9c516e23a4..accd9fddfc 100644 --- a/indra/llui/lldockablefloater.h +++ b/indra/llui/lldockablefloater.h @@ -129,7 +129,7 @@ protected: // Checks if docking should be forced. // It may be useful e.g. if floater created in mouselook mode (see EXT-5609) - boost::function<bool ()> mIsDockedStateForcedCallback; + std::function<bool()> mIsDockedStateForcedCallback; private: std::unique_ptr<LLDockControl> mDockControl; diff --git a/indra/llui/lldockcontrol.h b/indra/llui/lldockcontrol.h index b6ac9c19dd..1f6c3b9f57 100644 --- a/indra/llui/lldockcontrol.h +++ b/indra/llui/lldockcontrol.h @@ -49,11 +49,11 @@ public: public: // callback for a function getting a rect valid for control's position - typedef boost::function<void (LLRect& )> get_allowed_rect_callback_t; + typedef std::function<void (LLRect& )> get_allowed_rect_callback_t; LOG_CLASS(LLDockControl); LLDockControl(LLView* dockWidget, LLFloater* dockableFloater, - const LLUIImagePtr& dockTongue, DocAt dockAt, get_allowed_rect_callback_t get_rect_callback = NULL); + const LLUIImagePtr& dockTongue, DocAt dockAt, get_allowed_rect_callback_t get_rect_callback = nullptr); virtual ~LLDockControl(); public: diff --git a/indra/llui/llflashtimer.cpp b/indra/llui/llflashtimer.cpp index 54f54653e2..addc3375b3 100644 --- a/indra/llui/llflashtimer.cpp +++ b/indra/llui/llflashtimer.cpp @@ -50,7 +50,7 @@ LLFlashTimer::LLFlashTimer(callback_t cb, S32 count, F32 period) void LLFlashTimer::unset() { mUnset = true; - mCallback = NULL; + mCallback = nullptr; } bool LLFlashTimer::tick() diff --git a/indra/llui/llflashtimer.h b/indra/llui/llflashtimer.h index 4ef70faf2d..1cd1df392b 100644 --- a/indra/llui/llflashtimer.h +++ b/indra/llui/llflashtimer.h @@ -28,13 +28,13 @@ #define LL_FLASHTIMER_H #include "lleventtimer.h" -#include "boost/function.hpp" +#include <functional> class LLFlashTimer : public LLEventTimer { public: - typedef boost::function<void (bool)> callback_t; + typedef std::function<void (bool)> callback_t; /** * Constructor. @@ -43,7 +43,7 @@ public: * @param period - how frequently callback should be called * @param cb - callback to be called each tick */ - LLFlashTimer(callback_t cb = NULL, S32 count = 0, F32 period = 0.0); + LLFlashTimer(callback_t cb = nullptr, S32 count = 0, F32 period = 0.0); ~LLFlashTimer() {}; /*virtual*/ bool tick(); diff --git a/indra/llui/llfloaterreg.h b/indra/llui/llfloaterreg.h index 94a67c8d8b..24d1476dda 100644 --- a/indra/llui/llfloaterreg.h +++ b/indra/llui/llfloaterreg.h @@ -30,8 +30,8 @@ #include "llrect.h" #include "llsd.h" +#include <functional> #include <list> -#include <boost/function.hpp> //******************************************************* // @@ -41,7 +41,7 @@ class LLFloater; class LLUICtrl; -typedef boost::function<LLFloater* (const LLSD& key)> LLFloaterBuildFunc; +typedef std::function<LLFloater* (const LLSD& key)> LLFloaterBuildFunc; class LLFloaterReg { diff --git a/indra/llui/llfocusmgr.cpp b/indra/llui/llfocusmgr.cpp index 0d7c98294f..7544a44478 100644 --- a/indra/llui/llfocusmgr.cpp +++ b/indra/llui/llfocusmgr.cpp @@ -32,11 +32,11 @@ const F32 FOCUS_FADE_TIME = 0.3f; -LLFocusableElement::LLFocusableElement() -: mFocusLostCallback(NULL), - mFocusReceivedCallback(NULL), - mFocusChangedCallback(NULL), - mTopLostCallback(NULL) +LLFocusableElement::LLFocusableElement() : + mFocusLostCallback(nullptr), + mFocusReceivedCallback(nullptr), + mFocusChangedCallback(nullptr), + mTopLostCallback(nullptr) { } diff --git a/indra/llui/llfunctorregistry.h b/indra/llui/llfunctorregistry.h index da5570d922..953963b683 100644 --- a/indra/llui/llfunctorregistry.h +++ b/indra/llui/llfunctorregistry.h @@ -31,8 +31,6 @@ #include <string> #include <map> -#include <boost/function.hpp> - #include "llsd.h" #include "llsingleton.h" diff --git a/indra/llui/lllazyvalue.h b/indra/llui/lllazyvalue.h index 622e69ce95..fc15ead032 100644 --- a/indra/llui/lllazyvalue.h +++ b/indra/llui/lllazyvalue.h @@ -28,15 +28,16 @@ #ifndef LL_LAZY_VALUE_H #define LL_LAZY_VALUE_H -#include <boost/function.hpp> +#include <functional> +#include <type_traits> // Holds on to a value of type T *or* calls a functor to generate a value of type T template<typename T> class LLLazyValue { public: - typedef typename boost::add_reference<typename boost::add_const<T>::type>::type T_const_ref; - typedef typename boost::function<T_const_ref (void)> function_type; + typedef typename std::add_lvalue_reference<typename std::add_const<T>::type>::type T_const_ref; + typedef typename std::function<T_const_ref (void)> function_type; public: LLLazyValue(const function_type& value) diff --git a/indra/llui/lllineeditor.h b/indra/llui/lllineeditor.h index 7533f76f1d..3f762822ee 100644 --- a/indra/llui/lllineeditor.h +++ b/indra/llui/lllineeditor.h @@ -60,7 +60,7 @@ class LLLineEditor { public: - typedef boost::function<void (LLLineEditor* caller)> keystroke_callback_t; + typedef std::function<void (LLLineEditor* caller)> keystroke_callback_t; struct MaxLength : public LLInitParam::ChoiceBlock<MaxLength> { @@ -259,7 +259,7 @@ public: void setSelectAllonCommit(bool b) { mSelectAllonCommit = b; } void onKeystroke(); - typedef boost::function<void (LLLineEditor* caller, void* user_data)> callback_t; + typedef std::function<void (LLLineEditor* caller, void* user_data)> callback_t; void setKeystrokeCallback(callback_t callback, void* user_data); void setMaxTextLength(S32 max_text_length); diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h index ff9456acc6..a5ad1964ad 100644 --- a/indra/llui/llmenugl.h +++ b/indra/llui/llmenugl.h @@ -37,7 +37,6 @@ #include "llfloater.h" #include "lluistring.h" #include "llview.h" -#include <boost/function.hpp> extern S32 MENU_BAR_HEIGHT; extern S32 MENU_BAR_WIDTH; diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index 637f0bd88d..d56c459560 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -75,6 +75,7 @@ * */ +#include <functional> #include <string> #include <list> #include <vector> @@ -83,8 +84,6 @@ #include <iomanip> #include <sstream> -#include <boost/utility.hpp> -#include <boost/type_traits.hpp> #include <boost/signals2.hpp> #include <boost/range.hpp> #include <boost/intrusive_ptr.hpp> @@ -129,7 +128,7 @@ public: virtual void fromLLSD(const LLSD& params) = 0; }; -typedef boost::function<void (const LLSD&, const LLSD&)> LLNotificationResponder; +typedef std::function<void (const LLSD&, const LLSD&)> LLNotificationResponder; typedef std::shared_ptr<LLNotificationResponderInterface> LLNotificationResponderPtr; @@ -669,8 +668,8 @@ namespace LLNotificationFilters template<typename T> struct filterBy { - typedef boost::function<T (LLNotificationPtr)> field_t; - typedef typename boost::remove_reference<T>::type value_t; + typedef std::function<T (LLNotificationPtr)> field_t; + typedef typename std::remove_reference<T>::type value_t; filterBy(field_t field, value_t value, EComparison comparison = EQUAL) : mField(field), @@ -715,7 +714,7 @@ namespace LLNotificationComparators }; }; -typedef boost::function<bool (LLNotificationPtr)> LLNotificationFilter; +typedef std::function<bool (LLNotificationPtr)> LLNotificationFilter; typedef std::set<LLNotificationPtr, LLNotificationComparators::orderByUUID> LLNotificationSet; typedef std::multimap<std::string, LLNotificationPtr> LLNotificationMap; @@ -860,7 +859,7 @@ public: S32 size() const; size_t size(); - typedef boost::function<void(LLNotificationPtr)> NotificationProcess; + typedef std::function<void(LLNotificationPtr)> NotificationProcess; void forEachNotification(NotificationProcess process); std::string summarize(); diff --git a/indra/llui/llnotificationsutil.cpp b/indra/llui/llnotificationsutil.cpp index c1cad431c5..6b570d043f 100644 --- a/indra/llui/llnotificationsutil.cpp +++ b/indra/llui/llnotificationsutil.cpp @@ -71,7 +71,7 @@ LLNotificationPtr LLNotificationsUtil::add(const std::string& name, LLNotificationPtr LLNotificationsUtil::add(const std::string& name, const LLSD& substitutions, const LLSD& payload, - boost::function<void (const LLSD&, const LLSD&)> functor) + std::function<void (const LLSD&, const LLSD&)> functor) { LLNotification::Params::Functor functor_p; functor_p.function = functor; diff --git a/indra/llui/llnotificationsutil.h b/indra/llui/llnotificationsutil.h index f21d93a50e..73e64e47ba 100644 --- a/indra/llui/llnotificationsutil.h +++ b/indra/llui/llnotificationsutil.h @@ -32,7 +32,7 @@ #include "llnotificationptr.h" #include "lluuid.h" -#include <boost/function.hpp> +#include <functional> class LLSD; @@ -55,7 +55,7 @@ namespace LLNotificationsUtil LLNotificationPtr add(const std::string& name, const LLSD& substitutions, const LLSD& payload, - boost::function<void (const LLSD&, const LLSD&)> functor); + std::function<void (const LLSD&, const LLSD&)> functor); S32 getSelectedOption(const LLSD& notification, const LLSD& response); diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index db314cae0f..2100b23783 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -662,12 +662,12 @@ bool LLPanel::childHasFocus(std::string_view id) // Prefer getChild<LLUICtrl>("foo")->setCommitCallback(boost:bind(...)), // which takes a generic slot. Or use mCommitCallbackRegistrar.add() with // a named callback and reference it in XML. -void LLPanel::childSetCommitCallback(std::string_view id, boost::function<void (LLUICtrl*,void*)> cb, void* data) +void LLPanel::childSetCommitCallback(std::string_view id, std::function<void (LLUICtrl*,void*)> cb, void* data) { LLUICtrl* child = findChild<LLUICtrl>(id); if (child) { - child->setCommitCallback(boost::bind(cb, child, data)); + child->setCommitCallback(std::bind(cb, child, data)); } } @@ -759,12 +759,12 @@ void LLPanel::childSetAction(std::string_view id, const commit_signal_t::slot_ty } } -void LLPanel::childSetAction(std::string_view id, boost::function<void(void*)> function, void* value) +void LLPanel::childSetAction(std::string_view id, std::function<void(void*)> function, void* value) { LLButton* button = findChild<LLButton>(id); if (button) { - button->setClickedCallback(boost::bind(function, value)); + button->setClickedCallback(std::bind(function, value)); } } diff --git a/indra/llui/llpanel.h b/indra/llui/llpanel.h index f085c123c1..fe861dc719 100644 --- a/indra/llui/llpanel.h +++ b/indra/llui/llpanel.h @@ -191,7 +191,7 @@ public: // Prefer getChild<LLUICtrl>("foo")->setCommitCallback(boost:bind(...)), // which takes a generic slot. Or use mCommitCallbackRegistrar.add() with // a named callback and reference it in XML. - void childSetCommitCallback(std::string_view id, boost::function<void (LLUICtrl*,void*)> cb, void* data); + void childSetCommitCallback(std::string_view id, std::function<void (LLUICtrl*,void*)> cb, void* data); void childSetColor(std::string_view id, const LLUIColor& color); LLCtrlSelectionInterface* childGetSelectionInterface(std::string_view id) const; @@ -208,7 +208,7 @@ public: bool childSetLabelArg(std::string_view id, const std::string& key, const LLStringExplicit& text); // LLButton - void childSetAction(std::string_view id, boost::function<void(void*)> function, void* value); + void childSetAction(std::string_view id, std::function<void(void*)> function, void* value); void childSetAction(std::string_view id, const commit_signal_t::slot_type& function); static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node = NULL); @@ -262,7 +262,7 @@ extern template class LLPanel* LLView::getChild<class LLPanel>( std::string_view name, bool recurse) const; #endif -typedef boost::function<LLPanel* (void)> LLPanelClassCreatorFunc; +typedef std::function<LLPanel* (void)> LLPanelClassCreatorFunc; // local static instance for registering a particular panel class diff --git a/indra/llui/llresizebar.h b/indra/llui/llresizebar.h index 68bf0fd95e..d95536c360 100644 --- a/indra/llui/llresizebar.h +++ b/indra/llui/llresizebar.h @@ -62,7 +62,7 @@ public: void setEnableSnapping(bool enable) { mSnappingEnabled = enable; } void setAllowDoubleClickSnapping(bool allow) { mAllowDoubleClickSnapping = allow; } bool canResize() const { return getEnabled() && mMaxSize > mMinSize; } - void setResizeListener(boost::function<void(void*)> listener) {mResizeListener = listener;} + void setResizeListener(std::function<void(void*)> listener) { mResizeListener = listener; } void setImagePanel(LLPanel * panelp); LLPanel * getImagePanel() const; @@ -78,7 +78,7 @@ private: bool mSnappingEnabled, mAllowDoubleClickSnapping; LLView* mResizingView; - boost::function<void(void*)> mResizeListener; + std::function<void(void*)> mResizeListener; LLPointer<LLUIImage> mDragHandleImage; LLPanel * mImagePanel; }; diff --git a/indra/llui/llscrollbar.h b/indra/llui/llscrollbar.h index 9607355a9d..c49d2b534a 100644 --- a/indra/llui/llscrollbar.h +++ b/indra/llui/llscrollbar.h @@ -40,7 +40,7 @@ class LLScrollbar { public: - typedef boost::function<void (S32, LLScrollbar*)> callback_t; + typedef std::function<void (S32, LLScrollbar*)> callback_t; struct Params : public LLInitParam::Block<Params, LLUICtrl::Params> { diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index ff77b4d482..b459c67dad 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -190,19 +190,19 @@ LLScrollListCtrl::LLScrollListCtrl(const LLScrollListCtrl::Params& p) mColumnsDirty(false), mMaxItemCount(INT_MAX), mBorderThickness( 2 ), - mOnDoubleClickCallback( NULL ), - mOnMaximumSelectCallback( NULL ), - mOnSortChangedCallback( NULL ), + mOnDoubleClickCallback(nullptr), + mOnMaximumSelectCallback(nullptr), + mOnSortChangedCallback(nullptr), mHighlightedItem(-1), - mBorder(NULL), - mSortCallback(NULL), + mBorder(nullptr), + mSortCallback(nullptr), mNumDynamicWidthColumns(0), mTotalStaticColumnWidth(0), mTotalColumnPadding(0), mSorted(false), mDirty(false), mOriginalSelection(-1), - mLastSelected(NULL), + mLastSelected(nullptr), mHeadingHeight(p.heading_height), mAllowMultipleSelection(p.multi_select), mDisplayColumnHeaders(p.draw_heading), @@ -222,7 +222,7 @@ LLScrollListCtrl::LLScrollListCtrl(const LLScrollListCtrl::Params& p) mRowPadding(p.row_padding), mAlternateSort(false), mContextMenuType(MENU_NONE), - mIsFriendSignal(NULL) + mIsFriendSignal(nullptr) { mItemListRect.setOriginAndSize( mBorderThickness, diff --git a/indra/llui/llscrolllistctrl.h b/indra/llui/llscrolllistctrl.h index 1f04100306..d3735c5052 100644 --- a/indra/llui/llscrolllistctrl.h +++ b/indra/llui/llscrolllistctrl.h @@ -77,7 +77,7 @@ public: }; // *TODO: Add callbacks to Params - typedef boost::function<void (void)> callback_t; + typedef std::function<void (void)> callback_t; template<typename T> struct maximum { @@ -241,7 +241,7 @@ public: void setMaximumSelectCallback( callback_t cb) { mOnMaximumSelectCallback = cb; } void setSortChangedCallback( callback_t cb) { mOnSortChangedCallback = cb; } // Convenience function; *TODO: replace with setter above + boost::bind() in calling code - void setDoubleClickCallback( boost::function<void (void* userdata)> cb, void* userdata) { mOnDoubleClickCallback = boost::bind(cb, userdata); } + void setDoubleClickCallback( std::function<void (void* userdata)> cb, void* userdata) { mOnDoubleClickCallback = std::bind(cb, userdata); } void swapWithNext(S32 index); void swapWithPrevious(S32 index); diff --git a/indra/llui/llsearcheditor.cpp b/indra/llui/llsearcheditor.cpp index a0c1e9d0c0..244faf8fe9 100644 --- a/indra/llui/llsearcheditor.cpp +++ b/indra/llui/llsearcheditor.cpp @@ -106,12 +106,12 @@ LLSearchEditor::LLSearchEditor(const LLSearchEditor::Params& p) LLSearchEditor::~LLSearchEditor() { - mKeystrokeCallback = NULL; - mTextChangedCallback = NULL; + mKeystrokeCallback = nullptr; + mTextChangedCallback = nullptr; setCommitOnFocusLost(false); - mSearchButton = NULL; - mClearButton = NULL; + mSearchButton = nullptr; + mClearButton = nullptr; mSearchEditor->deleteAllChildren(); deleteAllChildren(); } diff --git a/indra/llui/lltextbox.cpp b/indra/llui/lltextbox.cpp index 9f945d3735..d2a21998a6 100644 --- a/indra/llui/lltextbox.cpp +++ b/indra/llui/lltextbox.cpp @@ -43,7 +43,7 @@ template class LLTextBox* LLView::getChild<class LLTextBox>( LLTextBox::LLTextBox(const LLTextBox::Params& p) : LLTextBase(p), - mClickedCallback(NULL), + mClickedCallback(nullptr), mShowCursorHand(true) { mSkipTripleClick = true; @@ -135,9 +135,9 @@ void LLTextBox::setText(const LLStringExplicit& text , const LLStyle::Params& in LLTextBase::setText(mText.getString(), input_params ); } -void LLTextBox::setClickedCallback( boost::function<void (void*)> cb, void* userdata /*= NULL */ ) +void LLTextBox::setClickedCallback(std::function<void (void*)> cb, void* userdata /*= nullptr */) { - mClickedCallback = boost::bind(cb, userdata); + mClickedCallback = std::bind(cb, userdata); } S32 LLTextBox::getTextPixelWidth() diff --git a/indra/llui/lltextbox.h b/indra/llui/lltextbox.h index 507d8f3ee6..8716917ced 100644 --- a/indra/llui/lltextbox.h +++ b/indra/llui/lltextbox.h @@ -36,7 +36,7 @@ class LLTextBox : public: // *TODO: Add callback to Params - typedef boost::function<void (void)> callback_t; + typedef std::function<void (void)> callback_t; struct Params : public LLInitParam::Block<Params, LLTextBase::Params> {}; @@ -58,7 +58,7 @@ public: void setRightAlign() { mHAlign = LLFontGL::RIGHT; } void setHAlign(LLFontGL::HAlign align) { mHAlign = align; } - void setClickedCallback(boost::function<void(void*)> cb, void* userdata = NULL); + void setClickedCallback(std::function<void(void*)> cb, void* userdata = nullptr); void reshapeToFitText(bool called_from_parent = false); diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 58b785fcdd..fcdf3782ae 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -1242,7 +1242,7 @@ void LLTextEditor::addChar(llwchar wc) tryToShowEmojiHelper(); tryToShowMentionHelper(); - if (!mReadOnly && mAutoreplaceCallback != NULL) + if (!mReadOnly && mAutoreplaceCallback != nullptr) { // autoreplace the text, if necessary S32 replacement_start; diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h index cdfcbcdd63..d9742db34d 100644 --- a/indra/llui/lltexteditor.h +++ b/indra/llui/lltexteditor.h @@ -164,7 +164,7 @@ public: bool allowsEmbeddedItems() const { return mAllowEmbeddedItems; } // Autoreplace (formerly part of LLLineEditor) - typedef boost::function<void(S32&, S32&, LLWString&, S32&, const LLWString&)> autoreplace_callback_t; + typedef std::function<void(S32&, S32&, LLWString&, S32&, const LLWString&)> autoreplace_callback_t; autoreplace_callback_t mAutoreplaceCallback; void setAutoreplaceCallback(autoreplace_callback_t cb) { mAutoreplaceCallback = cb; } diff --git a/indra/llui/lltextutil.cpp b/indra/llui/lltextutil.cpp index 8ffce1b8b4..1454de34c7 100644 --- a/indra/llui/lltextutil.cpp +++ b/indra/llui/lltextutil.cpp @@ -30,7 +30,7 @@ #include "lltextbox.h" #include "llurlmatch.h" -boost::function<bool(LLUrlMatch*,LLTextBase*)> LLTextUtil::TextHelpers::iconCallbackCreationFunction = 0; +std::function<bool(LLUrlMatch*, LLTextBase*)> LLTextUtil::TextHelpers::iconCallbackCreationFunction = nullptr; void LLTextUtil::textboxSetHighlightedVal(LLTextBox *txtbox, const LLStyle::Params& normal_style, const std::string& text, const std::string& hl) { diff --git a/indra/llui/lltextutil.h b/indra/llui/lltextutil.h index f3838e59fa..6328ff133f 100644 --- a/indra/llui/lltextutil.h +++ b/indra/llui/lltextutil.h @@ -74,7 +74,7 @@ namespace LLTextUtil //we need this special callback since we need to create LLAvataIconCtrls while parsing //avatar/group url but can't create LLAvataIconCtrl from LLUI public: - static boost::function<bool(LLUrlMatch*,LLTextBase*)> iconCallbackCreationFunction; + static std::function<bool(LLUrlMatch*,LLTextBase*)> iconCallbackCreationFunction; }; diff --git a/indra/llui/lltextvalidate.h b/indra/llui/lltextvalidate.h index a4ff144d82..096c28b448 100644 --- a/indra/llui/lltextvalidate.h +++ b/indra/llui/lltextvalidate.h @@ -30,7 +30,6 @@ #include "llstring.h" #include "llinitparam.h" -#include <boost/function.hpp> namespace LLTextValidate { diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index 56ab6e9bae..785dc85448 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -99,8 +99,8 @@ LLToolBar::LLToolBar(const LLToolBar::Params& p) mWrap(p.wrap), mNeedsLayout(false), mModified(false), - mButtonPanel(NULL), - mCenteringStack(NULL), + mButtonPanel(nullptr), + mCenteringStack(nullptr), mPadLeft(p.pad_left), mPadRight(p.pad_right), mPadTop(p.pad_top), @@ -108,17 +108,17 @@ LLToolBar::LLToolBar(const LLToolBar::Params& p) mPadBetween(p.pad_between), mMinGirth(p.min_girth), mPopupMenuHandle(), - mRightMouseTargetButton(NULL), - mStartDragItemCallback(NULL), - mHandleDragItemCallback(NULL), - mHandleDropCallback(NULL), - mButtonAddSignal(NULL), - mButtonEnterSignal(NULL), - mButtonLeaveSignal(NULL), - mButtonRemoveSignal(NULL), + mRightMouseTargetButton(nullptr), + mStartDragItemCallback(nullptr), + mHandleDragItemCallback(nullptr), + mHandleDropCallback(nullptr), + mButtonAddSignal(nullptr), + mButtonEnterSignal(nullptr), + mButtonLeaveSignal(nullptr), + mButtonRemoveSignal(nullptr), mDragAndDropTarget(false), - mCaretIcon(NULL), - mCenterPanel(NULL) + mCaretIcon(nullptr), + mCenterPanel(nullptr) { mButtonParams[LLToolBarEnums::BTNTYPE_ICONS_WITH_TEXT] = p.button_icon_and_text; mButtonParams[LLToolBarEnums::BTNTYPE_ICONS_ONLY] = p.button_icon; @@ -1097,12 +1097,12 @@ LLToolBarButton::LLToolBarButton(const Params& p) mWidthRange(p.button_width), mDesiredHeight(p.desired_height), mId(""), - mIsEnabledSignal(NULL), - mIsRunningSignal(NULL), - mIsStartingSignal(NULL), + mIsEnabledSignal(nullptr), + mIsRunningSignal(nullptr), + mIsStartingSignal(nullptr), mIsDragged(false), - mStartDragItemCallback(NULL), - mHandleDragItemCallback(NULL), + mStartDragItemCallback(nullptr), + mHandleDragItemCallback(nullptr), mOriginalImageSelected(p.image_selected), mOriginalImageUnselected(p.image_unselected), mOriginalImagePressed(p.image_pressed), @@ -1256,7 +1256,7 @@ void LLToolBar::LLCenterLayoutPanel::handleReshape(const LLRect& rect, bool by_u { LLLayoutPanel::handleReshape(rect, by_user); - if (!mReshapeCallback.empty()) + if (mReshapeCallback != nullptr) { LLRect r; localRectToOtherView(mButtonPanel->getRect(), &r, gFloaterView); diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index a3f044c256..abf44f259a 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -39,9 +39,9 @@ class LLToolBar; class LLToolBarButton; class LLIconCtrl; -typedef boost::function<void (S32 x, S32 y, LLToolBarButton* button)> tool_startdrag_callback_t; -typedef boost::function<bool (S32 x, S32 y, const LLUUID& uuid, LLAssetType::EType type)> tool_handledrag_callback_t; -typedef boost::function<bool (void* data, EDragAndDropType cargo_type, S32 x, S32 y, LLToolBar* toolbar)> tool_handledrop_callback_t; +typedef std::function<void (S32 x, S32 y, LLToolBarButton* button)> tool_startdrag_callback_t; +typedef std::function<bool (S32 x, S32 y, const LLUUID& uuid, LLAssetType::EType type)> tool_handledrag_callback_t; +typedef std::function<bool (void* data, EDragAndDropType cargo_type, S32 x, S32 y, LLToolBar* toolbar)> tool_handledrop_callback_t; class LLToolBarButton : public LLButton { @@ -167,7 +167,7 @@ public: class LLCenterLayoutPanel : public LLLayoutPanel { public: - typedef boost::function<void(LLToolBarEnums::EToolBarLocation tb, const LLRect& rect)> reshape_callback_t; + typedef std::function<void(LLToolBarEnums::EToolBarLocation tb, const LLRect& rect)> reshape_callback_t; virtual ~LLCenterLayoutPanel() {} /*virtual*/ void handleReshape(const LLRect& rect, bool by_user); diff --git a/indra/llui/lltooltip.h b/indra/llui/lltooltip.h index 760acddd6f..c9d6937c1a 100644 --- a/indra/llui/lltooltip.h +++ b/indra/llui/lltooltip.h @@ -67,8 +67,8 @@ public: struct Params : public LLInitParam::Block<Params, LLPanel::Params> { - typedef boost::function<void(void)> click_callback_t; - typedef boost::function<LLToolTip*(LLToolTip::Params)> create_callback_t; + typedef std::function<void(void)> click_callback_t; + typedef std::function<LLToolTip*(LLToolTip::Params)> create_callback_t; Optional<std::string> message; Multiple<StyledText> styled_message; diff --git a/indra/llui/llui.h b/indra/llui/llui.h index b2dcb6dc88..2ef64baaf6 100644 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -241,9 +241,9 @@ public: // // Methods // - typedef boost::function<void(LLView*)> add_popup_t; - typedef boost::function<void(LLView*)> remove_popup_t; - typedef boost::function<void(void)> clear_popups_t; + typedef std::function<void(LLView*)> add_popup_t; + typedef std::function<void(LLView*)> remove_popup_t; + typedef std::function<void(void)> clear_popups_t; void setPopupFuncs(const add_popup_t& add_popup, const remove_popup_t&, const clear_popups_t& ); diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index cbabb5a933..05461edd82 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -999,15 +999,16 @@ bool LLUICtrl::findHelpTopic(std::string& help_topic_out) } // *TODO: Deprecate; for backwards compatability only: -boost::signals2::connection LLUICtrl::setCommitCallback( boost::function<void (LLUICtrl*,void*)> cb, void* data) +boost::signals2::connection LLUICtrl::setCommitCallback( std::function<void (LLUICtrl*,void*)> cb, void* data) { - return setCommitCallback( boost::bind(cb, _1, data)); + return setCommitCallback( std::bind(cb, std::placeholders::_1, data)); } -boost::signals2::connection LLUICtrl::setValidateBeforeCommit( boost::function<bool (const LLSD& data)> cb ) + +boost::signals2::connection LLUICtrl::setValidateBeforeCommit( std::function<bool (const LLSD& data)> cb ) { if (!mValidateSignal) mValidateSignal = new enable_signal_t(); - return mValidateSignal->connect(boost::bind(cb, _2)); + return mValidateSignal->connect(std::bind(cb, std::placeholders::_2)); } // virtual diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h index bcaf479b0f..940951bcf7 100644 --- a/indra/llui/lluictrl.h +++ b/indra/llui/lluictrl.h @@ -31,7 +31,7 @@ //#include "llboost.h" #include "llrect.h" #include "llsd.h" -#include <boost/function.hpp> +#include <functional> #include <boost/signals2.hpp> #include "llinitparam.h" @@ -47,12 +47,12 @@ class LLUICtrl : public LLView, public boost::signals2::trackable { public: - typedef boost::function<void (LLUICtrl* ctrl, const LLSD& param)> commit_callback_t; + typedef std::function<void (LLUICtrl* ctrl, const LLSD& param)> commit_callback_t; typedef boost::signals2::signal<void (LLUICtrl* ctrl, const LLSD& param)> commit_signal_t; // *TODO: add xml support for this type of signal in the future typedef boost::signals2::signal<void (LLUICtrl* ctrl, S32 x, S32 y, MASK mask)> mouse_signal_t; - typedef boost::function<bool (LLUICtrl* ctrl, const LLSD& param)> enable_callback_t; + typedef std::function<bool (LLUICtrl* ctrl, const LLSD& param)> enable_callback_t; typedef boost::signals2::signal<bool (LLUICtrl* ctrl, const LLSD& param), boost_boolean_combiner> enable_signal_t; struct CallbackParam : public LLInitParam::Block<CallbackParam> @@ -258,8 +258,8 @@ public: boost::signals2::connection setDoubleClickCallback( const mouse_signal_t::slot_type& cb ); // *TODO: Deprecate; for backwards compatability only: - boost::signals2::connection setCommitCallback( boost::function<void (LLUICtrl*,void*)> cb, void* data); - boost::signals2::connection setValidateBeforeCommit( boost::function<bool (const LLSD& data)> cb ); + boost::signals2::connection setCommitCallback( std::function<void (LLUICtrl*,void*)> cb, void* data); + boost::signals2::connection setValidateBeforeCommit( std::function<bool (const LLSD& data)> cb ); LLUICtrl* findRootMostFocusRoot(); diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h index 91221dc7f3..fc069c078f 100644 --- a/indra/llui/lluictrlfactory.h +++ b/indra/llui/lluictrlfactory.h @@ -311,7 +311,7 @@ LLUICtrlFactory::ParamDefaults<LLInitParam::BaseBlock, DUMMY>::ParamDefaults() { template<typename DERIVED> template<typename T> LLChildRegistry<DERIVED>::Register<T>::Register(const char* tag, LLWidgetCreatorFunc func) -: LLChildRegistry<DERIVED>::StaticRegistrar(tag, func.empty() ? (LLWidgetCreatorFunc)&LLUICtrlFactory::defaultBuilder<T> : func) +: LLChildRegistry<DERIVED>::StaticRegistrar(tag, func == nullptr ? (LLWidgetCreatorFunc)&LLUICtrlFactory::defaultBuilder<T> : func) { // add this widget to various registries LLUICtrlFactory::instance().registerWidget(&typeid(T), &typeid(typename T::Params), tag); diff --git a/indra/llui/llurlaction.h b/indra/llui/llurlaction.h index 56d459bb26..c4cfd0f3fb 100644 --- a/indra/llui/llurlaction.h +++ b/indra/llui/llurlaction.h @@ -28,8 +28,8 @@ #ifndef LL_LLURLACTION_H #define LL_LLURLACTION_H +#include <functional> #include <string> -#include <boost/function.hpp> /// /// The LLUrlAction class provides a number of static functions that @@ -93,8 +93,8 @@ public: static void unblockObject(std::string url); /// specify the callbacks to enable this class's functionality - typedef boost::function<void (const std::string&)> url_callback_t; - typedef boost::function<bool(const std::string& url, bool trusted_content)> execute_url_callback_t; + typedef std::function<void (const std::string&)> url_callback_t; + typedef std::function<bool(const std::string& url, bool trusted_content)> execute_url_callback_t; static void setOpenURLCallback(url_callback_t cb); static void setOpenURLInternalCallback(url_callback_t cb); diff --git a/indra/llui/llview.h b/indra/llui/llview.h index 5695776ae6..d747ef9555 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -48,8 +48,8 @@ #include "lltreeiterators.h" #include "llfocusmgr.h" +#include <functional> #include <list> -#include <boost/function.hpp> class LLSD; @@ -626,7 +626,7 @@ private: LLView& getDefaultWidgetContainer() const; // This allows special mouse-event targeting logic for testing. - typedef boost::function<bool(const LLView*, S32 x, S32 y)> DrilldownFunc; + typedef std::function<bool(const LLView*, S32 x, S32 y)> DrilldownFunc; static DrilldownFunc sDrilldown; public: diff --git a/indra/llui/llxuiparser.h b/indra/llui/llxuiparser.h index f755c12cbf..2179ae54d3 100644 --- a/indra/llui/llxuiparser.h +++ b/indra/llui/llxuiparser.h @@ -31,7 +31,7 @@ #include "llregistry.h" #include "llxmlnode.h" -#include <boost/function.hpp> +#include <functional> #include <iosfwd> #include <stack> #include <set> @@ -47,7 +47,7 @@ class LLWidgetTypeRegistry // global static instance for registering all widget types -typedef boost::function<LLView* (LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node)> LLWidgetCreatorFunc; +typedef std::function<LLView* (LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node)> LLWidgetCreatorFunc; typedef LLRegistry<std::string, LLWidgetCreatorFunc> widget_registry_t; diff --git a/indra/llwindow/llkeyboard.cpp b/indra/llwindow/llkeyboard.cpp index 33eebdadd1..b642736d8e 100644 --- a/indra/llwindow/llkeyboard.cpp +++ b/indra/llwindow/llkeyboard.cpp @@ -30,6 +30,8 @@ #include "llwindowcallbacks.h" +#include "llstl.h" + // // Globals // diff --git a/indra/llwindow/llkeyboard.h b/indra/llwindow/llkeyboard.h index 713eb7aec2..067445d24c 100644 --- a/indra/llwindow/llkeyboard.h +++ b/indra/llwindow/llkeyboard.h @@ -27,10 +27,9 @@ #ifndef LL_LLKEYBOARD_H #define LL_LLKEYBOARD_H +#include <functional> #include <map> -#include <boost/function.hpp> -#include "llstringtable.h" #include "lltimer.h" #include "indra_constants.h" @@ -41,7 +40,7 @@ enum EKeystate KEYSTATE_UP }; -typedef boost::function<bool(EKeystate keystate)> LLKeyFunc; +typedef std::function<bool(EKeystate keystate)> LLKeyFunc; typedef std::string (LLKeyStringTranslatorFunc)(std::string_view); enum EKeyboardInsertMode diff --git a/indra/llxml/llcontrol.h b/indra/llxml/llcontrol.h index 4f54a9d705..da7268bf45 100644 --- a/indra/llxml/llcontrol.h +++ b/indra/llxml/llcontrol.h @@ -28,15 +28,15 @@ #define LL_LLCONTROL_H #include "llboost.h" -#include "llevent.h" #include "llstring.h" +#include "llpointer.h" #include "llrect.h" #include "llrefcount.h" #include "llinstancetracker.h" +#include <functional> #include <vector> -#include <boost/bind.hpp> #include <boost/signals2.hpp> class LLVector3; @@ -341,7 +341,7 @@ private: // Add a listener to the controls signal... // NOTE: All listeners connected to 0 group, for guaranty that variable handlers (gSavedSettings) call last mConnection = controlp->getSignal()->connect(0, - boost::bind(&LLControlCache<T>::handleValueChange, this, _2) + std::bind(&LLControlCache<T>::handleValueChange, this, std::placeholders::_2) ); mType = controlp->type(); } @@ -400,7 +400,7 @@ public: } operator const T&() const { return mCachedControlPtr->getValue(); } - operator boost::function<const T&()> () const { return boost::function<const T&()>(*this); } + operator std::function<const T&()> () const { return std::function<const T&()>(*this); } const T& operator()() { return mCachedControlPtr->getValue(); } private: diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index a05261e430..0d7ad0a124 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -437,8 +437,8 @@ LLAgent::LLAgent() : mAutoPilotTargetDist(0.f), mAutoPilotNoProgressFrameCount(0), mAutoPilotRotationThreshold(0.f), - mAutoPilotFinishedCallback(NULL), - mAutoPilotCallbackData(NULL), + mAutoPilotFinishedCallback(nullptr), + mAutoPilotCallbackData(nullptr), mMovementKeysLocked(false), @@ -455,8 +455,8 @@ LLAgent::LLAgent() : mVoiceConnected(false), - mMouselookModeInSignal(NULL), - mMouselookModeOutSignal(NULL) + mMouselookModeInSignal(nullptr), + mMouselookModeOutSignal(nullptr) { for (U32 i = 0; i < TOTAL_CONTROLS; i++) { diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index c1d3c6c14b..3352890d99 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -39,9 +39,10 @@ #include "httprequest.h" #include "llcorehttputil.h" -#include <boost/function.hpp> #include <boost/signals2.hpp> +#include <functional> + extern const bool ANIMATE; extern const U8 AGENT_STATE_TYPING; // Typing indication extern const U8 AGENT_STATE_EDITING; // Set when agent has objects selected @@ -254,7 +255,7 @@ public: void changeParcels(); // called by LLViewerParcelMgr when we cross a parcel boundary // Register a boost callback to be called when the agent changes parcels - typedef boost::function<void()> parcel_changed_callback_t; + typedef std::function<void()> parcel_changed_callback_t; boost::signals2::connection addParcelChangedCallback(parcel_changed_callback_t); private: @@ -756,7 +757,7 @@ public: void requestEnterGodMode(); void requestLeaveGodMode(); - typedef boost::function<void (U8)> god_level_change_callback_t; + typedef std::function<void(U8)> god_level_change_callback_t; typedef boost::signals2::signal<void (U8)> god_level_change_signal_t; typedef boost::signals2::connection god_level_change_slot_t; @@ -964,8 +965,8 @@ public: /// Utilities for allowing the the agent sub managers to post and get via /// HTTP using the agent's policy settings and headers. - bool requestPostCapability(const std::string &capName, LLSD &postData, httpCallback_t cbSuccess = NULL, httpCallback_t cbFailure = NULL); - bool requestGetCapability(const std::string &capName, httpCallback_t cbSuccess = NULL, httpCallback_t cbFailure = NULL); + bool requestPostCapability(const std::string &capName, LLSD &postData, httpCallback_t cbSuccess = nullptr, httpCallback_t cbFailure = nullptr); + bool requestGetCapability(const std::string& capName, httpCallback_t cbSuccess = nullptr, httpCallback_t cbFailure = nullptr); LLCore::HttpRequest::policy_t getAgentPolicy() const { return mHttpPolicy; } diff --git a/indra/newview/llagentpicksinfo.cpp b/indra/newview/llagentpicksinfo.cpp index 265e4060ff..4a5c037f1f 100644 --- a/indra/newview/llagentpicksinfo.cpp +++ b/indra/newview/llagentpicksinfo.cpp @@ -53,7 +53,7 @@ public: LLAvatarPropertiesProcessor::getInstance()->sendAvatarPropertiesRequest(gAgent.getID()); } - typedef boost::function<void(LLAvatarData*)> server_respond_callback_t; + typedef std::function<void(LLAvatarData*)> server_respond_callback_t; void setServerRespondCallback(const server_respond_callback_t& cb) { diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h index 1e118ffa98..70da86805c 100644 --- a/indra/newview/llagentwearables.h +++ b/indra/newview/llagentwearables.h @@ -189,11 +189,11 @@ public: // Signals //-------------------------------------------------------------------- public: - typedef boost::function<void()> loading_started_callback_t; + typedef std::function<void()> loading_started_callback_t; typedef boost::signals2::signal<void()> loading_started_signal_t; boost::signals2::connection addLoadingStartedCallback(loading_started_callback_t cb); - typedef boost::function<void()> loaded_callback_t; + typedef std::function<void()> loaded_callback_t; typedef boost::signals2::signal<void()> loaded_signal_t; boost::signals2::connection addLoadedCallback(loaded_callback_t cb); diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp index eecd42d427..1da1647fe8 100644 --- a/indra/newview/llaisapi.cpp +++ b/indra/newview/llaisapi.cpp @@ -950,7 +950,7 @@ void AISAPI::InvokeAISCommandCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t ht LL_DEBUGS("Inventory", "AIS3") << "Result: " << result << LL_ENDL; onUpdateReceived(result, type, body); - if (callback && !callback.empty()) + if (callback != nullptr) { bool needs_callback = true; LLUUID id(LLUUID::null); diff --git a/indra/newview/llaisapi.h b/indra/newview/llaisapi.h index dd490c8268..cfc286da2e 100644 --- a/indra/newview/llaisapi.h +++ b/indra/newview/llaisapi.h @@ -44,7 +44,7 @@ public: LIBRARY } ITEM_TYPE; - typedef boost::function<void(const LLUUID &invItem)> completion_t; + typedef std::function<void(const LLUUID& invItem)> completion_t; static bool isAvailable(); static void getCapNames(LLSD& capNames); @@ -89,7 +89,7 @@ private: static const std::string INVENTORY_CAP_NAME; static const std::string LIBRARY_CAP_NAME; - typedef boost::function < LLSD (LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t, LLCore::HttpRequest::ptr_t, + typedef std::function<LLSD(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t, LLCore::HttpRequest::ptr_t, const std::string, LLSD, LLCore::HttpOptions::ptr_t, LLCore::HttpHeaders::ptr_t) > invokationFn_t; static void EnqueueAISCommand(const std::string &procName, LLCoprocedureManager::CoProcedure_t proc); diff --git a/indra/newview/llappcorehttp.cpp b/indra/newview/llappcorehttp.cpp index f4f19906f1..f3265afebd 100644 --- a/indra/newview/llappcorehttp.cpp +++ b/indra/newview/llappcorehttp.cpp @@ -145,8 +145,8 @@ LLAppCoreHttp::~LLAppCoreHttp() void LLAppCoreHttp::init() { LLCoreHttpUtil::setPropertyMethods( - boost::bind(&LLControlGroup::getBOOL, boost::ref(gSavedSettings), _1), - boost::bind(&LLControlGroup::declareBOOL, boost::ref(gSavedSettings), _1, _2, _3, LLControlVariable::PERSIST_NONDFT)); + std::bind(&LLControlGroup::getBOOL, std::ref(gSavedSettings), std::placeholders::_1), + std::bind(&LLControlGroup::declareBOOL, std::ref(gSavedSettings), std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, LLControlVariable::PERSIST_NONDFT)); LLCore::LLHttp::initialize(); diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 0a41a91750..131b6817ed 100644 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -235,7 +235,7 @@ public: void setAppearanceServiceURL(const std::string& url) { mAppearanceServiceURL = url; } std::string getAppearanceServiceURL() const; - typedef boost::function<void ()> attachments_changed_callback_t; + typedef std::function<void()> attachments_changed_callback_t; typedef boost::signals2::signal<void ()> attachments_changed_signal_t; boost::signals2::connection setAttachmentsChangedCallback(attachments_changed_callback_t cb); diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 9b16cbd3bf..a3ca25855d 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1232,8 +1232,8 @@ bool LLAppViewer::init() /// Tell the Coprocedure manager how to discover and store the pool sizes // what I wanted LLCoprocedureManager::getInstance()->setPropertyMethods( - boost::bind(&LLControlGroup::getU32, boost::ref(gSavedSettings), _1), - boost::bind(&LLControlGroup::declareU32, boost::ref(gSavedSettings), _1, _2, _3, LLControlVariable::PERSIST_ALWAYS)); + std::bind(&LLControlGroup::getU32, std::ref(gSavedSettings), std::placeholders::_1), + std::bind(&LLControlGroup::declareU32, std::ref(gSavedSettings), std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, LLControlVariable::PERSIST_ALWAYS)); // TODO: consider moving proxy initialization here or LLCopocedureManager after proxy initialization, may be implement // some other protection to make sure we don't use network before initializng proxy @@ -4461,7 +4461,7 @@ bool LLAppViewer::initCache() return true; } -void LLAppViewer::addOnIdleCallback(const boost::function<void()>& cb) +void LLAppViewer::addOnIdleCallback(const std::function<void()>& cb) { gMainloopWork.post(cb); } diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index 4f2583cb16..c12b2e83ef 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -222,7 +222,7 @@ public: return mOnLoginCompleted.connect(cb); } - void addOnIdleCallback(const boost::function<void()>& cb); // add a callback to fire (once) when idle + void addOnIdleCallback(const std::function<void()>& cb); // add a callback to fire (once) when idle void initGeneralThread(); void purgeUserDataOnExit() { mPurgeUserDataOnExit = true; } diff --git a/indra/newview/llappviewerlistener.h b/indra/newview/llappviewerlistener.h index 5ade3d3e04..8686d6522e 100644 --- a/indra/newview/llappviewerlistener.h +++ b/indra/newview/llappviewerlistener.h @@ -30,7 +30,7 @@ #define LL_LLAPPVIEWERLISTENER_H #include "lleventapi.h" -#include <boost/function.hpp> +#include <functional> class LLAppViewer; class LLSD; @@ -39,7 +39,7 @@ class LLSD; class LLAppViewerListener: public LLEventAPI { public: - typedef boost::function<LLAppViewer*(void)> LLAppViewerGetter; + typedef std::function<LLAppViewer*(void)> LLAppViewerGetter; /// Bind the LLAppViewer instance to use (e.g. LLAppViewer::instance()). LLAppViewerListener(const LLAppViewerGetter& getter); diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h index 5114c97beb..c19f7dc1c1 100644 --- a/indra/newview/llchiclet.h +++ b/indra/newview/llchiclet.h @@ -187,7 +187,7 @@ public: /*virtual*/ boost::signals2::connection setLeftButtonClickCallback( const commit_callback_t& cb); - typedef boost::function<void (LLChiclet* ctrl, const LLSD& param)> + typedef std::function<void(LLChiclet* ctrl, const LLSD& param)> chiclet_size_changed_callback_t; /** diff --git a/indra/newview/llcofwearables.h b/indra/newview/llcofwearables.h index 6f0e97a98b..b349f35921 100644 --- a/indra/newview/llcofwearables.h +++ b/indra/newview/llcofwearables.h @@ -54,7 +54,7 @@ public: LLCOFCallbacks() {}; virtual ~LLCOFCallbacks() {}; - typedef boost::function<void ()> cof_callback_t; + typedef std::function<void()> cof_callback_t; cof_callback_t mAddWearable; cof_callback_t mMoveWearableCloser; diff --git a/indra/newview/llcommandlineparser.cpp b/indra/newview/llcommandlineparser.cpp index f21bae9805..dde0c18580 100644 --- a/indra/newview/llcommandlineparser.cpp +++ b/indra/newview/llcommandlineparser.cpp @@ -101,7 +101,7 @@ class LLCLPValue : public po::value_semantic_codecvt_helper<char> unsigned mMinTokens; unsigned mMaxTokens; bool mIsComposing; - typedef boost::function1<void, const LLCommandLineParser::token_vector_t&> notify_callback_t; + typedef std::function<void(const LLCommandLineParser::token_vector_t&)> notify_callback_t; notify_callback_t mNotifyCallback; bool mLastOption; @@ -226,7 +226,7 @@ protected: // LLCommandLineParser defintions //---------------------------------------------------------------------------- void LLCommandLineParser::addOptionDesc(const std::string& option_name, - boost::function1<void, const token_vector_t&> notify_callback, + std::function<void(const token_vector_t&)> notify_callback, unsigned int token_count, const std::string& description, const std::string& short_name, @@ -255,7 +255,7 @@ void LLCommandLineParser::addOptionDesc(const std::string& option_name, value_desc, description.c_str())); - if(!notify_callback.empty()) + if(notify_callback) { value_desc->setNotifyCallback(notify_callback); } @@ -693,7 +693,7 @@ void LLControlGroupCLP::configure(const std::string& config_filename, LLControlG last_option = option_params["last_option"].asBoolean(); } - boost::function1<void, const token_vector_t&> callback; + std::function<void(const token_vector_t&)> callback; if (! option_params.has("map-to")) { // If this option isn't mapped to a settings variable, is it diff --git a/indra/newview/llcommandlineparser.h b/indra/newview/llcommandlineparser.h index 5279d02c0a..984bcfbad0 100644 --- a/indra/newview/llcommandlineparser.h +++ b/indra/newview/llcommandlineparser.h @@ -27,7 +27,7 @@ #ifndef LL_LLCOMMANDLINEPARSER_H #define LL_LLCOMMANDLINEPARSER_H -#include <boost/function/function1.hpp> +#include <functional> // *NOTE:Mani The following is a forward decl of // boost::program_options::command_line_parser @@ -58,7 +58,7 @@ public: */ void addOptionDesc( const std::string& option_name, - boost::function1<void, const token_vector_t&> notify_callback = 0, + std::function<void(const token_vector_t&)> notify_callback = nullptr, unsigned int num_tokens = 0, const std::string& description = LLStringUtil::null, const std::string& short_name = LLStringUtil::null, @@ -121,7 +121,7 @@ public: * The parser_func takes an input string, and should return a * name/value pair as the result. */ - typedef boost::function1<std::pair<std::string, std::string>, const std::string&> parser_func; + typedef std::function<std::pair<std::string, std::string>(const std::string&)> parser_func; void setCustomParser(parser_func f) { mExtraParser = f; } private: diff --git a/indra/newview/llcompilequeue.h b/indra/newview/llcompilequeue.h index 951d4800e8..bcbb166c58 100644 --- a/indra/newview/llcompilequeue.h +++ b/indra/newview/llcompilequeue.h @@ -98,7 +98,7 @@ protected: std::string mStartString; bool mMono; - typedef boost::function<bool(const LLPointer<LLViewerObject> &, LLInventoryObject*, LLEventPump &)> fnQueueAction_t; + typedef std::function<bool(const LLPointer<LLViewerObject> &, LLInventoryObject*, LLEventPump &)> fnQueueAction_t; static void objectScriptProcessingQueueCoro(std::string action, LLHandle<LLFloaterScriptQueue> hfloater, object_data_list_t objectList, fnQueueAction_t func); }; diff --git a/indra/newview/lldndbutton.h b/indra/newview/lldndbutton.h index 277c2aad69..d503b367e1 100644 --- a/indra/newview/lldndbutton.h +++ b/indra/newview/lldndbutton.h @@ -47,7 +47,7 @@ public: LLDragAndDropButton(const Params& params); - typedef boost::function<bool ( + typedef std::function<bool ( S32 /*x*/, S32 /*y*/, MASK /*mask*/, bool /*drop*/, EDragAndDropType /*cargo_type*/, void* /*cargo_data*/, diff --git a/indra/newview/llexperiencelog.cpp b/indra/newview/llexperiencelog.cpp index ce10fba2ca..b86474c5ca 100644 --- a/indra/newview/llexperiencelog.cpp +++ b/indra/newview/llexperiencelog.cpp @@ -279,6 +279,6 @@ void LLExperienceLog::setNotifyNewEvent( bool val ) } else if( val && !mNotifyConnection.connected()) { - mNotifyConnection = addUpdateSignal(boost::function<void(LLSD&)>(LLExperienceLog::notify)); + mNotifyConnection = addUpdateSignal(std::function<void(LLSD&)>(LLExperienceLog::notify)); } } diff --git a/indra/newview/llfloateravatarpicker.h b/indra/newview/llfloateravatarpicker.h index 817427aae6..1761497f83 100644 --- a/indra/newview/llfloateravatarpicker.h +++ b/indra/newview/llfloateravatarpicker.h @@ -43,7 +43,7 @@ public: typedef validate_signal_t::slot_type validate_callback_t; // The callback function will be called with an avatar name and UUID. - typedef boost::function<void (const uuid_vec_t&, const std::vector<LLAvatarName>&)> select_callback_t; + typedef std::function<void(const uuid_vec_t&, const std::vector<LLAvatarName>&)> select_callback_t; // Call this to select an avatar. static LLFloaterAvatarPicker* show(select_callback_t callback, bool allow_multiple = false, diff --git a/indra/newview/llfloaterbanduration.h b/indra/newview/llfloaterbanduration.h index 4793b524f7..0f8944a56a 100644 --- a/indra/newview/llfloaterbanduration.h +++ b/indra/newview/llfloaterbanduration.h @@ -31,7 +31,7 @@ class LLFloaterBanDuration : public LLFloater { - typedef boost::function<void(const uuid_vec_t&, const S32 duration)> select_callback_t; + typedef std::function<void(const uuid_vec_t&, const S32 duration)> select_callback_t; public: LLFloaterBanDuration(const LLSD& target); diff --git a/indra/newview/llfloateremojipicker.h b/indra/newview/llfloateremojipicker.h index b807adb67d..88d288b141 100644 --- a/indra/newview/llfloateremojipicker.h +++ b/indra/newview/llfloateremojipicker.h @@ -40,8 +40,8 @@ class LLFloaterEmojiPicker : public LLFloater public: // The callback function will be called with an emoji char. - typedef boost::function<void (llwchar)> pick_callback_t; - typedef boost::function<void ()> close_callback_t; + typedef std::function<void(llwchar)> pick_callback_t; + typedef std::function<void ()> close_callback_t; LLFloaterEmojiPicker(const LLSD& key); diff --git a/indra/newview/llfloaterexperiencepicker.h b/indra/newview/llfloaterexperiencepicker.h index 0a001478f1..d0fb611bd4 100644 --- a/indra/newview/llfloaterexperiencepicker.h +++ b/indra/newview/llfloaterexperiencepicker.h @@ -38,9 +38,9 @@ class LLFloaterExperiencePicker : public LLFloater { public: - typedef boost::function<void (const uuid_vec_t&)> select_callback_t; + typedef std::function<void(const uuid_vec_t&)> select_callback_t; // filter function for experiences, return true if the experience should be hidden. - typedef boost::function<bool (const LLSD&)> filter_function; + typedef std::function<bool(const LLSD&)> filter_function; typedef std::vector<filter_function> filter_list; static LLFloaterExperiencePicker* show( select_callback_t callback, const LLUUID& key, bool allow_multiple, bool close_on_select, filter_list filters, LLView * frustumOrigin); diff --git a/indra/newview/llfloaterexperiences.cpp b/indra/newview/llfloaterexperiences.cpp index f4cb3a04f5..999a473a49 100644 --- a/indra/newview/llfloaterexperiences.cpp +++ b/indra/newview/llfloaterexperiences.cpp @@ -407,7 +407,7 @@ void LLFloaterExperiences::retrieveExperienceListCoro(std::string url, { const LLSD& ids = result[it->first]; tab->setExperienceList(ids); - if (!cback.empty()) + if (cback != nullptr) { cback(tab, result); } diff --git a/indra/newview/llfloaterexperiences.h b/indra/newview/llfloaterexperiences.h index 5852d33e0c..ec5f52d2f7 100644 --- a/indra/newview/llfloaterexperiences.h +++ b/indra/newview/llfloaterexperiences.h @@ -43,7 +43,7 @@ public: static LLFloaterExperiences* findInstance(); protected: typedef std::map<std::string, std::string> NameMap_t; - typedef boost::function<void(LLPanelExperiences*, const LLSD&)> Callback_t; + typedef std::function<void(LLPanelExperiences*, const LLSD&)> Callback_t; void clearFromRecent(const LLSD& ids); void resizeToTabs(); @@ -65,7 +65,7 @@ protected: const std::string &errorNotify, Callback_t cback); private: - typedef boost::function < LLSD(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t, LLCore::HttpRequest::ptr_t, + typedef std::function<LLSD(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t, LLCore::HttpRequest::ptr_t, const std::string, LLCore::HttpOptions::ptr_t, LLCore::HttpHeaders::ptr_t) > invokationFn_t; static void retrieveExperienceListCoro(std::string url, LLHandle<LLFloaterExperiences> hparent, diff --git a/indra/newview/llfloatergroups.h b/indra/newview/llfloatergroups.h index be6ced40bf..93a6deb0a3 100644 --- a/indra/newview/llfloatergroups.h +++ b/indra/newview/llfloatergroups.h @@ -40,8 +40,9 @@ #include "lluuid.h" #include "llfloater.h" +#include "llevent.h" + #include <map> -#include <boost/function.hpp> #include <boost/signals2.hpp> class LLUICtrl; diff --git a/indra/newview/llfloaterimnearbychathandler.cpp b/indra/newview/llfloaterimnearbychathandler.cpp index c920a3c898..ec9458ea9b 100644 --- a/indra/newview/llfloaterimnearbychathandler.cpp +++ b/indra/newview/llfloaterimnearbychathandler.cpp @@ -87,7 +87,7 @@ public: void addChat (LLSD& chat); void arrangeToasts (); - typedef boost::function<LLFloaterIMNearbyChatToastPanel* (void )> create_toast_panel_callback_t; + typedef std::function<LLFloaterIMNearbyChatToastPanel*(void)> create_toast_panel_callback_t; void setCreatePanelCallback(create_toast_panel_callback_t value) { m_create_toast_panel_callback_t = value;} void onToastDestroyed (LLToast* toast, bool app_quitting); diff --git a/indra/newview/llfloaterpay.cpp b/indra/newview/llfloaterpay.cpp index c557c25d65..d5e45c09e3 100644 --- a/indra/newview/llfloaterpay.cpp +++ b/indra/newview/llfloaterpay.cpp @@ -127,8 +127,8 @@ const S32 PAY_AMOUNT_NOTIFICATION = 200; LLFloaterPay::LLFloaterPay(const LLSD& key) : LLFloater(key), mCallbackData(), - mCallback(NULL), - mObjectNameText(NULL), + mCallback(nullptr), + mObjectNameText(nullptr), mTargetUUID(key.asUUID()), mTargetIsGroup(false), mHaveName(false) diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 43731dd766..c5c1e01538 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -2068,7 +2068,7 @@ class LLPanelPreference::Updater : public LLEventTimer public: - typedef boost::function<bool(const LLSD&)> callback_t; + typedef std::function<bool(const LLSD&)> callback_t; Updater(callback_t cb, F32 period) :LLEventTimer(period), diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 5a9b529a0c..bfce13affc 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -94,7 +94,6 @@ #include "llmeshrepository.h" #include "llfloaterregionrestarting.h" #include "llpanelexperiencelisteditor.h" -#include <boost/function.hpp> #include "llpanelexperiencepicker.h" #include "llexperiencecache.h" #include "llpanelexperiences.h" diff --git a/indra/newview/llfloatersimplesnapshot.h b/indra/newview/llfloatersimplesnapshot.h index 487e77469c..5620a15d87 100644 --- a/indra/newview/llfloatersimplesnapshot.h +++ b/indra/newview/llfloatersimplesnapshot.h @@ -63,7 +63,7 @@ public: void postSave(); - typedef boost::function<void(const LLUUID& asset_id)> completion_t; + typedef std::function<void(const LLUUID& asset_id)> completion_t; void setComplectionCallback(completion_t callback) { mUploadCompletionCallback = callback; } static void uploadThumbnail(const std::string &file_path, const LLUUID &inventory_id, diff --git a/indra/newview/llfloatertos.h b/indra/newview/llfloatertos.h index 3bec4da58d..82a8c8ac5a 100644 --- a/indra/newview/llfloatertos.h +++ b/indra/newview/llfloatertos.h @@ -30,7 +30,6 @@ #include "llmodaldialog.h" #include "llassetstorage.h" #include "llmediactrl.h" -#include <boost/function.hpp> #include "lleventcoro.h" #include "llcoros.h" diff --git a/indra/newview/llfriendcard.cpp b/indra/newview/llfriendcard.cpp index 5300627cec..b9f19b5247 100644 --- a/indra/newview/llfriendcard.cpp +++ b/indra/newview/llfriendcard.cpp @@ -136,7 +136,7 @@ bool LLFindAgentCallingCard::operator()(LLInventoryCategory* cat, LLInventoryIte class LLInitialFriendCardsFetch : public LLInventoryFetchDescendentsObserver { public: - typedef boost::function<void()> callback_t; + typedef std::function<void()> callback_t; LLInitialFriendCardsFetch(const LLUUID& folder_id, callback_t cb) : diff --git a/indra/newview/llfriendcard.h b/indra/newview/llfriendcard.h index e3bd25aae7..f6c0a991bc 100644 --- a/indra/newview/llfriendcard.h +++ b/indra/newview/llfriendcard.h @@ -96,7 +96,7 @@ public: void syncFriendCardsFolders(); private: - typedef boost::function<void()> callback_t; + typedef std::function<void()> callback_t; diff --git a/indra/newview/llgesturemgr.h b/indra/newview/llgesturemgr.h index 8db36c6d89..e10bc8bbb4 100644 --- a/indra/newview/llgesturemgr.h +++ b/indra/newview/llgesturemgr.h @@ -54,7 +54,7 @@ class LLGestureMgr : public LLSingleton<LLGestureMgr>, public LLInventoryFetchIt ~LLGestureMgr(); public: - typedef boost::function<void (LLMultiGesture* loaded_gesture)> gesture_loaded_callback_t; + typedef std::function<void (LLMultiGesture* loaded_gesture)> gesture_loaded_callback_t; // Maps inventory item_id to gesture typedef std::map<LLUUID, LLMultiGesture*> item_map_t; typedef std::map<LLUUID, gesture_loaded_callback_t> callback_map_t; diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index d96adbd1d2..decb2c0528 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -239,7 +239,7 @@ public: const LLUUID& uuid) : LLInvFVBridge(inventory, root, uuid) {} - typedef boost::function<void(std::string& slurl)> slurl_callback_t; + typedef std::function<void(std::string& slurl)> slurl_callback_t; virtual void performAction(LLInventoryModel* model, std::string action); virtual void selectItem(); @@ -833,7 +833,7 @@ void rez_attachment(LLViewerInventoryItem* item, bool move_inv_category_world_to_agent(const LLUUID& object_id, const LLUUID& category_id, bool drop, - std::function<void(S32, void*, const LLMoveInv *)> callback = NULL, + std::function<void(S32, void*, const LLMoveInv *)> callback = nullptr, void* user_data = NULL, LLInventoryFilter* filter = NULL); diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index e6b33453d5..3cc57e851f 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -1758,7 +1758,7 @@ bool sort_alpha(const LLViewerInventoryCategory* cat1, const LLViewerInventoryCa // The only inventory changes that are done is to move and sort folders containing no-copy items to stock folders. // @pending_callbacks - how many callbacks we are waiting for, must be inited before use // @result - true if things validate, false if issues are raised, must be inited before use -typedef boost::function<void(S32 pending_callbacks, bool result)> validation_result_callback_t; +typedef std::function<void(S32 pending_callbacks, bool result)> validation_result_callback_t; void validate_marketplacelistings( LLInventoryCategory* cat, validation_result_callback_t cb_result, diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h index 77a2a18877..eba67be313 100644 --- a/indra/newview/llinventoryfunctions.h +++ b/indra/newview/llinventoryfunctions.h @@ -151,13 +151,13 @@ class LLMarketplaceValidator: public LLSingleton<LLMarketplaceValidator> LOG_CLASS(LLMarketplaceValidator); public: - typedef boost::function<void(std::string& validation_message, S32 depth, LLError::ELevel log_level)> validation_msg_callback_t; - typedef boost::function<void(bool result)> validation_done_callback_t; + typedef std::function<void(std::string& validation_message, S32 depth, LLError::ELevel log_level)> validation_msg_callback_t; + typedef std::function<void(bool result)> validation_done_callback_t; void validateMarketplaceListings( const LLUUID &category_id, - validation_done_callback_t cb_done = NULL, - validation_msg_callback_t cb_msg = NULL, + validation_done_callback_t cb_done = nullptr, + validation_msg_callback_t cb_msg = nullptr, bool fix_hierarchy = true, S32 depth = -1); diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp index 97c80cc01d..f77088e0b1 100644 --- a/indra/newview/llinventorygallery.cpp +++ b/indra/newview/llinventorygallery.cpp @@ -1816,8 +1816,8 @@ void LLInventoryGallery::paste(const LLUUID& dest, const LLUUID& marketplacelistings_id) { LLHandle<LLPanel> handle = getHandle(); - std::function <void(const LLUUID)> on_copy_callback = NULL; - LLPointer<LLInventoryCallback> cb = NULL; + std::function<void(const LLUUID)> on_copy_callback = nullptr; + LLPointer<LLInventoryCallback> cb = nullptr; if (dest == mFolderID) { on_copy_callback = [handle](const LLUUID& inv_item) @@ -3586,8 +3586,8 @@ bool dragItemIntoFolder(LLUUID folder_id, LLInventoryItem* inv_item, bool drop, move_inv->mObjectID = inv_item->getParentUUID(); std::pair<LLUUID, LLUUID> item_pair(folder_id, inv_item->getUUID()); move_inv->mMoveList.push_back(item_pair); - move_inv->mCallback = NULL; - move_inv->mUserData = NULL; + move_inv->mCallback = nullptr; + move_inv->mUserData = nullptr; if (is_move) { warn_move_inventory(object, move_inv); diff --git a/indra/newview/llinventorygallery.h b/indra/newview/llinventorygallery.h index 7f53f9998d..a53637a477 100644 --- a/indra/newview/llinventorygallery.h +++ b/indra/newview/llinventorygallery.h @@ -44,14 +44,14 @@ class LLGalleryGestureObserver; class LLInventoryGalleryContextMenu; -typedef boost::function<void()> callback_t; +typedef std::function<void()> callback_t; class LLInventoryGallery : public LLPanel, public LLEditMenuHandler { public: typedef boost::signals2::signal<void(const LLUUID&)> selection_change_signal_t; - typedef boost::function<void(const LLUUID&)> selection_change_callback_t; + typedef std::function<void(const LLUUID&)> selection_change_callback_t; typedef std::deque<LLUUID> selection_deque; struct Params diff --git a/indra/newview/llinventorygallerymenu.cpp b/indra/newview/llinventorygallerymenu.cpp index eda93e3e79..fe007a78cd 100644 --- a/indra/newview/llinventorygallerymenu.cpp +++ b/indra/newview/llinventorygallerymenu.cpp @@ -362,7 +362,7 @@ void LLInventoryGalleryContextMenu::doToSelected(const LLSD& userdata) } else if ("show_on_map" == action) { - boost::function<void(LLLandmark*)> show_on_map_cb = [](LLLandmark* landmark) + std::function<void(LLLandmark*)> show_on_map_cb = [](LLLandmark* landmark) { LLVector3d landmark_global_pos; if (landmark->getGlobalPos(landmark_global_pos)) diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 8de0a3c648..043fd7003d 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1037,7 +1037,7 @@ void LLInventoryModel::createNewCategory(const LLUUID& parent_id, { if (new_category.isNull()) { - if (callback && !callback.empty()) + if (callback) { callback(new_category); } @@ -1064,7 +1064,7 @@ void LLInventoryModel::createNewCategory(const LLUUID& parent_id, updateCategory(cat); } - if (callback && !callback.empty()) + if (callback) { callback(new_category); } diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index 31345f3ab3..2859923df9 100644 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -488,7 +488,7 @@ public: void createNewCategory(const LLUUID& parent_id, LLFolderType::EType preferred_type, const std::string& name, - inventory_func_type callback = NULL, + inventory_func_type callback = nullptr, const LLUUID& thumbnail_id = LLUUID::null); protected: // Internal methods that add inventory and make sure that all of diff --git a/indra/newview/llinventorymodelbackgroundfetch.h b/indra/newview/llinventorymodelbackgroundfetch.h index 2e9f69ee29..ef6fa06e9f 100644 --- a/indra/newview/llinventorymodelbackgroundfetch.h +++ b/indra/newview/llinventorymodelbackgroundfetch.h @@ -53,7 +53,7 @@ public: void scheduleFolderFetch(const LLUUID& cat_id, bool forced = false); void scheduleItemFetch(const LLUUID& item_id, bool forced = false); - typedef boost::function<void()> nullary_func_t; + typedef std::function<void()> nullary_func_t; // AIS3 only, Fetches folder and everything links inside the folder point to // Intended for outfits void fetchFolderAndLinks(const LLUUID& cat_id, nullary_func_t callback); @@ -78,7 +78,7 @@ public: bool isBulkFetchProcessingComplete() const; void setAllFoldersFetched(); - typedef boost::function<void()> folders_fetched_callback_t; + typedef std::function<void()> folders_fetched_callback_t; boost::signals2::connection setFetchCompletionCallback(folders_fetched_callback_t cb); void addRequestAtFront(const LLUUID& id, bool recursive, bool is_category); diff --git a/indra/newview/llinventoryobserver.h b/indra/newview/llinventoryobserver.h index 12d6c44521..99cb9ec811 100644 --- a/indra/newview/llinventoryobserver.h +++ b/indra/newview/llinventoryobserver.h @@ -258,7 +258,7 @@ protected: class LLInventoryCategoriesObserver : public LLInventoryObserver { public: - typedef boost::function<void()> callback_t; + typedef std::function<void()> callback_t; LLInventoryCategoriesObserver() {}; virtual void changed(U32 mask); diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 411d28b97b..cde87ede9b 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -113,7 +113,7 @@ protected: class LLInvPanelComplObserver : public LLInventoryCompletionObserver { public: - typedef boost::function<void()> callback_t; + typedef std::function<void()> callback_t; LLInvPanelComplObserver(callback_t cb) : mCallback(cb) @@ -1595,7 +1595,7 @@ void LLInventoryPanel::setSelection(const LLUUID& obj_id, bool take_keyboard_foc setSelectionByID(obj_id, take_keyboard_focus); } -void LLInventoryPanel::setSelectCallback(const boost::function<void (const std::deque<LLFolderViewItem*>& items, bool user_action)>& cb) +void LLInventoryPanel::setSelectCallback(const std::function<void (const std::deque<LLFolderViewItem*>& items, bool user_action)>& cb) { if (mFolderRoot.get()) { @@ -2762,7 +2762,7 @@ void LLInventorySingleFolderPanel::updateSingleFolderRoot() mFolderRoot.get()->setFollowsAll(); mFolderRoot.get()->addChild(mFolderRoot.get()->mStatusTextBox); - if (!mSelectionCallback.empty()) + if (mSelectionCallback != nullptr) { mFolderRoot.get()->setSelectCallback(mSelectionCallback); } diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 50333709fc..dc2e304ab3 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -37,6 +37,7 @@ #include "llinventorymodel.h" #include "llscrollcontainer.h" #include "lluictrlfactory.h" +#include <functional> #include <set> class LLInvFVBridge; @@ -182,7 +183,7 @@ public: // Call this method to set the selection. void openAllFolders(); void setSelection(const LLUUID& obj_id, bool take_keyboard_focus); - void setSelectCallback(const boost::function<void (const std::deque<LLFolderViewItem*>& items, bool user_action)>& cb); + void setSelectCallback(const std::function<void (const std::deque<LLFolderViewItem*>& items, bool user_action)>& cb); void clearSelection(); selected_items_t getSelectedItems() const; @@ -374,7 +375,7 @@ protected: virtual LLFolderViewFolder* createFolderViewFolder(LLInvFVBridge * bridge, bool allow_drop); virtual LLFolderViewItem* createFolderViewItem(LLInvFVBridge * bridge); - boost::function<void(const std::deque<LLFolderViewItem*>& items, bool user_action)> mSelectionCallback; + std::function<void(const std::deque<LLFolderViewItem*>& items, bool user_action)> mSelectionCallback; // buildViewsTree does not include some checks and is meant // for recursive use, use buildNewViews() for first call @@ -436,7 +437,7 @@ public: std::list<LLUUID> getNavBackwardList() { return mBackwardFolders; } std::list<LLUUID> getNavForwardList() { return mForwardFolders; } - typedef boost::function<void()> root_changed_callback_t; + typedef std::function<void()> root_changed_callback_t; boost::signals2::connection setRootChangedCallback(root_changed_callback_t cb); protected: diff --git a/indra/newview/lllandmarkactions.h b/indra/newview/lllandmarkactions.h index 1abf10e110..0996dfed29 100644 --- a/indra/newview/lllandmarkactions.h +++ b/indra/newview/lllandmarkactions.h @@ -39,8 +39,8 @@ class LLLandmark; class LLLandmarkActions { public: - typedef boost::function<void(std::string& slurl)> slurl_callback_t; - typedef boost::function<void(std::string& slurl, S32 x, S32 y, S32 z)> region_name_and_coords_callback_t; + typedef std::function<void(std::string& slurl)> slurl_callback_t; + typedef std::function<void(std::string& slurl, S32 x, S32 y, S32 z)> region_name_and_coords_callback_t; /** * @brief Fetches landmark LLViewerInventoryItems for the given landmark name. @@ -107,7 +107,7 @@ public: * * @return pointer to loaded landmark from gLandmarkList or NULL if landmark does not exist or wasn't loaded. */ - static LLLandmark* getLandmark(const LLUUID& landmarkInventoryItemID, LLLandmarkList::loaded_callback_t cb = NULL); + static LLLandmark* getLandmark(const LLUUID& landmarkInventoryItemID, LLLandmarkList::loaded_callback_t cb = nullptr); /** * @brief Performs standard action of copying of SLURL from landmark to user's clipboard. diff --git a/indra/newview/lllandmarklist.h b/indra/newview/lllandmarklist.h index 508148abde..fb8b5a1960 100644 --- a/indra/newview/lllandmarklist.h +++ b/indra/newview/lllandmarklist.h @@ -27,7 +27,7 @@ #ifndef LL_LLLANDMARKLIST_H #define LL_LLLANDMARKLIST_H -#include <boost/function.hpp> +#include <functional> #include <map> #include "lllandmark.h" #include "lluuid.h" @@ -40,7 +40,7 @@ class LLInventoryItem; class LLLandmarkList { public: - typedef boost::function<void(LLLandmark*)> loaded_callback_t; + typedef std::function<void(LLLandmark*)> loaded_callback_t; LLLandmarkList() {} ~LLLandmarkList(); @@ -50,7 +50,7 @@ public: //const LLLandmark* getNext() { return mList.getNextData(); } bool assetExists(const LLUUID& asset_uuid); - LLLandmark* getAsset(const LLUUID& asset_uuid, loaded_callback_t cb = NULL); + LLLandmark* getAsset(const LLUUID& asset_uuid, loaded_callback_t cb = nullptr); static void processGetAssetReply( const LLUUID& uuid, LLAssetType::EType type, diff --git a/indra/newview/lllistcontextmenu.h b/indra/newview/lllistcontextmenu.h index 4b515a3b26..cb2ca5260f 100644 --- a/indra/newview/lllistcontextmenu.h +++ b/indra/newview/lllistcontextmenu.h @@ -63,7 +63,7 @@ public: virtual void hide(); protected: - typedef boost::function<void (const LLUUID& id)> functor_t; + typedef std::function<void (const LLUUID& id)> functor_t; virtual LLContextMenu* createMenu() = 0; diff --git a/indra/newview/lllocationhistory.h b/indra/newview/lllocationhistory.h index ca9b81457c..34cb83367f 100644 --- a/indra/newview/lllocationhistory.h +++ b/indra/newview/lllocationhistory.h @@ -29,10 +29,9 @@ #include "llsingleton.h" // for LLSingleton +#include <functional> #include <vector> #include <string> -#include <map> -#include <boost/function.hpp> #include <boost/signals2.hpp> class LLSD; @@ -115,7 +114,7 @@ public: }; typedef std::vector<LLLocationHistoryItem> location_list_t; - typedef boost::function<void(EChangeType event)> history_changed_callback_t; + typedef std::function<void(EChangeType event)> history_changed_callback_t; typedef boost::signals2::signal<void(EChangeType event)> history_changed_signal_t; diff --git a/indra/newview/lllogininstance.h b/indra/newview/lllogininstance.h index 941b378b14..54ce51720f 100644 --- a/indra/newview/lllogininstance.h +++ b/indra/newview/lllogininstance.h @@ -29,7 +29,6 @@ #include "lleventdispatcher.h" #include "lleventapi.h" -#include <boost/function.hpp> #include <memory> // std::shared_ptr #include "llsecapi.h" class LLLogin; diff --git a/indra/newview/llmarketplacefunctions.h b/indra/newview/llmarketplacefunctions.h index 281743c1d6..07ed667b0a 100644 --- a/indra/newview/llmarketplacefunctions.h +++ b/indra/newview/llmarketplacefunctions.h @@ -28,15 +28,11 @@ #ifndef LL_LLMARKETPLACEFUNCTIONS_H #define LL_LLMARKETPLACEFUNCTIONS_H - -#include <llsd.h> -#include <boost/function.hpp> -#include <boost/signals2.hpp> - +#include "llsd.h" #include "llsingleton.h" #include "llstring.h" - +#include <boost/signals2.hpp> namespace MarketplaceErrorCodes { diff --git a/indra/newview/llmarketplacenotifications.h b/indra/newview/llmarketplacenotifications.h index a602b930de..0b03bde16c 100644 --- a/indra/newview/llmarketplacenotifications.h +++ b/indra/newview/llmarketplacenotifications.h @@ -30,7 +30,7 @@ #include <llsd.h> -#include <boost/function.hpp> +#include <functional> // @@ -48,7 +48,7 @@ namespace LLMarketplaceInventoryNotifications { void update(); - typedef boost::function<void (const LLSD&)> NoCopyCallbackFunction; + typedef std::function<void (const LLSD&)> NoCopyCallbackFunction; void addNoCopyNotification(const LLSD& payload, const NoCopyCallbackFunction& cb); }; diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp index cbd95f9cc6..4e14f416e9 100644 --- a/indra/newview/llmaterialeditor.cpp +++ b/indra/newview/llmaterialeditor.cpp @@ -494,7 +494,7 @@ bool LLMaterialEditor::postBuild() refreshUploadCost(); } - boost::function<void(LLUICtrl*, void*)> changes_callback = [this](LLUICtrl * ctrl, void* userData) + std::function<void(LLUICtrl*, void*)> changes_callback = [this](LLUICtrl * ctrl, void* userData) { const U32 *flag = (const U32*)userData; markChangesUnsaved(*flag); diff --git a/indra/newview/llmaterialmgr.cpp b/indra/newview/llmaterialmgr.cpp index c80d2a55ab..723f834d6f 100644 --- a/indra/newview/llmaterialmgr.cpp +++ b/indra/newview/llmaterialmgr.cpp @@ -67,7 +67,7 @@ class LLMaterialHttpHandler : public LLHttpSDHandler { public: - typedef boost::function<void(bool, const LLSD&)> CallbackFunction; + typedef std::function<void(bool, const LLSD&)> CallbackFunction; typedef std::shared_ptr<LLMaterialHttpHandler> ptr_t; LLMaterialHttpHandler(const std::string& method, CallbackFunction cback); diff --git a/indra/newview/llmutelist.cpp b/indra/newview/llmutelist.cpp index f6d635f51f..9157e34833 100644 --- a/indra/newview/llmutelist.cpp +++ b/indra/newview/llmutelist.cpp @@ -190,7 +190,7 @@ LLMuteList::~LLMuteList() void LLMuteList::cleanupSingleton() { - LLAvatarNameCache::getInstance()->setAccountNameChangedCallback(NULL); + LLAvatarNameCache::getInstance()->setAccountNameChangedCallback(nullptr); } bool LLMuteList::isLinden(const std::string& name) diff --git a/indra/newview/llnamelistctrl.h b/indra/newview/llnamelistctrl.h index dde85f4d29..ffff21c95c 100644 --- a/indra/newview/llnamelistctrl.h +++ b/indra/newview/llnamelistctrl.h @@ -210,12 +210,12 @@ private: boost::signals2::signal<void(const LLUUID &)> mIconClickedSignal; public: - boost::signals2::connection setOnNameListCompleteCallback(boost::function<void(bool)> onNameListCompleteCallback) + boost::signals2::connection setOnNameListCompleteCallback(std::function<void(bool)> onNameListCompleteCallback) { return mNameListCompleteSignal.connect(onNameListCompleteCallback); } - boost::signals2::connection setIconClickedCallback(boost::function<void(const LLUUID &)> cb) + boost::signals2::connection setIconClickedCallback(std::function<void(const LLUUID&)> cb) { return mIconClickedSignal.connect(cb); } diff --git a/indra/newview/llnotificationlistitem.h b/indra/newview/llnotificationlistitem.h index bddbe0ff16..b3283ca642 100644 --- a/indra/newview/llnotificationlistitem.h +++ b/indra/newview/llnotificationlistitem.h @@ -84,7 +84,7 @@ public: virtual void onMouseLeave(S32 x, S32 y, MASK mask); //callbacks - typedef boost::function<void (LLNotificationListItem* item)> item_callback_t; + typedef std::function<void (LLNotificationListItem* item)> item_callback_t; typedef boost::signals2::signal<void (LLNotificationListItem* item)> item_signal_t; item_signal_t mOnItemClose; item_signal_t mOnItemClick; diff --git a/indra/newview/llnotificationstorage.cpp b/indra/newview/llnotificationstorage.cpp index 75bafb8785..5cec35fc88 100644 --- a/indra/newview/llnotificationstorage.cpp +++ b/indra/newview/llnotificationstorage.cpp @@ -41,7 +41,7 @@ #include "llregistry.h" #include "llviewermessage.h" -typedef boost::function<LLNotificationResponderInterface * (const LLSD& pParams)> responder_constructor_t; +typedef std::function<LLNotificationResponderInterface*(const LLSD& pParams)> responder_constructor_t; class LLResponderRegistry : public LLRegistrySingleton<std::string, responder_constructor_t, LLResponderRegistry> { diff --git a/indra/newview/lloutfitslist.h b/indra/newview/lloutfitslist.h index 5010be50eb..bcf7e45696 100644 --- a/indra/newview/lloutfitslist.h +++ b/indra/newview/lloutfitslist.h @@ -75,7 +75,7 @@ public: class LLOutfitListBase : public LLPanelAppearanceTab { public: - typedef boost::function<void(const LLUUID&)> selection_change_callback_t; + typedef std::function<void(const LLUUID&)> selection_change_callback_t; typedef boost::signals2::signal<void(const LLUUID&)> selection_change_signal_t; LLOutfitListBase(); diff --git a/indra/newview/llpanelblockedlist.cpp b/indra/newview/llpanelblockedlist.cpp index 7d55ba3265..69f51b03b6 100644 --- a/indra/newview/llpanelblockedlist.cpp +++ b/indra/newview/llpanelblockedlist.cpp @@ -263,7 +263,7 @@ void LLPanelBlockedList::callbackBlockByName(const std::string& text) // Constructor/Destructor LLFloaterGetBlockedObjectName::LLFloaterGetBlockedObjectName(const LLSD& key) : LLFloater(key) -, mGetObjectNameCallback(NULL) +, mGetObjectNameCallback(nullptr) { } diff --git a/indra/newview/llpanelblockedlist.h b/indra/newview/llpanelblockedlist.h index 1f470199ce..782a44bc5b 100644 --- a/indra/newview/llpanelblockedlist.h +++ b/indra/newview/llpanelblockedlist.h @@ -95,7 +95,7 @@ class LLFloaterGetBlockedObjectName : public LLFloater { friend class LLFloaterReg; public: - typedef boost::function<void (const std::string&)> get_object_name_callback_t; + typedef std::function<void(const std::string&)> get_object_name_callback_t; bool postBuild() override; diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index 282b6d4a0a..8bcb6e9ec3 100644 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -438,7 +438,7 @@ template <typename T> const LLEditWearableDictionary::PickerControlEntry* get_picker_entry (const ETextureIndex index) { return NULL; } -typedef boost::function<void(LLPanel* panel, const LLEditWearableDictionary::PickerControlEntry*)> function_t; +typedef std::function<void(LLPanel* panel, const LLEditWearableDictionary::PickerControlEntry*)> function_t; typedef struct PickerControlEntryNamePredicate { diff --git a/indra/newview/llpanelexperiencelisteditor.h b/indra/newview/llpanelexperiencelisteditor.h index 7ff1ddac5a..70bc2ecd3c 100644 --- a/indra/newview/llpanelexperiencelisteditor.h +++ b/indra/newview/llpanelexperiencelisteditor.h @@ -42,7 +42,7 @@ public: typedef boost::signals2::signal<void (const LLUUID&) > list_changed_signal_t; // filter function for experiences, return true if the experience should be hidden. - typedef boost::function<bool (const LLSD&)> experience_function; + typedef std::function<bool(const LLSD&)> experience_function; typedef std::vector<experience_function> filter_list; typedef LLHandle<LLFloaterExperiencePicker> PickerHandle; LLPanelExperienceListEditor(); diff --git a/indra/newview/llpanelexperiencepicker.h b/indra/newview/llpanelexperiencepicker.h index 72c0b1b74d..5cde0a03fb 100644 --- a/indra/newview/llpanelexperiencepicker.h +++ b/indra/newview/llpanelexperiencepicker.h @@ -39,9 +39,9 @@ public: friend class LLExperienceSearchResponder; friend class LLFloaterExperiencePicker; - typedef boost::function<void (const uuid_vec_t&)> select_callback_t; + typedef std::function<void(const uuid_vec_t&)> select_callback_t; // filter function for experiences, return true if the experience should be hidden. - typedef boost::function<bool (const LLSD&)> filter_function; + typedef std::function<bool(const LLSD&)> filter_function; typedef std::vector<filter_function> filter_list; LLPanelExperiencePicker(); diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 33599357a3..64e0a8c429 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -251,7 +251,7 @@ static LLPanelInjector<LLPanelPeople> t_people("panel_people"); class LLPanelPeople::Updater { public: - typedef boost::function<void()> callback_t; + typedef std::function<void()> callback_t; Updater(callback_t cb) : mCallback(cb) { diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index 9ef9c26411..c6a88dbada 100644 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -41,7 +41,7 @@ LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source, LLFolderViewModelInterface& root_view_model) : LLConversationItemSession(data_source->getSessionID(), root_view_model), mSpeakerMgr(data_source), - mValidateSpeakerCallback(NULL) + mValidateSpeakerCallback(nullptr) { mSpeakerAddListener = new SpeakerAddListener(*this); mSpeakerRemoveListener = new SpeakerRemoveListener(*this); diff --git a/indra/newview/llparticipantlist.h b/indra/newview/llparticipantlist.h index 7cb29a6211..4b4334c6f9 100644 --- a/indra/newview/llparticipantlist.h +++ b/indra/newview/llparticipantlist.h @@ -27,8 +27,8 @@ #ifndef LL_PARTICIPANTLIST_H #define LL_PARTICIPANTLIST_H -#include "llviewerprecompiledheaders.h" #include "llconversationmodel.h" +#include "llevent.h" class LLSpeakerMgr; class LLUICtrl; @@ -38,7 +38,7 @@ class LLParticipantList : public LLConversationItemSession LOG_CLASS(LLParticipantList); public: - typedef boost::function<bool (const LLUUID& speaker_id)> validate_speaker_callback_t; + typedef std::function<bool (const LLUUID& speaker_id)> validate_speaker_callback_t; LLParticipantList(LLSpeakerMgr* data_source, LLFolderViewModelInterface& root_view_model); ~LLParticipantList(); diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index c9b0978a38..412e25a7b1 100644 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -34,7 +34,6 @@ #include <map> #include <boost/bind.hpp> -#include <boost/function.hpp> #include <boost/signals2.hpp> #include "llagent.h" diff --git a/indra/newview/llpathfindingmanager.h b/indra/newview/llpathfindingmanager.h index 663cb3cf34..d209266467 100644 --- a/indra/newview/llpathfindingmanager.h +++ b/indra/newview/llpathfindingmanager.h @@ -27,10 +27,10 @@ #ifndef LL_LLPATHFINDINGMANAGER_H #define LL_LLPATHFINDINGMANAGER_H +#include <functional> #include <string> #include <map> -#include <boost/function.hpp> #include <boost/signals2.hpp> #include "llpathfindinglinkset.h" @@ -76,21 +76,21 @@ public: void requestGetNavMeshForRegion(LLViewerRegion *pRegion, bool pIsGetStatusOnly); typedef U32 request_id_t; - typedef boost::function<void (request_id_t, ERequestStatus, LLPathfindingObjectListPtr)> object_request_callback_t; + typedef std::function<void(request_id_t, ERequestStatus, LLPathfindingObjectListPtr)> object_request_callback_t; void requestGetLinksets(request_id_t pRequestId, object_request_callback_t pLinksetsCallback) const; void requestSetLinksets(request_id_t pRequestId, const LLPathfindingObjectListPtr &pLinksetListPtr, LLPathfindingLinkset::ELinksetUse pLinksetUse, S32 pA, S32 pB, S32 pC, S32 pD, object_request_callback_t pLinksetsCallback) const; void requestGetCharacters(request_id_t pRequestId, object_request_callback_t pCharactersCallback) const; - typedef boost::function<void (bool)> agent_state_callback_t; + typedef std::function<void(bool)> agent_state_callback_t; typedef boost::signals2::signal<void (bool)> agent_state_signal_t; typedef boost::signals2::connection agent_state_slot_t; agent_state_slot_t registerAgentStateListener(agent_state_callback_t pAgentStateCallback); void requestGetAgentState(); - typedef boost::function<void (bool)> rebake_navmesh_callback_t; + typedef std::function<void(bool)> rebake_navmesh_callback_t; void requestRebakeNavMesh(rebake_navmesh_callback_t pRebakeNavMeshCallback); protected: diff --git a/indra/newview/llpathfindingnavmesh.h b/indra/newview/llpathfindingnavmesh.h index d838a1a51c..44397c9118 100644 --- a/indra/newview/llpathfindingnavmesh.h +++ b/indra/newview/llpathfindingnavmesh.h @@ -27,9 +27,9 @@ #ifndef LL_LLPATHFINDINGNAVMESH_H #define LL_LLPATHFINDINGNAVMESH_H +#include <functional> #include <string> -#include <boost/function.hpp> #include <boost/signals2.hpp> #include "llpathfindingnavmeshstatus.h" @@ -54,7 +54,7 @@ public: kNavMeshRequestError } ENavMeshRequestStatus; - typedef boost::function<void (ENavMeshRequestStatus, const LLPathfindingNavMeshStatus &, const LLSD::Binary &)> navmesh_callback_t; + typedef std::function<void(ENavMeshRequestStatus, const LLPathfindingNavMeshStatus&, const LLSD::Binary&)> navmesh_callback_t; typedef boost::signals2::signal<void (ENavMeshRequestStatus, const LLPathfindingNavMeshStatus &, const LLSD::Binary &)> navmesh_signal_t; typedef boost::signals2::connection navmesh_slot_t; diff --git a/indra/newview/llpathfindingnavmeshzone.h b/indra/newview/llpathfindingnavmeshzone.h index e770efa0d0..8f7750d4c5 100644 --- a/indra/newview/llpathfindingnavmeshzone.h +++ b/indra/newview/llpathfindingnavmeshzone.h @@ -27,9 +27,9 @@ #ifndef LL_LLPATHFINDINGNAVMESHZONE_H #define LL_LLPATHFINDINGNAVMESHZONE_H +#include <functional> #include <vector> -#include <boost/function.hpp> #include <boost/signals2.hpp> #include "llpathfindingnavmesh.h" @@ -62,7 +62,7 @@ public: kNavMeshZoneComplete } ENavMeshZoneStatus; - typedef boost::function<void (ENavMeshZoneRequestStatus)> navmesh_zone_callback_t; + typedef std::function<void(ENavMeshZoneRequestStatus)> navmesh_zone_callback_t; typedef boost::signals2::signal<void (ENavMeshZoneRequestStatus)> navmesh_zone_signal_t; typedef boost::signals2::connection navmesh_zone_slot_t; @@ -81,7 +81,7 @@ public: protected: private: - typedef boost::function<void (void)> navmesh_location_callback_t; + typedef std::function<void(void)> navmesh_location_callback_t; class NavMeshLocation { public: diff --git a/indra/newview/llpathfindingobject.h b/indra/newview/llpathfindingobject.h index 79a796dd60..bf27f114f5 100644 --- a/indra/newview/llpathfindingobject.h +++ b/indra/newview/llpathfindingobject.h @@ -27,9 +27,9 @@ #ifndef LL_LLPATHFINDINGOBJECT_H #define LL_LLPATHFINDINGOBJECT_H +#include <functional> #include <string> -#include <boost/function.hpp> #include <boost/signals2.hpp> #include "llavatarname.h" @@ -61,7 +61,7 @@ public: inline bool isGroupOwned() const {return mIsGroupOwned;}; inline const LLVector3& getLocation() const {return mLocation;}; - typedef boost::function<void (const LLPathfindingObject *)> name_callback_t; + typedef std::function<void(const LLPathfindingObject*)> name_callback_t; typedef boost::signals2::signal<void (const LLPathfindingObject *)> name_signal_t; typedef boost::signals2::connection name_connection_t; diff --git a/indra/newview/llpathfindingpathtool.cpp b/indra/newview/llpathfindingpathtool.cpp index 61791492e7..57f4aefadf 100644 --- a/indra/newview/llpathfindingpathtool.cpp +++ b/indra/newview/llpathfindingpathtool.cpp @@ -30,7 +30,6 @@ #include "llpathfindingpathtool.h" -#include <boost/function.hpp> #include <boost/signals2.hpp> #include "llagent.h" diff --git a/indra/newview/llpathfindingpathtool.h b/indra/newview/llpathfindingpathtool.h index 189b9d4954..f6b4500f0f 100644 --- a/indra/newview/llpathfindingpathtool.h +++ b/indra/newview/llpathfindingpathtool.h @@ -27,7 +27,7 @@ #ifndef LL_LLPATHFINDINGPATHTOOL_H #define LL_LLPATHFINDINGPATHTOOL_H -#include <boost/function.hpp> +#include <functional> #include <boost/signals2.hpp> #include "llpathinglib.h" @@ -62,7 +62,7 @@ public: kCharacterTypeD } ECharacterType; - typedef boost::function<void (void)> path_event_callback_t; + typedef std::function<void(void)> path_event_callback_t; typedef boost::signals2::signal<void (void)> path_event_signal_t; typedef boost::signals2::connection path_event_slot_t; diff --git a/indra/newview/llpopupview.cpp b/indra/newview/llpopupview.cpp index cc55b3c8db..16149b7e33 100644 --- a/indra/newview/llpopupview.cpp +++ b/indra/newview/llpopupview.cpp @@ -94,8 +94,8 @@ void LLPopupView::draw() LLPanel::draw(); } -bool LLPopupView::handleMouseEvent(boost::function<bool(LLView*, S32, S32)> func, - boost::function<bool(LLView*)> predicate, +bool LLPopupView::handleMouseEvent(std::function<bool(LLView*, S32, S32)> func, + std::function<bool(LLView*)> predicate, S32 x, S32 y, bool close_popups) { diff --git a/indra/newview/llpopupview.h b/indra/newview/llpopupview.h index 4a88866185..8c0db623ac 100644 --- a/indra/newview/llpopupview.h +++ b/indra/newview/llpopupview.h @@ -55,7 +55,7 @@ public: popup_list_t getCurrentPopups() { return mPopups; } private: - bool handleMouseEvent(boost::function<bool(LLView*, S32, S32)>, boost::function<bool(LLView*)>, S32 x, S32 y, bool close_popups); + bool handleMouseEvent(std::function<bool(LLView*, S32, S32)>, std::function<bool(LLView*)>, S32 x, S32 y, bool close_popups); popup_list_t mPopups; }; #endif //LL_LLROOTVIEW_H diff --git a/indra/newview/llpostcard.h b/indra/newview/llpostcard.h index cfe6f3951d..11178aa027 100644 --- a/indra/newview/llpostcard.h +++ b/indra/newview/llpostcard.h @@ -40,7 +40,7 @@ class LLPostCard LOG_CLASS(LLPostCard); public: - typedef boost::function<void(bool ok)> result_callback_t; + typedef std::function<void(bool ok)> result_callback_t; static void setPostResultCallback(result_callback_t cb) { mResultCallback = cb; } static void reportPostResult(bool ok); diff --git a/indra/newview/llpreviewscript.h b/indra/newview/llpreviewscript.h index 0bbe540207..a56697117a 100644 --- a/indra/newview/llpreviewscript.h +++ b/indra/newview/llpreviewscript.h @@ -58,7 +58,7 @@ class LLScriptMovedObserver; class LLLiveLSLFile : public LLLiveFile { public: - typedef boost::function<bool(const std::string& filename)> change_callback_t; + typedef std::function<bool(const std::string& filename)> change_callback_t; LLLiveLSLFile(std::string file_path, change_callback_t change_cb); ~LLLiveLSLFile(); diff --git a/indra/newview/llsetkeybinddialog.cpp b/indra/newview/llsetkeybinddialog.cpp index 5dbd579b45..2790705fd8 100644 --- a/indra/newview/llsetkeybinddialog.cpp +++ b/indra/newview/llsetkeybinddialog.cpp @@ -40,7 +40,7 @@ class LLSetKeyBindDialog::Updater : public LLEventTimer { public: - typedef boost::function<void(MASK)> callback_t; + typedef std::function<void(MASK)> callback_t; Updater(callback_t cb, F32 period, MASK mask) :LLEventTimer(period), diff --git a/indra/newview/llspeakers.h b/indra/newview/llspeakers.h index b30852941f..c3773d2c33 100644 --- a/indra/newview/llspeakers.h +++ b/indra/newview/llspeakers.h @@ -141,7 +141,7 @@ private: class LLSpeakerActionTimer : public LLEventTimer { public: - typedef boost::function<bool(const LLUUID&)> action_callback_t; + typedef std::function<bool(const LLUUID&)> action_callback_t; typedef std::map<LLUUID, LLSpeakerActionTimer*> action_timers_map_t; typedef action_timers_map_t::value_type action_value_t; typedef action_timers_map_t::const_iterator action_timer_const_iter_t; diff --git a/indra/newview/llsplitbutton.cpp b/indra/newview/llsplitbutton.cpp index 6c252ed31f..140b63c84d 100644 --- a/indra/newview/llsplitbutton.cpp +++ b/indra/newview/llsplitbutton.cpp @@ -118,7 +118,7 @@ void LLSplitButton::onItemSelected(LLUICtrl* ctrl) hideButtons(); // call the callback if it exists - if(!mSelectionCallback.empty()) + if(mSelectionCallback != nullptr) { mSelectionCallback(this, ctrl->getName()); } diff --git a/indra/newview/llsyswellitem.h b/indra/newview/llsyswellitem.h index 0a4e26cb98..2ad5de816b 100644 --- a/indra/newview/llsyswellitem.h +++ b/indra/newview/llsyswellitem.h @@ -60,7 +60,7 @@ public: virtual void onMouseLeave(S32 x, S32 y, MASK mask); //callbacks - typedef boost::function<void (LLSysWellItem* item)> syswell_item_callback_t; + typedef std::function<void (LLSysWellItem* item)> syswell_item_callback_t; typedef boost::signals2::signal<void (LLSysWellItem* item)> syswell_item_signal_t; syswell_item_signal_t mOnItemClose; syswell_item_signal_t mOnItemClick; diff --git a/indra/newview/llteleporthistory.h b/indra/newview/llteleporthistory.h index b534b136b0..76bd65e7a9 100644 --- a/indra/newview/llteleporthistory.h +++ b/indra/newview/llteleporthistory.h @@ -29,9 +29,9 @@ #include "llsingleton.h" // for LLSingleton +#include <functional> #include <vector> #include <string> -#include <boost/function.hpp> #include <boost/signals2.hpp> #include "llteleporthistorystorage.h" @@ -80,7 +80,7 @@ class LLTeleportHistory: public LLSingleton<LLTeleportHistory> public: typedef std::vector<LLTeleportHistoryItem> slurl_list_t; - typedef boost::function<void()> history_callback_t; + typedef std::function<void()> history_callback_t; typedef boost::signals2::signal<void()> history_signal_t; /** diff --git a/indra/newview/llteleporthistorystorage.h b/indra/newview/llteleporthistorystorage.h index 643c4a6bfc..07da596aab 100644 --- a/indra/newview/llteleporthistorystorage.h +++ b/indra/newview/llteleporthistorystorage.h @@ -77,7 +77,7 @@ public: typedef std::vector<LLTeleportHistoryPersistentItem> slurl_list_t; // removed_index is index of removed item, which replaced by more recent - typedef boost::function<void(S32 removed_index)> history_callback_t; + typedef std::function<void(S32 removed_index)> history_callback_t; typedef boost::signals2::signal<void(S32 removed_index)> history_signal_t; /** diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index b2f2509e80..52ec8c17c1 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -166,10 +166,10 @@ LLFloaterTexturePicker::LLFloaterTexturePicker( mBlankImageAssetID(blank_image_asset_id), mAllowNoTexture(allow_no_texture), mLabel(label), - mTentativeLabel(NULL), - mResolutionLabel(NULL), + mTentativeLabel(nullptr), + mResolutionLabel(nullptr), mActive( true ), - mFilterEdit(NULL), + mFilterEdit(nullptr), mImmediateFilterPermMask(immediate_filter_perm_mask), mDnDFilterPermMask(dnd_filter_perm_mask), mContextConeOpacity(0.f), @@ -180,10 +180,10 @@ LLFloaterTexturePicker::LLFloaterTexturePicker( mMaxDim(S32_MAX), mMinDim(0), mPreviewSettingChanged(false), - mOnFloaterCommitCallback(NULL), - mOnFloaterCloseCallback(NULL), - mSetImageAssetIDCallback(NULL), - mOnUpdateImageStatsCallback(NULL), + mOnFloaterCommitCallback(nullptr), + mOnFloaterCloseCallback(nullptr), + mSetImageAssetIDCallback(nullptr), + mOnUpdateImageStatsCallback(nullptr), mBakeTextureEnabled(false), mLocalTextureEnabled(false), mNoCopyTextureSelected(false), @@ -1090,7 +1090,7 @@ void LLFloaterTexturePicker::onSelectionChange(const std::deque<LLFolderViewItem mNoCopyTextureSelected = false; if (itemp) { - if (!mTextureSelectedCallback.empty()) + if (mTextureSelectedCallback != nullptr) { mTextureSelectedCallback(itemp); } @@ -1683,11 +1683,11 @@ static LLDefaultChildRegistry::Register<LLTextureCtrl> r("texture_picker"); LLTextureCtrl::LLTextureCtrl(const LLTextureCtrl::Params& p) : LLUICtrl(p), - mDragCallback(NULL), - mDropCallback(NULL), - mOnCancelCallback(NULL), - mOnCloseCallback(NULL), - mOnSelectCallback(NULL), + mDragCallback(nullptr), + mDropCallback(nullptr), + mOnCancelCallback(nullptr), + mOnCloseCallback(nullptr), + mOnSelectCallback(nullptr), mBorderColor( p.border_color() ), mAllowNoTexture( p.allow_no_texture ), mAllowLocalTexture( true ), diff --git a/indra/newview/lltexturectrl.h b/indra/newview/lltexturectrl.h index 467b8d1091..e0060474ce 100644 --- a/indra/newview/lltexturectrl.h +++ b/indra/newview/lltexturectrl.h @@ -50,8 +50,8 @@ class LLViewerFetchedTexture; class LLFetchedGLTFMaterial; // used for setting drag & drop callbacks. -typedef boost::function<bool (LLUICtrl*, LLInventoryItem*)> drag_n_drop_callback; -typedef boost::function<void (LLInventoryItem*)> texture_selected_callback; +typedef std::function<bool (LLUICtrl*, LLInventoryItem*)> drag_n_drop_callback; +typedef std::function<void (LLInventoryItem*)> texture_selected_callback; // Helper functions for UI that work with picker bool get_is_predefined_texture(LLUUID asset_id); @@ -299,10 +299,10 @@ private: ////////////////////////////////////////////////////////////////////////////////////////// // LLFloaterTexturePicker -typedef boost::function<void(LLTextureCtrl::ETexturePickOp op, LLPickerSource source, const LLUUID& asset_id, const LLUUID& inventory_id, const LLUUID& tracking_id)> floater_commit_callback; -typedef boost::function<void()> floater_close_callback; -typedef boost::function<void(const LLUUID& asset_id)> set_image_asset_id_callback; -typedef boost::function<void(LLPointer<LLViewerTexture> texture)> set_on_update_image_stats_callback; +typedef std::function<void(LLTextureCtrl::ETexturePickOp op, LLPickerSource source, const LLUUID& asset_id, const LLUUID& inventory_id, const LLUUID& tracking_id)> floater_commit_callback; +typedef std::function<void()> floater_close_callback; +typedef std::function<void(const LLUUID& asset_id)> set_image_asset_id_callback; +typedef std::function<void(LLPointer<LLViewerTexture> texture)> set_on_update_image_stats_callback; class LLFloaterTexturePicker : public LLFloater { diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp index b05c9fde59..3c939a88e5 100644 --- a/indra/newview/lltoast.cpp +++ b/indra/newview/lltoast.cpp @@ -140,7 +140,7 @@ LLToast::LLToast(const LLToast::Params& p) } // init callbacks if present - if(!p.on_delete_toast().empty()) + if (p.on_delete_toast() != nullptr) { mOnDeleteToastSignal.connect(p.on_delete_toast()); } diff --git a/indra/newview/lltoast.h b/indra/newview/lltoast.h index cf116bfadf..a73f7820ba 100644 --- a/indra/newview/lltoast.h +++ b/indra/newview/lltoast.h @@ -75,7 +75,7 @@ class LLToast : public LLModalDialog, public LLInstanceTracker<LLToast> friend class LLToastLifeTimer; public: - typedef boost::function<void (LLToast* toast)> toast_callback_t; + typedef std::function<void (LLToast* toast)> toast_callback_t; typedef boost::signals2::signal<void (LLToast* toast)> toast_signal_t; typedef boost::signals2::signal<void (LLToast* toast, bool mouse_enter)> toast_hover_check_signal_t; diff --git a/indra/newview/lltoolpipette.h b/indra/newview/lltoolpipette.h index 0f1574f2d5..6c79674d76 100644 --- a/indra/newview/lltoolpipette.h +++ b/indra/newview/lltoolpipette.h @@ -34,7 +34,6 @@ #include "lltool.h" #include "lltextureentry.h" -#include <boost/function.hpp> #include <boost/signals2.hpp> class LLViewerObject; diff --git a/indra/newview/lltranslate.cpp b/indra/newview/lltranslate.cpp index bc656feaba..dcd1582eb9 100644 --- a/indra/newview/lltranslate.cpp +++ b/indra/newview/lltranslate.cpp @@ -199,7 +199,7 @@ void LLTranslationAPIHandler::verifyKeyCoro(LLTranslate::EService service, LLSD bOk = false; } - if (!fnc.empty()) + if (fnc != nullptr) { fnc(service, bOk, parseResult); } @@ -275,7 +275,7 @@ void LLTranslationAPIHandler::translateMessageCoro(LanguagePair_t fromTo, std::s LLStringUtil::replaceString(translation, "&", "&"); LLStringUtil::replaceString(translation, "'", "'"); - if (!success.empty()) + if (success != nullptr) success(translation, detected_lang); } else @@ -291,7 +291,7 @@ void LLTranslationAPIHandler::translateMessageCoro(LanguagePair_t fromTo, std::s } LL_WARNS() << "Translation request failed: " << err_msg << LL_ENDL; - if (!failure.empty()) + if (failure != nullptr) failure(status, err_msg); } } diff --git a/indra/newview/lltranslate.h b/indra/newview/lltranslate.h index 0ad769b27f..14372cf406 100644 --- a/indra/newview/lltranslate.h +++ b/indra/newview/lltranslate.h @@ -28,10 +28,10 @@ #define LL_LLTRANSLATE_H #include "llbufferstream.h" -#include <boost/function.hpp> - #include "llsingleton.h" +#include <functional> + class LLTranslationAPIHandler; /** * Entry point for machine translation services. @@ -59,9 +59,9 @@ public : SERVICE_DEEPL, } EService; - typedef boost::function<void(EService, bool, S32)> KeyVerificationResult_fn; - typedef boost::function<void(std::string , std::string )> TranslationSuccess_fn; - typedef boost::function<void(int, std::string)> TranslationFailure_fn; + typedef std::function<void(EService, bool, S32)> KeyVerificationResult_fn; + typedef std::function<void(std::string, std::string)> TranslationSuccess_fn; + typedef std::function<void(int, std::string)> TranslationFailure_fn; /** * Translate given text. diff --git a/indra/newview/llviewerinput.cpp b/indra/newview/llviewerinput.cpp index ea3088613f..3c79f0b21c 100644 --- a/indra/newview/llviewerinput.cpp +++ b/indra/newview/llviewerinput.cpp @@ -63,13 +63,13 @@ const LLKeyData agent_control_lbutton(CLICK_LEFT, KEY_NONE, MASK_NONE, true); struct LLKeybindFunctionData { - LLKeybindFunctionData(boost::function<bool(EKeystate keystate)> function, bool global) + LLKeybindFunctionData(std::function<bool(EKeystate keystate)> function, bool global) : mFunction(function), mIsGlobal(global) { } - boost::function<bool(EKeystate keystate)> mFunction; + std::function<bool(EKeystate keystate)> mFunction; // todo: might be good idea to make this into enum, like: global/inworld/menu bool mIsGlobal; }; @@ -1165,8 +1165,8 @@ bool LLViewerInput::handleGlobalBindsMouse(EMouseClickType clicktype, MASK mask, bool LLViewerInput::bindKey(const S32 mode, const KEY key, const MASK mask, const std::string& function_name) { size_t index; - typedef boost::function<bool(EKeystate)> function_t; - function_t function = NULL; + typedef std::function<bool(EKeystate)> function_t; + function_t function = nullptr; std::string name; // Allow remapping of F2-F12 @@ -1255,8 +1255,8 @@ bool LLViewerInput::bindKey(const S32 mode, const KEY key, const MASK mask, cons bool LLViewerInput::bindMouse(const S32 mode, const EMouseClickType mouse, const MASK mask, const std::string& function_name) { size_t index; - typedef boost::function<bool(EKeystate)> function_t; - function_t function = NULL; + typedef std::function<bool(EKeystate)> function_t; + function_t function = nullptr; if (mouse == CLICK_LEFT && mask == MASK_NONE diff --git a/indra/newview/llviewerinput.h b/indra/newview/llviewerinput.h index 50b2c4ab9f..80ba99e201 100644 --- a/indra/newview/llviewerinput.h +++ b/indra/newview/llviewerinput.h @@ -38,7 +38,7 @@ class LLWindow; class LLNamedFunction { public: - LLNamedFunction() : mFunction(NULL) { }; + LLNamedFunction() : mFunction(nullptr) { }; ~LLNamedFunction() { }; std::string mName; diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 6e9458597a..efa3f5cd1e 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1712,7 +1712,7 @@ void create_new_item(const std::string& name, LLAssetType::EType asset_type, LLInventoryType::EType inv_type, U32 next_owner_perm, - std::function<void(const LLUUID&)> created_cb = NULL) + std::function<void(const LLUUID&)> created_cb = nullptr) { std::string desc; LLViewerAssetType::generateDescriptionFor(asset_type, desc); @@ -1836,7 +1836,7 @@ void menu_create_inventory_item(LLInventoryPanel* panel, LLUUID dest_id, const L parent_id = gInventory.getRootFolderID(); } - std::function<void(const LLUUID&)> callback_cat_created = NULL; + std::function<void(const LLUUID&)> callback_cat_created = nullptr; if (panel) { LLHandle<LLPanel> handle = panel->getHandle(); diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index 0dfbf0cced..a42bdaa2b0 100644 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -284,9 +284,9 @@ private: LLUUID mTargetLandmarkId; }; -typedef boost::function<void(const LLUUID&)> inventory_func_type; -typedef boost::function<void(const LLSD&)> llsd_func_type; -typedef boost::function<void()> nullary_func_type; +typedef std::function<void(const LLUUID&)> inventory_func_type; +typedef std::function<void(const LLSD&)> llsd_func_type; +typedef std::function<void()> nullary_func_type; void no_op_inventory_func(const LLUUID&); // A do-nothing inventory_func void no_op_llsd_func(const LLSD&); // likewise for LLSD @@ -470,7 +470,7 @@ void menu_create_inventory_item(LLInventoryPanel* root, const LLSD& userdata, const LLUUID& default_parent_uuid = LLUUID::null); -void menu_create_inventory_item(LLInventoryPanel* panel, LLUUID dest_id, const LLSD& userdata, const LLUUID& default_parent_uuid = LLUUID::null, std::function<void(const LLUUID&)> folder_created_cb = NULL); +void menu_create_inventory_item(LLInventoryPanel* panel, LLUUID dest_id, const LLSD& userdata, const LLUUID& default_parent_uuid = LLUUID::null, std::function<void(const LLUUID&)> folder_created_cb = nullptr); void slam_inventory_folder(const LLUUID& folder_id, const LLSD& contents, diff --git a/indra/newview/llviewermessage.h b/indra/newview/llviewermessage.h index 52f383faa9..00743909f0 100644 --- a/indra/newview/llviewermessage.h +++ b/indra/newview/llviewermessage.h @@ -36,9 +36,10 @@ #include "llnotifications.h" #include "llextendedstatus.h" -#include <boost/function.hpp> #include <boost/signals2.hpp> +#include <functional> + // // Forward declarations // @@ -216,7 +217,7 @@ class LLViewerMessage : public LLSingleton<LLViewerMessage> { LLSINGLETON_EMPTY_CTOR(LLViewerMessage); public: - typedef boost::function<void()> teleport_started_callback_t; + typedef std::function<void()> teleport_started_callback_t; typedef boost::signals2::signal<void()> teleport_started_signal_t; boost::signals2::connection setTeleportStartedCallback(teleport_started_callback_t cb); @@ -264,7 +265,7 @@ private: std::string getSanitizedDescription(); void sendReceiveResponse(bool accept, const LLUUID &destination_folder_id); - typedef boost::function<bool (const LLSD&, const LLSD&)> respond_function_t; + typedef std::function<bool (const LLSD&, const LLSD&)> respond_function_t; typedef std::map<std::string, respond_function_t> respond_function_map_t; respond_function_map_t mRespondFunctions; diff --git a/indra/newview/llviewerparcelaskplay.h b/indra/newview/llviewerparcelaskplay.h index 720daa2e5d..563fb13011 100644 --- a/indra/newview/llviewerparcelaskplay.h +++ b/indra/newview/llviewerparcelaskplay.h @@ -38,7 +38,7 @@ class LLViewerParcelAskPlay : public LLSingleton<LLViewerParcelAskPlay> void cleanupSingleton() override; public: // functor expects functor(region_id, parcel_id, url, play/stop) - typedef boost::function<void(const LLUUID&, const S32&, const std::string&, const bool&)> ask_callback; + typedef std::function<void(const LLUUID&, const S32&, const std::string&, const bool&)> ask_callback; void askToPlay(const LLUUID ®ion_id, const S32 &parcel_id, const std::string &url, ask_callback cb); void cancelNotification(); diff --git a/indra/newview/llviewerparcelmgr.h b/indra/newview/llviewerparcelmgr.h index 1925cd23ed..8439283eb0 100644 --- a/indra/newview/llviewerparcelmgr.h +++ b/indra/newview/llviewerparcelmgr.h @@ -33,9 +33,10 @@ #include "llparcelselection.h" #include "llui.h" -#include <boost/function.hpp> #include <boost/signals2.hpp> +#include <functional> + class LLUUID; class LLMessageSystem; class LLParcel; @@ -79,9 +80,9 @@ class LLViewerParcelMgr : public LLSingleton<LLViewerParcelMgr> ~LLViewerParcelMgr(); public: - typedef boost::function<void (const LLVector3d&, const bool& local)> teleport_finished_callback_t; + typedef std::function<void (const LLVector3d&, const bool& local)> teleport_finished_callback_t; typedef boost::signals2::signal<void (const LLVector3d&, const bool&)> teleport_finished_signal_t; - typedef boost::function<void()> teleport_failed_callback_t; + typedef std::function<void()> teleport_failed_callback_t; typedef boost::signals2::signal<void()> teleport_failed_signal_t; static void cleanupGlobals(); diff --git a/indra/newview/llviewerpartsim.cpp b/indra/newview/llviewerpartsim.cpp index b556aef768..6dead0cf82 100644 --- a/indra/newview/llviewerpartsim.cpp +++ b/indra/newview/llviewerpartsim.cpp @@ -76,12 +76,12 @@ LLViewerPart::LLViewerPart() : mPartID(0), mLastUpdateTime(0.f), mSkipOffset(0.f), - mVPCallback(NULL), - mImagep(NULL) + mVPCallback(nullptr), + mImagep(nullptr) { - mPartSourcep = NULL; - mParent = NULL; - mChild = NULL; + mPartSourcep = nullptr; + mParent = nullptr; + mChild = nullptr; ++LLViewerPartSim::sParticleCount2 ; } diff --git a/indra/newview/llviewerprecompiledheaders.h b/indra/newview/llviewerprecompiledheaders.h index 5700d8b278..f6ee00cb25 100644 --- a/indra/newview/llviewerprecompiledheaders.h +++ b/indra/newview/llviewerprecompiledheaders.h @@ -125,7 +125,6 @@ #include "llpanel.h" #include "llfloater.h" -#include <boost/function.hpp> #include <boost/signals2.hpp> #include <boost/unordered_set.hpp> #include <boost/unordered_map.hpp> diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index 244e2b7835..b3ec857907 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -295,10 +295,10 @@ public: typedef LLCoreHttpUtil::HttpCoroutineAdapter::completionCallback_t httpCallback_t; bool requestPostCapability(const std::string &capName, LLSD &postData, - httpCallback_t cbSuccess = NULL, - httpCallback_t cbFailure = NULL); - bool requestGetCapability(const std::string &capName, httpCallback_t cbSuccess = NULL, httpCallback_t cbFailure = NULL); - bool requestDelCapability(const std::string &capName, httpCallback_t cbSuccess = NULL, httpCallback_t cbFailure = NULL); + httpCallback_t cbSuccess = nullptr, + httpCallback_t cbFailure = nullptr); + bool requestGetCapability(const std::string& capName, httpCallback_t cbSuccess = nullptr, httpCallback_t cbFailure = nullptr); + bool requestDelCapability(const std::string& capName, httpCallback_t cbSuccess = nullptr, httpCallback_t cbFailure = nullptr); /// implements LLCapabilityProvider /*virtual*/ const LLHost& getHost() const; diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index cb7d45564d..692e192edb 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -6142,7 +6142,7 @@ bool LLViewerWindow::getUIVisibility() // LLPickInfo::LLPickInfo() : mKeyMask(MASK_NONE), - mPickCallback(NULL), + mPickCallback(nullptr), mPickType(PICK_INVALID), mWantSurfaceInfo(false), mObjectFace(-1), @@ -6153,7 +6153,7 @@ LLPickInfo::LLPickInfo() mNormal(), mTangent(), mBinormal(), - mHUDIcon(NULL), + mHUDIcon(nullptr), mPickTransparent(false), mPickRigged(false), mPickParticle(false) diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index 61aa84394c..f3c7ef3289 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -48,9 +48,10 @@ #include "lltrace.h" #include "llsnapshotmodel.h" -#include <boost/function.hpp> #include <boost/signals2.hpp> +#include <functional> + class LLView; class LLViewerObject; class LLUUID; @@ -238,7 +239,7 @@ public: const std::map<std::string, std::string>& args); // signal on update of WorldView rect - typedef boost::function<void (LLRect old_world_rect, LLRect new_world_rect)> world_rect_callback_t; + typedef std::function<void (LLRect old_world_rect, LLRect new_world_rect)> world_rect_callback_t; typedef boost::signals2::signal<void (LLRect old_world_rect, LLRect new_world_rect)> world_rect_signal_t; world_rect_signal_t mOnWorldViewRectUpdated; boost::signals2::connection setOnWorldViewRectUpdated(world_rect_callback_t cb) { return mOnWorldViewRectUpdated.connect(cb); } diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 1e62f47082..e5c14a34a5 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2735,7 +2735,7 @@ void LLVOAvatarSelf::onCustomizeEnd(bool disable_camera_switch) // Dereferencing the previous callback will cause // updateAppearanceFromCOF to be called, whenever all refs // have resolved. - gAgentAvatarp->mEndCustomizeCallback = NULL; + gAgentAvatarp->mEndCustomizeCallback = nullptr; } } diff --git a/indra/newview/llvoicechannel.h b/indra/newview/llvoicechannel.h index bf119638d3..18e1d60987 100644 --- a/indra/newview/llvoicechannel.h +++ b/indra/newview/llvoicechannel.h @@ -57,7 +57,7 @@ public: typedef boost::signals2::signal<void(const EState& old_state, const EState& new_state, const EDirection& direction, bool ended_by_agent, const LLUUID& session_id)> state_changed_signal_t; // on current channel changed signal - typedef boost::function<void(const LLUUID& session_id)> channel_changed_callback_t; + typedef std::function<void(const LLUUID& session_id)> channel_changed_callback_t; typedef boost::signals2::signal<void(const LLUUID& session_id)> channel_changed_signal_t; static channel_changed_signal_t sCurrentVoiceChannelChangedSignal; static boost::signals2::connection setCurrentVoiceChannelChangedCallback(channel_changed_callback_t cb, bool at_front = false); diff --git a/indra/newview/llwatchdog.h b/indra/newview/llwatchdog.h index 1931c582b0..b7dd55577e 100644 --- a/indra/newview/llwatchdog.h +++ b/indra/newview/llwatchdog.h @@ -27,8 +27,6 @@ #ifndef LL_LLTHREADWATCHDOG_H #define LL_LLTHREADWATCHDOG_H -#include <boost/function.hpp> - #ifndef LL_TIMER_H #include "lltimer.h" #endif diff --git a/indra/newview/llwebprofile.h b/indra/newview/llwebprofile.h index a9cfa102c0..5b3f3f2ce1 100644 --- a/indra/newview/llwebprofile.h +++ b/indra/newview/llwebprofile.h @@ -51,7 +51,7 @@ class LLWebProfile LOG_CLASS(LLWebProfile); public: - typedef boost::function<void(bool ok)> status_callback_t; + typedef std::function<void(bool ok)> status_callback_t; static void uploadImage(LLPointer<LLImageFormatted> image, const std::string& caption, bool add_location); static void setAuthCookie(const std::string& cookie); diff --git a/indra/newview/llwindowlistener.cpp b/indra/newview/llwindowlistener.cpp index 1b2953fea6..edaa44aa70 100644 --- a/indra/newview/llwindowlistener.cpp +++ b/indra/newview/llwindowlistener.cpp @@ -41,9 +41,9 @@ #include "llrootview.h" #include "llsdutil.h" #include "stringize.h" +#include <functional> #include <typeinfo> #include <map> -#include <boost/bind.hpp> LLWindowListener::LLWindowListener(LLViewerWindow *window, const KeyboardGetter& kbgetter) : LLEventAPI("LLWindow", "Inject input events into the LLWindow instance"), @@ -352,7 +352,7 @@ struct WhichButton: public StringLookup<Actions> }; static WhichButton buttons; -typedef boost::function<bool(LLCoordGL, MASK)> MouseFunc; +typedef std::function<bool(LLCoordGL, MASK)> MouseFunc; // Wrap a function returning 'void' to return 'true' instead. I'm sure there's // a more generic way to accomplish this, but generically handling the @@ -363,7 +363,7 @@ typedef boost::function<bool(LLCoordGL, MASK)> MouseFunc; // seem to overload comma the same way; or at least not with bind().) class MouseFuncTrue { - typedef boost::function<void(LLCoordGL, MASK)> MouseFuncVoid; + typedef std::function<void(LLCoordGL, MASK)> MouseFuncVoid; MouseFuncVoid mFunc; public: @@ -463,7 +463,7 @@ static void mouseEvent(const MouseFunc& func, const LLSD& request) // Instantiate a TemporaryDrilldownFunc to route incoming mouse events // to the target LLView*. But put it on the heap since "path" is - // optional. Nonetheless, manage it with a boost::scoped_ptr so it + // optional. Nonetheless, manage it with a std::unique_ptr so it // will be destroyed when we leave. tempfunc = std::make_unique<LLView::TemporaryDrilldownFunc>(llview::TargetEvent(target)); } @@ -484,11 +484,11 @@ void LLWindowListener::mouseDown(LLSD const & request) if (actions.valid) { // Normally you can pass NULL to an LLWindow* without compiler - // complaint, but going through boost::bind() evidently + // complaint, but going through std::bind() evidently // bypasses that special case: it only knows you're trying to pass an // int to a pointer. Explicitly cast NULL to the desired pointer type. - mouseEvent(boost::bind(actions.down, mWindow, - static_cast<LLWindow*>(NULL), _1, _2), + mouseEvent(std::bind(actions.down, mWindow, + static_cast<LLWindow*>(NULL), std::placeholders::_1, std::placeholders::_2), request); } } @@ -498,8 +498,7 @@ void LLWindowListener::mouseUp(LLSD const & request) Actions actions(buttons.lookup(request["button"])); if (actions.valid) { - mouseEvent(boost::bind(actions.up, mWindow, - static_cast<LLWindow*>(NULL), _1, _2), + mouseEvent(std::bind(actions.up, mWindow, static_cast<LLWindow*>(NULL), std::placeholders::_1, std::placeholders::_2), request); } } @@ -511,8 +510,8 @@ void LLWindowListener::mouseMove(LLSD const & request) // void, whereas mouseEvent() accepts a function returning bool -- and // uses that bool return. Use MouseFuncTrue to construct a callable that // returns bool anyway. - mouseEvent(MouseFuncTrue(boost::bind(&LLWindowCallbacks::handleMouseMove, mWindow, - static_cast<LLWindow*>(NULL), _1, _2)), + mouseEvent(MouseFuncTrue(std::bind(&LLWindowCallbacks::handleMouseMove, mWindow, static_cast<LLWindow*>(NULL), std::placeholders::_1, + std::placeholders::_2)), request); } diff --git a/indra/newview/llwindowlistener.h b/indra/newview/llwindowlistener.h index 207f64c8c0..9908a9c451 100644 --- a/indra/newview/llwindowlistener.h +++ b/indra/newview/llwindowlistener.h @@ -28,7 +28,7 @@ #define LL_LLWINDOWLISTENER_H #include "lleventapi.h" -#include <boost/function.hpp> +#include <functional> class LLKeyboard; class LLViewerWindow; @@ -36,7 +36,7 @@ class LLViewerWindow; class LLWindowListener : public LLEventAPI { public: - typedef boost::function<LLKeyboard*()> KeyboardGetter; + typedef std::function<LLKeyboard*()> KeyboardGetter; LLWindowListener(LLViewerWindow * window, const KeyboardGetter& kbgetter); void getInfo(LLSD const & evt); diff --git a/indra/newview/llworldmap.h b/indra/newview/llworldmap.h index aab19a4d5f..68e7f3ee29 100644 --- a/indra/newview/llworldmap.h +++ b/indra/newview/llworldmap.h @@ -28,7 +28,6 @@ #define LL_LLWORLDMAP_H #include "llworldmipmap.h" -#include <boost/function.hpp> #include "v3dmath.h" #include "lluuid.h" diff --git a/indra/newview/llworldmapmessage.cpp b/indra/newview/llworldmapmessage.cpp index c60d075e0c..e81e6b4596 100644 --- a/indra/newview/llworldmapmessage.cpp +++ b/indra/newview/llworldmapmessage.cpp @@ -43,7 +43,7 @@ LLWorldMapMessage::LLWorldMapMessage() : mSLURLRegionName(), mSLURLRegionHandle(0), mSLURL(), - mSLURLCallback(0), + mSLURLCallback(nullptr), mSLURLTeleport(false) { } @@ -215,14 +215,14 @@ void LLWorldMapMessage::processMapBlockReply(LLMessageSystem* msg, void**) // Handle the SLURL callback if any url_callback_t callback = LLWorldMapMessage::getInstance()->mSLURLCallback; - if(callback != NULL) + if (callback != nullptr) { U64 handle = to_region_handle(x_world, y_world); // Check if we reached the requested region if ((LLStringUtil::compareInsensitive(LLWorldMapMessage::getInstance()->mSLURLRegionName, name)==0) || (LLWorldMapMessage::getInstance()->mSLURLRegionHandle == handle)) { - LLWorldMapMessage::getInstance()->mSLURLCallback = NULL; + LLWorldMapMessage::getInstance()->mSLURLCallback = nullptr; LLWorldMapMessage::getInstance()->mSLURLRegionName.clear(); LLWorldMapMessage::getInstance()->mSLURLRegionHandle = 0; diff --git a/indra/newview/llworldmapmessage.h b/indra/newview/llworldmapmessage.h index 357d31ccc1..87ae935bb9 100644 --- a/indra/newview/llworldmapmessage.h +++ b/indra/newview/llworldmapmessage.h @@ -27,7 +27,7 @@ #ifndef LL_LLWORLDMAPMESSAGE_H #define LL_LLWORLDMAPMESSAGE_H -#include "boost/function.hpp" +#include <functional> // Handling of messages (send and process) as well as SLURL callback if necessary class LLMessageSystem; @@ -38,7 +38,7 @@ class LLWorldMapMessage : public LLSingleton<LLWorldMapMessage> ~LLWorldMapMessage(); public: - typedef boost::function<void(U64 region_handle, const std::string& url, const LLUUID& snapshot_id, bool teleport)> + typedef std::function<void(U64 region_handle, const std::string& url, const LLUUID& snapshot_id, bool teleport)> url_callback_t; // Process incoming answers to map stuff requests diff --git a/indra/newview/tests/lllogininstance_test.cpp b/indra/newview/tests/lllogininstance_test.cpp index 29ca903256..b82a58163c 100644 --- a/indra/newview/tests/lllogininstance_test.cpp +++ b/indra/newview/tests/lllogininstance_test.cpp @@ -123,7 +123,7 @@ void LLCredential::authenticatorType(std::string &idType) LLNotificationPtr LLNotificationsUtil::add(const std::string& name, const LLSD& substitutions, const LLSD& payload, - boost::function<void (const LLSD&, const LLSD&)> functor) + std::function<void (const LLSD&, const LLSD&)> functor) { return LLNotificationPtr((LLNotification*)NULL); } @@ -253,7 +253,7 @@ void LLProgressView::setMessage(std::string const &){} // LLNotifications class MockNotifications : public LLNotificationsInterface { - boost::function<void (const LLSD&, const LLSD&)> mResponder; + std::function<void (const LLSD&, const LLSD&)> mResponder; int mAddedCount; public: diff --git a/indra/test/test.cpp b/indra/test/test.cpp index 172b6e3542..d32388cd45 100644 --- a/indra/test/test.cpp +++ b/indra/test/test.cpp @@ -77,12 +77,14 @@ public: virtual void replay(std::ostream&) {} }; -class RecordToTempFile : public LLError::Recorder, public boost::noncopyable +class RecordToTempFile : public LLError::Recorder { public: + RecordToTempFile(const RecordToTempFile&) = delete; + RecordToTempFile& operator=(const RecordToTempFile&) = delete; + RecordToTempFile() : LLError::Recorder(), - boost::noncopyable(), mTempFile("log", ""), mFile(mTempFile.getName().c_str()) { @@ -121,12 +123,14 @@ private: llofstream mFile; }; -class LLReplayLogReal: public LLReplayLog, public boost::noncopyable +class LLReplayLogReal: public LLReplayLog { public: + LLReplayLogReal(const LLReplayLogReal&) = delete; + LLReplayLogReal& operator=(const LLReplayLogReal&) = delete; + LLReplayLogReal(LLError::ELevel level) : LLReplayLog(), - boost::noncopyable(), mOldSettings(LLError::saveAndResetSettings()), mRecorder(new RecordToTempFile()) { diff --git a/indra/viewer_components/login/lllogin.h b/indra/viewer_components/login/lllogin.h index 45bcc2866f..1fdba129ea 100644 --- a/indra/viewer_components/login/lllogin.h +++ b/indra/viewer_components/login/lllogin.h @@ -26,8 +26,6 @@ #ifndef LL_LLLOGIN_H #define LL_LLLOGIN_H -#include <boost/scoped_ptr.hpp> - class LLSD; class LLEventPump; |
