Skip to content

Commit def2599

Browse files
authored
Merge pull request #263 from mzf-guest/remove_unary_binary_functions
Remove obsolete unary and binary functions.
2 parents ef7a8a7 + 7751df5 commit def2599

13 files changed

+622
-171
lines changed

plugin/seq/msh3.cpp

+24-6
Original file line numberDiff line numberDiff line change
@@ -1981,12 +1981,18 @@ Mesh3 *GluMesh3(listMesh3 const &lst) {
19811981
}
19821982

19831983
template< class RR, class AA = RR, class BB = AA >
1984-
struct Op3_addmesh : public binary_function< AA, BB, RR > {
1984+
struct Op3_addmesh {
1985+
using first_argument_type = AA;
1986+
using second_argument_type = BB;
1987+
using result_type = RR;
19851988
static RR f(Stack s, const AA &a, const BB &b) { return RR(s, a, b); }
19861989
};
19871990

19881991
template< bool INIT, class RR, class AA = RR, class BB = AA >
1989-
struct Op3_setmesh : public binary_function< AA, BB, RR > {
1992+
struct Op3_setmesh {
1993+
using first_argument_type = AA;
1994+
using second_argument_type = BB;
1995+
using result_type = RR;
19901996
static RR f(Stack stack, const AA &a, const BB &b) {
19911997
ffassert(a);
19921998
const pmesh3 p = GluMesh3(b);
@@ -2362,12 +2368,18 @@ MeshL *GluMesh(listMeshT<MeshL> const &lst) {
23622368

23632369

23642370
template< class RR, class AA = RR, class BB = AA >
2365-
struct Op3_addmeshS : public binary_function< AA, BB, RR > {
2371+
struct Op3_addmeshS {
2372+
using first_argument_type = AA;
2373+
using second_argument_type = BB;
2374+
using result_type = RR;
23662375
static RR f(Stack s, const AA &a, const BB &b) { return RR(s, a, b); }
23672376
};
23682377

23692378
template< bool INIT, class RR, class AA = RR, class BB = AA >
2370-
struct Op3_setmeshS : public binary_function< AA, BB, RR > {
2379+
struct Op3_setmeshS {
2380+
using first_argument_type = AA;
2381+
using second_argument_type = BB;
2382+
using result_type = RR;
23712383
static RR f(Stack stack, const AA &a, const BB &b) {
23722384
ffassert(a);
23732385
const pmeshS p = GluMesh(b);
@@ -2381,12 +2393,18 @@ struct Op3_setmeshS : public binary_function< AA, BB, RR > {
23812393

23822394

23832395
template< class RR, class AA = RR, class BB = AA >
2384-
struct Op3_addmeshL : public binary_function< AA, BB, RR > {
2396+
struct Op3_addmeshL {
2397+
using first_argument_type = AA;
2398+
using second_argument_type = BB;
2399+
using result_type = RR;
23852400
static RR f(Stack s, const AA &a, const BB &b) { return RR(s, a, b); }
23862401
};
23872402

23882403
template< bool INIT, class RR, class AA = RR, class BB = AA >
2389-
struct Op3_setmeshL : public binary_function< AA, BB, RR > {
2404+
struct Op3_setmeshL {
2405+
using first_argument_type = AA;
2406+
using second_argument_type = BB;
2407+
using result_type = RR;
23902408
static RR f(Stack stack, const AA &a, const BB &b) {
23912409
ffassert(a);
23922410
const pmeshL p = GluMesh(b);

src/fflib/AFunction.cpp

+11-3
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,10 @@ template<class T> inline T Max (const T &a,const T & b,const T & c,const T & d){
148148

149149
template<class T> inline T Square (const T &a){return a*a;}
150150

151-
struct SubArray2: public binary_function<long,long,SubArray> {
151+
struct SubArray2 {
152+
using first_argument_type = long;
153+
using second_argument_type = long;
154+
using result_type = SubArray;
152155
static SubArray f(const long & a,const long & b) {
153156
return SubArray(b-a+1,a);} };
154157
struct SubArray3: public ternary_function<long,long,long,SubArray> {
@@ -236,12 +239,17 @@ R *MakePtrWithDel( A const & a)
236239
return r;}
237240

238241
template<class R,class RR>
239-
struct Op1_new_pstring: public unary_function<string*,R> {
242+
struct Op1_new_pstring{
243+
using argument_type = string*;
244+
using result_type = R;
240245
static R f(string * const & a) {R r = new RR(a->c_str());
241246
return r;} };
242247

243248
template<class R,class RR>
244-
struct Op2_set_pstring: public binary_function<R,string*,R> {
249+
struct Op2_set_pstring {
250+
using first_argument_type = R;
251+
using second_argument_type = string*;
252+
using result_type = R;
245253
static R f(R const & p,string * const & a) {*p = new RR(a->c_str());
246254
if ( !*p || !**p) {
247255
cerr << " Error opening file " << *a << endl;

src/fflib/AFunction.hpp

+10-3
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,11 @@ Expression NewExpression(Function2,Expression,Expression);
183183
inline Type_Expr make_Type_Expr(aType t, E_F0 * e) {return make_pair(t,e);}
184184
inline Type_Expr make_Type_Expr( E_F0 * e,aType t) {return make_pair(t,e);}
185185

186-
struct Keyless : binary_function<const char *,const char *, bool>
186+
struct Keyless
187187
{
188+
using first_argument_type = const char *;
189+
using second_argument_type = const char *;
190+
using result_type = bool;
188191
typedef const char * Key;
189192
bool operator()(const Key& x, const Key& y) const { return strcmp(x,y)<0;} };
190193

@@ -372,8 +375,12 @@ class E_F0 :public CodeAlloc
372375
{
373376
public:
374377
static E_F0 *tnull;
375-
struct kless : binary_function<Expression,Expression, bool>
376-
{ bool operator()(const Expression& x, const Expression& y) const{
378+
struct kless
379+
{
380+
using first_argument_type = Expression;
381+
using second_argument_type = Expression;
382+
using result_type = bool;
383+
bool operator()(const Expression& x, const Expression& y) const{
377384
//cout << x << " " << y << x->compare(y) << " ::: ";
378385
int r1 = x->compare(y);// , r2 = y->compare(x);
379386
//assert(r1+r2==0);

0 commit comments

Comments
 (0)