aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2013-05-24 00:21:38 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2013-05-24 00:21:38 +0100
commit6ae005b11e2041beacf4fd3c3d690313863b7bf6 (patch)
tree07af435adbf048c6d448ac193425750f8ad1a9ee
parent8c1d1b87bec1c2b81ec8da4318c96bc4181ab4f9 (diff)
downloadpaludis-6ae005b11e2041beacf4fd3c3d690313863b7bf6.tar.gz
paludis-6ae005b11e2041beacf4fd3c3d690313863b7bf6.tar.xz
Convert to fancy new visitors
-rw-r--r--paludis/repositories/gemcutter/gemcutter_repository.cc54
1 files changed, 10 insertions, 44 deletions
diff --git a/paludis/repositories/gemcutter/gemcutter_repository.cc b/paludis/repositories/gemcutter/gemcutter_repository.cc
index 4bdad24..6540fdb 100644
--- a/paludis/repositories/gemcutter/gemcutter_repository.cc
+++ b/paludis/repositories/gemcutter/gemcutter_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
@@ -182,52 +182,18 @@ GemcutterRepository::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 true;
- }
-
- 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
GemcutterRepository::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 true; },
+ [&] (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