From 0341d6f87397a69fe2882e024f8df4f66469acae Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 1 Nov 2018 09:13:43 +0000 Subject: [PATCH] Removed reprecated C++ usage --- include/osgWidget/WindowManager | 6 ++-- src/osgDB/DatabasePager.cpp | 51 --------------------------------- 2 files changed, 4 insertions(+), 53 deletions(-) diff --git a/include/osgWidget/WindowManager b/include/osgWidget/WindowManager index 49b5e6eeb..a99772d8e 100644 --- a/include/osgWidget/WindowManager +++ b/include/osgWidget/WindowManager @@ -285,14 +285,16 @@ class OSGWIDGET_EXPORT WindowManager: public osg::Switch, public UIObjectParent< private: // A functor used to sort the Windows by their Z component in descending order. - struct WindowZCompare: public std::binary_function { + struct WindowZCompare + { bool operator()(const ptr_type& x, const ptr_type& y) { return x.get()->getZ() > y.get()->getZ(); } }; // A functor used to sort the Windows by their BinNum component in descending order. - struct WindowBinNumberCompare: public std::binary_function { + struct WindowBinNumberCompare + { bool operator()(const ptr_type& x, const ptr_type& y) { return x.get()->getOrCreateStateSet()->getBinNumber() > diff --git a/src/osgDB/DatabasePager.cpp b/src/osgDB/DatabasePager.cpp index b2bfcdeff..0ce93db42 100644 --- a/src/osgDB/DatabasePager.cpp +++ b/src/osgDB/DatabasePager.cpp @@ -49,57 +49,6 @@ static osg::ApplicationUsageProxy DatabasePager_e4(osg::ApplicationUsage::ENVIRO static osg::ApplicationUsageProxy DatabasePager_e11(osg::ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_MAX_PAGEDLOD ","Set the target maximum number of PagedLOD to maintain."); static osg::ApplicationUsageProxy DatabasePager_e12(osg::ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_ASSIGN_PBO_TO_IMAGES ","Set whether PixelBufferObjects should be assigned to Images to aid download to the GPU."); -// Convert function objects that take pointer args into functions that a -// reference to an osg::ref_ptr. This is quite useful for doing STL -// operations on lists of ref_ptr. This code assumes that a function -// with an argument const Foo* should be composed into a function of -// argument type ref_ptr&, not ref_ptr&. Some support -// for that should be added to make this more general. - -namespace -{ -template -struct PointerTraits -{ - typedef class NullType {} PointeeType; -}; - -template -struct PointerTraits -{ - typedef U PointeeType; -}; - -template -struct PointerTraits -{ - typedef U PointeeType; -}; - -template -class RefPtrAdapter - : public std::unary_function::PointeeType>, - typename FuncObj::result_type> -{ -public: - typedef typename PointerTraits::PointeeType PointeeType; - typedef osg::ref_ptr RefPtrType; - explicit RefPtrAdapter(const FuncObj& funcObj) : _func(funcObj) {} - typename FuncObj::result_type operator()(const RefPtrType& refPtr) const - { - return _func(refPtr.get()); - } -protected: - FuncObj _func; -}; - -template -RefPtrAdapter refPtrAdapt(const FuncObj& func) -{ - return RefPtrAdapter(func); -} -} - ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// //