From 0bcb76d981bf8ebd8806d6ae73cdcb77b5f4a124 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Sun, 14 Apr 2024 20:58:48 +0200 Subject: Fix compatibility with C++17. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- kig/kig/kig_part.cpp | 4 ++-- kig/misc/object_constructor.cpp | 14 +++++++------- kig/misc/special_constructors.cpp | 6 +++--- kig/modes/construct_mode.cpp | 4 ++-- kig/modes/linkslabel.cpp | 4 ++-- kig/modes/macro.cpp | 8 ++++---- kig/modes/normal.cpp | 4 ++-- kig/objects/object_calcer.cpp | 14 +++++++------- kig/objects/object_factory.cpp | 2 +- 9 files changed, 30 insertions(+), 30 deletions(-) (limited to 'kig') diff --git a/kig/kig/kig_part.cpp b/kig/kig/kig_part.cpp index fa7a9f6b..4ccbb62b 100644 --- a/kig/kig/kig_part.cpp +++ b/kig/kig/kig_part.cpp @@ -563,8 +563,8 @@ void KigPart::delObjects( const std::vector& os ) void KigPart::enableConstructActions( bool enabled ) { for_each( aActions.begin(), aActions.end(), - bind2nd( mem_fun( &TDEAction::setEnabled ), - enabled ) ); + std::bind( mem_fn( &TDEAction::setEnabled ), + std::placeholders::_1, enabled ) ); } void KigPart::unplugActionLists() diff --git a/kig/misc/object_constructor.cpp b/kig/misc/object_constructor.cpp index 625554a8..6db3d802 100644 --- a/kig/misc/object_constructor.cpp +++ b/kig/misc/object_constructor.cpp @@ -130,7 +130,7 @@ void SimpleObjectTypeConstructor::drawprelim( const ObjectDrawer& drawer, KigPai Args args; using namespace std; transform( parents.begin(), parents.end(), - back_inserter( args ), mem_fun( &ObjectCalcer::imp ) ); + back_inserter( args ), mem_fn( &ObjectCalcer::imp ) ); ObjectImp* data = mtype->calc( args, doc ); drawer.draw( *data, p, true ); delete data; @@ -184,7 +184,7 @@ void MultiObjectTypeConstructor::drawprelim( const ObjectDrawer& drawer, KigPain Args args; using namespace std; transform( parents.begin(), parents.end(), - back_inserter( args ), mem_fun( &ObjectCalcer::imp ) ); + back_inserter( args ), mem_fn( &ObjectCalcer::imp ) ); for ( vector::const_iterator i = mparams.begin(); i != mparams.end(); ++i ) { @@ -302,7 +302,7 @@ TQString StandardConstructorBase::useText( const ObjectCalcer& o, const std::vec { using namespace std; Args args; - transform( sel.begin(), sel.end(), back_inserter( args ), mem_fun( &ObjectCalcer::imp ) ); + transform( sel.begin(), sel.end(), back_inserter( args ), mem_fn( &ObjectCalcer::imp ) ); std::string ret = margsparser.usetext( o.imp(), args ); if ( ret.empty() ) return TQString(); @@ -315,7 +315,7 @@ TQString StandardConstructorBase::selectStatement( { using namespace std; Args args; - transform( sel.begin(), sel.end(), back_inserter( args ), mem_fun( &ObjectCalcer::imp ) ); + transform( sel.begin(), sel.end(), back_inserter( args ), mem_fn( &ObjectCalcer::imp ) ); std::string ret = margsparser.selectStatement( args ); if ( ret.empty() ) return TQString(); @@ -419,7 +419,7 @@ TQString MacroConstructor::selectStatement( using namespace std; Args args; transform( sel.begin(), sel.end(), back_inserter( args ), - mem_fun( &ObjectCalcer::imp ) ); + mem_fn( &ObjectCalcer::imp ) ); std::string ret = mparser.selectStatement( args ); if ( ret.empty() ) return TQString(); else return i18n( ret.c_str() ); @@ -432,7 +432,7 @@ TQString MacroConstructor::useText( const ObjectCalcer& o, const std::vector ret = mhier.calc( args, doc ); for ( uint i = 0; i < ret.size(); ++i ) diff --git a/kig/misc/special_constructors.cpp b/kig/misc/special_constructors.cpp index 1cc27ecb..c8137966 100644 --- a/kig/misc/special_constructors.cpp +++ b/kig/misc/special_constructors.cpp @@ -116,7 +116,7 @@ void ConicRadicalConstructor::drawprelim( { Args args; std::transform( parents.begin(), parents.end(), - std::back_inserter( args ), std::mem_fun( &ObjectCalcer::imp ) ); + std::back_inserter( args ), std::mem_fn( &ObjectCalcer::imp ) ); for ( int i = -1; i < 2; i += 2 ) { IntImp root( i ); @@ -803,7 +803,7 @@ void PolygonBCVConstructor::drawprelim( const ObjectDrawer& drawer, KigPainter& Args args; std::transform( parents.begin(), parents.end(), - std::back_inserter( args ), std::mem_fun( &ObjectCalcer::imp ) ); + std::back_inserter( args ), std::mem_fn( &ObjectCalcer::imp ) ); ObjectImp* data = mtype->calc( args, doc ); drawer.draw( *data, p, true ); @@ -1196,7 +1196,7 @@ void MeasureTransportConstructor::drawprelim( const ObjectDrawer& drawer, Args args; using namespace std; transform( parents.begin(), parents.end(), - back_inserter( args ), mem_fun( &ObjectCalcer::imp ) ); + back_inserter( args ), mem_fn( &ObjectCalcer::imp ) ); ObjectImp* data = mtype->calc( args, doc ); drawer.draw( *data, p, true ); delete data; diff --git a/kig/modes/construct_mode.cpp b/kig/modes/construct_mode.cpp index cc07c78a..378fc999 100644 --- a/kig/modes/construct_mode.cpp +++ b/kig/modes/construct_mode.cpp @@ -423,7 +423,7 @@ void TestConstructMode::handlePrelim( const std::vector& os, cons { Args args; std::transform( os.begin(), os.end(), std::back_inserter( args ), - std::mem_fun( &ObjectCalcer::imp ) ); + std::mem_fn( &ObjectCalcer::imp ) ); // usetext TQString usetext = i18n( mtype->argsParser().usetext( args.back(), args ).c_str() ); @@ -554,7 +554,7 @@ TQString TestConstructMode::selectStatement( const std::vector& s { using namespace std; Args args; - transform( sel.begin(), sel.end(), back_inserter( args ), mem_fun( &ObjectCalcer::imp ) ); + transform( sel.begin(), sel.end(), back_inserter( args ), mem_fn( &ObjectCalcer::imp ) ); std::string ret = mtype->argsParser().selectStatement( args ); if ( ret.empty() ) return TQString(); diff --git a/kig/modes/linkslabel.cpp b/kig/modes/linkslabel.cpp index a9d0fa59..19cb744d 100644 --- a/kig/modes/linkslabel.cpp +++ b/kig/modes/linkslabel.cpp @@ -129,6 +129,6 @@ void LinksLabel::applyEdit( LinksLabelEditBuf& buf ) p->layout->activate(); - std::for_each( p->urllabels.begin(), p->urllabels.end(), mem_fun( &TQWidget::show ) ); - std::for_each( p->labels.begin(), p->labels.end(), mem_fun( &TQWidget::show ) ); + std::for_each( p->urllabels.begin(), p->urllabels.end(), mem_fn( &TQWidget::show ) ); + std::for_each( p->labels.begin(), p->labels.end(), mem_fn( &TQWidget::show ) ); } diff --git a/kig/modes/macro.cpp b/kig/modes/macro.cpp index 35315b26..be69d80b 100644 --- a/kig/modes/macro.cpp +++ b/kig/modes/macro.cpp @@ -94,11 +94,11 @@ void DefineMacroMode::namePageEntered() std::vector given; std::transform( mgiven.begin(), mgiven.end(), std::back_inserter( given ), - std::mem_fun( memfun ) ); + std::mem_fn( memfun ) ); std::vector final; std::transform( mfinal.begin(), mfinal.end(), std::back_inserter( final ), - std::mem_fun( memfun ) ); + std::mem_fn( memfun ) ); ObjectHierarchy hier( given, final ); if ( hier.resultDoesNotDependOnGiven() ) { @@ -132,11 +132,11 @@ void DefineMacroMode::finishPressed() std::vector given; std::transform( mgiven.begin(), mgiven.end(), std::back_inserter( given ), - std::mem_fun( memfun ) ); + std::mem_fn( memfun ) ); std::vector final; std::transform( mfinal.begin(), mfinal.end(), std::back_inserter( final ), - std::mem_fun( memfun ) ); + std::mem_fn( memfun ) ); ObjectHierarchy hier( given, final ); MacroConstructor* ctor = new MacroConstructor( hier, diff --git a/kig/modes/normal.cpp b/kig/modes/normal.cpp index 2ca6f8b0..b91db417 100644 --- a/kig/modes/normal.cpp +++ b/kig/modes/normal.cpp @@ -71,8 +71,8 @@ void NormalMode::selectObjects( const std::vector& os ) { // hehe, don't you love this c++ stuff ;) std::for_each( os.begin(), os.end(), - std::bind1st( - std::mem_fun( &NormalMode::selectObject ), this ) ); + std::bind( + std::mem_fn( &NormalMode::selectObject ), this, std::placeholders::_1 ) ); } void NormalMode::unselectObject( ObjectHolder* o ) diff --git a/kig/objects/object_calcer.cpp b/kig/objects/object_calcer.cpp index 40545ed1..b15766bc 100644 --- a/kig/objects/object_calcer.cpp +++ b/kig/objects/object_calcer.cpp @@ -31,7 +31,7 @@ void ObjectTypeCalcer::calc( const KigDocument& doc ) Args a; a.reserve( mparents.size() ); std::transform( mparents.begin(), mparents.end(), - std::back_inserter( a ), std::mem_fun( &ObjectCalcer::imp ) ); + std::back_inserter( a ), std::mem_fn( &ObjectCalcer::imp ) ); ObjectImp* n = mtype->calc( a, doc ); delete mimp; mimp = n; @@ -42,7 +42,7 @@ ObjectTypeCalcer::ObjectTypeCalcer( const ObjectType* type, : mparents( ( sort )?type->sortArgs( parents ):parents ), mtype( type ), mimp( 0 ) { std::for_each( mparents.begin(), mparents.end(), - std::bind2nd( std::mem_fun( &ObjectCalcer::addChild ), this ) ); + std::bind( std::mem_fn( &ObjectCalcer::addChild ), std::placeholders::_1, this ) ); } ObjectCalcer::~ObjectCalcer() @@ -122,7 +122,7 @@ void ObjectCalcer::delChild( ObjectCalcer* c ) ObjectTypeCalcer::~ObjectTypeCalcer() { std::for_each( mparents.begin(), mparents.end(), - std::bind2nd( std::mem_fun( &ObjectCalcer::delChild ), this ) ); + std::bind( std::mem_fn( &ObjectCalcer::delChild ), std::placeholders::_1, this ) ); delete mimp; } @@ -201,7 +201,7 @@ const ObjectImpType* ObjectTypeCalcer::impRequirement( std::transform( os.begin(), os.end(), std::back_inserter( args ), - std::mem_fun( &ObjectCalcer::imp ) ); + std::mem_fn( &ObjectCalcer::imp ) ); assert( std::find( args.begin(), args.end(), o->imp() ) != args.end() ); return mtype->impRequirement( o->imp(), args ); } @@ -219,9 +219,9 @@ void ObjectConstCalcer::setImp( ObjectImp* newimp ) void ObjectTypeCalcer::setParents( const std::vector np ) { std::for_each( np.begin(), np.end(), - std::bind2nd( std::mem_fun( &ObjectCalcer::addChild ), this ) ); + std::bind( std::mem_fn( &ObjectCalcer::addChild ), std::placeholders::_1, this ) ); std::for_each( mparents.begin(), mparents.end(), - std::bind2nd( std::mem_fun( &ObjectCalcer::delChild ), this ) ); + std::bind( std::mem_fn( &ObjectCalcer::delChild ), std::placeholders::_1, this ) ); mparents = np; } @@ -314,7 +314,7 @@ bool ObjectTypeCalcer::isDefinedOnOrThrough( const ObjectCalcer* o ) const std::transform( mparents.begin(), mparents.end(), std::back_inserter( args ), - std::mem_fun( &ObjectCalcer::imp ) ); + std::mem_fn( &ObjectCalcer::imp ) ); if ( std::find( args.begin(), args.end(), o->imp() ) == args.end() ) return false; diff --git a/kig/objects/object_factory.cpp b/kig/objects/object_factory.cpp index bf333094..7235e834 100644 --- a/kig/objects/object_factory.cpp +++ b/kig/objects/object_factory.cpp @@ -296,7 +296,7 @@ void ObjectFactory::redefinePoint( std::vector os; ObjectCalcer* (ObjectHolder::*calcmeth)() = &ObjectHolder::calcer; std::transform( hos.begin(), hos.end(), std::back_inserter( os ), - std::mem_fun( calcmeth ) ); + std::mem_fn( calcmeth ) ); ObjectCalcer* v = 0; // we don't want one of our children as a parent... -- cgit v1.2.1