aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2013-05-23 22:22:00 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2013-05-23 22:22:00 +0100
commit02af9159b804d6001edc548187bb260c2ad011aa (patch)
tree5c36c44cce01eae799352e33380cf10874975bef
parentcc5f762b62509071450a6405fe63416c9e8e3cde (diff)
downloadpaludis-02af9159b804d6001edc548187bb260c2ad011aa.tar.gz
paludis-02af9159b804d6001edc548187bb260c2ad011aa.tar.xz
Add visitor->make_accept
-rw-r--r--paludis/util/visitor.hh15
1 files changed, 15 insertions, 0 deletions
diff --git a/paludis/util/visitor.hh b/paludis/util/visitor.hh
index c51429b..19b3d0b 100644
--- a/paludis/util/visitor.hh
+++ b/paludis/util/visitor.hh
@@ -182,6 +182,15 @@ namespace paludis
}
};
+ template <typename Case_, typename V_>
+ struct CallThisCase<void, Case_, V_, true>
+ {
+ static void call(const Case_ & thiscase, const FirstCallArgumentType<Case_> & v, const V_ & revisitor)
+ {
+ thiscase(v, accept_visitor(revisitor));
+ }
+ };
+
template <typename Revisitor_, typename Result_, typename Case_, typename... Rest_>
struct MadeVisitor<Revisitor_, Result_, Case_, Rest_...> :
MadeVisitor<Revisitor_, Result_, Rest_...>
@@ -390,6 +399,12 @@ namespace paludis
{
return this->accept_returning<CallResultType<Case_> >(make_visitor(firstcase, cases...));
}
+
+ template <typename... Cases_>
+ void make_accept(const Cases_ & ... cases) const
+ {
+ this->accept(make_visitor(cases...));
+ }
};
template <typename BaseClass_, typename RealClass_>