Skip to content

Instantly share code, notes, and snippets.

@pperehozhih
Created January 19, 2017 12:25
Show Gist options
  • Select an option

  • Save pperehozhih/aba8b8c20d21c07554a227c713faf169 to your computer and use it in GitHub Desktop.

Select an option

Save pperehozhih/aba8b8c20d21c07554a227c713faf169 to your computer and use it in GitHub Desktop.
#include <functional>
#include <iostream>
void test() {
}
void test2() {
}
class test3 {
public:
void ttt(){}
};
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;
std::cout << sizeof(&test) << std::endl;
std::cout << sizeof(&test3::ttt) << std::endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment