Advertisement
Guest User

Untitled

a guest
Dec 17th, 2011
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. void c_func(void(*ptr)()) {
  2. ptr();
  3. }
  4.  
  5. void c_func_helper() {
  6. try {
  7. throw;
  8. } catch(std::function<void()>& func) {
  9. func();
  10. }
  11. }
  12.  
  13. void call_c_func_with_function(std::function<void()> func) {
  14. try {
  15. throw func;
  16. } catch(std::function<void()>& func) {
  17. c_func(c_func_helper);
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement