diff options
author | 2011-01-08 09:41:19 +0000 | |
---|---|---|
committer | 2011-01-08 09:41:19 +0000 | |
commit | 592c4ad75c7bcbad15fa9afab9a4175822bcfe57 (patch) | |
tree | e3c0a49ffe1cb1365539e6cd6f7fdea2eeea20bf | |
parent | f8d478e0e274ea05882d0b3de1dbe4dcdbce0d64 (diff) | |
download | paludis-592c4ad75c7bcbad15fa9afab9a4175822bcfe57.tar.gz paludis-592c4ad75c7bcbad15fa9afab9a4175822bcfe57.tar.xz |
Use return_literal_function
-rw-r--r-- | paludis/legacy/uninstall_list_TEST.cc | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/paludis/legacy/uninstall_list_TEST.cc b/paludis/legacy/uninstall_list_TEST.cc index 04481d891..67bd1b3b1 100644 --- a/paludis/legacy/uninstall_list_TEST.cc +++ b/paludis/legacy/uninstall_list_TEST.cc @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh + * Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011 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 @@ -24,6 +24,7 @@ #include <paludis/environments/test/test_environment.hh> #include <paludis/util/options.hh> #include <paludis/util/make_named_values.hh> +#include <paludis/util/return_literal_function.hh> #include <paludis/package_database.hh> #include <paludis/user_dep_spec.hh> #include <paludis/repository_factory.hh> @@ -46,18 +47,6 @@ namespace paludis s << *e.package_id(); return s; } - - template <typename T_> - T_ make_k_result(T_ t) - { - return t; - } - - template <typename T_> - std::function<T_ ()> make_k(T_ t) - { - return std::bind(&make_k_result<T_>, t); - } } #ifdef ENABLE_VIRTUALS_REPOSITORY @@ -391,7 +380,7 @@ namespace test_cases { std::shared_ptr<SetSpecTree> world(std::make_shared<SetSpecTree>(std::make_shared<AllDepSpec>())); world->top()->append(std::make_shared<PackageDepSpec>(parse_user_package_dep_spec("foo/moo", &env, { }))); - env.add_set(SetName("world"), SetName("world"), make_k<std::shared_ptr<const SetSpecTree> >(world), false); + env.add_set(SetName("world"), SetName("world"), return_literal_function(world), false); } void populate_targets() @@ -431,7 +420,7 @@ namespace test_cases std::shared_ptr<SetSpecTree> world(std::make_shared<SetSpecTree>(std::make_shared<AllDepSpec>())); world->top()->append(std::make_shared<PackageDepSpec>(parse_user_package_dep_spec("foo/moo", &env, { }))); world->top()->append(std::make_shared<PackageDepSpec>(parse_user_package_dep_spec("foo/bar", &env, { }))); - env.add_set(SetName("world"), SetName("world"), make_k(world), false); + env.add_set(SetName("world"), SetName("world"), return_literal_function(world), false); } void populate_targets() @@ -473,7 +462,7 @@ namespace test_cases world->top()->append(std::make_shared<PackageDepSpec>(parse_user_package_dep_spec("cat/needs-b", &env, { }))); world->top()->append(std::make_shared<PackageDepSpec>(parse_user_package_dep_spec("cat/needs-c", &env, { }))); world->top()->append(std::make_shared<PackageDepSpec>(parse_user_package_dep_spec("cat/needs-d", &env, { }))); - env.add_set(SetName("world"), SetName("world"), make_k(world), false); + env.add_set(SetName("world"), SetName("world"), return_literal_function(world), false); } void populate_targets() |