Skip to content

Instantly share code, notes, and snippets.

@kalyco
Created July 17, 2019 17:39
Show Gist options
  • Save kalyco/88e951354982920529b7c84d625ef170 to your computer and use it in GitHub Desktop.
Save kalyco/88e951354982920529b7c84d625ef170 to your computer and use it in GitHub Desktop.
#include <functional>
#include <iostream>
void print(const int &i)
{
std::cout << i << '\n';
}
int main()
{
int i = 5;
const auto f = std::bind(&print, i);
f();
f();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment