Last active
January 24, 2020 22:54
-
-
Save kalman5/6f0385e53250e7e01a65b990e9749339 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
| void PrePost(const std::function<void(void)>& f) { | |
| std::cout << "pre\n"; | |
| f(); | |
| std::cout << "post\n"; | |
| } | |
| int main() { | |
| double a = 1.1; | |
| double b = 2.2; | |
| double c = 3.3; | |
| PrePost( | |
| [&a, &b, &c](){ | |
| std::cout << a << " " << b << " " << c << "\n"; | |
| } | |
| ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment