Last active
January 25, 2020 08:36
-
-
Save kalman5/d32d2fbcec54825cd6299ecd95f65611 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
| template <typename F> | |
| void PrePost(const F& 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