Skip to content

Instantly share code, notes, and snippets.

@pperehozhih
Created January 19, 2017 12:17
Show Gist options
  • Save pperehozhih/d7b35ae3a573e238c3e5026fe344fb51 to your computer and use it in GitHub Desktop.
Save pperehozhih/d7b35ae3a573e238c3e5026fe344fb51 to your computer and use it in GitHub Desktop.
#include <functional>
#include <iostream>
void test() {
}
void test2() {
}
int main(){
std::function<void()> a1(test);
std::function<void()> a2(test);
std::function<void()> a3(test2);
std::cout << (*(a1.target<void(*)()>()) == *(a2.target<void(*)()>()));
std::cout << std::endl;
std::cout << (*(a1.target<void(*)()>()) == *(a3.target<void(*)()>()));
std::cout << std::endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment