Created
January 19, 2017 12:25
-
-
Save pperehozhih/aba8b8c20d21c07554a227c713faf169 to your computer and use it in GitHub Desktop.
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> | |
| 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