aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2013-05-24 00:34:14 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2013-05-24 00:34:14 +0100
commit9607f69eecb2149dfc4258af920c5f326d65af0a (patch)
tree71eb23e0a021c08c4a2c0d23063bf8ec2ac70651
parent6ae005b11e2041beacf4fd3c3d690313863b7bf6 (diff)
downloadpaludis-9607f69eecb2149dfc4258af920c5f326d65af0a.tar.gz
paludis-9607f69eecb2149dfc4258af920c5f326d65af0a.tar.xz
Convert to fancy new visitors
-rw-r--r--paludis/repositories/repository/repository_repository.cc54
1 files changed, 10 insertions, 44 deletions
diff --git a/paludis/repositories/repository/repository_repository.cc b/paludis/repositories/repository/repository_repository.cc
index 99f73dd..299888e 100644
--- a/paludis/repositories/repository/repository_repository.cc
+++ b/paludis/repositories/repository/repository_repository.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2010, 2011 Ciaran McCreesh
+ * Copyright (c) 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
@@ -193,52 +193,18 @@ RepositoryRepository::package_ids(const QualifiedPackageName & p, const Reposito
return _imp->store->package_ids(p);
}
-namespace
-{
- struct SupportsActionQuery
- {
- bool visit(const SupportsActionTest<InstallAction> &) const
- {
- return false;
- }
-
- 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
RepositoryRepository::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 false; },
+ [&] (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