aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2013-05-24 00:40:58 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2013-05-24 00:40:58 +0100
commit450c0331aca4600729216b9bff5d3e1b4e203871 (patch)
tree49d5464a442b52add931b81915c2f6fe477f449c
parent5b56eb71629d72bb3b1fa1bf1633d2b7748459f9 (diff)
downloadpaludis-450c0331aca4600729216b9bff5d3e1b4e203871.tar.gz
paludis-450c0331aca4600729216b9bff5d3e1b4e203871.tar.xz
Convert to fancy new visitors
-rw-r--r--paludis/repositories/unwritten/unwritten_repository.cc54
1 files changed, 10 insertions, 44 deletions
diff --git a/paludis/repositories/unwritten/unwritten_repository.cc b/paludis/repositories/unwritten/unwritten_repository.cc
index 63a2199..43717db 100644
--- a/paludis/repositories/unwritten/unwritten_repository.cc
+++ b/paludis/repositories/unwritten/unwritten_repository.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009, 2010, 2011 Ciaran McCreesh
+ * Copyright (c) 2008, 2009, 2010, 2011, 2013 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -197,52 +197,18 @@ UnwrittenRepository::package_ids(const QualifiedPackageName & p, const Repositor
return _imp->store->package_ids(p);
}
-namespace
-{
- struct SupportsActionQuery
- {
- bool visit(const SupportsActionTest<InstallAction> &) const
- {
- return true;
- }
-
- bool visit(const SupportsActionTest<FetchAction> &) const
- {
- return false;
- }
-
- bool visit(const SupportsActionTest<PretendFetchAction> &) const
- {
- return false;
- }
-
- bool visit(const SupportsActionTest<ConfigAction> &) const
- {
- return false;
- }
-
- bool visit(const SupportsActionTest<PretendAction> &) const
- {
- return false;
- }
-
- bool visit(const SupportsActionTest<InfoAction> &) const
- {
- return false;
- }
-
- bool visit(const SupportsActionTest<UninstallAction> &) const
- {
- return false;
- }
- };
-}
-
bool
UnwrittenRepository::some_ids_might_support_action(const SupportsActionTestBase & a) const
{
- SupportsActionQuery q;
- return a.accept_returning<bool>(q);
+ return a.make_accept_returning(
+ [&] (const SupportsActionTest<InstallAction> &) { return true; },
+ [&] (const SupportsActionTest<FetchAction> &) { return false; },
+ [&] (const SupportsActionTest<PretendFetchAction> &) { return false; },
+ [&] (const SupportsActionTest<ConfigAction> &) { return false; },
+ [&] (const SupportsActionTest<PretendAction> &) { return false; },
+ [&] (const SupportsActionTest<InfoAction> &) { return false; },
+ [&] (const SupportsActionTest<UninstallAction> &) { return false; }
+ );
}
bool