aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories/e/ebuild_id.cc
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2013-05-23 23:01:33 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2013-05-23 23:02:02 +0100
commit4663dbe5248be2a9ee2d0e5986c1e01f5006d02e (patch)
treee1ffa1c2d76b5f1018ab2e1eccc0d0520d7b4f45 /paludis/repositories/e/ebuild_id.cc
parent02af9159b804d6001edc548187bb260c2ad011aa (diff)
downloadpaludis-4663dbe5248be2a9ee2d0e5986c1e01f5006d02e.tar.gz
paludis-4663dbe5248be2a9ee2d0e5986c1e01f5006d02e.tar.xz
Convert to fancy new visitors
Diffstat (limited to 'paludis/repositories/e/ebuild_id.cc')
-rw-r--r--paludis/repositories/e/ebuild_id.cc52
1 files changed, 9 insertions, 43 deletions
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index d1e1fb430..d8ad37d7a 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -1274,52 +1274,18 @@ EbuildID::load_scm_revision(const std::string & r, const std::string & h, const
add_metadata_key(_imp->scm_revision);
}
-namespace
-{
- struct SupportsActionQuery
- {
- bool visit(const SupportsActionTest<FetchAction> &) const
- {
- return true;
- }
-
- bool visit(const SupportsActionTest<PretendFetchAction> &) const
- {
- return true;
- }
-
- bool visit(const SupportsActionTest<InstallAction> &) const
- {
- return true;
- }
-
- bool visit(const SupportsActionTest<ConfigAction> &) const
- {
- return false;
- }
-
- bool visit(const SupportsActionTest<PretendAction> &) const
- {
- return true;
- }
-
- bool visit(const SupportsActionTest<InfoAction> &) const
- {
- return true;
- }
-
- bool visit(const SupportsActionTest<UninstallAction> &) const
- {
- return false;
- }
- };
-}
-
bool
EbuildID::supports_action(const SupportsActionTestBase & b) const
{
- SupportsActionQuery q;
- return b.accept_returning<bool>(q) && eapi()->supported();
+ return b.make_accept_returning(
+ [&] (const SupportsActionTest<FetchAction> &) { return true; },
+ [&] (const SupportsActionTest<PretendFetchAction> &) { return true; },
+ [&] (const SupportsActionTest<InstallAction> &) { return true; },
+ [&] (const SupportsActionTest<ConfigAction> &) { return false; },
+ [&] (const SupportsActionTest<PretendAction> &) { return true; },
+ [&] (const SupportsActionTest<InfoAction> &) { return true; },
+ [&] (const SupportsActionTest<UninstallAction> &) { return false; }
+ ) && eapi()->supported();
}
namespace