Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct BarHandler {
- template <typename T>
- void operator()(T& t) const {
- return t.bar();
- }
- void operator()(two&) const {
- // alternative behavior
- }
- };
- void bar(const int key) {
- findObject(key, BarHandler{});
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement