Advertisement
Guest User

Untitled

a guest
Feb 16th, 2018
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.24 KB | None | 0 0
  1. struct BarHandler {
  2.   template <typename T>
  3.   void operator()(T& t) const {
  4.     return t.bar();
  5.   }
  6.  
  7.   void operator()(two&) const {
  8.     // alternative behavior
  9.   }
  10. };
  11.  
  12. void bar(const int key) {
  13.   findObject(key, BarHandler{});
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement