From: Richard Kreckel Date: Wed, 25 Nov 2015 11:49:31 +0000 (+0100) Subject: Replace idx_is_not functor by a C++11 lambda. X-Git-Tag: release_1-7-0~7^2~47 X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=commitdiff_plain;h=9593ce33c14b7ff535d113f8a825f4c42ca81912;hp=b236efe23093bf2c4b5e7702b60d45505724d915 Replace idx_is_not functor by a C++11 lambda. --- diff --git a/ginac/indexed.cpp b/ginac/indexed.cpp index 55c9768d..d5f7bf85 100644 --- a/ginac/indexed.cpp +++ b/ginac/indexed.cpp @@ -243,12 +243,6 @@ bool indexed::info(unsigned inf) const return inherited::info(inf); } -struct idx_is_not : public std::binary_function { - bool operator() (const ex & e, unsigned inf) const { - return !(ex_to(e).get_value().info(inf)); - } -}; - bool indexed::all_index_values_are(unsigned inf) const { // No indices? Then no property can be fulfilled @@ -256,7 +250,8 @@ bool indexed::all_index_values_are(unsigned inf) const return false; // Check all indices - return find_if(seq.begin() + 1, seq.end(), bind2nd(idx_is_not(), inf)) == seq.end(); + return find_if(seq.begin() + 1, seq.end(), + [inf](const ex & e) { return !(ex_to(e).get_value().info(inf)); }) == seq.end(); } int indexed::compare_same_type(const basic & other) const