_EWL_EXTENDED_BINDERS

Defining this flag adds defaulted template parameters to binder1st and binder2nd. This allows client code to alter the type of the value that is stored. This is especially useful when you want the binder to store the value by const reference instead of by value to save on an expensive copy construction.

Listing: Example:
#include <string>
#include <functional>
#include <algorithm>

struct A
{
public:
   A(int data = 0) : data_(data) {}
   friend bool operator < (const A& x, const A& y) {return x < y;}
 
   private:
   int data_;
   A(const A&);
};

int main()
{
using namespace std;
   A a[5];
   A* i = find_if(a, a+5, binder2nd<less<A> >(less<A>(), A(5)));
}

This causes the compile-time error, because binder2nd is attempting to store a copy of A(5). But with _EWL_EXTENDED_BINDERS you can request that binder2nd store a const A& to A(5).

  A* i = find_if(a, a+5, 
     binder2nd<less<A>, const A&>(less<A>(), A(5)));

This may be valuable when A is expensive to copy.

This also allows for the use of polymorphic operators by specifying reference types for the operator.

This extension to the standard is detectable with template parameters so it can be disabled by not defining _EWL_EXTENDED_BINDERS.