#include <iostream>
#include <algorithm>
#include <functional>
int main()
{
bool foo = false;
auto b = std::bind2nd(foo ? std::function<bool(int,int)>(std::greater<int>()) : std::function<bool(int,int)>(std::equal_to<int>()), 2);
std::cout << b(4) << std::endl; // true, 4 > 2
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8YWxnb3JpdGhtPgojaW5jbHVkZSA8ZnVuY3Rpb25hbD4KCmludCBtYWluKCkKewoJYm9vbCBmb28gPSBmYWxzZTsKCWF1dG8gYiA9IHN0ZDo6YmluZDJuZChmb28gPyBzdGQ6OmZ1bmN0aW9uPGJvb2woaW50LGludCk+KHN0ZDo6Z3JlYXRlcjxpbnQ+KCkpIDogc3RkOjpmdW5jdGlvbjxib29sKGludCxpbnQpPihzdGQ6OmVxdWFsX3RvPGludD4oKSksIDIpOwoJc3RkOjpjb3V0IDw8IGIoNCkgPDwgc3RkOjplbmRsOyAvLyB0cnVlLCA0ID4gMgp9Cg==