Elegant porting lambda expressions in C ++

Since lambda expressions require GCC version> 4.4: which is the most elegant or fastest (but not too "dirty") way to port code containing a pair of lambda expressions with binding to binding to pre-C ++ 0x code

Can this be done in a semi-automatic way using templates / macros?

+5
source share
2 answers

Perhaps you should take a look at boost :: lambda . This should do what you are looking for.

+6
source

(Disclaimer: I am attached to my site.)

. , , . .

, , : -)

sort(vs.begin(), vs.end(),
YALM(bool,vector<int>&,vector<int>&,return l.size() < r.size()  )
);
+2

All Articles