aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2013-05-24 00:35:41 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2013-05-24 00:35:41 +0100
commit53b757d8595fd4821fc7f69eebe7940f0c9f4c35 (patch)
tree760654adfe18a953f0b1af47aa9e725f19882c52
parent9607f69eecb2149dfc4258af920c5f326d65af0a (diff)
downloadpaludis-53b757d8595fd4821fc7f69eebe7940f0c9f4c35.tar.gz
paludis-53b757d8595fd4821fc7f69eebe7940f0c9f4c35.tar.xz
Convert to fancy new visitors
-rw-r--r--paludis/repositories/unavailable/unavailable_repository.cc54
1 files changed, 10 insertions, 44 deletions
diff --git a/paludis/repositories/unavailable/unavailable_repository.cc b/paludis/repositories/unavailable/unavailable_repository.cc
index 051b64b..5be25fd 100644
--- a/paludis/repositories/unavailable/unavailable_repository.cc
+++ b/paludis/repositories/unavailable/unavailable_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
@@ -249,52 +249,18 @@ UnavailableRepository::package_ids(const QualifiedPackageName & p, const Reposit
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
UnavailableRepository::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