Created
March 8, 2014 21:38
-
-
Save lawliet89/9439285 to your computer and use it in GitHub Desktop.
std::function declaration of the std::min function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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