Skip to content

Instantly share code, notes, and snippets.

@vralex
Created February 28, 2017 12:51
Show Gist options
  • Save vralex/bae61c9cc209341a14c85b810a41bd39 to your computer and use it in GitHub Desktop.
Save vralex/bae61c9cc209341a14c85b810a41bd39 to your computer and use it in GitHub Desktop.
#include <iostream>
struct Widget {
template <typename T, typename U>
void operator()(const T& a, const U& b)
{
std::cout << a << " " << b << std::endl;
}
};
int main()
{
using namespace std::placeholders;
auto poly = std::bind(Widget(), 1, _1);
poly("32");
poly(12);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment