Skip to content

Instantly share code, notes, and snippets.

@lawliet89
Created March 8, 2014 21:38
Show Gist options
  • Save lawliet89/9439285 to your computer and use it in GitHub Desktop.
Save lawliet89/9439285 to your computer and use it in GitHub Desktop.
std::function declaration of the std::min function
#include <functional>
#include <iostream>
#include <algorithm>
int main() {
std::function<const int &(const int &, const int &)> func =
(const int & (*)(const int &, const int &)) & std::min;
std::cout << func(1, 2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment