aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-07-22 12:52:10 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-07-22 18:55:26 +0100
commitf7be9952e67a5cdad6f3531a22654db198e7d106 (patch)
tree54c8fae2eaaf89851c038d28ed6deb9096c87b4d
parent84f32a46c9bd03039af31be9626206ce891fa841 (diff)
downloadpaludis-f7be9952e67a5cdad6f3531a22654db198e7d106.tar.gz
paludis-f7be9952e67a5cdad6f3531a22654db198e7d106.tar.xz
Use std::make_shared<>
-rw-r--r--configure.ac16
-rw-r--r--doc/api/cplusplus/examples/example_action.cc2
-rw-r--r--paludis/buffer_output_manager.cc3
-rw-r--r--paludis/choice.cc1
-rw-r--r--paludis/comma_separated_dep_parser.cc3
-rw-r--r--paludis/common_sets.cc16
-rw-r--r--paludis/contents.cc4
-rw-r--r--paludis/create_output_manager_info.cc20
-rw-r--r--paludis/dep_list.cc16
-rw-r--r--paludis/dep_list_TEST.cc18
-rw-r--r--paludis/dep_spec.cc1
-rw-r--r--paludis/dep_spec_TEST.cc1
-rw-r--r--paludis/dep_spec_flattener.cc1
-rw-r--r--paludis/distribution.cc5
-rw-r--r--paludis/elike_annotations.cc4
-rw-r--r--paludis/elike_conditional_dep_spec.cc9
-rw-r--r--paludis/elike_package_dep_spec.cc9
-rw-r--r--paludis/elike_use_requirement.cc3
-rw-r--r--paludis/environment_implementation.cc12
-rw-r--r--paludis/environments/no_config/no_config_environment.cc9
-rw-r--r--paludis/environments/no_config/no_config_environment_TEST.cc3
-rw-r--r--paludis/environments/no_config/registration.cc3
-rw-r--r--paludis/environments/paludis/extra_distribution_data.cc5
-rw-r--r--paludis/environments/paludis/keywords_conf.cc6
-rw-r--r--paludis/environments/paludis/licenses_conf.cc6
-rw-r--r--paludis/environments/paludis/output_conf.cc7
-rw-r--r--paludis/environments/paludis/package_mask_conf.cc6
-rw-r--r--paludis/environments/paludis/paludis_config.cc9
-rw-r--r--paludis/environments/paludis/paludis_environment.cc10
-rw-r--r--paludis/environments/paludis/world.cc2
-rw-r--r--paludis/environments/portage/portage_environment.cc9
-rw-r--r--paludis/environments/test/test_environment.cc7
-rw-r--r--paludis/file_output_manager.cc9
-rw-r--r--paludis/filter.cc19
-rw-r--r--paludis/format_messages_output_manager.cc5
-rw-r--r--paludis/forward_at_finish_output_manager.cc5
-rw-r--r--paludis/fuzzy_finder.cc3
-rw-r--r--paludis/generator.cc29
-rw-r--r--paludis/hooker.cc7
-rw-r--r--paludis/install_task.cc47
-rw-r--r--paludis/ipc_output_manager.cc1
-rw-r--r--paludis/merger_TEST.cc5
-rw-r--r--paludis/ndbam.cc33
-rw-r--r--paludis/ndbam_unmerger.cc1
-rw-r--r--paludis/paludislike_options_conf.cc2
-rw-r--r--paludis/python_hooks.cc3
-rw-r--r--paludis/query_visitor.cc7
-rw-r--r--paludis/range_rewriter.cc4
-rw-r--r--paludis/range_rewriter_TEST.cc12
-rw-r--r--paludis/repositories/accounts/accounts_dep_key.cc8
-rw-r--r--paludis/repositories/accounts/accounts_id.cc8
-rw-r--r--paludis/repositories/accounts/accounts_repository.cc14
-rw-r--r--paludis/repositories/accounts/accounts_repository_store.cc23
-rw-r--r--paludis/repositories/accounts/installed_accounts_id.cc4
-rw-r--r--paludis/repositories/cran/cran_dep_parser.cc3
-rw-r--r--paludis/repositories/cran/cran_installed_repository.cc4
-rw-r--r--paludis/repositories/cran/cran_package_id.cc30
-rw-r--r--paludis/repositories/cran/cran_repository.cc6
-rw-r--r--paludis/repositories/cran/keys.cc3
-rw-r--r--paludis/repositories/cran/package_dep_spec.cc2
-rw-r--r--paludis/repositories/e/dep_parser.cc55
-rw-r--r--paludis/repositories/e/depend_rdepend_TEST.cc5
-rw-r--r--paludis/repositories/e/dependencies_rewriter.cc7
-rw-r--r--paludis/repositories/e/e_choices_key.cc1
-rw-r--r--paludis/repositories/e/e_installed_repository.cc15
-rw-r--r--paludis/repositories/e/e_installed_repository_id.cc34
-rw-r--r--paludis/repositories/e/e_key.cc13
-rw-r--r--paludis/repositories/e/e_repository.cc34
-rw-r--r--paludis/repositories/e/e_repository_TEST.cc7
-rw-r--r--paludis/repositories/e/e_repository_TEST_0.cc5
-rw-r--r--paludis/repositories/e/e_repository_TEST_1.cc5
-rw-r--r--paludis/repositories/e/e_repository_TEST_2.cc5
-rw-r--r--paludis/repositories/e/e_repository_TEST_3.cc5
-rw-r--r--paludis/repositories/e/e_repository_TEST_4.cc5
-rw-r--r--paludis/repositories/e/e_repository_TEST_dependencies_rewriter.cc3
-rw-r--r--paludis/repositories/e/e_repository_TEST_ever.cc5
-rw-r--r--paludis/repositories/e/e_repository_TEST_exheres_0.cc5
-rw-r--r--paludis/repositories/e/e_repository_TEST_exlibs.cc5
-rw-r--r--paludis/repositories/e/e_repository_TEST_pbin.cc7
-rw-r--r--paludis/repositories/e/e_repository_TEST_phases.cc5
-rw-r--r--paludis/repositories/e/e_repository_TEST_replacing.cc3
-rw-r--r--paludis/repositories/e/e_repository_TEST_symlink_rewriting.cc5
-rw-r--r--paludis/repositories/e/e_repository_sets.cc4
-rw-r--r--paludis/repositories/e/eapi.cc53
-rw-r--r--paludis/repositories/e/eapi_phase.cc5
-rw-r--r--paludis/repositories/e/ebuild_id.cc114
-rw-r--r--paludis/repositories/e/exheres_layout.cc6
-rw-r--r--paludis/repositories/e/exheres_profile.cc8
-rw-r--r--paludis/repositories/e/exndbam_id.cc5
-rw-r--r--paludis/repositories/e/exndbam_repository.cc6
-rw-r--r--paludis/repositories/e/exndbam_repository_TEST.cc3
-rw-r--r--paludis/repositories/e/extra_distribution_data.cc5
-rw-r--r--paludis/repositories/e/fetch_visitor.cc3
-rw-r--r--paludis/repositories/e/fetch_visitor_TEST.cc5
-rw-r--r--paludis/repositories/e/fix_locked_dependencies.cc7
-rw-r--r--paludis/repositories/e/metadata_xml.cc1
-rw-r--r--paludis/repositories/e/myoptions_requirements_verifier.cc4
-rw-r--r--paludis/repositories/e/pretend_fetch_visitor.cc3
-rw-r--r--paludis/repositories/e/traditional_layout.cc6
-rw-r--r--paludis/repositories/e/traditional_profile.cc7
-rw-r--r--paludis/repositories/e/vdb_id.cc7
-rw-r--r--paludis/repositories/e/vdb_merger_TEST.cc5
-rw-r--r--paludis/repositories/e/vdb_repository.cc16
-rw-r--r--paludis/repositories/e/vdb_repository_TEST.cc9
-rw-r--r--paludis/repositories/e/vdb_unmerger_TEST.cc3
-rw-r--r--paludis/repositories/e/xml_things.cc7
-rw-r--r--paludis/repositories/fake/dep_parser.cc27
-rw-r--r--paludis/repositories/fake/fake_installed_repository.cc8
-rw-r--r--paludis/repositories/fake/fake_package_id.cc29
-rw-r--r--paludis/repositories/fake/fake_repository.cc2
-rw-r--r--paludis/repositories/fake/fake_repository_base.cc1
-rw-r--r--paludis/repositories/fake/registration.cc3
-rw-r--r--paludis/repositories/gems/extra_distribution_data.cc5
-rw-r--r--paludis/repositories/gems/gem_specification.cc5
-rw-r--r--paludis/repositories/gems/gem_specifications.cc3
-rw-r--r--paludis/repositories/gems/gems_repository.cc20
-rw-r--r--paludis/repositories/gems/gems_repository_TEST.cc5
-rw-r--r--paludis/repositories/gems/installed_gems_repository.cc24
-rw-r--r--paludis/repositories/gems/registration.cc3
-rw-r--r--paludis/repositories/gems/yaml.cc3
-rw-r--r--paludis/repositories/repository/repository_id.cc4
-rw-r--r--paludis/repositories/repository/repository_repository.cc5
-rw-r--r--paludis/repositories/repository/repository_repository_store.cc11
-rw-r--r--paludis/repositories/unavailable/unavailable_package_id.cc4
-rw-r--r--paludis/repositories/unavailable/unavailable_repository.cc5
-rw-r--r--paludis/repositories/unavailable/unavailable_repository_dependencies_key.cc3
-rw-r--r--paludis/repositories/unavailable/unavailable_repository_id.cc6
-rw-r--r--paludis/repositories/unavailable/unavailable_repository_store.cc20
-rw-r--r--paludis/repositories/unpackaged/installed_id.cc16
-rw-r--r--paludis/repositories/unpackaged/installed_repository.cc10
-rw-r--r--paludis/repositories/unpackaged/installed_repository_TEST.cc9
-rw-r--r--paludis/repositories/unpackaged/unpackaged_id.cc12
-rw-r--r--paludis/repositories/unpackaged/unpackaged_key.cc7
-rw-r--r--paludis/repositories/unpackaged/unpackaged_repository.cc14
-rw-r--r--paludis/repositories/unpackaged/unpackaged_repository_TEST.cc6
-rw-r--r--paludis/repositories/unwritten/unwritten_id.cc4
-rw-r--r--paludis/repositories/unwritten/unwritten_repository.cc5
-rw-r--r--paludis/repositories/unwritten/unwritten_repository_file.cc3
-rw-r--r--paludis/repositories/unwritten/unwritten_repository_store.cc15
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository.cc12
-rw-r--r--paludis/repositories/virtuals/package_id.cc26
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.cc14
-rw-r--r--paludis/repositories/virtuals/virtuals_repository_TEST.cc29
-rw-r--r--paludis/repository.cc7
-rw-r--r--paludis/resolver/constraint.cc4
-rw-r--r--paludis/resolver/decider.cc62
-rw-r--r--paludis/resolver/decision.cc13
-rw-r--r--paludis/resolver/destination.cc5
-rw-r--r--paludis/resolver/job.cc5
-rw-r--r--paludis/resolver/job_state.cc16
-rw-r--r--paludis/resolver/nag.cc5
-rw-r--r--paludis/resolver/orderer.cc17
-rw-r--r--paludis/resolver/orderer_notes.cc5
-rw-r--r--paludis/resolver/package_or_block_dep_spec.cc6
-rw-r--r--paludis/resolver/reason.cc28
-rw-r--r--paludis/resolver/required_confirmations.cc8
-rw-r--r--paludis/resolver/resolution.cc5
-rw-r--r--paludis/resolver/resolvent.cc7
-rw-r--r--paludis/resolver/resolver.cc27
-rw-r--r--paludis/resolver/resolver_TEST_any.cc1
-rw-r--r--paludis/resolver/resolver_TEST_blockers.cc1
-rw-r--r--paludis/resolver/resolver_TEST_continue_on_failure.cc1
-rw-r--r--paludis/resolver/resolver_TEST_cycles.cc1
-rw-r--r--paludis/resolver/resolver_TEST_errors.cc1
-rw-r--r--paludis/resolver/resolver_TEST_fetches.cc1
-rw-r--r--paludis/resolver/resolver_TEST_purges.cc1
-rw-r--r--paludis/resolver/resolver_TEST_serialisation.cc3
-rw-r--r--paludis/resolver/resolver_TEST_simple.cc1
-rw-r--r--paludis/resolver/resolver_TEST_suggestions.cc1
-rw-r--r--paludis/resolver/resolver_TEST_uninstalls.cc1
-rw-r--r--paludis/resolver/resolver_TEST_virtuals.cc1
-rw-r--r--paludis/resolver/resolver_test.cc27
-rw-r--r--paludis/resolver/slot_name_or_null.cc3
-rw-r--r--paludis/resolver/spec_rewriter.cc7
-rw-r--r--paludis/selection.cc25
-rw-r--r--paludis/serialise-impl.hh2
-rw-r--r--paludis/set_file.cc8
-rw-r--r--paludis/show_suggest_visitor.cc5
-rw-r--r--paludis/spec_tree.cc11
-rw-r--r--paludis/spec_tree.hh1
-rw-r--r--paludis/standard_output_manager.cc3
-rw-r--r--paludis/stringify_formatter_TEST.cc3
-rw-r--r--paludis/sync_task.cc1
-rw-r--r--paludis/tee_output_manager.cc3
-rw-r--r--paludis/unchoices_key.cc5
-rw-r--r--paludis/uninstall_list.cc5
-rw-r--r--paludis/uninstall_list_TEST.cc20
-rw-r--r--paludis/uninstall_task.cc7
-rw-r--r--paludis/user_dep_spec.cc3
-rw-r--r--paludis/user_dep_spec_TEST.cc1
-rw-r--r--paludis/util/active_object_ptr.hh5
-rw-r--r--paludis/util/active_object_ptr_TEST.cc8
-rw-r--r--paludis/util/deferred_construction_ptr_TEST.cc10
-rw-r--r--paludis/util/elf.cc13
-rw-r--r--paludis/util/elf_dynamic_section.cc19
-rw-r--r--paludis/util/executor.cc5
-rw-r--r--paludis/util/files.m42
-rw-r--r--paludis/util/make_null_shared_ptr.hh (renamed from paludis/util/make_shared_ptr.hh)34
-rw-r--r--paludis/util/make_shared_copy.hh6
-rw-r--r--paludis/util/make_shared_ptr-fwd.hh60
-rw-r--r--paludis/util/singleton_TEST.cc3
-rw-r--r--paludis/util/thread_pool.cc5
-rw-r--r--python/action.cc8
-rw-r--r--python/dep_spec.cc57
-rw-r--r--python/environment.cc6
-rw-r--r--python/mask.cc5
-rw-r--r--python/metadata_key.cc1
-rw-r--r--python/repository.cc4
-rw-r--r--ruby/action.cc22
-rw-r--r--ruby/dep_label.cc3
-rw-r--r--ruby/dep_spec.cc18
-rw-r--r--src/clients/accerso/accerso.cc3
-rw-r--r--src/clients/adjutrix/downgrade_check.cc5
-rw-r--r--src/clients/appareo/appareo.cc3
-rw-r--r--src/clients/cave/cmd_config.cc3
-rw-r--r--src/clients/cave/cmd_contents.cc3
-rw-r--r--src/clients/cave/cmd_display_resolution.cc7
-rw-r--r--src/clients/cave/cmd_executables.cc3
-rw-r--r--src/clients/cave/cmd_execute_resolution.cc12
-rw-r--r--src/clients/cave/cmd_find_candidates.cc5
-rw-r--r--src/clients/cave/cmd_fix_cache.cc3
-rw-r--r--src/clients/cave/cmd_fix_linkage.cc6
-rw-r--r--src/clients/cave/cmd_help.cc5
-rw-r--r--src/clients/cave/cmd_import.cc3
-rw-r--r--src/clients/cave/cmd_info.cc3
-rw-r--r--src/clients/cave/cmd_match.cc3
-rw-r--r--src/clients/cave/cmd_owner.cc3
-rw-r--r--src/clients/cave/cmd_perform.cc7
-rw-r--r--src/clients/cave/cmd_print_categories.cc3
-rw-r--r--src/clients/cave/cmd_print_commands.cc5
-rw-r--r--src/clients/cave/cmd_print_environment_metadata.cc5
-rw-r--r--src/clients/cave/cmd_print_id_actions.cc3
-rw-r--r--src/clients/cave/cmd_print_id_contents.cc5
-rw-r--r--src/clients/cave/cmd_print_id_executables.cc3
-rw-r--r--src/clients/cave/cmd_print_id_masks.cc4
-rw-r--r--src/clients/cave/cmd_print_id_metadata.cc5
-rw-r--r--src/clients/cave/cmd_print_ids.cc5
-rw-r--r--src/clients/cave/cmd_print_owners.cc3
-rw-r--r--src/clients/cave/cmd_print_packages.cc3
-rw-r--r--src/clients/cave/cmd_print_repositories.cc3
-rw-r--r--src/clients/cave/cmd_print_repository_formats.cc3
-rw-r--r--src/clients/cave/cmd_print_repository_metadata.cc3
-rw-r--r--src/clients/cave/cmd_print_set.cc3
-rw-r--r--src/clients/cave/cmd_print_sets.cc3
-rw-r--r--src/clients/cave/cmd_print_sync_protocols.cc4
-rw-r--r--src/clients/cave/cmd_purge.cc12
-rw-r--r--src/clients/cave/cmd_resolve.cc5
-rw-r--r--src/clients/cave/cmd_resume.cc11
-rw-r--r--src/clients/cave/cmd_search.cc3
-rw-r--r--src/clients/cave/cmd_show.cc4
-rw-r--r--src/clients/cave/cmd_sync.cc3
-rw-r--r--src/clients/cave/cmd_uninstall.cc12
-rw-r--r--src/clients/cave/cmd_update_world.cc3
-rw-r--r--src/clients/cave/cmd_verify.cc3
-rw-r--r--src/clients/cave/command_factory.cc5
-rw-r--r--src/clients/cave/executables_common.cc1
-rw-r--r--src/clients/cave/owner_common.cc1
-rw-r--r--src/clients/cave/resolve_common.cc36
-rw-r--r--src/clients/inquisitio/do_search.cc7
-rw-r--r--src/clients/paludis/query.cc6
-rw-r--r--src/clients/reconcilio/fix_linkage.cc3
-rw-r--r--src/output/console_install_task.cc1
262 files changed, 1083 insertions, 1268 deletions
diff --git a/configure.ac b/configure.ac
index cbade11..0bf41ee 100644
--- a/configure.ac
+++ b/configure.ac
@@ -767,6 +767,22 @@ void f(const T_ & ... a)
])
dnl }}}
+dnl {{{ c++0x auto
+AC_MSG_CHECKING([for c++0x auto])
+AC_COMPILE_IFELSE([
+#include <string>
+std::string f(int);
+int main(int, char **)
+{
+ auto x = f(1);
+}
+],
+ [AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])
+ AC_MSG_ERROR([your compiler does not support c++0x auto])
+ ])
+dnl }}}
+
dnl {{{ c++0x rvalue references
AC_MSG_CHECKING([for c++0x rvalue references])
AC_COMPILE_IFELSE([
diff --git a/doc/api/cplusplus/examples/example_action.cc b/doc/api/cplusplus/examples/example_action.cc
index b6a4b3a..9af459c 100644
--- a/doc/api/cplusplus/examples/example_action.cc
+++ b/doc/api/cplusplus/examples/example_action.cc
@@ -32,7 +32,7 @@ namespace
* to use the user's preferences for logging etc. */
std::shared_ptr<OutputManager> make_standard_output_manager(const Action &)
{
- return make_shared_ptr(new StandardOutputManager);
+ return std::make_shared<StandardOutputManager>();
}
}
diff --git a/paludis/buffer_output_manager.cc b/paludis/buffer_output_manager.cc
index e33464b..6fb6fbd 100644
--- a/paludis/buffer_output_manager.cc
+++ b/paludis/buffer_output_manager.cc
@@ -21,7 +21,6 @@
#include <paludis/util/buffer_output_stream.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/set.hh>
#include <paludis/util/exception.hh>
@@ -117,7 +116,7 @@ BufferOutputManager::factory_create(
throw ConfigurationError("No child specified for BufferOutputManager");
const std::shared_ptr<OutputManager> child(create_child(child_str));
- return make_shared_ptr(new BufferOutputManager(child));
+ return std::make_shared<BufferOutputManager>(child);
}
template class PrivateImplementationPattern<BufferOutputManager>;
diff --git a/paludis/choice.cc b/paludis/choice.cc
index 6e1253c..fda1160 100644
--- a/paludis/choice.cc
+++ b/paludis/choice.cc
@@ -21,7 +21,6 @@
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/wrapped_output_iterator-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/exception.hh>
#include <paludis/util/set-impl.hh>
diff --git a/paludis/comma_separated_dep_parser.cc b/paludis/comma_separated_dep_parser.cc
index 1348631..ce0d3e6 100644
--- a/paludis/comma_separated_dep_parser.cc
+++ b/paludis/comma_separated_dep_parser.cc
@@ -22,7 +22,6 @@
#include <paludis/util/strip.hh>
#include <paludis/util/exception.hh>
#include <paludis/util/options.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/dep_spec.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/spec_tree.hh>
@@ -35,7 +34,7 @@ CommaSeparatedDepParser::parse(const Environment * const env, const std::string
{
Context context("When parsing '" + s + "':");
- std::shared_ptr<DependencySpecTree> result(new DependencySpecTree(make_shared_ptr(new AllDepSpec)));
+ std::shared_ptr<DependencySpecTree> result(new DependencySpecTree(std::make_shared<AllDepSpec>()));
std::list<std::string> tokens;
tokenise<delim_kind::AnyOfTag, delim_mode::DelimiterTag>(s, ",", "", std::back_inserter(tokens));
diff --git a/paludis/common_sets.cc b/paludis/common_sets.cc
index 707ae9c..518f58a 100644
--- a/paludis/common_sets.cc
+++ b/paludis/common_sets.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009 Ciaran McCreesh
+ * Copyright (c) 2009, 2010 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
@@ -44,7 +44,7 @@ namespace
Context context("When making " + std::string(slots ? "installed-slots" : "installed-packages") +
" set from '" + stringify(repo->name()) + "':");
- std::shared_ptr<SetSpecTree> result(new SetSpecTree(make_shared_ptr(new AllDepSpec)));
+ std::shared_ptr<SetSpecTree> result(new SetSpecTree(std::make_shared<AllDepSpec>()));
std::shared_ptr<const PackageIDSequence> ids;
if (slots)
@@ -55,17 +55,17 @@ namespace
for (PackageIDSequence::ConstIterator i(ids->begin()), i_end(ids->end()) ;
i != i_end ; ++i)
if (slots && (*i)->slot_key())
- result->root()->append(make_shared_ptr(new PackageDepSpec(
+ result->root()->append(std::make_shared<PackageDepSpec>(
make_package_dep_spec(PartiallyMadePackageDepSpecOptions())
.package((*i)->name())
- .slot_requirement(make_shared_ptr(new ELikeSlotExactRequirement(
- (*i)->slot_key()->value(), false)))
- )));
+ .slot_requirement(std::make_shared<ELikeSlotExactRequirement>(
+ (*i)->slot_key()->value(), false))
+ ));
else
- result->root()->append(make_shared_ptr(new PackageDepSpec(
+ result->root()->append(std::make_shared<PackageDepSpec>(
make_package_dep_spec(PartiallyMadePackageDepSpecOptions())
.package((*i)->name())
- )));
+ ));
return result;
}
diff --git a/paludis/contents.cc b/paludis/contents.cc
index 67a963c..24b3b65 100644
--- a/paludis/contents.cc
+++ b/paludis/contents.cc
@@ -35,7 +35,7 @@ namespace paludis
const std::shared_ptr<const MetadataValueKey<FSEntry> > location_key;
Implementation(const FSEntry & n) :
- location_key(make_shared_ptr(new LiteralMetadataValueKey<FSEntry>("location", "location", mkt_significant, n)))
+ location_key(std::make_shared<LiteralMetadataValueKey<FSEntry>>("location", "location", mkt_significant, n))
{
}
};
@@ -86,7 +86,7 @@ namespace paludis
const std::shared_ptr<const MetadataValueKey<std::string> > target_key;
Implementation(const std::string & t) :
- target_key(make_shared_ptr(new LiteralMetadataValueKey<std::string>("target", "target", mkt_normal, t)))
+ target_key(std::make_shared<LiteralMetadataValueKey<std::string>>("target", "target", mkt_normal, t))
{
}
};
diff --git a/paludis/create_output_manager_info.cc b/paludis/create_output_manager_info.cc
index 0932317..b392a85 100644
--- a/paludis/create_output_manager_info.cc
+++ b/paludis/create_output_manager_info.cc
@@ -38,17 +38,17 @@ namespace
{
std::shared_ptr<Set<std::string> > visit(const InstallAction &) const
{
- return make_shared_ptr(new Set<std::string>);
+ return std::make_shared<Set<std::string>>();
}
std::shared_ptr<Set<std::string> > visit(const UninstallAction &) const
{
- return make_shared_ptr(new Set<std::string>);
+ return std::make_shared<Set<std::string>>();
}
std::shared_ptr<Set<std::string> > visit(const PretendAction &) const
{
- return make_shared_ptr(new Set<std::string>);
+ return std::make_shared<Set<std::string>>();
}
std::shared_ptr<Set<std::string> > visit(const FetchAction & a) const
@@ -61,17 +61,17 @@ namespace
std::shared_ptr<Set<std::string> > visit(const PretendFetchAction &) const
{
- return make_shared_ptr(new Set<std::string>);
+ return std::make_shared<Set<std::string>>();
}
std::shared_ptr<Set<std::string> > visit(const ConfigAction &) const
{
- return make_shared_ptr(new Set<std::string>);
+ return std::make_shared<Set<std::string>>();
}
std::shared_ptr<Set<std::string> > visit(const InfoAction &) const
{
- return make_shared_ptr(new Set<std::string>);
+ return std::make_shared<Set<std::string>>();
}
};
@@ -211,13 +211,13 @@ CreateOutputManagerForPackageIDActionInfo::deserialise(Deserialisation & d)
for (int n(1), n_end(vv.member<int>("count") + 1) ; n != n_end ; ++n)
action_flags->insert(vv.member<std::string>(stringify(n)));
- return make_shared_ptr(new CreateOutputManagerForPackageIDActionInfo(
+ return std::make_shared<CreateOutputManagerForPackageIDActionInfo>(
v.member<std::shared_ptr<const PackageID> >("package_id"),
v.member<std::string>("action_name"),
action_flags,
destringify<OutputExclusivity>(v.member<std::string>("output_exclusivity")),
v.member<ClientOutputFeatures>("client_output_features")
- ));
+ );
}
CreateOutputManagerForRepositorySyncInfo::CreateOutputManagerForRepositorySyncInfo(
@@ -263,11 +263,11 @@ const std::shared_ptr<CreateOutputManagerForRepositorySyncInfo>
CreateOutputManagerForRepositorySyncInfo::deserialise(Deserialisation & d)
{
Deserialisator v(d, "CreateOutputManagerForRepositorySyncInfo");
- return make_shared_ptr(new CreateOutputManagerForRepositorySyncInfo(
+ return std::make_shared<CreateOutputManagerForRepositorySyncInfo>(
RepositoryName(v.member<std::string>("repo_name")),
destringify<OutputExclusivity>(v.member<std::string>("output_exclusivity")),
v.member<ClientOutputFeatures>("client_output_features")
- ));
+ );
}
template class PrivateImplementationPattern<CreateOutputManagerForRepositorySyncInfo>;
diff --git a/paludis/dep_list.cc b/paludis/dep_list.cc
index fce847b..aaf7911 100644
--- a/paludis/dep_list.cc
+++ b/paludis/dep_list.cc
@@ -44,7 +44,6 @@
#include <paludis/util/join.hh>
#include <paludis/util/log.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/iterator_funcs.hh>
#include <paludis/util/save.hh>
#include <paludis/util/member_iterator.hh>
@@ -56,6 +55,7 @@
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/accept_visitor.hh>
#include <paludis/util/timestamp.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/util/sequence-impl.hh>
#include <paludis/util/set-impl.hh>
@@ -139,7 +139,7 @@ namespace paludis
current_top_level_target(0),
throw_on_blocker(o.blocks() == dl_blocks_error)
{
- labels.push_front(make_shared_ptr(new DependenciesLabelSequence));
+ labels.push_front(std::make_shared<DependenciesLabelSequence>());
}
};
@@ -1114,8 +1114,8 @@ DepList::add(const SetSpecTree & spec, const std::shared_ptr<const DestinationsS
void
DepList::add(const PackageDepSpec & spec, const std::shared_ptr<const DestinationsSet> & destinations)
{
- SetSpecTree tree(make_shared_ptr(new AllDepSpec));
- tree.root()->append(make_shared_ptr(new PackageDepSpec(spec)));
+ SetSpecTree tree(std::make_shared<AllDepSpec>());
+ tree.root()->append(std::make_shared<PackageDepSpec>(spec));
add(tree, destinations);
}
@@ -1203,7 +1203,7 @@ DepList::add_package(const std::shared_ptr<const PackageID> & p, const std::shar
n::associated_entry() = &*_imp->current_merge_list_entry,
n::destination() = std::shared_ptr<Repository>(),
n::generation() = _imp->merge_list_generation,
- n::handled() = make_shared_ptr(new DepListEntryNoHandlingRequired),
+ n::handled() = std::make_shared<DepListEntryNoHandlingRequired>(),
n::kind() = dlk_provided,
n::package_id() = (*_imp->env->package_database()->fetch_repository(
RepositoryName("virtuals"))).make_virtuals_interface()->make_virtual_package_id(
@@ -1290,7 +1290,7 @@ DepList::add_error_package(const std::shared_ptr<const PackageID> & p, const Dep
n::associated_entry() = &*_imp->current_merge_list_entry,
n::destination() = std::shared_ptr<Repository>(),
n::generation() = _imp->merge_list_generation,
- n::handled() = make_shared_ptr(new DepListEntryNoHandlingRequired),
+ n::handled() = std::make_shared<DepListEntryNoHandlingRequired>(),
n::kind() = kind,
n::package_id() = p,
n::state() = dle_has_all_deps,
@@ -1327,7 +1327,7 @@ DepList::add_suggested_package(const std::shared_ptr<const PackageID> & p,
n::associated_entry() = &*_imp->current_merge_list_entry,
n::destination() = find_destination(*p, destinations),
n::generation() = _imp->merge_list_generation,
- n::handled() = make_shared_ptr(new DepListEntryNoHandlingRequired),
+ n::handled() = std::make_shared<DepListEntryNoHandlingRequired>(),
n::kind() = dlk_suggested,
n::package_id() = p,
n::state() = dle_has_all_deps,
@@ -1412,7 +1412,7 @@ DepList::add_already_installed_package(const std::shared_ptr<const PackageID> &
n::associated_entry() = static_cast<DepListEntry *>(0),
n::destination() = std::shared_ptr<Repository>(),
n::generation() = _imp->merge_list_generation,
- n::handled() = make_shared_ptr(new DepListEntryNoHandlingRequired),
+ n::handled() = std::make_shared<DepListEntryNoHandlingRequired>(),
n::kind() = dlk_already_installed,
n::package_id() = p,
n::state() = dle_has_pre_deps,
diff --git a/paludis/dep_list_TEST.cc b/paludis/dep_list_TEST.cc
index e69da19..b18e8a8 100644
--- a/paludis/dep_list_TEST.cc
+++ b/paludis/dep_list_TEST.cc
@@ -2164,15 +2164,15 @@ namespace test_cases
DepList d3(&env, DepListOptions());
d3.options()->fall_back() = dl_fall_back_as_needed_except_targets;
- std::shared_ptr<SetSpecTree> t3(new SetSpecTree(make_shared_ptr(new AllDepSpec)));
- t3->root()->append(make_shared_ptr(new PackageDepSpec(parse_user_package_dep_spec("cat/one", &env, UserPackageDepSpecOptions()))));
- t3->root()->append(make_shared_ptr(new PackageDepSpec(parse_user_package_dep_spec("cat/two", &env, UserPackageDepSpecOptions()))));
+ std::shared_ptr<SetSpecTree> t3(new SetSpecTree(std::make_shared<AllDepSpec>()));
+ t3->root()->append(std::make_shared<PackageDepSpec>(parse_user_package_dep_spec("cat/one", &env, UserPackageDepSpecOptions())));
+ t3->root()->append(std::make_shared<PackageDepSpec>(parse_user_package_dep_spec("cat/two", &env, UserPackageDepSpecOptions())));
TEST_CHECK_THROWS(d3.add(*t3, env.default_destinations()), DepListError);
DepList d4(&env, DepListOptions());
- std::shared_ptr<SetSpecTree> t4(new SetSpecTree(make_shared_ptr(new AllDepSpec)));
- t4->root()->append(make_shared_ptr(new PackageDepSpec(parse_user_package_dep_spec("cat/one", &env, UserPackageDepSpecOptions()))));
- t4->root()->append(make_shared_ptr(new PackageDepSpec(parse_user_package_dep_spec("cat/three", &env, UserPackageDepSpecOptions()))));
+ std::shared_ptr<SetSpecTree> t4(new SetSpecTree(std::make_shared<AllDepSpec>()));
+ t4->root()->append(std::make_shared<PackageDepSpec>(parse_user_package_dep_spec("cat/one", &env, UserPackageDepSpecOptions())));
+ t4->root()->append(std::make_shared<PackageDepSpec>(parse_user_package_dep_spec("cat/three", &env, UserPackageDepSpecOptions())));
TEST_CHECK_THROWS(d4.add(*t4, env.default_destinations()), DepListError);
}
} test_dep_list_fall_back_as_needed_not_targets;
@@ -2214,9 +2214,9 @@ namespace test_cases
DepList d2(&env, DepListOptions());
d2.options()->upgrade() = dl_upgrade_as_needed;
- std::shared_ptr<SetSpecTree> t2(new SetSpecTree(make_shared_ptr(new AllDepSpec)));
- t2->root()->append(make_shared_ptr(new PackageDepSpec(parse_user_package_dep_spec("cat/one", &env, UserPackageDepSpecOptions()))));
- t2->root()->append(make_shared_ptr(new PackageDepSpec(parse_user_package_dep_spec("cat/two", &env, UserPackageDepSpecOptions()))));
+ std::shared_ptr<SetSpecTree> t2(new SetSpecTree(std::make_shared<AllDepSpec>()));
+ t2->root()->append(std::make_shared<PackageDepSpec>(parse_user_package_dep_spec("cat/one", &env, UserPackageDepSpecOptions())));
+ t2->root()->append(std::make_shared<PackageDepSpec>(parse_user_package_dep_spec("cat/two", &env, UserPackageDepSpecOptions())));
d2.add(*t2, env.default_destinations());
TEST_CHECK_EQUAL(join(d2.begin(), d2.end(), " "), "cat/two-2:0::repo cat/one-1:0::repo");
}
diff --git a/paludis/dep_spec.cc b/paludis/dep_spec.cc
index 1fe30f7..6929d83 100644
--- a/paludis/dep_spec.cc
+++ b/paludis/dep_spec.cc
@@ -34,7 +34,6 @@
#include <paludis/util/iterator_funcs.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/options.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/metadata_key.hh>
#include <functional>
diff --git a/paludis/dep_spec_TEST.cc b/paludis/dep_spec_TEST.cc
index 074da10..050dbda 100644
--- a/paludis/dep_spec_TEST.cc
+++ b/paludis/dep_spec_TEST.cc
@@ -24,7 +24,6 @@
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/iterator_funcs.hh>
#include <paludis/util/options.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/version_requirements.hh>
#include <paludis/environments/test/test_environment.hh>
#include <test/test_framework.hh>
diff --git a/paludis/dep_spec_flattener.cc b/paludis/dep_spec_flattener.cc
index 6dc9211..ab6d08f 100644
--- a/paludis/dep_spec_flattener.cc
+++ b/paludis/dep_spec_flattener.cc
@@ -24,7 +24,6 @@
#include <paludis/util/log.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/repository.hh>
#include <list>
diff --git a/paludis/distribution.cc b/paludis/distribution.cc
index edced97..b86bb38 100644
--- a/paludis/distribution.cc
+++ b/paludis/distribution.cc
@@ -24,7 +24,6 @@
#include <paludis/util/hashes.hh>
#include <paludis/util/is_file_with_extension.hh>
#include <paludis/util/make_named_values.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/singleton-impl.hh>
#include <paludis/util/stringify.hh>
@@ -65,7 +64,7 @@ namespace paludis
KeyValueConfigFile k(*d, KeyValueConfigFileOptions(), &KeyValueConfigFile::no_defaults, &KeyValueConfigFile::no_transformation);
values.insert(std::make_pair(strip_trailing_string(d->basename(), ".conf"),
- make_shared_ptr(new Distribution(make_named_values<Distribution>(
+ std::make_shared<Distribution>(make_named_values<Distribution>(
n::concept_keyword() = k.get("concept_keyword"),
n::concept_license() = k.get("concept_license"),
n::concept_use() = k.get("concept_use"),
@@ -75,7 +74,7 @@ namespace paludis
n::name() = strip_trailing_string(d->basename(), ".conf"),
n::paludis_package() = k.get("paludis_package"),
n::support_old_style_virtuals() = destringify<bool>(k.get("support_old_style_virtuals"))
- )))));
+ ))));
}
}
};
diff --git a/paludis/elike_annotations.cc b/paludis/elike_annotations.cc
index 8e16c82..8934d16 100644
--- a/paludis/elike_annotations.cc
+++ b/paludis/elike_annotations.cc
@@ -38,8 +38,8 @@ ELikeAnnotations::ELikeAnnotations(const std::shared_ptr<const Map<std::string,
{
for (Map<std::string, std::string>::ConstIterator k(m->begin()), k_end(m->end()) ;
k != k_end ; ++k)
- add_metadata_key(make_shared_ptr(new LiteralMetadataValueKey<std::string>(
- k->first, k->first, mkt_normal, k->second)));
+ add_metadata_key(std::make_shared<LiteralMetadataValueKey<std::string>>(
+ k->first, k->first, mkt_normal, k->second));
}
ELikeAnnotations::~ELikeAnnotations()
diff --git a/paludis/elike_conditional_dep_spec.cc b/paludis/elike_conditional_dep_spec.cc
index 6f62c4a..70cac0f 100644
--- a/paludis/elike_conditional_dep_spec.cc
+++ b/paludis/elike_conditional_dep_spec.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008 Ciaran McCreesh
+ * Copyright (c) 2008, 2010 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
@@ -20,7 +20,6 @@
#include <paludis/elike_conditional_dep_spec.hh>
#include <paludis/util/exception.hh>
#include <paludis/util/stringify.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/destringify.hh>
@@ -114,8 +113,8 @@ namespace
flag = ChoiceNameWithPrefix(s.substr(inverse ? 1 : 0, s.length() - (inverse ? 2 : 1)));
- add_metadata_key(make_shared_ptr(new LiteralMetadataValueKey<std::string> ("Flag", "Flag", mkt_normal, stringify(flag))));
- add_metadata_key(make_shared_ptr(new LiteralMetadataValueKey<std::string> ("Inverse", "Inverse", mkt_normal, stringify(inverse))));
+ add_metadata_key(std::make_shared<LiteralMetadataValueKey<std::string> >("Flag", "Flag", mkt_normal, stringify(flag)));
+ add_metadata_key(std::make_shared<LiteralMetadataValueKey<std::string> >("Inverse", "Inverse", mkt_normal, stringify(inverse)));
}
virtual std::string as_string() const
@@ -150,7 +149,7 @@ paludis::parse_elike_conditional_dep_spec(const std::string & s,
const Environment * const env, const std::shared_ptr<const PackageID> & id,
const bool no_warning_for_unlisted)
{
- return ConditionalDepSpec(make_shared_ptr(new EConditionalDepSpecData(s, env, id, no_warning_for_unlisted)));
+ return ConditionalDepSpec(std::make_shared<EConditionalDepSpecData>(s, env, id, no_warning_for_unlisted));
}
ChoiceNameWithPrefix
diff --git a/paludis/elike_package_dep_spec.cc b/paludis/elike_package_dep_spec.cc
index ae2b4ce..cfe1782 100644
--- a/paludis/elike_package_dep_spec.cc
+++ b/paludis/elike_package_dep_spec.cc
@@ -22,7 +22,6 @@
#include <paludis/elike_slot_requirement.hh>
#include <paludis/util/options.hh>
#include <paludis/util/log.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/dep_spec.hh>
#include <paludis/version_operator.hh>
@@ -292,7 +291,7 @@ paludis::elike_remove_trailing_slot_if_exists(std::string & s, PartiallyMadePack
Log::get_instance()->message("e.package_dep_spec.slot_star_not_allowed", ll_warning, lc_context)
<< "Slot '*' dependencies not safe for use here";
}
- result.slot_requirement(make_shared_ptr(new ELikeSlotAnyUnlockedRequirement));
+ result.slot_requirement(std::make_shared<ELikeSlotAnyUnlockedRequirement>());
}
else if ('=' == match.at(0))
{
@@ -306,9 +305,9 @@ paludis::elike_remove_trailing_slot_if_exists(std::string & s, PartiallyMadePack
}
if (1 == match.length())
- result.slot_requirement(make_shared_ptr(new ELikeSlotAnyLockedRequirement));
+ result.slot_requirement(std::make_shared<ELikeSlotAnyLockedRequirement>());
else
- result.slot_requirement(make_shared_ptr(new ELikeSlotExactRequirement(SlotName(s.substr(slot_p + 2)), true)));
+ result.slot_requirement(std::make_shared<ELikeSlotExactRequirement>(SlotName(s.substr(slot_p + 2)), true));
}
else
{
@@ -320,7 +319,7 @@ paludis::elike_remove_trailing_slot_if_exists(std::string & s, PartiallyMadePack
Log::get_instance()->message("e.package_dep_spec.slot_not_allowed", ll_warning, lc_context)
<< "Slot dependencies not safe for use here";
}
- result.slot_requirement(make_shared_ptr(new ELikeSlotExactRequirement(SlotName(s.substr(slot_p + 1)), false)));
+ result.slot_requirement(std::make_shared<ELikeSlotExactRequirement>(SlotName(s.substr(slot_p + 1)), false));
}
s.erase(slot_p);
}
diff --git a/paludis/elike_use_requirement.cc b/paludis/elike_use_requirement.cc
index 2307527..9aecd4c 100644
--- a/paludis/elike_use_requirement.cc
+++ b/paludis/elike_use_requirement.cc
@@ -19,7 +19,6 @@
#include <paludis/elike_use_requirement.hh>
#include <paludis/util/options.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/join.hh>
#include <paludis/util/tokeniser.hh>
@@ -457,7 +456,7 @@ namespace
make_requirement(const std::string & n, const std::shared_ptr<const PackageID > & i,
const ELikeUseRequirementOptions & o, Tribool d, const bool b)
{
- return make_shared_ptr(new T_(n, i, o, d, b));
+ return std::make_shared<T_>(n, i, o, d, b);
}
typedef std::shared_ptr<const UseRequirement> (* Factory)(
diff --git a/paludis/environment_implementation.cc b/paludis/environment_implementation.cc
index 0f6f3d9..d1cbdfe 100644
--- a/paludis/environment_implementation.cc
+++ b/paludis/environment_implementation.cc
@@ -24,7 +24,6 @@
#include <paludis/util/log.hh>
#include <paludis/util/save.hh>
#include <paludis/util/set.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/system.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/mutex.hh>
@@ -32,6 +31,7 @@
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/hook.hh>
#include <paludis/distribution.hh>
#include <paludis/selection.hh>
@@ -54,7 +54,7 @@ namespace
void add(const SetName & s)
{
- tree->root()->append(make_shared_ptr(new NamedSetDepSpec(s)));
+ tree->root()->append(std::make_shared<NamedSetDepSpec>(s));
}
CombineSets() :
@@ -137,7 +137,7 @@ EnvironmentImplementation::~EnvironmentImplementation()
std::shared_ptr<const FSEntrySequence>
EnvironmentImplementation::bashrc_files() const
{
- return make_shared_ptr(new FSEntrySequence);
+ return std::make_shared<FSEntrySequence>();
}
std::shared_ptr<const FSEntrySequence>
@@ -319,8 +319,8 @@ namespace
Log::get_instance()->message("environment_implementation.everything_deprecated", ll_warning, lc_context)
<< "The 'everything' set is deprecated. Use either 'installed-packages' or 'installed-slots' instead";
- std::shared_ptr<SetSpecTree> result(new SetSpecTree(make_shared_ptr(new AllDepSpec)));
- result->root()->append(make_shared_ptr(new NamedSetDepSpec(SetName("installed-packages"))));
+ std::shared_ptr<SetSpecTree> result(new SetSpecTree(std::make_shared<AllDepSpec>()));
+ result->root()->append(std::make_shared<NamedSetDepSpec>(SetName("installed-packages")));
return result;
}
}
@@ -350,7 +350,7 @@ namespace
{
std::shared_ptr<const SetSpecTree> make_empty_set()
{
- return make_shared_ptr(new SetSpecTree(make_shared_ptr(new AllDepSpec)));
+ return std::make_shared<SetSpecTree>(std::make_shared<AllDepSpec>());
}
}
diff --git a/paludis/environments/no_config/no_config_environment.cc b/paludis/environments/no_config/no_config_environment.cc
index 8567382..1b0141b 100644
--- a/paludis/environments/no_config/no_config_environment.cc
+++ b/paludis/environments/no_config/no_config_environment.cc
@@ -26,7 +26,6 @@
#include <paludis/util/set.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/create_iterator-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/config_file.hh>
#include <paludis/util/wrapped_output_iterator-impl.hh>
@@ -529,7 +528,7 @@ NoConfigEnvironment::reduced_gid() const
std::shared_ptr<const MirrorsSequence>
NoConfigEnvironment::mirrors(const std::string &) const
{
- return make_shared_ptr(new MirrorsSequence);
+ return std::make_shared<MirrorsSequence>();
}
bool
@@ -553,7 +552,7 @@ NoConfigEnvironment::perform_hook(const Hook &) const
std::shared_ptr<const FSEntrySequence>
NoConfigEnvironment::hook_dirs() const
{
- return make_shared_ptr(new FSEntrySequence);
+ return std::make_shared<FSEntrySequence>();
}
void
@@ -599,13 +598,13 @@ NoConfigEnvironment::known_choice_value_names(
const std::shared_ptr<const Choice> &
) const
{
- return make_shared_ptr(new Set<UnprefixedChoiceName>);
+ return std::make_shared<Set<UnprefixedChoiceName>>();
}
const std::shared_ptr<OutputManager>
NoConfigEnvironment::create_output_manager(const CreateOutputManagerInfo &) const
{
- return make_shared_ptr(new StandardOutputManager);
+ return std::make_shared<StandardOutputManager>();
}
void
diff --git a/paludis/environments/no_config/no_config_environment_TEST.cc b/paludis/environments/no_config/no_config_environment_TEST.cc
index dd16b47..d3de816 100644
--- a/paludis/environments/no_config/no_config_environment_TEST.cc
+++ b/paludis/environments/no_config/no_config_environment_TEST.cc
@@ -22,7 +22,6 @@
#include <test/test_framework.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/fs_entry.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/make_named_values.hh>
using namespace test;
@@ -41,7 +40,7 @@ namespace test_cases
n::disable_metadata_cache() = false,
n::extra_accept_keywords() = "",
n::extra_params() = std::shared_ptr<Map<std::string, std::string> >(),
- n::extra_repository_dirs() = make_shared_ptr(new FSEntrySequence),
+ n::extra_repository_dirs() = std::make_shared<FSEntrySequence>(),
n::master_repository_name() = "",
n::profiles_if_not_auto() = "",
n::repository_dir() = FSEntry("no_config_environment_TEST_dir/repo"),
diff --git a/paludis/environments/no_config/registration.cc b/paludis/environments/no_config/registration.cc
index 89831ba..45548c8 100644
--- a/paludis/environments/no_config/registration.cc
+++ b/paludis/environments/no_config/registration.cc
@@ -23,7 +23,6 @@
#include <paludis/util/set.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/destringify.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/make_named_values.hh>
#include <list>
@@ -39,7 +38,7 @@ namespace
Context context("When making NoConfigEnvironment using spec '" + s + "':");
std::shared_ptr<Map<std::string, std::string> > extra_params(
- make_shared_ptr(new Map<std::string, std::string>));
+ std::make_shared<Map<std::string, std::string>>());
FSEntry repository_dir(FSEntry::cwd());
std::shared_ptr<FSEntrySequence> extra_repository_dirs(new FSEntrySequence);
FSEntry write_cache("/var/empty");
diff --git a/paludis/environments/paludis/extra_distribution_data.cc b/paludis/environments/paludis/extra_distribution_data.cc
index 7f4591e..4170948 100644
--- a/paludis/environments/paludis/extra_distribution_data.cc
+++ b/paludis/environments/paludis/extra_distribution_data.cc
@@ -20,7 +20,6 @@
#include <paludis/environments/paludis/extra_distribution_data.hh>
#include <paludis/util/destringify.hh>
#include <paludis/util/make_named_values.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/singleton-impl.hh>
#include <paludis/distribution-impl.hh>
@@ -39,7 +38,7 @@ namespace paludis
static std::shared_ptr<PaludisDistribution> make_data(const std::shared_ptr<const KeyValueConfigFile> & k)
{
- return make_shared_ptr(new PaludisDistribution(make_named_values<PaludisDistribution>(
+ return std::make_shared<PaludisDistribution>(make_named_values<PaludisDistribution>(
n::bashrc_filename() = k->get("bashrc_filename"),
n::info_messages_are_spam() = destringify<bool>(k->get("info_messages_are_spam")),
n::keywords_filename_part() = k->get("keywords_filename_part"),
@@ -53,7 +52,7 @@ namespace paludis
n::repositories_directory() = k->get("repositories_directory"),
n::repository_defaults_filename_part() = k->get("repository_defaults_filename_part"),
n::use_filename_part() = k->get("use_filename_part")
- )));
+ ));
}
};
}
diff --git a/paludis/environments/paludis/keywords_conf.cc b/paludis/environments/paludis/keywords_conf.cc
index 4a05027..e67d27e 100644
--- a/paludis/environments/paludis/keywords_conf.cc
+++ b/paludis/environments/paludis/keywords_conf.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010 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
@@ -37,7 +37,7 @@
#include <paludis/util/mutex.hh>
#include <paludis/util/set.hh>
#include <paludis/util/hashes.hh>
-#include <paludis/util/make_shared_ptr.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <unordered_map>
#include <list>
#include <vector>
@@ -186,7 +186,7 @@ KeywordsConf::query(const std::shared_ptr<const KeywordNameSet> & k, const Packa
{
Log::get_instance()->message("paludis_environment.keywords_conf.unknown_set", ll_warning, lc_no_context) << "Set name '"
<< i->first << "' does not exist";
- i->second.first.reset(new SetSpecTree(make_shared_ptr(new AllDepSpec)));
+ i->second.first.reset(new SetSpecTree(std::make_shared<AllDepSpec>()));
}
}
diff --git a/paludis/environments/paludis/licenses_conf.cc b/paludis/environments/paludis/licenses_conf.cc
index e8bcc37..c2cc0d9 100644
--- a/paludis/environments/paludis/licenses_conf.cc
+++ b/paludis/environments/paludis/licenses_conf.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010 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
@@ -36,7 +36,7 @@
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/iterator_funcs.hh>
#include <paludis/util/hashes.hh>
-#include <paludis/util/make_shared_ptr.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <unordered_map>
#include <list>
#include <vector>
@@ -178,7 +178,7 @@ LicensesConf::query(const std::string & t, const PackageID & e) const
{
Log::get_instance()->message("paludis_environment.licenses_conf.unknown_set", ll_warning, lc_no_context) << "Set name '"
<< i->first << "' does not exist";
- i->second.first.reset(new SetSpecTree(make_shared_ptr(new AllDepSpec)));
+ i->second.first.reset(new SetSpecTree(std::make_shared<AllDepSpec>()));
}
}
diff --git a/paludis/environments/paludis/output_conf.cc b/paludis/environments/paludis/output_conf.cc
index f03e2ad..11807fe 100644
--- a/paludis/environments/paludis/output_conf.cc
+++ b/paludis/environments/paludis/output_conf.cc
@@ -36,6 +36,7 @@
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/map.hh>
#include <paludis/util/simple_parser.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/create_output_manager_info.hh>
#include <paludis/package_id.hh>
@@ -330,7 +331,7 @@ OutputConf::add(const FSEntry & filename)
Context context("When adding source '" + stringify(filename) + "' as an output file:");
std::shared_ptr<KeyValueConfigFile> f(make_bashable_kv_conf(filename,
- make_shared_ptr(new Map<std::string, std::string>),
+ std::make_shared<Map<std::string, std::string>>(),
KeyValueConfigFileOptions() + kvcfo_allow_sections));
if (! f)
return;
@@ -361,14 +362,14 @@ OutputConf::add(const FSEntry & filename)
{
local_rules.insert(
std::make_pair(section_name,
- make_shared_ptr(new Map<std::string, std::string>))).first->second->insert(
+ std::make_shared<Map<std::string, std::string>>())).first->second->insert(
remainder, k->second);
}
else if (section_kind == "manager")
{
local_managers.insert(
std::make_pair(section_name,
- make_shared_ptr(new Map<std::string, std::string>))).first->second->insert(
+ std::make_shared<Map<std::string, std::string>>())).first->second->insert(
remainder, k->second);
}
else
diff --git a/paludis/environments/paludis/package_mask_conf.cc b/paludis/environments/paludis/package_mask_conf.cc
index f13de6f..93af226 100644
--- a/paludis/environments/paludis/package_mask_conf.cc
+++ b/paludis/environments/paludis/package_mask_conf.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010 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
@@ -36,7 +36,7 @@
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/hashes.hh>
-#include <paludis/util/make_shared_ptr.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <list>
#include <algorithm>
#include <functional>
@@ -120,7 +120,7 @@ PackageMaskConf::query(const PackageID & e) const
{
Log::get_instance()->message("paludis_environment.package_mask.unknown_set", ll_warning, lc_no_context) << "Set name '"
<< it->first << "' does not exist";
- it->second.reset(new SetSpecTree(make_shared_ptr(new AllDepSpec)));
+ it->second.reset(new SetSpecTree(std::make_shared<AllDepSpec>()));
}
}
diff --git a/paludis/environments/paludis/paludis_config.cc b/paludis/environments/paludis/paludis_config.cc
index 26eaf74..fdd9646 100644
--- a/paludis/environments/paludis/paludis_config.cc
+++ b/paludis/environments/paludis/paludis_config.cc
@@ -44,7 +44,6 @@
#include <paludis/util/mutex.hh>
#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/hashes.hh>
#include <paludis/util/graph-impl.hh>
@@ -523,10 +522,10 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
if ((local_config_dir / (dist->repository_defaults_filename_part() + ".conf")).exists())
{
- _imp->predefined_conf_vars_func = std::bind(&from_kv, make_shared_ptr(new KeyValueConfigFile(
+ _imp->predefined_conf_vars_func = std::bind(&from_kv, std::make_shared<KeyValueConfigFile>(
local_config_dir / (dist->repository_defaults_filename_part() + ".conf"), KeyValueConfigFileOptions(),
std::bind(&to_kv_func, _imp->predefined_conf_vars_func, std::placeholders::_1, std::placeholders::_2),
- &KeyValueConfigFile::no_transformation)),
+ &KeyValueConfigFile::no_transformation),
std::placeholders::_1);
}
else if ((local_config_dir / (dist->repository_defaults_filename_part() + ".bash")).exists())
@@ -538,10 +537,10 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
.with_stderr_prefix(dist->repository_defaults_filename_part() + ".bash> ")
.with_captured_stdout_stream(&s));
int exit_status(run_command(cmd));
- _imp->predefined_conf_vars_func = std::bind(&from_kv, make_shared_ptr(new KeyValueConfigFile(
+ _imp->predefined_conf_vars_func = std::bind(&from_kv, std::make_shared<KeyValueConfigFile>(
s, KeyValueConfigFileOptions(),
std::bind(&to_kv_func, _imp->predefined_conf_vars_func, std::placeholders::_1, std::placeholders::_2),
- &KeyValueConfigFile::no_transformation)),
+ &KeyValueConfigFile::no_transformation),
std::placeholders::_1);
if (exit_status != 0)
Log::get_instance()->message("paludis_environment.repository_defaults.failure", ll_warning, lc_context)
diff --git a/paludis/environments/paludis/paludis_environment.cc b/paludis/environments/paludis/paludis_environment.cc
index 02a899c..4a0ca1b 100644
--- a/paludis/environments/paludis/paludis_environment.cc
+++ b/paludis/environments/paludis/paludis_environment.cc
@@ -45,7 +45,6 @@
#include <paludis/util/dir_iterator.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/is_file_with_extension.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/save.hh>
#include <paludis/util/strip.hh>
#include <paludis/util/set.hh>
@@ -96,9 +95,8 @@ namespace paludis
format_key(new LiteralMetadataValueKey<std::string>("format", "Format", mkt_significant, "paludis")),
config_location_key(new LiteralMetadataValueKey<FSEntry>("conf_dir", "Config dir", mkt_normal,
config->config_dir())),
- world_file_key(config->world()->location_if_set() ? make_shared_ptr(
- new LiteralMetadataValueKey<FSEntry>("world_file", "World file", mkt_normal,
- *config->world()->location_if_set()))
+ world_file_key(config->world()->location_if_set() ? std::make_shared<LiteralMetadataValueKey<FSEntry>>("world_file", "World file", mkt_normal,
+ *config->world()->location_if_set())
: std::shared_ptr<LiteralMetadataValueKey<FSEntry> >())
{
}
@@ -419,7 +417,7 @@ PaludisEnvironment::mask_for_breakage(const PackageID & id) const
_imp->config->accept_breaks_portage().begin(), _imp->config->accept_breaks_portage().end(),
std::back_inserter(bad_breakages));
if (! bad_breakages.empty())
- return make_shared_ptr(new BreaksPortageMask(join(breakages->begin(), breakages->end(), " ")));
+ return std::make_shared<BreaksPortageMask>(join(breakages->begin(), breakages->end(), " "));
}
}
@@ -430,7 +428,7 @@ const std::shared_ptr<const Mask>
PaludisEnvironment::mask_for_user(const PackageID & d, const bool o) const
{
if (_imp->config->package_mask_conf()->query(d))
- return make_shared_ptr(new UserConfigMask(o));
+ return std::make_shared<UserConfigMask>(o);
return std::shared_ptr<const Mask>();
}
diff --git a/paludis/environments/paludis/world.cc b/paludis/environments/paludis/world.cc
index 8c9b3b0..19f9ce4 100644
--- a/paludis/environments/paludis/world.cc
+++ b/paludis/environments/paludis/world.cc
@@ -197,7 +197,7 @@ World::world_set() const
<< "World file '" << *_imp->maybe_world_file << "' doesn't exist";
}
- return make_shared_ptr(new SetSpecTree(make_shared_ptr(new AllDepSpec)));
+ return std::make_shared<SetSpecTree>(std::make_shared<AllDepSpec>());
}
std::shared_ptr<const FSEntry>
diff --git a/paludis/environments/portage/portage_environment.cc b/paludis/environments/portage/portage_environment.cc
index 37b57bc..11ff499 100644
--- a/paludis/environments/portage/portage_environment.cc
+++ b/paludis/environments/portage/portage_environment.cc
@@ -33,7 +33,6 @@
#include <paludis/util/sequence.hh>
#include <paludis/util/map.hh>
#include <paludis/util/options.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/config_file.hh>
#include <paludis/util/tribool.hh>
#include <paludis/util/make_named_values.hh>
@@ -839,7 +838,7 @@ PortageEnvironment::mask_for_breakage(const PackageID & id) const
_imp->ignore_breaks_portage.begin(), _imp->ignore_breaks_portage.end(),
std::inserter(bad_breakages, bad_breakages.end()));
if (! bad_breakages.empty())
- return make_shared_ptr(new BreaksPortageMask(join(breakages->begin(), breakages->end(), " ")));
+ return std::make_shared<BreaksPortageMask>(join(breakages->begin(), breakages->end(), " "));
}
}
@@ -852,7 +851,7 @@ PortageEnvironment::mask_for_user(const PackageID & d, const bool o) const
for (PackageMask::const_iterator i(_imp->package_mask.begin()), i_end(_imp->package_mask.end()) ;
i != i_end ; ++i)
if (match_package(*this, **i, d, MatchPackageOptions()))
- return make_shared_ptr(new UserConfigMask(o));
+ return std::make_shared<UserConfigMask>(o);
return std::shared_ptr<const Mask>();
}
@@ -986,7 +985,7 @@ PortageEnvironment::config_location_key() const
const std::shared_ptr<OutputManager>
PortageEnvironment::create_output_manager(const CreateOutputManagerInfo &) const
{
- return make_shared_ptr(new StandardOutputManager);
+ return std::make_shared<StandardOutputManager>();
}
namespace
@@ -1001,7 +1000,7 @@ namespace
{
Log::get_instance()->message("portage_environment.world.does_not_exist", ll_warning, lc_no_context)
<< "World file '" << f << "' doesn't exist";
- return make_shared_ptr(new SetSpecTree(make_shared_ptr(new AllDepSpec)));
+ return std::make_shared<SetSpecTree>(std::make_shared<AllDepSpec>());
}
const std::shared_ptr<GeneralSetDepTag> tag(new GeneralSetDepTag(SetName("world::environment"), "Environment"));
diff --git a/paludis/environments/test/test_environment.cc b/paludis/environments/test/test_environment.cc
index c37def9..647a626 100644
--- a/paludis/environments/test/test_environment.cc
+++ b/paludis/environments/test/test_environment.cc
@@ -22,7 +22,6 @@
#include <paludis/util/set.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/sequence.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/hashes.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/tribool.hh>
@@ -171,7 +170,7 @@ TestEnvironment::perform_hook(const Hook &) const
std::shared_ptr<const FSEntrySequence>
TestEnvironment::hook_dirs() const
{
- return make_shared_ptr(new FSEntrySequence);
+ return std::make_shared<FSEntrySequence>();
}
const std::shared_ptr<const Mask>
@@ -278,13 +277,13 @@ TestEnvironment::known_choice_value_names(
const std::shared_ptr<const Choice> &
) const
{
- return make_shared_ptr(new Set<UnprefixedChoiceName>);
+ return std::make_shared<Set<UnprefixedChoiceName>>();
}
const std::shared_ptr<OutputManager>
TestEnvironment::create_output_manager(const CreateOutputManagerInfo &) const
{
- return make_shared_ptr(new StandardOutputManager);
+ return std::make_shared<StandardOutputManager>();
}
void
diff --git a/paludis/file_output_manager.cc b/paludis/file_output_manager.cc
index c1d8017..2242f0f 100644
--- a/paludis/file_output_manager.cc
+++ b/paludis/file_output_manager.cc
@@ -23,7 +23,6 @@
#include <paludis/util/set.hh>
#include <paludis/util/map.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/destringify.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/stringify.hh>
@@ -168,7 +167,7 @@ FileOutputManager::factory_create(
if (filename_s.empty())
throw ConfigurationError("Key 'filename' not specified when creating a file output manager");
- filename_s = replace_vars_func(filename_s, make_shared_ptr(new Map<std::string, std::string>));
+ filename_s = replace_vars_func(filename_s, std::make_shared<Map<std::string, std::string>>());
if (keep_on_success_s.empty())
keep_on_success_s = "true";
@@ -180,11 +179,11 @@ FileOutputManager::factory_create(
if (! summary_output_manager_s.empty())
summary_output_manager = create_child_function(summary_output_manager_s);
- summary_output_message_s = replace_vars_func(summary_output_message_s, make_shared_ptr(new Map<std::string, std::string>));
+ summary_output_message_s = replace_vars_func(summary_output_message_s, std::make_shared<Map<std::string, std::string>>());
- return make_shared_ptr(new FileOutputManager(FSEntry(filename_s),
+ return std::make_shared<FileOutputManager>(FSEntry(filename_s),
destringify<bool>(keep_on_success_s), destringify<bool>(keep_on_empty_s),
- summary_output_manager, summary_output_message_s));
+ summary_output_manager, summary_output_message_s);
}
template class PrivateImplementationPattern<FileOutputManager>;
diff --git a/paludis/filter.cc b/paludis/filter.cc
index 067f453..d7b97b6 100644
--- a/paludis/filter.cc
+++ b/paludis/filter.cc
@@ -31,7 +31,6 @@
#include <paludis/util/sequence.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/wrapped_output_iterator.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/action_names.hh>
@@ -428,48 +427,48 @@ namespace
}
filter::All::All() :
- Filter(make_shared_ptr(new AllFilterHandler))
+ Filter(std::make_shared<AllFilterHandler>())
{
}
template <typename A_>
filter::SupportsAction<A_>::SupportsAction() :
- Filter(make_shared_ptr(new SupportsActionFilterHandler<A_>))
+ Filter(std::make_shared<SupportsActionFilterHandler<A_>>())
{
}
filter::NotMasked::NotMasked() :
- Filter(make_shared_ptr(new NotMaskedFilterHandler()))
+ Filter(std::make_shared<NotMaskedFilterHandler>())
{
}
filter::InstalledAtRoot::InstalledAtRoot(const FSEntry & r) :
- Filter(make_shared_ptr(new InstalledAtRootFilterHandler(r)))
+ Filter(std::make_shared<InstalledAtRootFilterHandler>(r))
{
}
filter::And::And(const Filter & f1, const Filter & f2) :
- Filter(make_shared_ptr(new AndFilterHandler(f1, f2)))
+ Filter(std::make_shared<AndFilterHandler>(f1, f2))
{
}
filter::SameSlot::SameSlot(const std::shared_ptr<const PackageID> & i) :
- Filter(make_shared_ptr(new SameSlotHandler(i)))
+ Filter(std::make_shared<SameSlotHandler>(i))
{
}
filter::Slot::Slot(const SlotName & s) :
- Filter(make_shared_ptr(new SlotHandler(s)))
+ Filter(std::make_shared<SlotHandler>(s))
{
}
filter::NoSlot::NoSlot() :
- Filter(make_shared_ptr(new NoSlotHandler))
+ Filter(std::make_shared<NoSlotHandler>())
{
}
filter::Matches::Matches(const PackageDepSpec & spec, const MatchPackageOptions & o) :
- Filter(make_shared_ptr(new MatchesHandler(spec, o)))
+ Filter(std::make_shared<MatchesHandler>(spec, o))
{
}
diff --git a/paludis/format_messages_output_manager.cc b/paludis/format_messages_output_manager.cc
index 515d5b7..8a63282 100644
--- a/paludis/format_messages_output_manager.cc
+++ b/paludis/format_messages_output_manager.cc
@@ -23,7 +23,6 @@
#include <paludis/util/set.hh>
#include <paludis/util/map.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/destringify.hh>
#include <paludis/util/stringify.hh>
@@ -190,8 +189,8 @@ FormatMessagesOutputManager::factory_create(
FormatMessagesOutputManagerFormatFunction format_func(std::bind(
&format_message, replace_vars_func, std::placeholders::_1, std::placeholders::_2));
- return make_shared_ptr(new FormatMessagesOutputManager(
- child, format_debug_s, format_info_s, format_warn_s, format_error_s, format_log_s, format_func));
+ return std::make_shared<FormatMessagesOutputManager>(
+ child, format_debug_s, format_info_s, format_warn_s, format_error_s, format_log_s, format_func);
}
template class PrivateImplementationPattern<FormatMessagesOutputManager>;
diff --git a/paludis/forward_at_finish_output_manager.cc b/paludis/forward_at_finish_output_manager.cc
index 1f382a5..b81f084 100644
--- a/paludis/forward_at_finish_output_manager.cc
+++ b/paludis/forward_at_finish_output_manager.cc
@@ -22,7 +22,6 @@
#include <paludis/util/set.hh>
#include <paludis/util/map.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/destringify.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/stringify.hh>
@@ -148,10 +147,10 @@ ForwardAtFinishOutputManager::factory_create(
std::shared_ptr<OutputManager> child(create_child_function(child_s));
- return make_shared_ptr(new ForwardAtFinishOutputManager(
+ return std::make_shared<ForwardAtFinishOutputManager>(
destringify<bool>(if_success_s),
destringify<bool>(if_failure_s),
- child));
+ child);
}
template class PrivateImplementationPattern<ForwardAtFinishOutputManager>;
diff --git a/paludis/fuzzy_finder.cc b/paludis/fuzzy_finder.cc
index 7ac7dad..141cd86 100644
--- a/paludis/fuzzy_finder.cc
+++ b/paludis/fuzzy_finder.cc
@@ -22,7 +22,6 @@
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/damerau_levenshtein.hh>
#include <paludis/util/options.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/package_database.hh>
#include <paludis/environment.hh>
#include <paludis/repository.hh>
@@ -110,7 +109,7 @@ namespace
{
public:
FuzzyPackageName(const std::string & p) :
- Filter(make_shared_ptr(new FuzzyPackageNameFilterHandler(p)))
+ Filter(std::make_shared<FuzzyPackageNameFilterHandler>(p))
{
}
};
diff --git a/paludis/generator.cc b/paludis/generator.cc
index 7eca7a2..e3c3a45 100644
--- a/paludis/generator.cc
+++ b/paludis/generator.cc
@@ -25,7 +25,6 @@
#include <paludis/action.hh>
#include <paludis/match_package.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/set.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
@@ -677,14 +676,14 @@ namespace
virtual std::shared_ptr<const RepositoryNameSet> repositories(
const Environment * const) const
{
- return make_shared_ptr(new RepositoryNameSet);
+ return std::make_shared<RepositoryNameSet>();
}
virtual std::shared_ptr<const CategoryNamePartSet> categories(
const Environment * const,
const std::shared_ptr<const RepositoryNameSet> &) const
{
- return make_shared_ptr(new CategoryNamePartSet);
+ return std::make_shared<CategoryNamePartSet>();
}
virtual std::shared_ptr<const QualifiedPackageNameSet> packages(
@@ -692,7 +691,7 @@ namespace
const std::shared_ptr<const RepositoryNameSet> &,
const std::shared_ptr<const CategoryNamePartSet> &) const
{
- return make_shared_ptr(new QualifiedPackageNameSet);
+ return std::make_shared<QualifiedPackageNameSet>();
}
virtual std::shared_ptr<const PackageIDSet> ids(
@@ -700,7 +699,7 @@ namespace
const std::shared_ptr<const RepositoryNameSet> &,
const std::shared_ptr<const QualifiedPackageNameSet> &) const
{
- return make_shared_ptr(new PackageIDSet);
+ return std::make_shared<PackageIDSet>();
}
virtual std::string as_string() const
@@ -711,53 +710,53 @@ namespace
}
generator::All::All() :
- Generator(make_shared_ptr(new AllGeneratorHandler))
+ Generator(std::make_shared<AllGeneratorHandler>())
{
}
generator::InRepository::InRepository(const RepositoryName & n) :
- Generator(make_shared_ptr(new InRepositoryGeneratorHandler(n)))
+ Generator(std::make_shared<InRepositoryGeneratorHandler>(n))
{
}
generator::FromRepository::FromRepository(const RepositoryName & n) :
- Generator(make_shared_ptr(new FromRepositoryGeneratorHandler(n)))
+ Generator(std::make_shared<FromRepositoryGeneratorHandler>(n))
{
}
generator::Category::Category(const CategoryNamePart & n) :
- Generator(make_shared_ptr(new CategoryGeneratorHandler(n)))
+ Generator(std::make_shared<CategoryGeneratorHandler>(n))
{
}
generator::Package::Package(const QualifiedPackageName & n) :
- Generator(make_shared_ptr(new PackageGeneratorHandler(n)))
+ Generator(std::make_shared<PackageGeneratorHandler>(n))
{
}
generator::Matches::Matches(const PackageDepSpec & spec, const MatchPackageOptions & o) :
- Generator(make_shared_ptr(new MatchesGeneratorHandler(spec, o)))
+ Generator(std::make_shared<MatchesGeneratorHandler>(spec, o))
{
}
generator::Intersection::Intersection(const Generator & g1, const Generator & g2) :
- Generator(make_shared_ptr(new IntersectionGeneratorHandler(g1, g2)))
+ Generator(std::make_shared<IntersectionGeneratorHandler>(g1, g2))
{
}
generator::Union::Union(const Generator & g1, const Generator & g2) :
- Generator(make_shared_ptr(new UnionGeneratorHandler(g1, g2)))
+ Generator(std::make_shared<UnionGeneratorHandler>(g1, g2))
{
}
generator::Nothing::Nothing() :
- Generator(make_shared_ptr(new NothingGeneratorHandler))
+ Generator(std::make_shared<NothingGeneratorHandler>())
{
}
template <typename A_>
generator::SomeIDsMightSupportAction<A_>::SomeIDsMightSupportAction() :
- Generator(make_shared_ptr(new SomeIDsMightSupportActionGeneratorHandler<A_>))
+ Generator(std::make_shared<SomeIDsMightSupportActionGeneratorHandler<A_>>())
{
}
diff --git a/paludis/hooker.cc b/paludis/hooker.cc
index 19aeae1..6a9c19a 100644
--- a/paludis/hooker.cc
+++ b/paludis/hooker.cc
@@ -34,7 +34,6 @@
#include <paludis/util/tokeniser.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/sequence-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/join.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/about.hh>
@@ -85,7 +84,7 @@ namespace
virtual const std::shared_ptr<const Sequence<std::string> > auto_hook_names() const
{
- return make_shared_ptr(new Sequence<std::string>);
+ return std::make_shared<Sequence<std::string>>();
}
};
@@ -294,7 +293,7 @@ FancyHookFile::auto_hook_names() const
{
Log::get_instance()->message("hook.fancy.failure", ll_warning, lc_no_context) << "Hook '" << file_name()
<< "' returned failure '" << exit_status << "' for auto hook names";
- return make_shared_ptr(new Sequence<std::string>);
+ return std::make_shared<Sequence<std::string>>();
}
}
@@ -429,7 +428,7 @@ SoHookFile::auto_hook_names() const
Context c("When querying auto hook names for .so hook '" + stringify(file_name()) + "':");
if (! _auto_hook_names)
- return make_shared_ptr(new Sequence<std::string>);
+ return std::make_shared<Sequence<std::string>>();
return _auto_hook_names(_env);
}
diff --git a/paludis/install_task.cc b/paludis/install_task.cc
index 84760c6..ae065eb 100644
--- a/paludis/install_task.cc
+++ b/paludis/install_task.cc
@@ -42,7 +42,6 @@
#include <paludis/util/iterator_funcs.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/destringify.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/make_shared_copy.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/sequence-impl.hh>
@@ -153,7 +152,7 @@ namespace paludis
std::shared_ptr<const DestinationsSet> d) :
env(e),
dep_list(e, o),
- targets(new SetSpecTree(make_shared_ptr(new AllDepSpec))),
+ targets(new SetSpecTree(std::make_shared<AllDepSpec>())),
destinations(d),
pretend(false),
fetch_only(false),
@@ -194,7 +193,7 @@ InstallTask::~InstallTask()
void
InstallTask::clear()
{
- _imp->targets.reset(new SetSpecTree(make_shared_ptr(new AllDepSpec)));
+ _imp->targets.reset(new SetSpecTree(std::make_shared<AllDepSpec>()));
_imp->had_set_targets = false;
_imp->had_package_targets = false;
_imp->dep_list.clear();
@@ -231,42 +230,42 @@ namespace
case 'S':
if (s.length() != 1)
throw InternalError(PALUDIS_HERE, "S takes no extra value");
- return make_shared_ptr(new DepListEntryHandledSuccess);
+ return std::make_shared<DepListEntryHandledSuccess>();
case 'E':
if (s.length() != 1)
throw InternalError(PALUDIS_HERE, "E takes no extra value");
- return make_shared_ptr(new DepListEntryHandledFetchFailed);
+ return std::make_shared<DepListEntryHandledFetchFailed>();
case 'T':
if (s.length() != 1)
throw InternalError(PALUDIS_HERE, "T takes no extra value");
- return make_shared_ptr(new DepListEntryHandledFetchSuccess);
+ return std::make_shared<DepListEntryHandledFetchSuccess>();
case 'U':
- return make_shared_ptr(new DepListEntryHandledSkippedUnsatisfied(
- parse_user_package_dep_spec(s.substr(1), env, UserPackageDepSpecOptions())));
+ return std::make_shared<DepListEntryHandledSkippedUnsatisfied>(
+ parse_user_package_dep_spec(s.substr(1), env, UserPackageDepSpecOptions()));
case 'D':
- return make_shared_ptr(new DepListEntryHandledSkippedDependent(
+ return std::make_shared<DepListEntryHandledSkippedDependent>(
*(*env)[selection::RequireExactlyOne(generator::Matches(
parse_user_package_dep_spec(s.substr(1), env,
- UserPackageDepSpecOptions()), MatchPackageOptions()))]->begin()));
+ UserPackageDepSpecOptions()), MatchPackageOptions()))]->begin());
case 'F':
if (s.length() != 1)
throw InternalError(PALUDIS_HERE, "F takes no extra value");
- return make_shared_ptr(new DepListEntryHandledFailed);
+ return std::make_shared<DepListEntryHandledFailed>();
case 'P':
if (s.length() != 1)
throw InternalError(PALUDIS_HERE, "P takes no extra value");
- return make_shared_ptr(new DepListEntryUnhandled);
+ return std::make_shared<DepListEntryUnhandled>();
case 'N':
if (s.length() != 1)
throw InternalError(PALUDIS_HERE, "N takes no extra value");
- return make_shared_ptr(new DepListEntryNoHandlingRequired);
+ return std::make_shared<DepListEntryNoHandlingRequired>();
default:
throw InternalError(PALUDIS_HERE, "Unknown value '" + s + "'");
@@ -329,7 +328,7 @@ InstallTask::set_targets_from_serialisation(const std::string & format,
n::kind() = kind,
n::package_id() = package_id,
n::state() = state,
- n::tags() = make_shared_ptr(new DepListEntryTags)
+ n::tags() = std::make_shared<DepListEntryTags>()
));
}
}
@@ -533,7 +532,7 @@ InstallTask::_add_target(const std::string & target)
throw HadBothPackageAndSetTargets();
_imp->had_set_targets = true;
- _imp->targets->root()->append(make_shared_ptr(new NamedSetDepSpec(SetName(target))));
+ _imp->targets->root()->append(std::make_shared<NamedSetDepSpec>(SetName(target)));
if (! _imp->override_target_type)
_imp->dep_list.options()->target_type() = dl_target_set;
@@ -564,7 +563,7 @@ InstallTask::_add_package_id(const std::shared_ptr<const PackageID> & target)
n::version_spec() = target->version()));
if (target->slot_key())
- part_spec.slot_requirement(make_shared_ptr(new UserSlotExactRequirement(target->slot_key()->value())));
+ part_spec.slot_requirement(std::make_shared<UserSlotExactRequirement>(target->slot_key()->value()));
std::shared_ptr<PackageDepSpec> spec(make_shared_copy(PackageDepSpec(part_spec)));
spec->set_tag(std::shared_ptr<const DepTag>(new TargetDepTag));
@@ -761,7 +760,7 @@ InstallTask::_pretend()
if (dep->package_id()->supports_action(fetch_action_query))
{
FetchActionOptions options(make_named_values<FetchActionOptions>(
- n::errors() = make_shared_ptr(new Sequence<FetchActionFailure>),
+ n::errors() = std::make_shared<Sequence<FetchActionFailure>>(),
n::exclude_unmirrorable() = false,
n::fetch_parts() = FetchParts() + fp_regulars + fp_extras,
n::ignore_not_in_manifest() = false,
@@ -783,7 +782,7 @@ InstallTask::_pretend()
on_fetch_action_error(output_manager_holder.output_manager_if_constructed(), e,
options.errors());
else
- on_fetch_action_error(make_shared_ptr(new StandardOutputManager), e,
+ on_fetch_action_error(std::make_shared<StandardOutputManager>(), e,
options.errors());
}
}
@@ -1106,7 +1105,7 @@ InstallTask::_main_actions_all(const int y, const DepList::Iterator dep_last_pac
if (output_manager_holder && output_manager_holder->output_manager_if_constructed())
on_non_fetch_action_error(output_manager_holder->output_manager_if_constructed(), e);
else
- on_non_fetch_action_error(make_shared_ptr(new StandardOutputManager), e);
+ on_non_fetch_action_error(std::make_shared<StandardOutputManager>(), e);
++f;
}
@@ -1166,7 +1165,7 @@ InstallTask::_do_world_updates()
"() \t\r\n"));
}
- std::shared_ptr<SetSpecTree> all(new SetSpecTree(make_shared_ptr(new AllDepSpec)));
+ std::shared_ptr<SetSpecTree> all(new SetSpecTree(std::make_shared<AllDepSpec>()));
std::list<std::string> tokens;
tokenise_whitespace(*_imp->add_to_world_spec, std::back_inserter(tokens));
if ((! tokens.empty()) && ("(" == *tokens.begin()) && (")" == *previous(tokens.end())))
@@ -1179,10 +1178,10 @@ InstallTask::_do_world_updates()
t != t_end ; ++t)
{
if (s_had_package_targets)
- all->root()->append(make_shared_ptr(new PackageDepSpec(parse_user_package_dep_spec(*t, _imp->env,
- UserPackageDepSpecOptions()))));
+ all->root()->append(std::make_shared<PackageDepSpec>(parse_user_package_dep_spec(*t, _imp->env,
+ UserPackageDepSpecOptions())));
else
- all->root()->append(make_shared_ptr(new NamedSetDepSpec(SetName(*t))));
+ all->root()->append(std::make_shared<NamedSetDepSpec>(SetName(*t)));
}
if (s_had_package_targets)
@@ -1930,7 +1929,7 @@ FetchActionOptions
InstallTask::make_fetch_action_options(const DepListEntry &, OutputManagerFromEnvironment & o) const
{
return make_named_values<FetchActionOptions>(
- n::errors() = make_shared_ptr(new Sequence<FetchActionFailure>),
+ n::errors() = std::make_shared<Sequence<FetchActionFailure>>(),
n::exclude_unmirrorable() = false,
n::fetch_parts() = FetchParts() + fp_regulars + fp_extras,
n::ignore_not_in_manifest() = false,
diff --git a/paludis/ipc_output_manager.cc b/paludis/ipc_output_manager.cc
index 001c522..f427a9f 100644
--- a/paludis/ipc_output_manager.cc
+++ b/paludis/ipc_output_manager.cc
@@ -24,7 +24,6 @@
#include <paludis/util/set.hh>
#include <paludis/util/map.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/destringify.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/stringify.hh>
diff --git a/paludis/merger_TEST.cc b/paludis/merger_TEST.cc
index 1159929..27f98c2 100644
--- a/paludis/merger_TEST.cc
+++ b/paludis/merger_TEST.cc
@@ -25,7 +25,6 @@
#include <paludis/util/make_named_values.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/util/set.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/timestamp.hh>
#include <paludis/hook.hh>
#include <test/test_framework.hh>
@@ -180,7 +179,7 @@ namespace
n::get_new_ids_or_minus_one() = &get_new_ids_or_minus_one,
n::image() = image_dir,
n::install_under() = FSEntry("/"),
- n::merged_entries() = make_shared_ptr(new FSEntrySet),
+ n::merged_entries() = std::make_shared<FSEntrySet>(),
n::no_chown() = true,
n::options() = MergerOptions() + mo_rewrite_symlinks + mo_allow_empty_dirs,
n::root() = root_dir
@@ -201,7 +200,7 @@ namespace
n::get_new_ids_or_minus_one() = &get_new_ids_or_minus_one,
n::image() = image_dir,
n::install_under() = FSEntry("/"),
- n::merged_entries() = make_shared_ptr(new FSEntrySet),
+ n::merged_entries() = std::make_shared<FSEntrySet>(),
n::no_chown() = true,
n::options() = o,
n::root() = root_dir
diff --git a/paludis/ndbam.cc b/paludis/ndbam.cc
index e4d11d7..0728888 100644
--- a/paludis/ndbam.cc
+++ b/paludis/ndbam.cc
@@ -25,7 +25,6 @@
#include <paludis/util/tokeniser.hh>
#include <paludis/util/options.hh>
#include <paludis/util/log.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/config_file.hh>
#include <paludis/util/hashes.hh>
#include <paludis/util/make_named_values.hh>
@@ -162,7 +161,7 @@ NDBAM::category_names()
_imp->category_names->insert(c);
/* Inserting into category_contents_map might return false if
* we're partially populated. That's ok. */
- _imp->category_contents_map.insert(std::make_pair(c, make_shared_ptr(new CategoryContents)));
+ _imp->category_contents_map.insert(std::make_pair(c, std::make_shared<CategoryContents>()));
}
catch (const NameError & e)
{
@@ -179,7 +178,7 @@ std::shared_ptr<const QualifiedPackageNameSet>
NDBAM::package_names(const CategoryNamePart & c)
{
if (! has_category_named(c))
- return make_shared_ptr(new QualifiedPackageNameSet);
+ return std::make_shared<QualifiedPackageNameSet>();
Lock l(_imp->category_names_mutex);
CategoryContentsMap::iterator cc_i(_imp->category_contents_map.find(c));
@@ -207,7 +206,7 @@ NDBAM::package_names(const CategoryNamePart & c)
cc.package_names->insert(q);
/* Inserting into package_contents_map might return false if
* we're partially populated. That's ok. */
- cc.package_contents_map.insert(std::make_pair(q, make_shared_ptr(new PackageContents)));
+ cc.package_contents_map.insert(std::make_pair(q, std::make_shared<PackageContents>()));
}
catch (const NameError & e)
{
@@ -286,7 +285,7 @@ std::shared_ptr<NDBAMEntrySequence>
NDBAM::entries(const QualifiedPackageName & q)
{
if (! has_package_named(q))
- return make_shared_ptr(new NDBAMEntrySequence);
+ return std::make_shared<NDBAMEntrySequence>();
Lock l(_imp->category_names_mutex);
CategoryContentsMap::iterator cc_i(_imp->category_contents_map.find(q.category()));
@@ -328,15 +327,15 @@ NDBAM::entries(const QualifiedPackageName & q)
VersionSpec v(tokens[0], _imp->version_options);
SlotName s(tokens[1]);
std::string m(tokens[2]);
- pc.entries->push_back(make_shared_ptr(new NDBAMEntry(NDBAMEntry(make_named_values<NDBAMEntry>(
+ pc.entries->push_back(std::make_shared<NDBAMEntry>(NDBAMEntry(make_named_values<NDBAMEntry>(
n::fs_location() = d->realpath(),
n::magic() = m,
- n::mutex() = make_shared_ptr(new Mutex),
+ n::mutex() = std::make_shared<Mutex>(),
n::name() = q,
n::package_id() = std::shared_ptr<PackageID>(),
n::slot() = s,
n::version() = v
- )))));
+ ))));
}
catch (const InternalError &)
{
@@ -380,15 +379,15 @@ NDBAM::add_entry(const QualifiedPackageName & q, const FSEntry & d)
VersionSpec v(tokens[0], _imp->version_options);
SlotName s(tokens[1]);
std::string m(tokens[2]);
- pc.entries->push_back(make_shared_ptr(new NDBAMEntry(NDBAMEntry(make_named_values<NDBAMEntry>(
+ pc.entries->push_back(std::make_shared<NDBAMEntry>(NDBAMEntry(make_named_values<NDBAMEntry>(
n::fs_location() = d.realpath(),
n::magic() = m,
- n::mutex() = make_shared_ptr(new Mutex),
+ n::mutex() = std::make_shared<Mutex>(),
n::name() = q,
n::package_id() = std::shared_ptr<PackageID>(),
n::slot() = s,
n::version() = v
- )))));
+ ))));
}
}
@@ -554,14 +553,14 @@ NDBAM::parse_contents(const PackageID & id,
}
time_t mtime(destringify<time_t>(tokens.find("mtime")->second));
- std::shared_ptr<ContentsFileEntry> entry(make_shared_ptr(new ContentsFileEntry(path)));
- entry->add_metadata_key(make_shared_ptr(new LiteralMetadataValueKey<std::string>("md5", "md5", mkt_normal, md5)));
- entry->add_metadata_key(make_shared_ptr(new LiteralMetadataTimeKey("mtime", "mtime", mkt_normal, Timestamp(mtime, 0))));
+ std::shared_ptr<ContentsFileEntry> entry(std::make_shared<ContentsFileEntry>(path));
+ entry->add_metadata_key(std::make_shared<LiteralMetadataValueKey<std::string>>("md5", "md5", mkt_normal, md5));
+ entry->add_metadata_key(std::make_shared<LiteralMetadataTimeKey>("mtime", "mtime", mkt_normal, Timestamp(mtime, 0)));
on_file(entry);
}
else if ("dir" == type)
{
- std::shared_ptr<ContentsDirEntry> entry(make_shared_ptr(new ContentsDirEntry(path)));
+ std::shared_ptr<ContentsDirEntry> entry(std::make_shared<ContentsDirEntry>(path));
on_dir(entry);
}
else if ("sym" == type)
@@ -582,8 +581,8 @@ NDBAM::parse_contents(const PackageID & id,
}
time_t mtime(destringify<time_t>(tokens.find("mtime")->second));
- std::shared_ptr<ContentsSymEntry> entry(make_shared_ptr(new ContentsSymEntry(path, target)));
- entry->add_metadata_key(make_shared_ptr(new LiteralMetadataTimeKey("mtime", "mtime", mkt_normal, Timestamp(mtime, 0))));
+ std::shared_ptr<ContentsSymEntry> entry(std::make_shared<ContentsSymEntry>(path, target));
+ entry->add_metadata_key(std::make_shared<LiteralMetadataTimeKey>("mtime", "mtime", mkt_normal, Timestamp(mtime, 0)));
on_sym(entry);
}
else
diff --git a/paludis/ndbam_unmerger.cc b/paludis/ndbam_unmerger.cc
index 6099965..d3f5ae7 100644
--- a/paludis/ndbam_unmerger.cc
+++ b/paludis/ndbam_unmerger.cc
@@ -33,7 +33,6 @@
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/tokeniser.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/strip.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/make_named_values.hh>
diff --git a/paludis/paludislike_options_conf.cc b/paludis/paludislike_options_conf.cc
index 3266202..3af3940 100644
--- a/paludis/paludislike_options_conf.cc
+++ b/paludis/paludislike_options_conf.cc
@@ -140,7 +140,7 @@ namespace
{
Log::get_instance()->message("paludislike_options_conf.bad_set", ll_warning, lc_context)
<< "Set '" << name << "' in '" << from << "' does not exist";
- result.reset(new SetSpecTree(make_shared_ptr(new AllDepSpec)));
+ result.reset(new SetSpecTree(std::make_shared<AllDepSpec>()));
}
return result;
diff --git a/paludis/python_hooks.cc b/paludis/python_hooks.cc
index d2b07ce..8f98ea4 100644
--- a/paludis/python_hooks.cc
+++ b/paludis/python_hooks.cc
@@ -13,7 +13,6 @@
#include <paludis/util/system.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/sequence.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/make_named_values.hh>
#include <set>
@@ -75,7 +74,7 @@ namespace
virtual const std::shared_ptr<const Sequence<std::string> > auto_hook_names() const
{
- return make_shared_ptr(new Sequence<std::string>);
+ return std::make_shared<Sequence<std::string>>();
}
};
diff --git a/paludis/query_visitor.cc b/paludis/query_visitor.cc
index ae0c5d6..397a91e 100644
--- a/paludis/query_visitor.cc
+++ b/paludis/query_visitor.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010 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
@@ -31,7 +31,6 @@
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/accept_visitor.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <functional>
#include <algorithm>
#include <set>
@@ -166,7 +165,7 @@ QueryVisitor::visit(const DependencySpecTree::NodeType<AnyDepSpec>::Type & node)
if (r.spec())
{
- DependencySpecTree tree(make_shared_ptr(new AllDepSpec));
+ DependencySpecTree tree(std::make_shared<AllDepSpec>());
tree.root()->append(r.spec());
tree.root()->accept(*this);
}
@@ -186,7 +185,7 @@ QueryVisitor::visit(const DependencySpecTree::NodeType<AnyDepSpec>::Type & node)
void
QueryVisitor::visit(const DependencySpecTree::NodeType<BlockDepSpec>::Type & node)
{
- DependencySpecTree tree(make_shared_ptr(new AllDepSpec));
+ DependencySpecTree tree(std::make_shared<AllDepSpec>());
tree.root()->append(std::static_pointer_cast<const PackageDepSpec>(node.spec()->blocking().clone()));
tree.root()->accept(*this);
_imp->result = !_imp->result;
diff --git a/paludis/range_rewriter.cc b/paludis/range_rewriter.cc
index 27ec7ca..e74f6ad 100644
--- a/paludis/range_rewriter.cc
+++ b/paludis/range_rewriter.cc
@@ -24,11 +24,11 @@
#include <paludis/util/make_named_values.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/join.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/options.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/dep_spec.hh>
#include <list>
#include <sstream>
@@ -156,7 +156,7 @@ namespace
std::shared_ptr<const PackageDepSpecData> without_slot_requirements() const
{
- return make_shared_ptr(new RangeRewrittenPackageDepSpecData(*this));
+ return std::make_shared<RangeRewrittenPackageDepSpecData>(*this);
}
virtual std::shared_ptr<const RepositoryName> in_repository_ptr() const
diff --git a/paludis/range_rewriter_TEST.cc b/paludis/range_rewriter_TEST.cc
index f519365..4f00125 100644
--- a/paludis/range_rewriter_TEST.cc
+++ b/paludis/range_rewriter_TEST.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010 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
@@ -42,11 +42,11 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::shared_ptr<DependencySpecTree> a(new DependencySpecTree(make_shared_ptr(new AllDepSpec)));
- a->root()->append(make_shared_ptr(new PackageDepSpec(parse_user_package_dep_spec("=a/b-1",
- &env, UserPackageDepSpecOptions()))));
- a->root()->append(make_shared_ptr(new PackageDepSpec(parse_user_package_dep_spec("=a/b-2",
- &env, UserPackageDepSpecOptions()))));
+ std::shared_ptr<DependencySpecTree> a(new DependencySpecTree(std::make_shared<AllDepSpec>()));
+ a->root()->append(std::make_shared<PackageDepSpec>(parse_user_package_dep_spec("=a/b-1",
+ &env, UserPackageDepSpecOptions())));
+ a->root()->append(std::make_shared<PackageDepSpec>(parse_user_package_dep_spec("=a/b-2",
+ &env, UserPackageDepSpecOptions())));
RangeRewriter r;
TEST_CHECK(! r.spec());
diff --git a/paludis/repositories/accounts/accounts_dep_key.cc b/paludis/repositories/accounts/accounts_dep_key.cc
index fafcb0c..6627343 100644
--- a/paludis/repositories/accounts/accounts_dep_key.cc
+++ b/paludis/repositories/accounts/accounts_dep_key.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009 Ciaran McCreesh
+ * Copyright (c) 2009, 2010 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
@@ -48,7 +48,7 @@ namespace paludis
Implementation(const Environment * const e, const std::shared_ptr<const Set<std::string> > & s) :
env(e),
specs(new std::list<std::shared_ptr<PackageDepSpec> >),
- tree(new DependencySpecTree(make_shared_ptr(new AllDepSpec))),
+ tree(new DependencySpecTree(std::make_shared<AllDepSpec>())),
initial_labels(new DependenciesLabelSequence)
{
for (Set<std::string>::ConstIterator i(s->begin()), i_end(s->end()) ;
@@ -60,8 +60,8 @@ namespace paludis
tree->root()->append(spec);
}
- initial_labels->push_back(make_shared_ptr(new DependenciesBuildLabel("build", return_literal_function(true))));
- initial_labels->push_back(make_shared_ptr(new DependenciesRunLabel("run", return_literal_function(true))));
+ initial_labels->push_back(std::make_shared<DependenciesBuildLabel>("build", return_literal_function(true)));
+ initial_labels->push_back(std::make_shared<DependenciesRunLabel>("run", return_literal_function(true)));
}
};
}
diff --git a/paludis/repositories/accounts/accounts_id.cc b/paludis/repositories/accounts/accounts_id.cc
index c84fac7..40c00f5 100644
--- a/paludis/repositories/accounts/accounts_id.cc
+++ b/paludis/repositories/accounts/accounts_id.cc
@@ -21,7 +21,6 @@
#include <paludis/repositories/accounts/accounts_dep_key.hh>
#include <paludis/repositories/accounts/accounts_installed_mask.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/config_file.hh>
#include <paludis/util/options.hh>
#include <paludis/util/stringify.hh>
@@ -31,6 +30,7 @@
#include <paludis/util/mutex.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/wrapped_output_iterator.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/output_manager.hh>
#include <paludis/name.hh>
#include <paludis/version_spec.hh>
@@ -86,7 +86,7 @@ namespace paludis
repository(r),
fs_location_key(new LiteralMetadataValueKey<FSEntry>("location", "Location", mkt_internal, l)),
from_repositories_key(f),
- mask(m ? make_shared_ptr(new AccountsInstalledMask) : make_null_shared_ptr()),
+ mask(m ? std::make_shared<AccountsInstalledMask>() : make_null_shared_ptr()),
is_user(u),
has_file_keys(false),
has_metadata_keys(false)
@@ -424,7 +424,7 @@ AccountsID::slot_key() const
std::shared_ptr<const Set<std::string> >
AccountsID::breaks_portage() const
{
- return make_shared_ptr(new Set<std::string>);
+ return std::make_shared<Set<std::string>>();
}
bool
@@ -491,7 +491,7 @@ AccountsID::perform_action(Action & action) const
n::build_start_time() = build_start_time,
n::environment_file() = FSEntry("/dev/null"),
n::image_dir() = fs_location_key()->value(),
- n::merged_entries() = make_shared_ptr(new FSEntrySet),
+ n::merged_entries() = std::make_shared<FSEntrySet>(),
n::options() = MergerOptions() + mo_rewrite_symlinks + mo_allow_empty_dirs,
n::output_manager() = output_manager,
n::package_id() = shared_from_this(),
diff --git a/paludis/repositories/accounts/accounts_repository.cc b/paludis/repositories/accounts/accounts_repository.cc
index 07aba8d..ae53bff 100644
--- a/paludis/repositories/accounts/accounts_repository.cc
+++ b/paludis/repositories/accounts/accounts_repository.cc
@@ -24,12 +24,12 @@
#include <paludis/repositories/accounts/passwd_accounts_handler.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/make_named_values.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/set.hh>
#include <paludis/util/active_object_ptr.hh>
#include <paludis/util/deferred_construction_ptr.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/log.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/dep_tag.hh>
#include <paludis/literal_metadata_key.hh>
#include <paludis/action.hh>
@@ -49,9 +49,9 @@ namespace
std::shared_ptr<AccountsHandler> make_handler(const std::string & handler)
{
if (handler == "dummy")
- return make_shared_ptr(new DummyAccountsHandler);
+ return std::make_shared<DummyAccountsHandler>();
else if (handler == "passwd")
- return make_shared_ptr(new PasswdAccountsHandler);
+ return std::make_shared<PasswdAccountsHandler>();
else
throw AccountsRepositoryConfigurationError("Unknown accounts handler '" + handler + "'");
}
@@ -59,13 +59,13 @@ namespace
std::shared_ptr<AccountsRepositoryStore>
make_store(const AccountsRepository * const repo, const AccountsRepositoryParams & p)
{
- return make_shared_ptr(new AccountsRepositoryStore(p.environment(), repo, false));
+ return std::make_shared<AccountsRepositoryStore>(p.environment(), repo, false);
}
std::shared_ptr<AccountsRepositoryStore>
make_installed_store(const AccountsRepository * const repo, const InstalledAccountsRepositoryParams & p)
{
- return make_shared_ptr(new AccountsRepositoryStore(p.environment(), repo, true));
+ return std::make_shared<AccountsRepositoryStore>(p.environment(), repo, true);
}
}
@@ -236,7 +236,7 @@ AccountsRepository::repository_factory_dependencies(
const Environment * const,
const std::function<std::string (const std::string &)> &)
{
- return make_shared_ptr(new RepositoryNameSet);
+ return std::make_shared<RepositoryNameSet>();
}
std::shared_ptr<const RepositoryNameSet>
@@ -244,7 +244,7 @@ AccountsRepository::repository_factory_installed_dependencies(
const Environment * const,
const std::function<std::string (const std::string &)> &)
{
- return make_shared_ptr(new RepositoryNameSet);
+ return std::make_shared<RepositoryNameSet>();
}
const std::shared_ptr<const MetadataValueKey<std::string> >
diff --git a/paludis/repositories/accounts/accounts_repository_store.cc b/paludis/repositories/accounts/accounts_repository_store.cc
index 66f0315..4d00751 100644
--- a/paludis/repositories/accounts/accounts_repository_store.cc
+++ b/paludis/repositories/accounts/accounts_repository_store.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009 Ciaran McCreesh
+ * Copyright (c) 2009, 2010 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,7 +24,6 @@
#include <paludis/repositories/accounts/accounts_exceptions.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/hashes.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/set.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/sequence.hh>
@@ -201,20 +200,20 @@ AccountsRepositoryStore::_load_one_user(
PackageNames::iterator p(_imp->package_names.find(cat));
if (p == _imp->package_names.end())
- p = _imp->package_names.insert(std::make_pair(cat, make_shared_ptr(new QualifiedPackageNameSet))).first;
+ p = _imp->package_names.insert(std::make_pair(cat, std::make_shared<QualifiedPackageNameSet>())).first;
p->second->insert(qpn);
IDs::iterator q(_imp->ids.find(qpn));
if (q == _imp->ids.end())
- q = _imp->ids.insert(std::make_pair(qpn, make_shared_ptr(new PackageIDSequence))).first;
+ q = _imp->ids.insert(std::make_pair(qpn, std::make_shared<PackageIDSequence>())).first;
else
q->second.reset(new PackageIDSequence);
if (_imp->installed)
- q->second->push_back(make_shared_ptr(new InstalledAccountsID(_imp->env, qpn, repo, true)));
+ q->second->push_back(std::make_shared<InstalledAccountsID>(_imp->env, qpn, repo, true));
else
- q->second->push_back(make_shared_ptr(new AccountsID(_imp->env, qpn, repo, from_repo, filename, true, masked)));
+ q->second->push_back(std::make_shared<AccountsID>(_imp->env, qpn, repo, from_repo, filename, true, masked));
}
void
@@ -257,20 +256,20 @@ AccountsRepositoryStore::_load_one_group(
PackageNames::iterator p(_imp->package_names.find(cat));
if (p == _imp->package_names.end())
- p = _imp->package_names.insert(std::make_pair(cat, make_shared_ptr(new QualifiedPackageNameSet))).first;
+ p = _imp->package_names.insert(std::make_pair(cat, std::make_shared<QualifiedPackageNameSet>())).first;
p->second->insert(qpn);
IDs::iterator q(_imp->ids.find(qpn));
if (q == _imp->ids.end())
- q = _imp->ids.insert(std::make_pair(qpn, make_shared_ptr(new PackageIDSequence))).first;
+ q = _imp->ids.insert(std::make_pair(qpn, std::make_shared<PackageIDSequence>())).first;
else
q->second.reset(new PackageIDSequence);
if (_imp->installed)
- q->second->push_back(make_shared_ptr(new InstalledAccountsID(_imp->env, qpn, repo, false)));
+ q->second->push_back(std::make_shared<InstalledAccountsID>(_imp->env, qpn, repo, false));
else
- q->second->push_back(make_shared_ptr(new AccountsID(_imp->env, qpn, repo, from_repo, filename, false, masked)));
+ q->second->push_back(std::make_shared<AccountsID>(_imp->env, qpn, repo, from_repo, filename, false, masked));
}
bool
@@ -302,7 +301,7 @@ AccountsRepositoryStore::package_names(const CategoryNamePart & c) const
{
PackageNames::iterator p(_imp->package_names.find(c));
if (_imp->package_names.end() == p)
- return make_shared_ptr(new QualifiedPackageNameSet);
+ return std::make_shared<QualifiedPackageNameSet>();
else
return p->second;
}
@@ -312,7 +311,7 @@ AccountsRepositoryStore::package_ids(const QualifiedPackageName & p) const
{
IDs::iterator i(_imp->ids.find(p));
if (_imp->ids.end() == i)
- return make_shared_ptr(new PackageIDSequence);
+ return std::make_shared<PackageIDSequence>();
else
return i->second;
}
diff --git a/paludis/repositories/accounts/installed_accounts_id.cc b/paludis/repositories/accounts/installed_accounts_id.cc
index f1ba855..1305da3 100644
--- a/paludis/repositories/accounts/installed_accounts_id.cc
+++ b/paludis/repositories/accounts/installed_accounts_id.cc
@@ -20,7 +20,6 @@
#include <paludis/repositories/accounts/installed_accounts_id.hh>
#include <paludis/repositories/accounts/accounts_dep_key.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/config_file.hh>
#include <paludis/util/options.hh>
#include <paludis/util/stringify.hh>
@@ -30,6 +29,7 @@
#include <paludis/util/make_named_values.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/log.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/name.hh>
#include <paludis/version_spec.hh>
#include <paludis/literal_metadata_key.hh>
@@ -356,7 +356,7 @@ InstalledAccountsID::slot_key() const
std::shared_ptr<const Set<std::string> >
InstalledAccountsID::breaks_portage() const
{
- return make_shared_ptr(new Set<std::string>);
+ return std::make_shared<Set<std::string> >();
}
bool
diff --git a/paludis/repositories/cran/cran_dep_parser.cc b/paludis/repositories/cran/cran_dep_parser.cc
index bf46ef1..73d84f5 100644
--- a/paludis/repositories/cran/cran_dep_parser.cc
+++ b/paludis/repositories/cran/cran_dep_parser.cc
@@ -25,7 +25,6 @@
#include <paludis/util/strip.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/tokeniser.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <string>
#include <list>
@@ -37,7 +36,7 @@ cranrepository::parse_depends(const std::string & s)
{
Context context("When parsing CRAN 'Depends:' string: '" + s + "':");
- std::shared_ptr<DependencySpecTree> result(new DependencySpecTree(make_shared_ptr(new AllDepSpec)));
+ std::shared_ptr<DependencySpecTree> result(new DependencySpecTree(std::make_shared<AllDepSpec>()));
std::list<std::string> specs;
diff --git a/paludis/repositories/cran/cran_installed_repository.cc b/paludis/repositories/cran/cran_installed_repository.cc
index e64fe25..7faffb2 100644
--- a/paludis/repositories/cran/cran_installed_repository.cc
+++ b/paludis/repositories/cran/cran_installed_repository.cc
@@ -37,7 +37,6 @@
#include <paludis/repositories/cran/cran_dep_parser.hh>
#include <paludis/repositories/cran/cran_installed_repository.hh>
#include <paludis/repositories/cran/package_dep_spec.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/dir_iterator.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/sequence.hh>
@@ -51,6 +50,7 @@
#include <paludis/util/hashes.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/wrapped_output_iterator.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <unordered_map>
#include <functional>
#include <algorithm>
@@ -413,7 +413,7 @@ CRANInstalledRepository::repository_factory_dependencies(
const Environment * const,
const std::function<std::string (const std::string &)> &)
{
- return make_shared_ptr(new RepositoryNameSet);
+ return std::make_shared<RepositoryNameSet>();
}
CRANInstalledRepositoryConfigurationError::CRANInstalledRepositoryConfigurationError(
diff --git a/paludis/repositories/cran/cran_package_id.cc b/paludis/repositories/cran/cran_package_id.cc
index 8f79e6b..7ddb4d3 100644
--- a/paludis/repositories/cran/cran_package_id.cc
+++ b/paludis/repositories/cran/cran_package_id.cc
@@ -31,9 +31,9 @@
#include <paludis/util/log.hh>
#include <paludis/util/strip.hh>
#include <paludis/util/stringify.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/return_literal_function.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/literal_metadata_key.hh>
#include <paludis/name.hh>
#include <paludis/version_spec.hh>
@@ -86,8 +86,8 @@ namespace paludis
suggests_labels(new DependenciesLabelSequence),
depends_labels(new DependenciesLabelSequence)
{
- suggests_labels->push_back(make_shared_ptr(new DependenciesSuggestionLabel("Suggests", return_literal_function(true))));
- depends_labels->push_back(make_shared_ptr(new DependenciesBuildLabel("Depends", return_literal_function(true))));
+ suggests_labels->push_back(std::make_shared<DependenciesSuggestionLabel>("Suggests", return_literal_function(true)));
+ depends_labels->push_back(std::make_shared<DependenciesBuildLabel>("Depends", return_literal_function(true)));
}
Implementation(const Environment * const e,
@@ -101,8 +101,8 @@ namespace paludis
suggests_labels(new DependenciesLabelSequence),
depends_labels(new DependenciesLabelSequence)
{
- suggests_labels->push_back(make_shared_ptr(new DependenciesSuggestionLabel("Suggests", return_literal_function(true))));
- depends_labels->push_back(make_shared_ptr(new DependenciesBuildLabel("Depends", return_literal_function(true))));
+ suggests_labels->push_back(std::make_shared<DependenciesSuggestionLabel>("Suggests", return_literal_function(true)));
+ depends_labels->push_back(std::make_shared<DependenciesBuildLabel>("Depends", return_literal_function(true)));
}
};
}
@@ -115,7 +115,7 @@ CRANPackageID::CRANPackageID(const Environment * const env, const std::shared_pt
if (! f.is_regular_file())
{
- add_mask(make_shared_ptr(new BrokenMask('B', "Broken", "DESCRIPTION file not a file")));
+ add_mask(std::make_shared<BrokenMask>('B', "Broken", "DESCRIPTION file not a file"));
Log::get_instance()->message("cran.id.not_a_file", ll_warning, lc_context) << "Unexpected irregular file: '" << stringify(f) << "'";
return;
}
@@ -144,7 +144,7 @@ CRANPackageID::CRANPackageID(const Environment * const env, const std::shared_pt
else
{
Log::get_instance()->message("cran.id.broken", ll_warning, lc_context) << "No Package: or Bundle: key in '" << stringify(f) << "'";
- add_mask(make_shared_ptr(new BrokenMask('B', "Broken", "No Package: or Bundle: key")));
+ add_mask(std::make_shared<BrokenMask>('B', "Broken", "No Package: or Bundle: key"));
return;
}
@@ -153,7 +153,7 @@ CRANPackageID::CRANPackageID(const Environment * const env, const std::shared_pt
Context local_context("When handling Version: key:");
Log::get_instance()->message("cran.id.broken", ll_warning, lc_context) << "No Version: key in '" << stringify(f) << "'";
_imp->version = VersionSpec("0", VersionSpecOptions());
- add_mask(make_shared_ptr(new BrokenMask('B', "Broken", "No Version: key")));
+ add_mask(std::make_shared<BrokenMask>('B', "Broken", "No Version: key"));
return;
}
else
@@ -202,19 +202,19 @@ CRANPackageID::CRANPackageID(const Environment * const env, const std::shared_pt
{
Context local_context("When handling Date: key:");
/* no guarantee on the format */
- add_metadata_key(make_shared_ptr(new LiteralMetadataValueKey<std::string>("Date", "Date", mkt_normal, file.get("Date"))));
+ add_metadata_key(std::make_shared<LiteralMetadataValueKey<std::string>>("Date", "Date", mkt_normal, file.get("Date")));
}
if (! file.get("Author").empty())
{
Context local_context("When handling Author: key:");
- add_metadata_key(make_shared_ptr(new LiteralMetadataValueKey<std::string>("Author", "Author", mkt_author, file.get("Author"))));
+ add_metadata_key(std::make_shared<LiteralMetadataValueKey<std::string>>("Author", "Author", mkt_author, file.get("Author")));
}
if (! file.get("Maintainer").empty())
{
Context local_context("When handling Maintainer: key:");
- add_metadata_key(make_shared_ptr(new LiteralMetadataValueKey<std::string>("Maintainer", "Maintainer", mkt_author, file.get("Maintainer"))));
+ add_metadata_key(std::make_shared<LiteralMetadataValueKey<std::string>>("Maintainer", "Maintainer", mkt_author, file.get("Maintainer")));
}
if (! file.get("Contains").empty())
@@ -228,7 +228,7 @@ CRANPackageID::CRANPackageID(const Environment * const env, const std::shared_pt
t != t_end ; ++t)
{
if (*t != stringify(name().package()))
- _imp->contains_key->push_back(make_shared_ptr(new CRANPackageID(_imp->env, _imp->cran_repository, this, *t)));
+ _imp->contains_key->push_back(std::make_shared<CRANPackageID>(_imp->env, _imp->cran_repository, this, *t));
else
{
/* yay CRAN... */
@@ -249,8 +249,8 @@ CRANPackageID::CRANPackageID(const Environment * const env, const std::shared_pt
if (! file.get("SystemRequirements").empty())
{
Context local_context("When handling SystemRequirements: key:");
- add_metadata_key(make_shared_ptr(new LiteralMetadataValueKey<std::string>("SystemRequirements", "System Requirements", mkt_normal,
- file.get("SystemRequirements"))));
+ add_metadata_key(std::make_shared<LiteralMetadataValueKey<std::string>>("SystemRequirements", "System Requirements", mkt_normal,
+ file.get("SystemRequirements")));
}
if (! file.get("Depends").empty())
@@ -271,7 +271,7 @@ CRANPackageID::CRANPackageID(const Environment * const env, const std::shared_pt
{
Log::get_instance()->message("cran.id.broken", ll_warning, lc_context) << "Broken CRAN description file '" << stringify(f) << "': '"
<< e.message() << "' (" << e.what() << ")";
- add_mask(make_shared_ptr(new BrokenMask('B', "Broken", "Got exception '" + stringify(e.message()) + "' (" + e.what() + "')")));
+ add_mask(std::make_shared<BrokenMask>('B', "Broken", "Got exception '" + stringify(e.message()) + "' (" + e.what() + "')"));
}
}
diff --git a/paludis/repositories/cran/cran_repository.cc b/paludis/repositories/cran/cran_repository.cc
index d4fc874..d6cc72a 100644
--- a/paludis/repositories/cran/cran_repository.cc
+++ b/paludis/repositories/cran/cran_repository.cc
@@ -34,7 +34,6 @@
#include <paludis/util/join.hh>
#include <paludis/util/log.hh>
#include <paludis/util/map.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/stringify.hh>
@@ -47,6 +46,7 @@
#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/extract_host_from_url.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/output_manager.hh>
#include <paludis/syncer.hh>
#include <paludis/hook.hh>
@@ -117,7 +117,7 @@ CRANRepository::CRANRepository(const CRANRepositoryParams & p) :
n::provides_interface() = static_cast<RepositoryProvidesInterface *>(0),
n::virtuals_interface() = static_cast<RepositoryVirtualsInterface *>(0)
)),
- PrivateImplementationPattern<CRANRepository>(new Implementation<CRANRepository>(p, make_shared_ptr(new Mutex))),
+ PrivateImplementationPattern<CRANRepository>(new Implementation<CRANRepository>(p, std::make_shared<Mutex>())),
_imp(PrivateImplementationPattern<CRANRepository>::_imp)
{
_add_metadata_keys();
@@ -446,7 +446,7 @@ CRANRepository::repository_factory_dependencies(
const Environment * const,
const std::function<std::string (const std::string &)> &)
{
- return make_shared_ptr(new RepositoryNameSet);
+ return std::make_shared<RepositoryNameSet>();
}
CRANRepositoryConfigurationError::CRANRepositoryConfigurationError(
diff --git a/paludis/repositories/cran/keys.cc b/paludis/repositories/cran/keys.cc
index c3adc4b..3a00557 100644
--- a/paludis/repositories/cran/keys.cc
+++ b/paludis/repositories/cran/keys.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010 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
@@ -21,7 +21,6 @@
#include <paludis/repositories/cran/cran_package_id.hh>
#include <paludis/repositories/cran/cran_dep_parser.hh>
#include <paludis/repositories/cran/dep_spec_pretty_printer.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/join.hh>
diff --git a/paludis/repositories/cran/package_dep_spec.cc b/paludis/repositories/cran/package_dep_spec.cc
index f38d8b7..442ac29 100644
--- a/paludis/repositories/cran/package_dep_spec.cc
+++ b/paludis/repositories/cran/package_dep_spec.cc
@@ -23,9 +23,9 @@
#include <paludis/util/tokeniser.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/options.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/dep_spec.hh>
#include <paludis/version_operator.hh>
#include <paludis/version_spec.hh>
diff --git a/paludis/repositories/e/dep_parser.cc b/paludis/repositories/e/dep_parser.cc
index ae72788..70f8dbc 100644
--- a/paludis/repositories/e/dep_parser.cc
+++ b/paludis/repositories/e/dep_parser.cc
@@ -20,7 +20,6 @@
#include <paludis/repositories/e/dep_parser.hh>
#include <paludis/repositories/e/eapi.hh>
#include <paludis/util/stringify.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/options.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/make_named_values.hh>
@@ -323,7 +322,7 @@ paludis::erepository::parse_depend(const std::string & s,
ParseStackTypes<DependencySpecTree>::Stack stack;
std::shared_ptr<AllDepSpec> spec(new AllDepSpec);
std::shared_ptr<DepSpec> thing_to_annotate(spec);
- std::shared_ptr<DependencySpecTree> top(make_shared_ptr(new DependencySpecTree(spec)));
+ std::shared_ptr<DependencySpecTree> top(std::make_shared<DependencySpecTree>(spec));
stack.push_front(make_named_values<ParseStackTypes<DependencySpecTree>::Item>(
n::item() = top->root(),
n::spec() = spec
@@ -366,7 +365,7 @@ paludis::erepository::parse_provide(const std::string & s,
ParseStackTypes<ProvideSpecTree>::Stack stack;
std::shared_ptr<AllDepSpec> spec(new AllDepSpec);
std::shared_ptr<DepSpec> thing_to_annotate(spec);
- std::shared_ptr<ProvideSpecTree> top(make_shared_ptr(new ProvideSpecTree(spec)));
+ std::shared_ptr<ProvideSpecTree> top(std::make_shared<ProvideSpecTree>(spec));
stack.push_front(make_named_values<ParseStackTypes<ProvideSpecTree>::Item>(
n::item() = top->root(),
n::spec() = spec
@@ -405,7 +404,7 @@ paludis::erepository::parse_fetchable_uri(const std::string & s,
ParseStackTypes<FetchableURISpecTree>::Stack stack;
std::shared_ptr<AllDepSpec> spec(new AllDepSpec);
std::shared_ptr<DepSpec> thing_to_annotate(spec);
- std::shared_ptr<FetchableURISpecTree> top(make_shared_ptr(new FetchableURISpecTree(spec)));
+ std::shared_ptr<FetchableURISpecTree> top(std::make_shared<FetchableURISpecTree>(spec));
stack.push_front(make_named_values<ParseStackTypes<FetchableURISpecTree>::Item>(
n::item() = top->root(),
n::spec() = spec
@@ -448,7 +447,7 @@ paludis::erepository::parse_simple_uri(const std::string & s,
ParseStackTypes<SimpleURISpecTree>::Stack stack;
std::shared_ptr<AllDepSpec> spec(new AllDepSpec);
std::shared_ptr<DepSpec> thing_to_annotate(spec);
- std::shared_ptr<SimpleURISpecTree> top(make_shared_ptr(new SimpleURISpecTree(spec)));
+ std::shared_ptr<SimpleURISpecTree> top(std::make_shared<SimpleURISpecTree>(spec));
stack.push_front(make_named_values<ParseStackTypes<SimpleURISpecTree>::Item>(
n::item() = top->root(),
n::spec() = spec
@@ -487,7 +486,7 @@ paludis::erepository::parse_license(const std::string & s,
ParseStackTypes<LicenseSpecTree>::Stack stack;
std::shared_ptr<AllDepSpec> spec(new AllDepSpec);
std::shared_ptr<DepSpec> thing_to_annotate(spec);
- std::shared_ptr<LicenseSpecTree> top(make_shared_ptr(new LicenseSpecTree(spec)));
+ std::shared_ptr<LicenseSpecTree> top(std::make_shared<LicenseSpecTree>(spec));
stack.push_front(make_named_values<ParseStackTypes<LicenseSpecTree>::Item>(
n::item() = top->root(),
n::spec() = spec
@@ -526,7 +525,7 @@ paludis::erepository::parse_plain_text(const std::string & s,
ParseStackTypes<PlainTextSpecTree>::Stack stack;
std::shared_ptr<AllDepSpec> spec(new AllDepSpec);
std::shared_ptr<DepSpec> thing_to_annotate(spec);
- std::shared_ptr<PlainTextSpecTree> top(make_shared_ptr(new PlainTextSpecTree(spec)));
+ std::shared_ptr<PlainTextSpecTree> top(std::make_shared<PlainTextSpecTree>(spec));
stack.push_front(make_named_values<ParseStackTypes<PlainTextSpecTree>::Item>(
n::item() = top->root(),
n::spec() = spec
@@ -565,7 +564,7 @@ paludis::erepository::parse_myoptions(const std::string & s,
ParseStackTypes<PlainTextSpecTree>::Stack stack;
std::shared_ptr<AllDepSpec> spec(new AllDepSpec);
std::shared_ptr<DepSpec> thing_to_annotate(spec);
- std::shared_ptr<PlainTextSpecTree> top(make_shared_ptr(new PlainTextSpecTree(spec)));
+ std::shared_ptr<PlainTextSpecTree> top(std::make_shared<PlainTextSpecTree>(spec));
stack.push_front(make_named_values<ParseStackTypes<PlainTextSpecTree>::Item>(
n::item() = top->root(),
n::spec() = spec
@@ -612,17 +611,17 @@ paludis::erepository::parse_uri_label(const std::string & s, const EAPI & e)
std::shared_ptr<URILabelsDepSpec> l(new URILabelsDepSpec);
if (c == "URIMirrorsThenListedLabel")
- l->add_label(make_shared_ptr(new URIMirrorsThenListedLabel(s.substr(0, s.length() - 1))));
+ l->add_label(std::make_shared<URIMirrorsThenListedLabel>(s.substr(0, s.length() - 1)));
else if (c == "URIMirrorsOnlyLabel")
- l->add_label(make_shared_ptr(new URIMirrorsOnlyLabel(s.substr(0, s.length() - 1))));
+ l->add_label(std::make_shared<URIMirrorsOnlyLabel>(s.substr(0, s.length() - 1)));
else if (c == "URIListedOnlyLabel")
- l->add_label(make_shared_ptr(new URIListedOnlyLabel(s.substr(0, s.length() - 1))));
+ l->add_label(std::make_shared<URIListedOnlyLabel>(s.substr(0, s.length() - 1)));
else if (c == "URIListedThenMirrorsLabel")
- l->add_label(make_shared_ptr(new URIListedThenMirrorsLabel(s.substr(0, s.length() - 1))));
+ l->add_label(std::make_shared<URIListedThenMirrorsLabel>(s.substr(0, s.length() - 1)));
else if (c == "URILocalMirrorsOnlyLabel")
- l->add_label(make_shared_ptr(new URILocalMirrorsOnlyLabel(s.substr(0, s.length() - 1))));
+ l->add_label(std::make_shared<URILocalMirrorsOnlyLabel>(s.substr(0, s.length() - 1)));
else if (c == "URIManualOnlyLabel")
- l->add_label(make_shared_ptr(new URIManualOnlyLabel(s.substr(0, s.length() - 1))));
+ l->add_label(std::make_shared<URIManualOnlyLabel>(s.substr(0, s.length() - 1)));
else
throw EDepParseError(s, "Label '" + s + "' maps to unknown class '" + c + "'");
@@ -641,7 +640,7 @@ paludis::erepository::parse_plain_text_label(const std::string & s)
if (c.empty())
throw EDepParseError(s, "Unknown label");
- return make_shared_ptr(new PlainTextLabelDepSpec(s));
+ return std::make_shared<PlainTextLabelDepSpec>(s);
}
namespace
@@ -697,7 +696,7 @@ paludis::erepository::parse_dependency_label(
{
Log::get_instance()->message("e.dep_parser.obsolete_label_syntax", ll_warning, lc_context)
<< "Label '" << *it << "' uses commas, which are obsolete, so treating it as a build label instead";
- l->add_label(make_shared_ptr(new DependenciesBuildLabel(*it, return_literal_function(true))));
+ l->add_label(std::make_shared<DependenciesBuildLabel>(*it, return_literal_function(true)));
continue;
}
@@ -713,34 +712,34 @@ paludis::erepository::parse_dependency_label(
}
if (c == "DependenciesBuildLabel")
- l->add_label(make_shared_ptr(new DependenciesBuildLabel(*it, return_literal_function(true))));
+ l->add_label(std::make_shared<DependenciesBuildLabel>(*it, return_literal_function(true)));
else if (c == "DependenciesRunLabel")
- l->add_label(make_shared_ptr(new DependenciesRunLabel(*it, return_literal_function(true))));
+ l->add_label(std::make_shared<DependenciesRunLabel>(*it, return_literal_function(true)));
else if (c == "DependenciesPostLabel")
- l->add_label(make_shared_ptr(new DependenciesPostLabel(*it, return_literal_function(true))));
+ l->add_label(std::make_shared<DependenciesPostLabel>(*it, return_literal_function(true)));
else if (c == "DependenciesInstallLabel")
- l->add_label(make_shared_ptr(new DependenciesInstallLabel(*it, return_literal_function(true))));
+ l->add_label(std::make_shared<DependenciesInstallLabel>(*it, return_literal_function(true)));
else if (c == "DependenciesCompileAgainstLabel")
- l->add_label(make_shared_ptr(new DependenciesCompileAgainstLabel(*it, return_literal_function(true))));
+ l->add_label(std::make_shared<DependenciesCompileAgainstLabel>(*it, return_literal_function(true)));
else if (c == "DependenciesFetchLabel")
- l->add_label(make_shared_ptr(new DependenciesFetchLabel(*it, return_literal_function(true))));
+ l->add_label(std::make_shared<DependenciesFetchLabel>(*it, return_literal_function(true)));
else if (c == "DependenciesSuggestionLabel")
- l->add_label(make_shared_ptr(new DependenciesSuggestionLabel(*it, return_literal_function(true))));
+ l->add_label(std::make_shared<DependenciesSuggestionLabel>(*it, return_literal_function(true)));
else if (c == "DependenciesRecommendationLabel")
- l->add_label(make_shared_ptr(new DependenciesRecommendationLabel(*it, return_literal_function(true))));
+ l->add_label(std::make_shared<DependenciesRecommendationLabel>(*it, return_literal_function(true)));
else if (c == "DependenciesTestLabel")
{
if (cc.empty())
- l->add_label(make_shared_ptr(new DependenciesTestLabel(*it, return_literal_function(true))));
+ l->add_label(std::make_shared<DependenciesTestLabel>(*it, return_literal_function(true)));
else
- l->add_label(make_shared_ptr(new DependenciesTestLabel(*it, std::bind(
- &enabled_if_option, id, *it, ChoiceNameWithPrefix(cc)))));
+ l->add_label(std::make_shared<DependenciesTestLabel>(*it, std::bind(
+ &enabled_if_option, id, *it, ChoiceNameWithPrefix(cc))));
}
else if (c == "WarnAndIgnore")
{
Log::get_instance()->message("e.dep_parser.obsolete_label", ll_warning, lc_context)
<< "Label '" << *it << "' no longer exists, pretending it's a build label instead";
- l->add_label(make_shared_ptr(new DependenciesBuildLabel(*it, return_literal_function(true))));
+ l->add_label(std::make_shared<DependenciesBuildLabel>(*it, return_literal_function(true)));
}
else
throw EDepParseError(s, "Label '" + *it + "' maps to unknown class '" + c + "'");
diff --git a/paludis/repositories/e/depend_rdepend_TEST.cc b/paludis/repositories/e/depend_rdepend_TEST.cc
index 7755df5..d63e6d9 100644
--- a/paludis/repositories/e/depend_rdepend_TEST.cc
+++ b/paludis/repositories/e/depend_rdepend_TEST.cc
@@ -21,7 +21,6 @@
#include <paludis/repositories/e/vdb_repository.hh>
#include <paludis/environments/test/test_environment.hh>
#include <paludis/util/map.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/sequence.hh>
@@ -52,7 +51,7 @@ namespace
std::shared_ptr<OutputManager> make_standard_output_manager(const Action &)
{
- return make_shared_ptr(new StandardOutputManager);
+ return std::make_shared<StandardOutputManager>();
}
std::string from_keys(const std::shared_ptr<const Map<std::string, std::string> > & m,
@@ -150,7 +149,7 @@ namespace
n::destination() = v_repo,
n::make_output_manager() = &make_standard_output_manager,
n::perform_uninstall() = &cannot_uninstall,
- n::replacing() = make_shared_ptr(new PackageIDSequence),
+ n::replacing() = std::make_shared<PackageIDSequence>(),
n::want_phase() = &want_all_phases
));
diff --git a/paludis/repositories/e/dependencies_rewriter.cc b/paludis/repositories/e/dependencies_rewriter.cc
index bdec731..5c5329f 100644
--- a/paludis/repositories/e/dependencies_rewriter.cc
+++ b/paludis/repositories/e/dependencies_rewriter.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2008, 2009, 2010 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
@@ -20,7 +20,6 @@
#include <paludis/repositories/e/dependencies_rewriter.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/stringify.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/return_literal_function.hh>
#include <paludis/util/save.hh>
#include <paludis/util/indirect_iterator-impl.hh>
@@ -75,8 +74,8 @@ namespace paludis
Implementation() :
default_labels(new DependenciesLabelSequence)
{
- default_labels->push_back(make_shared_ptr(new DependenciesBuildLabel("build", return_literal_function(true))));
- default_labels->push_back(make_shared_ptr(new DependenciesRunLabel("run", return_literal_function(true))));
+ default_labels->push_back(std::make_shared<DependenciesBuildLabel>("build", return_literal_function(true)));
+ default_labels->push_back(std::make_shared<DependenciesRunLabel>("run", return_literal_function(true)));
labels.push_front(default_labels);
}
};
diff --git a/paludis/repositories/e/e_choices_key.cc b/paludis/repositories/e/e_choices_key.cc
index 8343519..bde164d 100644
--- a/paludis/repositories/e/e_choices_key.cc
+++ b/paludis/repositories/e/e_choices_key.cc
@@ -32,7 +32,6 @@
#include <paludis/util/mutex.hh>
#include <paludis/util/join.hh>
#include <paludis/util/simple_visitor_cast.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/tribool.hh>
#include <paludis/util/member_iterator-impl.hh>
#include <paludis/util/map-impl.hh>
diff --git a/paludis/repositories/e/e_installed_repository.cc b/paludis/repositories/e/e_installed_repository.cc
index 64c9035..df915b7 100644
--- a/paludis/repositories/e/e_installed_repository.cc
+++ b/paludis/repositories/e/e_installed_repository.cc
@@ -30,7 +30,6 @@
#include <paludis/util/stringify.hh>
#include <paludis/util/log.hh>
#include <paludis/util/set.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/strip.hh>
#include <paludis/util/system.hh>
#include <paludis/util/map.hh>
@@ -177,7 +176,7 @@ EInstalledRepository::is_unimportant() const
std::shared_ptr<const CategoryNamePartSet>
EInstalledRepository::unimportant_category_names() const
{
- std::shared_ptr<CategoryNamePartSet> result(make_shared_ptr(new CategoryNamePartSet));
+ std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
result->insert(CategoryNamePart("virtual"));
return result;
}
@@ -251,7 +250,7 @@ EInstalledRepository::perform_config(
n::ebuild_file() = ver_dir / (stringify(id->name().package()) + "-" + stringify(id->version()) + ".ebuild"),
n::eclassdirs() = eclassdirs,
n::environment() = _imp->params.environment(),
- n::exlibsdirs() = make_shared_ptr(new FSEntrySequence),
+ n::exlibsdirs() = std::make_shared<FSEntrySequence>(),
n::files_dir() = ver_dir,
n::maybe_output_manager() = output_manager,
n::package_builddir() = _imp->params.builddir() / (stringify(id->name().category()) + "-" + stringify(id->name().package()) + "-" + stringify(id->version()) + "-config"),
@@ -360,7 +359,7 @@ EInstalledRepository::perform_info(
n::ebuild_file() = ver_dir / (stringify(id->name().package()) + "-" + stringify(id->version()) + ".ebuild"),
n::eclassdirs() = eclassdirs,
n::environment() = _imp->params.environment(),
- n::exlibsdirs() = make_shared_ptr(new FSEntrySequence),
+ n::exlibsdirs() = std::make_shared<FSEntrySequence>(),
n::files_dir() = ver_dir,
n::maybe_output_manager() = output_manager,
n::package_builddir() = _imp->params.builddir() / (stringify(id->name().category()) + "-" + stringify(id->name().package()) + "-" + stringify(id->version()) + "-info"),
@@ -373,11 +372,11 @@ EInstalledRepository::perform_info(
),
make_named_values<EbuildInfoCommandParams>(
- n::expand_vars() = make_shared_ptr(new Map<std::string, std::string>),
- n::info_vars() = i ? i : make_shared_ptr(new const Set<std::string>),
+ n::expand_vars() = std::make_shared<Map<std::string, std::string> >(),
+ n::info_vars() = i ? i : std::make_shared<const Set<std::string> >(),
n::load_environment() = load_env.get(),
- n::profiles() = make_shared_ptr(new FSEntrySequence),
- n::profiles_with_parents() = make_shared_ptr(new FSEntrySequence),
+ n::profiles() = std::make_shared<FSEntrySequence>(),
+ n::profiles_with_parents() = std::make_shared<FSEntrySequence>(),
n::use() = "",
n::use_ebuild_file() = false,
n::use_expand() = "",
diff --git a/paludis/repositories/e/e_installed_repository_id.cc b/paludis/repositories/e/e_installed_repository_id.cc
index ba1db6d..28b1142 100644
--- a/paludis/repositories/e/e_installed_repository_id.cc
+++ b/paludis/repositories/e/e_installed_repository_id.cc
@@ -39,11 +39,11 @@
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/strip.hh>
#include <paludis/util/mutex.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/return_literal_function.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/output_manager.hh>
#include <paludis/literal_metadata_key.hh>
#include <paludis/user_dep_spec.hh>
@@ -144,17 +144,17 @@ namespace paludis
run_dependencies_labels(new DependenciesLabelSequence),
post_dependencies_labels(new DependenciesLabelSequence)
{
- raw_dependencies_labels->push_back(make_shared_ptr(new DependenciesBuildLabel("build",
- return_literal_function(true))));
- raw_dependencies_labels->push_back(make_shared_ptr(new DependenciesRunLabel("run",
- return_literal_function(true))));
-
- build_dependencies_labels->push_back(make_shared_ptr(new DependenciesBuildLabel("DEPEND",
- return_literal_function(true))));
- run_dependencies_labels->push_back(make_shared_ptr(new DependenciesRunLabel("RDEPEND",
- return_literal_function(true))));
- post_dependencies_labels->push_back(make_shared_ptr(new DependenciesPostLabel("PDEPEND",
- return_literal_function(true))));
+ raw_dependencies_labels->push_back(std::make_shared<DependenciesBuildLabel>("build",
+ return_literal_function(true)));
+ raw_dependencies_labels->push_back(std::make_shared<DependenciesRunLabel>("run",
+ return_literal_function(true)));
+
+ build_dependencies_labels->push_back(std::make_shared<DependenciesBuildLabel>("DEPEND",
+ return_literal_function(true)));
+ run_dependencies_labels->push_back(std::make_shared<DependenciesRunLabel>("RDEPEND",
+ return_literal_function(true)));
+ post_dependencies_labels->push_back(std::make_shared<DependenciesPostLabel>("PDEPEND",
+ return_literal_function(true)));
}
};
}
@@ -192,7 +192,7 @@ EInstalledRepositoryID::need_keys_added() const
Context context("When loading ID keys from '" + stringify(_imp->dir) + "':");
- add_metadata_key(make_shared_ptr(new LiteralMetadataValueKey<std::string>("EAPI", "EAPI", mkt_internal, eapi()->name())));
+ add_metadata_key(std::make_shared<LiteralMetadataValueKey<std::string>>("EAPI", "EAPI", mkt_internal, eapi()->name()));
if (! eapi()->supported())
{
@@ -1028,8 +1028,8 @@ EInstalledRepositoryID::make_choice_value(const std::shared_ptr<const Choice> &
if (raw_use_key())
enabled = (raw_use_key()->value()->end() != raw_use_key()->value()->find(name_with_prefix));
- return make_shared_ptr(new EChoiceValue(c->prefix(), v, ChoiceNameWithPrefix(name_with_prefix), name(), std::shared_ptr<const UseDesc>(),
- enabled, enabled, true, explicitly_listed, override_description, ""));
+ return std::make_shared<EChoiceValue>(c->prefix(), v, ChoiceNameWithPrefix(name_with_prefix), name(), std::shared_ptr<const UseDesc>(),
+ enabled, enabled, true, explicitly_listed, override_description, "");
}
void
@@ -1049,8 +1049,8 @@ EInstalledRepositoryID::add_build_options(const std::shared_ptr<Choices> & choic
choices->add(build_options);
/* trace */
- build_options->add(make_shared_ptr(new ELikeTraceChoiceValue(
- shared_from_this(), _imp->environment, build_options)));
+ build_options->add(std::make_shared<ELikeTraceChoiceValue>(
+ shared_from_this(), _imp->environment, build_options));
}
}
diff --git a/paludis/repositories/e/e_key.cc b/paludis/repositories/e/e_key.cc
index 11f4766..087793c 100644
--- a/paludis/repositories/e/e_key.cc
+++ b/paludis/repositories/e/e_key.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010 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
@@ -35,7 +35,6 @@
#include <paludis/util/mutex.hh>
#include <paludis/util/join.hh>
#include <paludis/util/create_iterator-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/tribool.hh>
#include <paludis/util/member_iterator-impl.hh>
#include <paludis/util/sequence.hh>
@@ -1012,9 +1011,9 @@ EContentsKey::value() const
if ("obj" == tokens.at(0))
{
std::shared_ptr<ContentsEntry> e(new ContentsFileEntry(tokens.at(1)));
- e->add_metadata_key(make_shared_ptr(new LiteralMetadataTimeKey("mtime", "mtime", mkt_normal,
- Timestamp(destringify<time_t>(tokens.at(3)), 0))));
- e->add_metadata_key(make_shared_ptr(new LiteralMetadataValueKey<std::string>("md5", "md5", mkt_normal, tokens.at(2))));
+ e->add_metadata_key(std::make_shared<LiteralMetadataTimeKey>("mtime", "mtime", mkt_normal,
+ Timestamp(destringify<time_t>(tokens.at(3)), 0)));
+ e->add_metadata_key(std::make_shared<LiteralMetadataValueKey<std::string>>("md5", "md5", mkt_normal, tokens.at(2)));
_imp->value->add(e);
}
else if ("dir" == tokens.at(0))
@@ -1025,8 +1024,8 @@ EContentsKey::value() const
else if ("sym" == tokens.at(0))
{
std::shared_ptr<ContentsEntry> e(new ContentsSymEntry(tokens.at(1), tokens.at(2)));
- e->add_metadata_key(make_shared_ptr(new LiteralMetadataTimeKey("mtime", "mtime", mkt_normal,
- Timestamp(destringify<time_t>(tokens.at(3)), 0))));
+ e->add_metadata_key(std::make_shared<LiteralMetadataTimeKey>("mtime", "mtime", mkt_normal,
+ Timestamp(destringify<time_t>(tokens.at(3)), 0)));
_imp->value->add(e);
}
else if ("misc" == tokens.at(0) || "fif" == tokens.at(0) || "dev" == tokens.at(0))
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index 1514661..64a7a08 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -75,7 +75,7 @@
#include <paludis/util/iterator_funcs.hh>
#include <paludis/util/log.hh>
#include <paludis/util/make_named_values.hh>
-#include <paludis/util/make_shared_ptr.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/util/make_shared_copy.hh>
#include <paludis/util/map.hh>
#include <paludis/util/mutex.hh>
@@ -216,7 +216,7 @@ namespace paludis
mutable EAPIForFileMap eapi_for_file_map;
- Implementation(ERepository * const, const ERepositoryParams &, std::shared_ptr<Mutexes> = make_shared_ptr(new Mutexes));
+ Implementation(ERepository * const, const ERepositoryParams &, std::shared_ptr<Mutexes> = std::make_shared<Mutexes>());
~Implementation();
void need_profiles() const;
@@ -326,14 +326,14 @@ namespace paludis
layout->info_packages_files()->end(),
std::bind(std::mem_fn(&FSEntry::is_regular_file_or_symlink_to_regular_file),
std::placeholders::_1)) ?
- make_shared_ptr(new InfoPkgsMetadataKey(params.environment(), layout->info_packages_files(), repo)) :
+ std::make_shared<InfoPkgsMetadataKey>(params.environment(), layout->info_packages_files(), repo) :
std::shared_ptr<InfoPkgsMetadataKey>()
),
info_vars_key(layout->info_variables_files()->end() != std::find_if(layout->info_variables_files()->begin(),
layout->info_variables_files()->end(),
std::bind(std::mem_fn(&FSEntry::is_regular_file_or_symlink_to_regular_file),
std::placeholders::_1)) ?
- make_shared_ptr(new InfoVarsMetadataKey(layout->info_variables_files())) :
+ std::make_shared<InfoVarsMetadataKey>(layout->info_variables_files()) :
std::shared_ptr<InfoVarsMetadataKey>()
),
#ifdef ENABLE_PBINS
@@ -360,20 +360,20 @@ namespace paludis
KeyValueConfigFile k(params.location() / "metadata" / "about.conf", KeyValueConfigFileOptions(),
&KeyValueConfigFile::no_defaults, &KeyValueConfigFile::no_transformation);
if (! k.get("description").empty())
- about_keys.push_back(make_shared_ptr(new LiteralMetadataValueKey<std::string>("description", "description",
- mkt_significant, k.get("description"))));
+ about_keys.push_back(std::make_shared<LiteralMetadataValueKey<std::string>>("description", "description",
+ mkt_significant, k.get("description")));
if (! k.get("summary").empty())
- about_keys.push_back(make_shared_ptr(new LiteralMetadataValueKey<std::string>("summary", "summary",
- mkt_significant, k.get("summary"))));
+ about_keys.push_back(std::make_shared<LiteralMetadataValueKey<std::string>>("summary", "summary",
+ mkt_significant, k.get("summary")));
if (! k.get("status").empty())
- about_keys.push_back(make_shared_ptr(new LiteralMetadataValueKey<std::string>("status", "status",
- mkt_significant, k.get("status"))));
+ about_keys.push_back(std::make_shared<LiteralMetadataValueKey<std::string>>("status", "status",
+ mkt_significant, k.get("status")));
if (! k.get("maintainer").empty())
- about_keys.push_back(make_shared_ptr(new LiteralMetadataValueKey<std::string>("maintainer", "maintainer",
- mkt_significant, k.get("maintainer"))));
+ about_keys.push_back(std::make_shared<LiteralMetadataValueKey<std::string>>("maintainer", "maintainer",
+ mkt_significant, k.get("maintainer")));
if (! k.get("homepage").empty())
- about_keys.push_back(make_shared_ptr(new LiteralMetadataValueKey<std::string>("homepage", "homepage",
- mkt_significant, k.get("homepage"))));
+ about_keys.push_back(std::make_shared<LiteralMetadataValueKey<std::string>>("homepage", "homepage",
+ mkt_significant, k.get("homepage")));
}
FSEntry mtf(params.location() / "metadata" / "timestamp");
@@ -1000,7 +1000,7 @@ ERepository::perform_hook(const Hook & hook)
std::shared_ptr<const CategoryNamePartSet>
ERepository::unimportant_category_names() const
{
- std::shared_ptr<CategoryNamePartSet> result(make_shared_ptr(new CategoryNamePartSet));
+ std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
result->insert(CategoryNamePart("virtual"));
return result;
}
@@ -1912,7 +1912,7 @@ namespace
{
MirrorMap::const_iterator i(map.find(m));
if (i == map.end())
- return make_shared_ptr(new MirrorsSequence);
+ return std::make_shared<MirrorsSequence>();
else
return i->second;
}
@@ -2614,7 +2614,7 @@ ERepository::info(const std::shared_ptr<const ERepositoryID> & id,
make_named_values<EbuildInfoCommandParams>(
n::expand_vars() = expand_vars,
n::info_vars() = info_vars_key() ?
- info_vars_key()->value() : make_shared_ptr(new const Set<std::string>),
+ info_vars_key()->value() : std::make_shared<const Set<std::string>>(),
n::load_environment() = static_cast<const FSEntry *>(0),
n::profiles() = _imp->params.profiles(),
n::profiles_with_parents() = profile()->profiles_with_parents(),
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index e2abb8b..8683ff7 100644
--- a/paludis/repositories/e/e_repository_TEST.cc
+++ b/paludis/repositories/e/e_repository_TEST.cc
@@ -29,7 +29,6 @@
#include <paludis/util/system.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/map.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/set.hh>
#include <paludis/util/return_literal_function.hh>
@@ -70,7 +69,7 @@ namespace
std::shared_ptr<OutputManager> make_standard_output_manager(const Action &)
{
- return make_shared_ptr(new StandardOutputManager);
+ return std::make_shared<StandardOutputManager>();
}
std::string from_keys(const std::shared_ptr<const Map<std::string, std::string> > & m,
@@ -936,7 +935,7 @@ namespace test_cases
env.package_database()->add_repository(1, repo);
FetchAction action(make_named_values<FetchActionOptions>(
- n::errors() = make_shared_ptr(new Sequence<FetchActionFailure>),
+ n::errors() = std::make_shared<Sequence<FetchActionFailure>>(),
n::exclude_unmirrorable() = false,
n::fetch_parts() = FetchParts() + fp_regulars + fp_extras,
n::ignore_not_in_manifest() = false,
@@ -1045,7 +1044,7 @@ namespace test_cases
env.package_database()->add_repository(1, repo);
FetchAction action(make_named_values<FetchActionOptions>(
- n::errors() = make_shared_ptr(new Sequence<FetchActionFailure>),
+ n::errors() = std::make_shared<Sequence<FetchActionFailure>>(),
n::exclude_unmirrorable() = false,
n::fetch_parts() = FetchParts() + fp_regulars + fp_extras,
n::ignore_not_in_manifest() = false,
diff --git a/paludis/repositories/e/e_repository_TEST_0.cc b/paludis/repositories/e/e_repository_TEST_0.cc
index f43bcee..85711c2 100644
--- a/paludis/repositories/e/e_repository_TEST_0.cc
+++ b/paludis/repositories/e/e_repository_TEST_0.cc
@@ -29,7 +29,6 @@
#include <paludis/util/system.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/map.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/set.hh>
#include <paludis/standard_output_manager.hh>
@@ -66,7 +65,7 @@ namespace
std::shared_ptr<OutputManager> make_standard_output_manager(const Action &)
{
- return make_shared_ptr(new StandardOutputManager);
+ return std::make_shared<StandardOutputManager>();
}
std::string from_keys(const std::shared_ptr<const Map<std::string, std::string> > & m,
@@ -154,7 +153,7 @@ namespace test_cases
n::destination() = installed_repo,
n::make_output_manager() = &make_standard_output_manager,
n::perform_uninstall() = &cannot_uninstall,
- n::replacing() = make_shared_ptr(new PackageIDSequence),
+ n::replacing() = std::make_shared<PackageIDSequence>(),
n::want_phase() = &want_all_phases
));
diff --git a/paludis/repositories/e/e_repository_TEST_1.cc b/paludis/repositories/e/e_repository_TEST_1.cc
index 67a4293..1bfbec5 100644
--- a/paludis/repositories/e/e_repository_TEST_1.cc
+++ b/paludis/repositories/e/e_repository_TEST_1.cc
@@ -29,7 +29,6 @@
#include <paludis/util/system.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/map.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/set.hh>
#include <paludis/standard_output_manager.hh>
@@ -66,7 +65,7 @@ namespace
std::shared_ptr<OutputManager> make_standard_output_manager(const Action &)
{
- return make_shared_ptr(new StandardOutputManager);
+ return std::make_shared<StandardOutputManager>();
}
std::string from_keys(const std::shared_ptr<const Map<std::string, std::string> > & m,
@@ -133,7 +132,7 @@ namespace test_cases
n::destination() = installed_repo,
n::make_output_manager() = &make_standard_output_manager,
n::perform_uninstall() = &cannot_uninstall,
- n::replacing() = make_shared_ptr(new PackageIDSequence),
+ n::replacing() = std::make_shared<PackageIDSequence>(),
n::want_phase() = &want_all_phases
));
diff --git a/paludis/repositories/e/e_repository_TEST_2.cc b/paludis/repositories/e/e_repository_TEST_2.cc
index 38ead40..617c2fb 100644
--- a/paludis/repositories/e/e_repository_TEST_2.cc
+++ b/paludis/repositories/e/e_repository_TEST_2.cc
@@ -29,7 +29,6 @@
#include <paludis/util/system.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/map.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/set.hh>
#include <paludis/standard_output_manager.hh>
@@ -66,7 +65,7 @@ namespace
std::shared_ptr<OutputManager> make_standard_output_manager(const Action &)
{
- return make_shared_ptr(new StandardOutputManager);
+ return std::make_shared<StandardOutputManager>();
}
std::string from_keys(const std::shared_ptr<const Map<std::string, std::string> > & m,
@@ -133,7 +132,7 @@ namespace test_cases
n::destination() = installed_repo,
n::make_output_manager() = &make_standard_output_manager,
n::perform_uninstall() = &cannot_uninstall,
- n::replacing() = make_shared_ptr(new PackageIDSequence),
+ n::replacing() = std::make_shared<PackageIDSequence>(),
n::want_phase() = &want_all_phases
));
diff --git a/paludis/repositories/e/e_repository_TEST_3.cc b/paludis/repositories/e/e_repository_TEST_3.cc
index d60d280..636f7bb 100644
--- a/paludis/repositories/e/e_repository_TEST_3.cc
+++ b/paludis/repositories/e/e_repository_TEST_3.cc
@@ -29,7 +29,6 @@
#include <paludis/util/system.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/map.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/set.hh>
#include <paludis/standard_output_manager.hh>
@@ -66,7 +65,7 @@ namespace
std::shared_ptr<OutputManager> make_standard_output_manager(const Action &)
{
- return make_shared_ptr(new StandardOutputManager);
+ return std::make_shared<StandardOutputManager>();
}
std::string from_keys(const std::shared_ptr<const Map<std::string, std::string> > & m,
@@ -133,7 +132,7 @@ namespace test_cases
n::destination() = installed_repo,
n::make_output_manager() = &make_standard_output_manager,
n::perform_uninstall() = &cannot_uninstall,
- n::replacing() = make_shared_ptr(new PackageIDSequence),
+ n::replacing() = std::make_shared<PackageIDSequence>(),
n::want_phase() = &want_all_phases
));
diff --git a/paludis/repositories/e/e_repository_TEST_4.cc b/paludis/repositories/e/e_repository_TEST_4.cc
index 3400b94..0bfd6d4 100644
--- a/paludis/repositories/e/e_repository_TEST_4.cc
+++ b/paludis/repositories/e/e_repository_TEST_4.cc
@@ -29,7 +29,6 @@
#include <paludis/util/system.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/map.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/set.hh>
#include <paludis/standard_output_manager.hh>
@@ -66,7 +65,7 @@ namespace
std::shared_ptr<OutputManager> make_standard_output_manager(const Action &)
{
- return make_shared_ptr(new StandardOutputManager);
+ return std::make_shared<StandardOutputManager>();
}
std::string from_keys(const std::shared_ptr<const Map<std::string, std::string> > & m,
@@ -133,7 +132,7 @@ namespace test_cases
n::destination() = installed_repo,
n::make_output_manager() = &make_standard_output_manager,
n::perform_uninstall() = &cannot_uninstall,
- n::replacing() = make_shared_ptr(new PackageIDSequence),
+ n::replacing() = std::make_shared<PackageIDSequence>(),
n::want_phase() = &want_all_phases
));
diff --git a/paludis/repositories/e/e_repository_TEST_dependencies_rewriter.cc b/paludis/repositories/e/e_repository_TEST_dependencies_rewriter.cc
index faf73c6..2ea7689 100644
--- a/paludis/repositories/e/e_repository_TEST_dependencies_rewriter.cc
+++ b/paludis/repositories/e/e_repository_TEST_dependencies_rewriter.cc
@@ -29,7 +29,6 @@
#include <paludis/util/system.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/map.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/set.hh>
#include <paludis/standard_output_manager.hh>
@@ -66,7 +65,7 @@ namespace
std::shared_ptr<OutputManager> make_standard_output_manager(const Action &)
{
- return make_shared_ptr(new StandardOutputManager);
+ return std::make_shared<StandardOutputManager>();
}
std::string from_keys(const std::shared_ptr<const Map<std::string, std::string> > & m,
diff --git a/paludis/repositories/e/e_repository_TEST_ever.cc b/paludis/repositories/e/e_repository_TEST_ever.cc
index ae6bf93..9a7fdc5 100644
--- a/paludis/repositories/e/e_repository_TEST_ever.cc
+++ b/paludis/repositories/e/e_repository_TEST_ever.cc
@@ -29,7 +29,6 @@
#include <paludis/util/system.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/map.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/set.hh>
#include <paludis/output_manager.hh>
@@ -66,7 +65,7 @@ namespace
std::shared_ptr<OutputManager> make_standard_output_manager(const Action &)
{
- return make_shared_ptr(new StandardOutputManager);
+ return std::make_shared<StandardOutputManager>();
}
std::string from_keys(const std::shared_ptr<const Map<std::string, std::string> > & m,
@@ -155,7 +154,7 @@ namespace
n::destination() = installed_repo,
n::make_output_manager() = &make_standard_output_manager,
n::perform_uninstall() = &cannot_uninstall,
- n::replacing() = make_shared_ptr(new PackageIDSequence),
+ n::replacing() = std::make_shared<PackageIDSequence>(),
n::want_phase() = &want_all_phases
));
diff --git a/paludis/repositories/e/e_repository_TEST_exheres_0.cc b/paludis/repositories/e/e_repository_TEST_exheres_0.cc
index 9a97426..8bd2a07 100644
--- a/paludis/repositories/e/e_repository_TEST_exheres_0.cc
+++ b/paludis/repositories/e/e_repository_TEST_exheres_0.cc
@@ -29,7 +29,6 @@
#include <paludis/util/system.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/map.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/set.hh>
#include <paludis/standard_output_manager.hh>
@@ -66,7 +65,7 @@ namespace
std::shared_ptr<OutputManager> make_standard_output_manager(const Action &)
{
- return make_shared_ptr(new StandardOutputManager);
+ return std::make_shared<StandardOutputManager>();
}
std::string from_keys(const std::shared_ptr<const Map<std::string, std::string> > & m,
@@ -152,7 +151,7 @@ namespace test_cases
n::destination() = installed_repo,
n::make_output_manager() = &make_standard_output_manager,
n::perform_uninstall() = &cannot_uninstall,
- n::replacing() = make_shared_ptr(new PackageIDSequence),
+ n::replacing() = std::make_shared<PackageIDSequence>(),
n::want_phase() = &want_all_phases
));
diff --git a/paludis/repositories/e/e_repository_TEST_exlibs.cc b/paludis/repositories/e/e_repository_TEST_exlibs.cc
index 1cb9241..a678bba 100644
--- a/paludis/repositories/e/e_repository_TEST_exlibs.cc
+++ b/paludis/repositories/e/e_repository_TEST_exlibs.cc
@@ -30,7 +30,6 @@
#include <paludis/util/system.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/map.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/set.hh>
#include <paludis/package_id.hh>
@@ -66,7 +65,7 @@ namespace
std::shared_ptr<OutputManager> make_standard_output_manager(const Action &)
{
- return make_shared_ptr(new StandardOutputManager);
+ return std::make_shared<StandardOutputManager>();
}
std::string from_keys(const std::shared_ptr<const Map<std::string, std::string> > & m,
@@ -149,7 +148,7 @@ namespace
n::destination() = installed_repo,
n::make_output_manager() = &make_standard_output_manager,
n::perform_uninstall() = &cannot_uninstall,
- n::replacing() = make_shared_ptr(new PackageIDSequence),
+ n::replacing() = std::make_shared<PackageIDSequence>(),
n::want_phase() = &want_all_phases
));
diff --git a/paludis/repositories/e/e_repository_TEST_pbin.cc b/paludis/repositories/e/e_repository_TEST_pbin.cc
index f8b7a19..7be5f65 100644
--- a/paludis/repositories/e/e_repository_TEST_pbin.cc
+++ b/paludis/repositories/e/e_repository_TEST_pbin.cc
@@ -29,7 +29,6 @@
#include <paludis/util/system.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/map.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/set.hh>
#include <paludis/standard_output_manager.hh>
@@ -66,7 +65,7 @@ namespace
std::shared_ptr<OutputManager> make_standard_output_manager(const Action &)
{
- return make_shared_ptr(new StandardOutputManager);
+ return std::make_shared<StandardOutputManager>();
}
std::string from_keys(const std::shared_ptr<const Map<std::string, std::string> > & m,
@@ -164,7 +163,7 @@ namespace test_cases
n::destination() = b_repo,
n::make_output_manager() = &make_standard_output_manager,
n::perform_uninstall() = &cannot_uninstall,
- n::replacing() = make_shared_ptr(new PackageIDSequence),
+ n::replacing() = std::make_shared<PackageIDSequence>(),
n::want_phase() = &want_all_phases
));
@@ -185,7 +184,7 @@ namespace test_cases
n::destination() = v_repo,
n::make_output_manager() = &make_standard_output_manager,
n::perform_uninstall() = &cannot_uninstall,
- n::replacing() = make_shared_ptr(new PackageIDSequence),
+ n::replacing() = std::make_shared<PackageIDSequence>(),
n::want_phase() = &want_all_phases
));
diff --git a/paludis/repositories/e/e_repository_TEST_phases.cc b/paludis/repositories/e/e_repository_TEST_phases.cc
index da548f8..2bfdd6c 100644
--- a/paludis/repositories/e/e_repository_TEST_phases.cc
+++ b/paludis/repositories/e/e_repository_TEST_phases.cc
@@ -29,7 +29,6 @@
#include <paludis/util/system.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/map.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/set.hh>
#include <paludis/output_manager.hh>
@@ -66,7 +65,7 @@ namespace
std::shared_ptr<OutputManager> make_standard_output_manager(const Action &)
{
- return make_shared_ptr(new StandardOutputManager);
+ return std::make_shared<StandardOutputManager>();
}
std::string from_keys(const std::shared_ptr<const Map<std::string, std::string> > & m,
@@ -165,7 +164,7 @@ namespace
n::destination() = installed_repo,
n::make_output_manager() = &make_standard_output_manager,
n::perform_uninstall() = &cannot_uninstall,
- n::replacing() = make_shared_ptr(new PackageIDSequence),
+ n::replacing() = std::make_shared<PackageIDSequence>(),
n::want_phase() = &want_all_phases
));
diff --git a/paludis/repositories/e/e_repository_TEST_replacing.cc b/paludis/repositories/e/e_repository_TEST_replacing.cc
index 1acbcf4..47f121a 100644
--- a/paludis/repositories/e/e_repository_TEST_replacing.cc
+++ b/paludis/repositories/e/e_repository_TEST_replacing.cc
@@ -23,7 +23,6 @@
#include <paludis/environments/test/test_environment.hh>
#include <paludis/repositories/fake/fake_installed_repository.hh>
#include <paludis/repositories/fake/fake_package_id.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/set.hh>
#include <paludis/util/map.hh>
@@ -59,7 +58,7 @@ namespace
std::shared_ptr<OutputManager> make_standard_output_manager(const Action &)
{
- return make_shared_ptr(new StandardOutputManager);
+ return std::make_shared<StandardOutputManager>();
}
std::string from_keys(const std::shared_ptr<const Map<std::string, std::string> > & m,
diff --git a/paludis/repositories/e/e_repository_TEST_symlink_rewriting.cc b/paludis/repositories/e/e_repository_TEST_symlink_rewriting.cc
index 0973b9f..d37e71e 100644
--- a/paludis/repositories/e/e_repository_TEST_symlink_rewriting.cc
+++ b/paludis/repositories/e/e_repository_TEST_symlink_rewriting.cc
@@ -29,7 +29,6 @@
#include <paludis/util/system.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/map.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/set.hh>
#include <paludis/standard_output_manager.hh>
@@ -66,7 +65,7 @@ namespace
std::shared_ptr<OutputManager> make_standard_output_manager(const Action &)
{
- return make_shared_ptr(new StandardOutputManager);
+ return std::make_shared<StandardOutputManager>();
}
std::string from_keys(const std::shared_ptr<const Map<std::string, std::string> > & m,
@@ -137,7 +136,7 @@ namespace test_cases
n::destination() = installed_repo,
n::make_output_manager() = &make_standard_output_manager,
n::perform_uninstall() = &cannot_uninstall,
- n::replacing() = make_shared_ptr(new PackageIDSequence),
+ n::replacing() = std::make_shared<PackageIDSequence>(),
n::want_phase() = &want_all_phases
));
diff --git a/paludis/repositories/e/e_repository_sets.cc b/paludis/repositories/e/e_repository_sets.cc
index 095b39e..bc281c1 100644
--- a/paludis/repositories/e/e_repository_sets.cc
+++ b/paludis/repositories/e/e_repository_sets.cc
@@ -42,8 +42,8 @@
#include <paludis/util/tokeniser.hh>
#include <paludis/util/set.hh>
#include <paludis/util/sequence.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/dep_spec.hh>
#include <paludis/elike_slot_requirement.hh>
#include <paludis/selection.hh>
@@ -255,7 +255,7 @@ ERepositorySets::security_set(bool insecurity) const
{
Context context("When building security or insecurity package set:");
- std::shared_ptr<SetSpecTree> security_packages(new SetSpecTree(make_shared_ptr(new AllDepSpec)));
+ std::shared_ptr<SetSpecTree> security_packages(new SetSpecTree(std::make_shared<AllDepSpec>()));
if (!_imp->params.securitydir().is_directory_or_symlink_to_directory())
return security_packages;
diff --git a/paludis/repositories/e/eapi.cc b/paludis/repositories/e/eapi.cc
index 6783859..6533b98 100644
--- a/paludis/repositories/e/eapi.cc
+++ b/paludis/repositories/e/eapi.cc
@@ -26,7 +26,6 @@
#include <paludis/util/strip.hh>
#include <paludis/util/destringify.hh>
#include <paludis/util/set.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/map.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/stringify.hh>
@@ -70,7 +69,7 @@ namespace
std::shared_ptr<const EAPIEbuildEnvironmentVariables> make_ebuild_environment_variables(const KeyValueConfigFile & k)
{
- return make_shared_ptr(new EAPIEbuildEnvironmentVariables(make_named_values<EAPIEbuildEnvironmentVariables>(
+ return std::make_shared<EAPIEbuildEnvironmentVariables>(make_named_values<EAPIEbuildEnvironmentVariables>(
n::description_choices() = check_get(k, "description_choices"),
n::description_use() = check_get(k, "description_use"),
n::env_a() = check_get(k, "env_a"),
@@ -101,21 +100,21 @@ namespace
n::env_use_expand_implicit() = check_get(k, "env_use_expand_implicit"),
n::env_use_expand_unprefixed() = check_get(k, "env_use_expand_unprefixed"),
n::env_use_expand_values_part() = check_get(k, "env_use_expand_values_part")
- )));
+ ));
}
std::shared_ptr<EAPIMetadataVariable> make_metadata_variable(const KeyValueConfigFile & k, const std::string & s)
{
- return make_shared_ptr(new EAPIMetadataVariable(make_named_values<EAPIMetadataVariable>(
+ return std::make_shared<EAPIMetadataVariable>(make_named_values<EAPIMetadataVariable>(
n::description() = check_get(k, "description_" + s),
n::flat_list_index() = destringify_key<int>(k, "flat_list_" + s),
n::name() = check_get(k, "metadata_" + s)
- )));
+ ));
}
std::shared_ptr<const EAPIEbuildMetadataVariables> make_ebuild_metadata_variables(const KeyValueConfigFile & k)
{
- return make_shared_ptr(new EAPIEbuildMetadataVariables(make_named_values<EAPIEbuildMetadataVariables>(
+ return std::make_shared<EAPIEbuildMetadataVariables>(make_named_values<EAPIEbuildMetadataVariables>(
n::bugs_to() = make_metadata_variable(k, "bugs_to"),
n::build_depend() = make_metadata_variable(k, "build_depend"),
n::defined_phases() = make_metadata_variable(k, "defined_phases"),
@@ -145,7 +144,7 @@ namespace
n::use() = make_metadata_variable(k, "use"),
n::use_expand() = make_metadata_variable(k, "use_expand"),
n::use_expand_hidden() = make_metadata_variable(k, "use_expand_hidden")
- )));
+ ));
}
std::shared_ptr<Set<std::string> > make_set(const std::string & s)
@@ -157,7 +156,7 @@ namespace
std::shared_ptr<const EAPIEbuildOptions> make_ebuild_options(const KeyValueConfigFile & k)
{
- return make_shared_ptr(new EAPIEbuildOptions(make_named_values<EAPIEbuildOptions>(
+ return std::make_shared<EAPIEbuildOptions>(make_named_values<EAPIEbuildOptions>(
n::binary_from_env_variables() = check_get(k, "binary_from_env_variables"),
n::bracket_merged_variables() = check_get(k, "bracket_merged_variables"),
n::bracket_merged_variables_annotatable() = check_get(k, "bracket_merged_variables_annotatable"),
@@ -194,12 +193,12 @@ namespace
n::vdb_from_env_unless_empty_variables() = check_get(k, "vdb_from_env_unless_empty_variables"),
n::vdb_from_env_variables() = check_get(k, "vdb_from_env_variables"),
n::want_portage_emulation_vars() = destringify_key<bool>(k, "want_portage_emulation_vars")
- )));
+ ));
}
std::shared_ptr<const EAPIEbuildPhases> make_ebuild_phases(const KeyValueConfigFile & k)
{
- return make_shared_ptr(new EAPIEbuildPhases(make_named_values<EAPIEbuildPhases>(
+ return std::make_shared<EAPIEbuildPhases>(make_named_values<EAPIEbuildPhases>(
n::ebuild_bad_options() = check_get(k, "ebuild_bad_options"),
n::ebuild_config() = check_get(k, "ebuild_config"),
n::ebuild_fetch_extra() = check_get(k, "ebuild_fetch_extra"),
@@ -211,20 +210,20 @@ namespace
n::ebuild_pretend() = check_get(k, "ebuild_pretend"),
n::ebuild_uninstall() = check_get(k, "ebuild_uninstall"),
n::ebuild_variable() = check_get(k, "ebuild_variable")
- )));
+ ));
}
std::shared_ptr<const EAPIPipeCommands> make_pipe_commands(const KeyValueConfigFile & k)
{
- return make_shared_ptr(new EAPIPipeCommands(make_named_values<EAPIPipeCommands>(
+ return std::make_shared<EAPIPipeCommands>(make_named_values<EAPIPipeCommands>(
n::no_slot_or_repo() = destringify_key<bool>(k, "pipe_commands_no_slot_or_repo"),
n::rewrite_virtuals() = destringify_key<bool>(k, "pipe_commands_rewrite_virtuals")
- )));
+ ));
}
std::shared_ptr<const EAPIToolsOptions> make_tool_options(const KeyValueConfigFile & k)
{
- return make_shared_ptr(new EAPIToolsOptions(make_named_values<EAPIToolsOptions>(
+ return std::make_shared<EAPIToolsOptions>(make_named_values<EAPIToolsOptions>(
n::dodoc_r() = destringify_key<bool>(k, "dodoc_r"),
n::doins_symlink() = destringify_key<bool>(k, "doins_symlink"),
n::doman_lang_filenames() = destringify_key<bool>(k, "doman_lang_filenames"),
@@ -234,31 +233,31 @@ namespace
n::unpack_fix_permissions() = destringify_key<bool>(k, "unpack_fix_permissions"),
n::unpack_suffixes() = k.get("unpack_suffixes"),
n::unpack_unrecognised_is_fatal() = destringify_key<bool>(k, "unpack_unrecognised_is_fatal")
- )));
+ ));
}
std::shared_ptr<const EAPIAnnotations> make_annotations(const KeyValueConfigFile & k)
{
- return make_shared_ptr(new EAPIAnnotations(make_named_values<EAPIAnnotations>(
+ return std::make_shared<EAPIAnnotations>(make_named_values<EAPIAnnotations>(
n::myoptions_description() = k.get("annotations_myoptions_description"),
n::myoptions_number_selected() = k.get("annotations_myoptions_number_selected"),
n::myoptions_number_selected_at_least_one() = k.get("annotations_myoptions_number_selected_at_least_one"),
n::myoptions_number_selected_at_most_one() = k.get("annotations_myoptions_number_selected_at_most_one"),
n::myoptions_number_selected_exactly_one() = k.get("annotations_myoptions_number_selected_exactly_one"),
n::myoptions_requires() = k.get("annotations_myoptions_requires")
- )));
+ ));
}
std::shared_ptr<const EAPIChoicesOptions> make_choices_options(const KeyValueConfigFile & k)
{
- return make_shared_ptr(new EAPIChoicesOptions(make_named_values<EAPIChoicesOptions>(
+ return std::make_shared<EAPIChoicesOptions>(make_named_values<EAPIChoicesOptions>(
n::fancy_test_flag() = check_get(k, "fancy_test_flag"),
n::has_expensive_tests() = destringify_key<bool>(k, "has_expensive_tests"),
n::has_optional_tests() = destringify_key<bool>(k, "has_optional_tests"),
n::has_recommended_tests() = destringify_key<bool>(k, "has_recommended_tests"),
n::profile_iuse_injection() = destringify_key<bool>(k, "profile_iuse_injection"),
n::use_expand_separator() = destringify_key<char>(k, "use_expand_separator")
- )));
+ ));
}
std::shared_ptr<const SupportedEAPI> make_supported_eapi(const KeyValueConfigFile & k)
@@ -313,12 +312,12 @@ namespace
merger_options += destringify<MergerOption>(*t);
}
- return make_shared_ptr(new SupportedEAPI(make_named_values<SupportedEAPI>(
+ return std::make_shared<SupportedEAPI>(make_named_values<SupportedEAPI>(
n::annotations() = make_annotations(k),
n::breaks_portage() = destringify_key<bool>(k, "breaks_portage"),
n::can_be_pbin() = destringify_key<bool>(k, "can_be_pbin"),
n::choices_options() = make_choices_options(k),
- n::dependency_labels() = make_shared_ptr(new const EAPILabels(check_get(k, "dependency_labels"))),
+ n::dependency_labels() = std::make_shared<const EAPILabels>(check_get(k, "dependency_labels")),
n::dependency_spec_tree_parse_options() = dependency_spec_tree_parse_options,
n::ebuild_environment_variables() = make_ebuild_environment_variables(k),
n::ebuild_metadata_variables() = make_ebuild_metadata_variables(k),
@@ -329,10 +328,10 @@ namespace
n::package_dep_spec_parse_options() = package_dep_spec_parse_options,
n::pipe_commands() = make_pipe_commands(k),
n::tools_options() = make_tool_options(k),
- n::uri_labels() = make_shared_ptr(new const EAPILabels(check_get(k, "uri_labels"))),
+ n::uri_labels() = std::make_shared<const EAPILabels>(check_get(k, "uri_labels")),
n::userpriv_cannot_use_root() = destringify_key<bool>(k, "userpriv_cannot_use_root"),
n::version_spec_options() = version_spec_options
- )));
+ ));
}
}
@@ -397,21 +396,21 @@ EAPIData::eapi_from_string(const std::string & s) const
if (i != _imp->values.end())
return i->second;
- return make_shared_ptr(new EAPI(make_named_values<EAPI>(
+ return std::make_shared<EAPI>(make_named_values<EAPI>(
n::exported_name() = s,
n::name() = s,
n::supported() = std::shared_ptr<const SupportedEAPI>())
- ));
+ );
}
std::shared_ptr<const EAPI>
EAPIData::unknown_eapi() const
{
- return make_shared_ptr(new EAPI(make_named_values<EAPI>(
+ return std::make_shared<EAPI>(make_named_values<EAPI>(
n::exported_name() = "UNKNOWN",
n::name() = "UNKNOWN",
n::supported() = std::shared_ptr<const SupportedEAPI>())
- ));
+ );
}
namespace paludis
diff --git a/paludis/repositories/e/eapi_phase.cc b/paludis/repositories/e/eapi_phase.cc
index b7b9237..ffab13b 100644
--- a/paludis/repositories/e/eapi_phase.cc
+++ b/paludis/repositories/e/eapi_phase.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010 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
@@ -21,7 +21,6 @@
#include <paludis/repositories/e/eapi.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/iterator_funcs.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/indirect_iterator-impl.hh>
@@ -120,7 +119,7 @@ EAPIPhases::EAPIPhases(const std::string & s) :
tokenise<delim_kind::AnyOfTag, delim_mode::DelimiterTag>(s, ";", "", std::back_inserter(tokens));
for (std::list<std::string>::const_iterator t(tokens.begin()), t_end(tokens.end()) ;
t != t_end ; ++t)
- _imp->phases.push_back(make_shared_ptr(new EAPIPhase(*t)));
+ _imp->phases.push_back(std::make_shared<EAPIPhase>(*t));
}
EAPIPhases::~EAPIPhases()
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index b053865..9ac2b12 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -46,7 +46,6 @@
#include <paludis/util/log.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/save.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/tribool.hh>
@@ -54,6 +53,7 @@
#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/util/return_literal_function.hh>
#include <paludis/util/indirect_iterator-impl.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <set>
#include <iterator>
@@ -138,17 +138,17 @@ namespace paludis
run_dependencies_labels(new DependenciesLabelSequence),
post_dependencies_labels(new DependenciesLabelSequence)
{
- raw_dependencies_labels->push_back(make_shared_ptr(new DependenciesBuildLabel("build",
- return_literal_function(true))));
- raw_dependencies_labels->push_back(make_shared_ptr(new DependenciesRunLabel("run",
- return_literal_function(true))));
-
- build_dependencies_labels->push_back(make_shared_ptr(new DependenciesBuildLabel("DEPEND",
- return_literal_function(true))));
- run_dependencies_labels->push_back(make_shared_ptr(new DependenciesRunLabel("RDEPEND",
- return_literal_function(true))));
- post_dependencies_labels->push_back(make_shared_ptr(new DependenciesPostLabel("PDEPEND",
- return_literal_function(true))));
+ raw_dependencies_labels->push_back(std::make_shared<DependenciesBuildLabel>("build",
+ return_literal_function(true)));
+ raw_dependencies_labels->push_back(std::make_shared<DependenciesRunLabel>("run",
+ return_literal_function(true)));
+
+ build_dependencies_labels->push_back(std::make_shared<DependenciesBuildLabel>("DEPEND",
+ return_literal_function(true)));
+ run_dependencies_labels->push_back(std::make_shared<DependenciesRunLabel>("RDEPEND",
+ return_literal_function(true)));
+ post_dependencies_labels->push_back(std::make_shared<DependenciesPostLabel>("PDEPEND",
+ return_literal_function(true)));
}
};
}
@@ -296,40 +296,40 @@ EbuildID::need_keys_added() const
}
}
- add_metadata_key(make_shared_ptr(new LiteralMetadataValueKey<std::string>("EAPI", "EAPI", mkt_internal, _imp->eapi->name())));
+ add_metadata_key(std::make_shared<LiteralMetadataValueKey<std::string>>("EAPI", "EAPI", mkt_internal, _imp->eapi->name()));
- _imp->repository_mask = make_shared_ptr(new EMutableRepositoryMaskInfoKey(shared_from_this(), "repository_mask", "Repository masked",
- std::static_pointer_cast<const ERepository>(repository())->repository_masked(*this), mkt_internal));
+ _imp->repository_mask = std::make_shared<EMutableRepositoryMaskInfoKey>(shared_from_this(), "repository_mask", "Repository masked",
+ std::static_pointer_cast<const ERepository>(repository())->repository_masked(*this), mkt_internal);
add_metadata_key(_imp->repository_mask);
- _imp->profile_mask = make_shared_ptr(new EMutableRepositoryMaskInfoKey(shared_from_this(), "profile_mask", "Profile masked",
- std::static_pointer_cast<const ERepository>(repository())->profile()->profile_masked(*this), mkt_internal));
+ _imp->profile_mask = std::make_shared<EMutableRepositoryMaskInfoKey>(shared_from_this(), "profile_mask", "Profile masked",
+ std::static_pointer_cast<const ERepository>(repository())->profile()->profile_masked(*this), mkt_internal);
add_metadata_key(_imp->profile_mask);
std::shared_ptr<const Map<ChoiceNameWithPrefix, std::string> > maybe_use_descriptions;
if (_imp->eapi->supported())
{
- _imp->raw_use_expand = make_shared_ptr(new LiteralMetadataStringSetKey(
+ _imp->raw_use_expand = std::make_shared<LiteralMetadataStringSetKey>(
_imp->eapi->supported()->ebuild_metadata_variables()->use_expand()->name(),
_imp->eapi->supported()->ebuild_metadata_variables()->use_expand()->description(),
mkt_internal,
- e_repository()->profile()->use_expand()));
- _imp->raw_use_expand_hidden = make_shared_ptr(new LiteralMetadataStringSetKey(
+ e_repository()->profile()->use_expand());
+ _imp->raw_use_expand_hidden = std::make_shared<LiteralMetadataStringSetKey>(
_imp->eapi->supported()->ebuild_metadata_variables()->use_expand_hidden()->name(),
_imp->eapi->supported()->ebuild_metadata_variables()->use_expand_hidden()->description(),
mkt_internal,
- e_repository()->profile()->use_expand_hidden()));
+ e_repository()->profile()->use_expand_hidden());
std::shared_ptr<const MetadataXML> m(MetadataXMLPool::get_instance()->metadata_if_exists(
_imp->fs_location->value().dirname() / "metadata.xml"));
if (m)
{
if (! m->long_description().empty())
- add_metadata_key(_imp->long_description = make_shared_ptr(new LiteralMetadataValueKey<std::string>("long_description",
- "Long Description", mkt_normal, m->long_description())));
+ add_metadata_key(_imp->long_description = std::make_shared<LiteralMetadataValueKey<std::string>>("long_description",
+ "Long Description", mkt_normal, m->long_description()));
if (! m->herds()->empty())
- add_metadata_key(make_shared_ptr(new LiteralMetadataStringSequenceKey("herds", "Herds", mkt_normal, m->herds())));
+ add_metadata_key(std::make_shared<LiteralMetadataStringSequenceKey>("herds", "Herds", mkt_normal, m->herds()));
if (! m->maintainers()->empty())
- add_metadata_key(make_shared_ptr(new LiteralMetadataStringSequenceKey("maintainers", "Maintainers", mkt_normal, m->maintainers())));
+ add_metadata_key(std::make_shared<LiteralMetadataStringSequenceKey>("maintainers", "Maintainers", mkt_normal, m->maintainers()));
maybe_use_descriptions = m->uses();
}
@@ -469,7 +469,7 @@ EbuildID::need_masks_added() const
if (! eapi()->supported())
{
- add_mask(make_shared_ptr(new EUnsupportedMask('E', "eapi", eapi()->name())));
+ add_mask(std::make_shared<EUnsupportedMask>('E', "eapi", eapi()->name()));
return;
}
@@ -477,20 +477,20 @@ EbuildID::need_masks_added() const
{
if (! _imp->environment->accept_keywords(keywords_key()->value(), *this))
{
- add_mask(make_shared_ptr(new EUnacceptedMask('K',
+ add_mask(std::make_shared<EUnacceptedMask>('K',
DistributionData::get_instance()->distribution_from_string(
- _imp->environment->distribution())->concept_keyword(), keywords_key())));
+ _imp->environment->distribution())->concept_keyword(), keywords_key()));
}
else if (keywords_key()->value()->end() == std::find_if(keywords_key()->value()->begin(),
keywords_key()->value()->end(), &is_stable_keyword))
{
- add_overridden_mask(make_shared_ptr(new OverriddenMask(
+ add_overridden_mask(std::make_shared<OverriddenMask>(
make_named_values<OverriddenMask>(
- n::mask() = make_shared_ptr(new EUnacceptedMask('~',
+ n::mask() = std::make_shared<EUnacceptedMask>('~',
DistributionData::get_instance()->distribution_from_string(
- _imp->environment->distribution())->concept_keyword() + " (unstable accepted)", keywords_key())),
+ _imp->environment->distribution())->concept_keyword() + " (unstable accepted)", keywords_key()),
n::override_reason() = mro_accepted_unstable
- ))));
+ )));
}
}
@@ -499,20 +499,20 @@ EbuildID::need_masks_added() const
LicenceChecker c(_imp->environment, &Environment::accept_license, this);
license_key()->value()->root()->accept(c);
if (! c.ok)
- add_mask(make_shared_ptr(new EUnacceptedMask('L',
+ add_mask(std::make_shared<EUnacceptedMask>('L',
DistributionData::get_instance()->distribution_from_string(
- _imp->environment->distribution())->concept_license(), license_key())));
+ _imp->environment->distribution())->concept_license(), license_key()));
}
if (! _imp->environment->unmasked_by_user(*this))
{
/* repo unless user */
if (_imp->repository_mask->value())
- add_mask(make_shared_ptr(new ERepositoryMask('R', "repository", _imp->repository_mask)));
+ add_mask(std::make_shared<ERepositoryMask>('R', "repository", _imp->repository_mask));
/* profile unless user */
if (_imp->profile_mask->value())
- add_mask(make_shared_ptr(new ERepositoryMask('P', "profile", _imp->profile_mask)));
+ add_mask(std::make_shared<ERepositoryMask>('P', "profile", _imp->profile_mask));
/* user */
std::shared_ptr<const Mask> user_mask(_imp->environment->mask_for_user(*this, false));
@@ -523,28 +523,28 @@ EbuildID::need_masks_added() const
{
/* repo overridden by user */
if (_imp->repository_mask->value())
- add_overridden_mask(make_shared_ptr(new OverriddenMask(
+ add_overridden_mask(std::make_shared<OverriddenMask>(
make_named_values<OverriddenMask>(
- n::mask() = make_shared_ptr(new ERepositoryMask('r', "repository (overridden)", _imp->repository_mask)),
+ n::mask() = std::make_shared<ERepositoryMask>('r', "repository (overridden)", _imp->repository_mask),
n::override_reason() = mro_overridden_by_user
- ))));
+ )));
/* profile unless user */
if (_imp->profile_mask->value())
- add_overridden_mask(make_shared_ptr(new OverriddenMask(
+ add_overridden_mask(std::make_shared<OverriddenMask>(
make_named_values<OverriddenMask>(
- n::mask() = make_shared_ptr(new ERepositoryMask('p', "profile (overridden)", _imp->profile_mask)),
+ n::mask() = std::make_shared<ERepositoryMask>('p', "profile (overridden)", _imp->profile_mask),
n::override_reason() = mro_overridden_by_user
- ))));
+ )));
/* user */
std::shared_ptr<const Mask> user_mask(_imp->environment->mask_for_user(*this, true));
if (user_mask)
- add_overridden_mask(make_shared_ptr(new OverriddenMask(
+ add_overridden_mask(std::make_shared<OverriddenMask>(
make_named_values<OverriddenMask>(
n::mask() = user_mask,
n::override_reason() = mro_overridden_by_user
- ))));
+ )));
}
@@ -1346,9 +1346,9 @@ EbuildID::make_choice_value(
}
}
- return make_shared_ptr(new EChoiceValue(choice->prefix(), value_name, ChoiceNameWithPrefix(name_with_prefix), name(),
+ return std::make_shared<EChoiceValue>(choice->prefix(), value_name, ChoiceNameWithPrefix(name_with_prefix), name(),
_imp->repository->use_desc(),
- enabled, enabled_by_default, force_locked || locked, explicitly_listed, override_description, ""));
+ enabled, enabled_by_default, force_locked || locked, explicitly_listed, override_description, "");
}
namespace
@@ -1409,12 +1409,12 @@ EbuildID::add_build_options(const std::shared_ptr<Choices> & choices) const
/* optional_tests */
if (eapi()->supported()->choices_options()->has_optional_tests())
if (may_be_unrestricted_test)
- build_options->add(make_shared_ptr(new ELikeOptionalTestsChoiceValue(shared_from_this(), _imp->environment, build_options)));
+ build_options->add(std::make_shared<ELikeOptionalTestsChoiceValue>(shared_from_this(), _imp->environment, build_options));
/* recommended_tests */
if (eapi()->supported()->choices_options()->has_recommended_tests())
if (may_be_unrestricted_test)
- build_options->add(make_shared_ptr(new ELikeRecommendedTestsChoiceValue(shared_from_this(), _imp->environment, build_options)));
+ build_options->add(std::make_shared<ELikeRecommendedTestsChoiceValue>(shared_from_this(), _imp->environment, build_options));
/* expensive_tests */
if (eapi()->supported()->choices_options()->has_expensive_tests())
@@ -1438,23 +1438,23 @@ EbuildID::add_build_options(const std::shared_ptr<Choices> & choices) const
}
if (has_expensive_test_phase)
- build_options->add(make_shared_ptr(new ELikeExpensiveTestsChoiceValue(shared_from_this(), _imp->environment, build_options)));
+ build_options->add(std::make_shared<ELikeExpensiveTestsChoiceValue>(shared_from_this(), _imp->environment, build_options));
}
/* split, strip */
if (may_be_unrestricted_strip)
{
- build_options->add(make_shared_ptr(new ELikeSplitChoiceValue(shared_from_this(), _imp->environment, build_options)));
- build_options->add(make_shared_ptr(new ELikeStripChoiceValue(shared_from_this(), _imp->environment, build_options)));
+ build_options->add(std::make_shared<ELikeSplitChoiceValue>(shared_from_this(), _imp->environment, build_options));
+ build_options->add(std::make_shared<ELikeStripChoiceValue>(shared_from_this(), _imp->environment, build_options));
}
/* trace */
- build_options->add(make_shared_ptr(new ELikeTraceChoiceValue(
- shared_from_this(), _imp->environment, build_options)));
+ build_options->add(std::make_shared<ELikeTraceChoiceValue>(
+ shared_from_this(), _imp->environment, build_options));
/* preserve_work */
- build_options->add(make_shared_ptr(new ELikePreserveWorkChoiceValue(
- shared_from_this(), _imp->environment, build_options, false)));
+ build_options->add(std::make_shared<ELikePreserveWorkChoiceValue>(
+ shared_from_this(), _imp->environment, build_options, false));
/* jobs */
if (! eapi()->supported()->ebuild_environment_variables()->env_jobs().empty())
@@ -1462,8 +1462,8 @@ EbuildID::add_build_options(const std::shared_ptr<Choices> & choices) const
if (! _imp->defined_phases)
throw InternalError(PALUDIS_HERE, "bug! no defined_phases yet");
- build_options->add(make_shared_ptr(new ELikeJobsChoiceValue(
- shared_from_this(), _imp->environment, build_options)));
+ build_options->add(std::make_shared<ELikeJobsChoiceValue>(
+ shared_from_this(), _imp->environment, build_options));
}
}
}
diff --git a/paludis/repositories/e/exheres_layout.cc b/paludis/repositories/e/exheres_layout.cc
index e860a94..d78a311 100644
--- a/paludis/repositories/e/exheres_layout.cc
+++ b/paludis/repositories/e/exheres_layout.cc
@@ -38,7 +38,7 @@
#include <paludis/util/set.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/hashes.hh>
-#include <paludis/util/make_shared_ptr.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/choice.hh>
#include <paludis/literal_metadata_key.hh>
#include <unordered_map>
@@ -647,8 +647,8 @@ std::shared_ptr<MetadataValueKey<FSEntry> >
ExheresLayout::accounts_repository_data_location_key() const
{
if ((_imp->tree_root / "metadata" / "accounts").exists())
- return make_shared_ptr(new LiteralMetadataValueKey<FSEntry>("accounts_repository_data_location",
- "AccountsRepository data location", mkt_internal, _imp->tree_root / "metadata" / "accounts"));
+ return std::make_shared<LiteralMetadataValueKey<FSEntry>>("accounts_repository_data_location",
+ "AccountsRepository data location", mkt_internal, _imp->tree_root / "metadata" / "accounts");
else
return make_null_shared_ptr();
}
diff --git a/paludis/repositories/e/exheres_profile.cc b/paludis/repositories/e/exheres_profile.cc
index 8b7fe05..51234ce 100644
--- a/paludis/repositories/e/exheres_profile.cc
+++ b/paludis/repositories/e/exheres_profile.cc
@@ -30,13 +30,13 @@
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/util/config_file.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/map.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/set.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/hashes.hh>
#include <paludis/util/system.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/choice.hh>
#include <paludis/dep_tag.hh>
#include <paludis/environment.hh>
@@ -57,7 +57,7 @@ namespace
const FSEntry & f,
const LineConfigFileOptions & o)
{
- return make_shared_ptr(new LineConfigFile(f, o));
+ return std::make_shared<LineConfigFile>(f, o);
}
typedef std::unordered_map<std::string, std::string, Hash<std::string> > EnvironmentVariablesMap;
@@ -112,7 +112,7 @@ namespace paludis
use_expand_implicit(new Set<std::string>),
iuse_implicit(new Set<std::string>),
use_expand_values(new Set<std::string>),
- system_packages(new SetSpecTree(make_shared_ptr(new AllDepSpec))),
+ system_packages(new SetSpecTree(std::make_shared<AllDepSpec>())),
system_tag(new GeneralSetDepTag(SetName("system"), stringify(name)))
{
environment_variables["CONFIG_PROTECT"] = getenv_with_default("CONFIG_PROTECT", "/etc");
@@ -383,6 +383,6 @@ ExheresProfile::system_packages() const
const std::shared_ptr<const Map<QualifiedPackageName, PackageDepSpec> >
ExheresProfile::virtuals() const
{
- return make_shared_ptr(new Map<QualifiedPackageName, PackageDepSpec>);
+ return std::make_shared<Map<QualifiedPackageName, PackageDepSpec>>();
}
diff --git a/paludis/repositories/e/exndbam_id.cc b/paludis/repositories/e/exndbam_id.cc
index 28ab194..4b79c50 100644
--- a/paludis/repositories/e/exndbam_id.cc
+++ b/paludis/repositories/e/exndbam_id.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2008, 2009, 2010 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
@@ -20,7 +20,6 @@
#include <paludis/repositories/e/exndbam_id.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/stringify.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/set.hh>
#include <paludis/util/sequence.hh>
#include <paludis/contents.hh>
@@ -117,7 +116,7 @@ ExndbamID::contents_filename() const
std::shared_ptr<MetadataValueKey<std::shared_ptr<const Contents> > >
ExndbamID::make_contents_key() const
{
- return make_shared_ptr(new ExndbamContentsKey(this, _ndbam));
+ return std::make_shared<ExndbamContentsKey>(this, _ndbam);
}
diff --git a/paludis/repositories/e/exndbam_repository.cc b/paludis/repositories/e/exndbam_repository.cc
index 7942d22..2d82906 100644
--- a/paludis/repositories/e/exndbam_repository.cc
+++ b/paludis/repositories/e/exndbam_repository.cc
@@ -32,10 +32,10 @@
#include <paludis/util/cookie.hh>
#include <paludis/util/set.hh>
#include <paludis/util/dir_iterator.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/system.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/safe_ifstream.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/output_manager.hh>
#include <paludis/distribution.hh>
#include <paludis/environment.hh>
@@ -189,7 +189,7 @@ ExndbamRepository::repository_factory_dependencies(
const Environment * const,
const std::function<std::string (const std::string &)> &)
{
- return make_shared_ptr(new RepositoryNameSet);
+ return std::make_shared<RepositoryNameSet>();
}
void
@@ -574,7 +574,7 @@ ExndbamRepository::perform_uninstall(
n::ebuild_file() = ver_dir / (stringify(id->name().package()) + "-" + stringify(id->version()) + ".ebuild"),
n::eclassdirs() = eclassdirs,
n::environment() = _imp->params.environment(),
- n::exlibsdirs() = make_shared_ptr(new FSEntrySequence),
+ n::exlibsdirs() = std::make_shared<FSEntrySequence>(),
n::files_dir() = ver_dir,
n::maybe_output_manager() = output_manager,
n::package_builddir() = package_builddir,
diff --git a/paludis/repositories/e/exndbam_repository_TEST.cc b/paludis/repositories/e/exndbam_repository_TEST.cc
index 7dd869b..dd91dcb 100644
--- a/paludis/repositories/e/exndbam_repository_TEST.cc
+++ b/paludis/repositories/e/exndbam_repository_TEST.cc
@@ -25,7 +25,6 @@
#include <paludis/util/join.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/sequence.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/action.hh>
#include <paludis/filtered_generator.hh>
@@ -48,7 +47,7 @@ namespace
std::shared_ptr<OutputManager> make_standard_output_manager(const Action &)
{
- return make_shared_ptr(new StandardOutputManager);
+ return std::make_shared<StandardOutputManager>();
}
std::string from_keys(const std::shared_ptr<const Map<std::string, std::string> > & m,
diff --git a/paludis/repositories/e/extra_distribution_data.cc b/paludis/repositories/e/extra_distribution_data.cc
index 0ca9174..45c7df1 100644
--- a/paludis/repositories/e/extra_distribution_data.cc
+++ b/paludis/repositories/e/extra_distribution_data.cc
@@ -19,7 +19,6 @@
#include <paludis/repositories/e/extra_distribution_data.hh>
#include <paludis/util/make_named_values.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/set.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/wrapped_output_iterator.hh>
@@ -50,7 +49,7 @@ namespace paludis
static std::shared_ptr<EDistribution> make_data(const std::shared_ptr<const KeyValueConfigFile> & k)
{
- return make_shared_ptr(new EDistribution(make_named_values<EDistribution>(
+ return std::make_shared<EDistribution>(make_named_values<EDistribution>(
n::default_buildroot() = k->get("default_buildroot"),
n::default_distdir() = k->get("default_distdir"),
n::default_eapi_when_unknown() = k->get("default_eapi_when_unknown"),
@@ -68,7 +67,7 @@ namespace paludis
n::qa_package_id_checks() = make_set(k->get("qa_package_id_checks")),
n::qa_package_id_file_contents_checks() = make_set(k->get("qa_package_id_file_contents_checks")),
n::qa_tree_checks() = make_set(k->get("qa_tree_checks"))
- )));
+ ));
}
};
}
diff --git a/paludis/repositories/e/fetch_visitor.cc b/paludis/repositories/e/fetch_visitor.cc
index 267dd43..91b3243 100644
--- a/paludis/repositories/e/fetch_visitor.cc
+++ b/paludis/repositories/e/fetch_visitor.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010 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
@@ -34,7 +34,6 @@
#include <paludis/util/log.hh>
#include <paludis/util/join.hh>
#include <paludis/util/stringify.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/output_manager.hh>
#include <list>
diff --git a/paludis/repositories/e/fetch_visitor_TEST.cc b/paludis/repositories/e/fetch_visitor_TEST.cc
index 6b1dad6..92f3e2c 100644
--- a/paludis/repositories/e/fetch_visitor_TEST.cc
+++ b/paludis/repositories/e/fetch_visitor_TEST.cc
@@ -24,7 +24,6 @@
#include <paludis/repositories/fake/fake_package_id.hh>
#include <paludis/environments/test/test_environment.hh>
#include <paludis/util/sequence.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/util/safe_ifstream.hh>
@@ -80,8 +79,8 @@ namespace test_cases
generator::Matches(parse_user_package_dep_spec("=cat/pkg-1",
&env, UserPackageDepSpecOptions()), MatchPackageOptions()))]->begin(),
*eapi, FSEntry("fetch_visitor_TEST_dir/out"),
- false, false, "test", make_shared_ptr(new URIListedThenMirrorsLabel("listed-then-mirrors")), false,
- make_shared_ptr(new StandardOutputManager), get_mirrors_fn);
+ false, false, "test", std::make_shared<URIListedThenMirrorsLabel>("listed-then-mirrors"), false,
+ std::make_shared<StandardOutputManager>(), get_mirrors_fn);
parse_fetchable_uri("file:///" + stringify(FSEntry("fetch_visitor_TEST_dir/in/input1").realpath()), &env, id, *eapi)->root()->accept(v);
TEST_CHECK(FSEntry("fetch_visitor_TEST_dir/out/input1").is_regular_file());
diff --git a/paludis/repositories/e/fix_locked_dependencies.cc b/paludis/repositories/e/fix_locked_dependencies.cc
index 21f6882..23570bd 100644
--- a/paludis/repositories/e/fix_locked_dependencies.cc
+++ b/paludis/repositories/e/fix_locked_dependencies.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2008, 2009, 2010 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
@@ -22,7 +22,6 @@
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/exception.hh>
#include <paludis/util/stringify.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/options.hh>
#include <paludis/util/indirect_iterator-impl.hh>
@@ -62,7 +61,7 @@ namespace
const std::shared_ptr<const PackageID> id;
Fixer(const Environment * const e, const EAPI & a, const std::shared_ptr<const PackageID> & i) :
- result(new DependencySpecTree(make_shared_ptr(new AllDepSpec))),
+ result(new DependencySpecTree(std::make_shared<AllDepSpec>())),
env(e),
eapi(a),
id(i)
@@ -115,7 +114,7 @@ namespace
if ((*matches->last())->slot_key())
{
PackageDepSpec new_s(PartiallyMadePackageDepSpec(*node.spec()).slot_requirement(
- make_shared_ptr(new ELikeSlotExactRequirement((*matches->last())->slot_key()->value(), true))));
+ std::make_shared<ELikeSlotExactRequirement>((*matches->last())->slot_key()->value(), true)));
c.reset(new PackageDepSpec(new_s));
}
} while (false);
diff --git a/paludis/repositories/e/metadata_xml.cc b/paludis/repositories/e/metadata_xml.cc
index 8a7eac8..d987999 100644
--- a/paludis/repositories/e/metadata_xml.cc
+++ b/paludis/repositories/e/metadata_xml.cc
@@ -25,7 +25,6 @@
#include <paludis/util/mutex.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/hashes.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/log.hh>
#include <paludis/literal_metadata_key.hh>
#include <paludis/choice.hh>
diff --git a/paludis/repositories/e/myoptions_requirements_verifier.cc b/paludis/repositories/e/myoptions_requirements_verifier.cc
index b53859d..2ddfa4c 100644
--- a/paludis/repositories/e/myoptions_requirements_verifier.cc
+++ b/paludis/repositories/e/myoptions_requirements_verifier.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2008, 2009, 2010 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
@@ -27,8 +27,8 @@
#include <paludis/util/tokeniser.hh>
#include <paludis/util/log.hh>
#include <paludis/util/set.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/indirect_iterator-impl.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/choice.hh>
#include <paludis/metadata_key.hh>
#include <algorithm>
diff --git a/paludis/repositories/e/pretend_fetch_visitor.cc b/paludis/repositories/e/pretend_fetch_visitor.cc
index c323044..4b06ab0 100644
--- a/paludis/repositories/e/pretend_fetch_visitor.cc
+++ b/paludis/repositories/e/pretend_fetch_visitor.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2008, 2009, 2010 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
@@ -29,7 +29,6 @@
#include <paludis/util/fs_entry.hh>
#include <paludis/util/log.hh>
#include <paludis/util/stringify.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <list>
#include <set>
diff --git a/paludis/repositories/e/traditional_layout.cc b/paludis/repositories/e/traditional_layout.cc
index 9b78a35..19771d2 100644
--- a/paludis/repositories/e/traditional_layout.cc
+++ b/paludis/repositories/e/traditional_layout.cc
@@ -38,7 +38,7 @@
#include <paludis/util/set.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/hashes.hh>
-#include <paludis/util/make_shared_ptr.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/choice.hh>
#include <paludis/literal_metadata_key.hh>
#include <functional>
@@ -670,8 +670,8 @@ std::shared_ptr<MetadataValueKey<FSEntry> >
TraditionalLayout::e_updates_location_key() const
{
if ((_imp->tree_root / "profiles" / "updates").exists())
- return make_shared_ptr(new LiteralMetadataValueKey<FSEntry>("e_updates_location",
- "VDBRepository updates data location", mkt_internal, _imp->tree_root / "profiles" / "updates"));
+ return std::make_shared<LiteralMetadataValueKey<FSEntry>>("e_updates_location",
+ "VDBRepository updates data location", mkt_internal, _imp->tree_root / "profiles" / "updates");
else
return make_null_shared_ptr();
}
diff --git a/paludis/repositories/e/traditional_profile.cc b/paludis/repositories/e/traditional_profile.cc
index bd5e9a9..33ebbe9 100644
--- a/paludis/repositories/e/traditional_profile.cc
+++ b/paludis/repositories/e/traditional_profile.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010 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
@@ -39,7 +39,6 @@
#include <paludis/util/create_iterator-impl.hh>
#include <paludis/util/config_file.hh>
#include <paludis/util/hashes.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/map.hh>
#include <paludis/choice.hh>
@@ -195,7 +194,7 @@ namespace paludis
env(e),
repository(p),
profiles_with_parents(new FSEntrySequence),
- system_packages(new SetSpecTree(make_shared_ptr(new AllDepSpec))),
+ system_packages(new SetSpecTree(std::make_shared<AllDepSpec>())),
system_tag(new GeneralSetDepTag(SetName("system"), stringify(name))),
virtuals(new Map<QualifiedPackageName, PackageDepSpec>),
use_expand(new Set<std::string>),
@@ -787,7 +786,7 @@ Implementation<TraditionalProfile>::fish_out_use_expand_names()
{
std::string lower_x;
std::transform(x->begin(), x->end(), std::back_inserter(lower_x), &::tolower);
- known_choice_value_names.insert(std::make_pair(lower_x, make_shared_ptr(new Set<UnprefixedChoiceName>)));
+ known_choice_value_names.insert(std::make_pair(lower_x, std::make_shared<Set<UnprefixedChoiceName>>()));
}
for (std::set<std::pair<ChoicePrefixName, UnprefixedChoiceName> >::const_iterator u(use.begin()), u_end(use.end()) ;
diff --git a/paludis/repositories/e/vdb_id.cc b/paludis/repositories/e/vdb_id.cc
index b04346f..2f1688e 100644
--- a/paludis/repositories/e/vdb_id.cc
+++ b/paludis/repositories/e/vdb_id.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2010 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
@@ -19,7 +19,6 @@
#include <paludis/repositories/e/vdb_id.hh>
#include <paludis/repositories/e/e_key.hh>
-#include <paludis/util/make_shared_ptr.hh>
using namespace paludis;
using namespace paludis::erepository;
@@ -53,7 +52,7 @@ VDBID::contents_filename() const
std::shared_ptr<MetadataValueKey<std::shared_ptr<const Contents> > >
VDBID::make_contents_key() const
{
- return make_shared_ptr(new EContentsKey(shared_from_this(), "CONTENTS", "Contents",
- fs_location_key()->value() / "CONTENTS", mkt_internal));
+ return std::make_shared<EContentsKey>(shared_from_this(), "CONTENTS", "Contents",
+ fs_location_key()->value() / "CONTENTS", mkt_internal);
}
diff --git a/paludis/repositories/e/vdb_merger_TEST.cc b/paludis/repositories/e/vdb_merger_TEST.cc
index 497299a..4718e20 100644
--- a/paludis/repositories/e/vdb_merger_TEST.cc
+++ b/paludis/repositories/e/vdb_merger_TEST.cc
@@ -22,7 +22,6 @@
#include <paludis/environments/test/test_environment.hh>
#include <paludis/repositories/fake/fake_repository.hh>
#include <paludis/util/make_named_values.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/util/set.hh>
#include <paludis/standard_output_manager.hh>
@@ -86,9 +85,9 @@ namespace
n::environment() = &env,
n::fix_mtimes_before() = Timestamp(0, 0),
n::image() = FSEntry::cwd() / "vdb_merger_TEST_dir" / what / "image",
- n::merged_entries() = make_shared_ptr(new FSEntrySet),
+ n::merged_entries() = std::make_shared<FSEntrySet>(),
n::options() = MergerOptions() + mo_rewrite_symlinks + mo_allow_empty_dirs,
- n::output_manager() = make_shared_ptr(new StandardOutputManager),
+ n::output_manager() = std::make_shared<StandardOutputManager>(),
n::package_id() = std::shared_ptr<PackageID>(),
n::root() = root_dir
))
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index 75066ed..c5fb325 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_repository.cc
@@ -55,7 +55,6 @@
#include <paludis/filtered_generator.hh>
#include <paludis/filter.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/dir_iterator.hh>
#include <paludis/util/fast_unique_copy.hh>
#include <paludis/util/mutex.hh>
@@ -71,6 +70,7 @@
#include <paludis/util/tokeniser.hh>
#include <paludis/util/hashes.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/output_manager.hh>
@@ -118,7 +118,7 @@ namespace paludis
mutable bool tried_provides_cache, used_provides_cache;
std::shared_ptr<RepositoryNameCache> names_cache;
- Implementation(const VDBRepository * const, const VDBRepositoryParams &, std::shared_ptr<Mutex> = make_shared_ptr(new Mutex));
+ Implementation(const VDBRepository * const, const VDBRepositoryParams &, std::shared_ptr<Mutex> = std::make_shared<Mutex>());
~Implementation();
std::shared_ptr<const MetadataValueKey<FSEntry> > location_key;
@@ -265,7 +265,7 @@ VDBRepository::package_names(const CategoryNamePart & c) const
need_category_names();
if (! has_category_named(c))
- return make_shared_ptr(new QualifiedPackageNameSet);
+ return std::make_shared<QualifiedPackageNameSet>();
need_package_ids(c);
@@ -283,11 +283,11 @@ VDBRepository::package_ids(const QualifiedPackageName & n) const
need_category_names();
if (! has_category_named(n.category()))
- return make_shared_ptr(new PackageIDSequence);
+ return std::make_shared<PackageIDSequence>();
need_package_ids(n.category());
if (! has_package_named(n))
- return make_shared_ptr(new PackageIDSequence);
+ return std::make_shared<PackageIDSequence>();
return _imp->ids.find(n)->second;
}
@@ -379,7 +379,7 @@ VDBRepository::repository_factory_dependencies(
const Environment * const,
const std::function<std::string (const std::string &)> &)
{
- return make_shared_ptr(new RepositoryNameSet);
+ return std::make_shared<RepositoryNameSet>();
}
VDBRepositoryConfigurationError::VDBRepositoryConfigurationError(
@@ -495,7 +495,7 @@ VDBRepository::perform_uninstall(
n::ebuild_file() = pkg_dir / (stringify(id->name().package()) + "-" + stringify(id->version()) + ".ebuild"),
n::eclassdirs() = eclassdirs,
n::environment() = _imp->params.environment(),
- n::exlibsdirs() = make_shared_ptr(new FSEntrySequence),
+ n::exlibsdirs() = std::make_shared<FSEntrySequence>(),
n::files_dir() = pkg_dir,
n::maybe_output_manager() = output_manager,
n::package_builddir() = package_builddir,
@@ -1110,7 +1110,7 @@ VDBRepository::need_package_ids(const CategoryNamePart & c) const
q->insert(*p.package_ptr());
IDMap::iterator i(_imp->ids.find(*p.package_ptr()));
if (_imp->ids.end() == i)
- i = _imp->ids.insert(std::make_pair(*p.package_ptr(), make_shared_ptr(new PackageIDSequence))).first;
+ i = _imp->ids.insert(std::make_pair(*p.package_ptr(), std::make_shared<PackageIDSequence>())).first;
i->second->push_back(make_id(*p.package_ptr(), p.version_requirements_ptr()->begin()->version_spec(), *d));
}
}
diff --git a/paludis/repositories/e/vdb_repository_TEST.cc b/paludis/repositories/e/vdb_repository_TEST.cc
index acf0718..83e9a28 100644
--- a/paludis/repositories/e/vdb_repository_TEST.cc
+++ b/paludis/repositories/e/vdb_repository_TEST.cc
@@ -40,6 +40,7 @@
#include <paludis/choice.hh>
#include <paludis/util/indirect_iterator-impl.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
@@ -61,7 +62,7 @@ namespace
std::shared_ptr<OutputManager> make_standard_output_manager(const Action &)
{
- return make_shared_ptr(new StandardOutputManager);
+ return std::make_shared<StandardOutputManager>();
}
std::string from_keys(const std::shared_ptr<const Map<std::string, std::string> > & m,
@@ -354,7 +355,7 @@ namespace test_cases
n::destination() = vdb_repo,
n::make_output_manager() = &make_standard_output_manager,
n::perform_uninstall() = &do_uninstall,
- n::replacing() = make_shared_ptr(new PackageIDSequence),
+ n::replacing() = std::make_shared<PackageIDSequence>(),
n::want_phase() = &want_all_phases
));
@@ -484,7 +485,7 @@ namespace test_cases
n::destination() = vdb_repo,
n::make_output_manager() = &make_standard_output_manager,
n::perform_uninstall() = &do_uninstall,
- n::replacing() = make_shared_ptr(new PackageIDSequence),
+ n::replacing() = std::make_shared<PackageIDSequence>(),
n::want_phase() = &want_all_phases
));
@@ -1210,7 +1211,7 @@ namespace test_cases
n::destination() = vdb_repo,
n::make_output_manager() = &make_standard_output_manager,
n::perform_uninstall() = &do_uninstall,
- n::replacing() = make_shared_ptr(new PackageIDSequence),
+ n::replacing() = std::make_shared<PackageIDSequence>(),
n::want_phase() = &want_all_phases
));
diff --git a/paludis/repositories/e/vdb_unmerger_TEST.cc b/paludis/repositories/e/vdb_unmerger_TEST.cc
index 462b67a..b6ed263 100644
--- a/paludis/repositories/e/vdb_unmerger_TEST.cc
+++ b/paludis/repositories/e/vdb_unmerger_TEST.cc
@@ -22,7 +22,6 @@
#include <paludis/environments/test/test_environment.hh>
#include <paludis/repositories/fake/fake_repository.hh>
#include <paludis/util/make_named_values.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/map.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/sequence.hh>
@@ -127,7 +126,7 @@ namespace
n::config_protect_mask() = "/protected_dir/unprotected_file /protected_dir/unprotected_dir",
n::environment() = &env,
n::ignore() = &ignore_nothing,
- n::output_manager() = make_shared_ptr(new StandardOutputManager),
+ n::output_manager() = std::make_shared<StandardOutputManager>(),
n::package_id() = *env[selection::RequireExactlyOne(generator::Matches(
parse_user_package_dep_spec("cat/" + fix(what), &env, UserPackageDepSpecOptions()),
MatchPackageOptions()))]->begin(),
diff --git a/paludis/repositories/e/xml_things.cc b/paludis/repositories/e/xml_things.cc
index 0813162..c8520be 100644
--- a/paludis/repositories/e/xml_things.cc
+++ b/paludis/repositories/e/xml_things.cc
@@ -20,7 +20,6 @@
#include <paludis/repositories/e/xml_things.hh>
#include <paludis/util/config_file.hh>
#include <paludis/util/make_named_values.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/map.hh>
#include <paludis/util/tokeniser.hh>
@@ -286,10 +285,10 @@ paludis_xml_things_create_metadata_xml_from_xml_file(const FSEntry & filename)
{
std::shared_ptr<erepository::MetadataXML> result(new erepository::MetadataXML(
make_named_values<erepository::MetadataXML>(
- n::herds() = make_shared_ptr(new Sequence<std::string>),
+ n::herds() = std::make_shared<Sequence<std::string>>(),
n::long_description() = "",
- n::maintainers() = make_shared_ptr(new Sequence<std::string>),
- n::uses() = make_shared_ptr(new Map<ChoiceNameWithPrefix, std::string>)
+ n::maintainers() = std::make_shared<Sequence<std::string>>(),
+ n::uses() = std::make_shared<Map<ChoiceNameWithPrefix, std::string>>()
)));
std::shared_ptr<xmlDoc> doc(manage_libxml_ptr(xmlParseFile(stringify(filename).c_str()), &xmlFreeDoc));
diff --git a/paludis/repositories/fake/dep_parser.cc b/paludis/repositories/fake/dep_parser.cc
index 973444a..d2e3465 100644
--- a/paludis/repositories/fake/dep_parser.cc
+++ b/paludis/repositories/fake/dep_parser.cc
@@ -18,7 +18,6 @@
*/
#include <paludis/repositories/fake/dep_parser.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/options.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/make_named_values.hh>
@@ -58,7 +57,7 @@ namespace
+ epdso_strict_parsing,
user_version_spec_options(),
id));
- (*h.begin())->append(make_shared_ptr(new PackageDepSpec(p)));
+ (*h.begin())->append(std::make_shared<PackageDepSpec>(p));
}
template <typename T_>
@@ -67,14 +66,14 @@ namespace
{
if ((! s.empty()) && ('!' == s.at(0)))
{
- (*h.begin())->append(make_shared_ptr(new BlockDepSpec(s,
+ (*h.begin())->append(std::make_shared<BlockDepSpec>(s,
parse_elike_package_dep_spec(s.substr(1),
ELikePackageDepSpecOptions() + epdso_allow_slot_deps
+ epdso_allow_slot_star_deps + epdso_allow_slot_equal_deps + epdso_allow_repository_deps
+ epdso_allow_use_deps + epdso_allow_ranged_deps + epdso_allow_tilde_greater_deps
+ epdso_strict_parsing,
user_version_spec_options(),
- id), false)));
+ id), false));
}
else
package_dep_spec_string_handler<T_>(h, s, id);
@@ -83,19 +82,19 @@ namespace
template <typename T_>
void license_handler(const typename ParseStackTypes<T_>::Stack & h, const std::string & s)
{
- (*h.begin())->append(make_shared_ptr(new LicenseDepSpec(s)));
+ (*h.begin())->append(std::make_shared<LicenseDepSpec>(s));
}
template <typename T_>
void simple_uri_handler(const typename ParseStackTypes<T_>::Stack & h, const std::string & s)
{
- (*h.begin())->append(make_shared_ptr(new SimpleURIDepSpec(s)));
+ (*h.begin())->append(std::make_shared<SimpleURIDepSpec>(s));
}
template <typename T_>
void arrow_handler(const typename ParseStackTypes<T_>::Stack & h, const std::string & s, const std::string & t)
{
- (*h.begin())->append(make_shared_ptr(new FetchableURIDepSpec(t.empty() ? s : s + " -> " + t)));
+ (*h.begin())->append(std::make_shared<FetchableURIDepSpec>(t.empty() ? s : s + " -> " + t));
}
void any_not_allowed_handler(const std::string & s) PALUDIS_ATTRIBUTE((noreturn));
@@ -129,7 +128,7 @@ namespace
template <typename T_, typename A_>
void any_all_handler(typename ParseStackTypes<T_>::Stack & stack)
{
- stack.push_front((*stack.begin())->append(make_shared_ptr(new A_)));
+ stack.push_front((*stack.begin())->append(std::make_shared<A_>()));
}
template <typename T_>
@@ -137,7 +136,7 @@ namespace
const Environment * const env, const std::shared_ptr<const PackageID> & id)
{
stack.push_front((*stack.begin())->append(
- make_shared_ptr(new ConditionalDepSpec(parse_elike_conditional_dep_spec(u, env, id, false)))));
+ std::make_shared<ConditionalDepSpec>(parse_elike_conditional_dep_spec(u, env, id, false))));
}
template <typename T_>
@@ -171,7 +170,7 @@ paludis::fakerepository::parse_depend(const std::string & s,
using namespace std::placeholders;
ParseStackTypes<DependencySpecTree>::Stack stack;
- std::shared_ptr<DependencySpecTree> top(make_shared_ptr(new DependencySpecTree(make_shared_ptr(new AllDepSpec))));
+ std::shared_ptr<DependencySpecTree> top(std::make_shared<DependencySpecTree>(std::make_shared<AllDepSpec>()));
stack.push_front(top->root());
ELikeDepParserCallbacks callbacks(
@@ -201,7 +200,7 @@ paludis::fakerepository::parse_provide(const std::string & s,
using namespace std::placeholders;
ParseStackTypes<ProvideSpecTree>::Stack stack;
- std::shared_ptr<ProvideSpecTree> top(make_shared_ptr(new ProvideSpecTree(make_shared_ptr(new AllDepSpec))));
+ std::shared_ptr<ProvideSpecTree> top(std::make_shared<ProvideSpecTree>(std::make_shared<AllDepSpec>()));
stack.push_front(top->root());
ELikeDepParserCallbacks callbacks(
@@ -231,7 +230,7 @@ paludis::fakerepository::parse_fetchable_uri(const std::string & s,
using namespace std::placeholders;
ParseStackTypes<FetchableURISpecTree>::Stack stack;
- std::shared_ptr<FetchableURISpecTree> top(make_shared_ptr(new FetchableURISpecTree(make_shared_ptr(new AllDepSpec))));
+ std::shared_ptr<FetchableURISpecTree> top(std::make_shared<FetchableURISpecTree>(std::make_shared<AllDepSpec>()));
stack.push_front(top->root());
ELikeDepParserCallbacks callbacks(
@@ -261,7 +260,7 @@ paludis::fakerepository::parse_simple_uri(const std::string & s,
using namespace std::placeholders;
ParseStackTypes<SimpleURISpecTree>::Stack stack;
- std::shared_ptr<SimpleURISpecTree> top(make_shared_ptr(new SimpleURISpecTree(make_shared_ptr(new AllDepSpec))));
+ std::shared_ptr<SimpleURISpecTree> top(std::make_shared<SimpleURISpecTree>(std::make_shared<AllDepSpec>()));
stack.push_front(top->root());
ELikeDepParserCallbacks callbacks(
@@ -291,7 +290,7 @@ paludis::fakerepository::parse_license(const std::string & s,
using namespace std::placeholders;
ParseStackTypes<LicenseSpecTree>::Stack stack;
- std::shared_ptr<LicenseSpecTree> top(make_shared_ptr(new LicenseSpecTree(make_shared_ptr(new AllDepSpec))));
+ std::shared_ptr<LicenseSpecTree> top(std::make_shared<LicenseSpecTree>(std::make_shared<AllDepSpec>()));
stack.push_front(top->root());
ELikeDepParserCallbacks callbacks(
diff --git a/paludis/repositories/fake/fake_installed_repository.cc b/paludis/repositories/fake/fake_installed_repository.cc
index 48f23a1..a13d7bc 100644
--- a/paludis/repositories/fake/fake_installed_repository.cc
+++ b/paludis/repositories/fake/fake_installed_repository.cc
@@ -21,8 +21,8 @@
#include <paludis/util/fs_entry.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/set.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
@@ -237,12 +237,12 @@ FakeInstalledRepository::repository_factory_create(
Context context("When creating FakeInstalledRepository:");
RepositoryName name(f("name"));
- return make_shared_ptr(new FakeInstalledRepository(make_named_values<FakeInstalledRepositoryParams>(
+ return std::make_shared<FakeInstalledRepository>(make_named_values<FakeInstalledRepositoryParams>(
n::environment() = env,
n::name() = name,
n::suitable_destination() = true,
n::supports_uninstall() = true
- )));
+ ));
}
std::shared_ptr<const RepositoryNameSet>
@@ -250,7 +250,7 @@ FakeInstalledRepository::repository_factory_dependencies(
const Environment * const,
const std::function<std::string (const std::string&)> &)
{
- return make_shared_ptr(new RepositoryNameSet);
+ return std::make_shared<RepositoryNameSet>();
}
const std::shared_ptr<const MetadataValueKey<std::string> >
diff --git a/paludis/repositories/fake/fake_package_id.cc b/paludis/repositories/fake/fake_package_id.cc
index ae2981b..db1ac5a 100644
--- a/paludis/repositories/fake/fake_package_id.cc
+++ b/paludis/repositories/fake/fake_package_id.cc
@@ -40,6 +40,7 @@
#include <paludis/util/tribool.hh>
#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/util/return_literal_function.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <map>
@@ -578,8 +579,8 @@ FakeMetadataChoicesKey::add(const std::string & n, const std::string & v)
_imp->choices.insert(std::make_pair(n, c));
}
- _imp->choices.find(n)->second->add(make_shared_ptr(new FakeChoiceValue(_imp->env, _imp->id,
- _imp->choices.find(n)->second, UnprefixedChoiceName(v))));
+ _imp->choices.find(n)->second->add(std::make_shared<FakeChoiceValue>(_imp->env, _imp->id,
+ _imp->choices.find(n)->second, UnprefixedChoiceName(v)));
}
const std::shared_ptr<const Choices>
@@ -733,14 +734,14 @@ namespace paludis
behaviours_set(new Set<std::string>),
has_masks(false)
{
- build_dependencies_labels->push_back(make_shared_ptr(new DependenciesBuildLabel("DEPEND",
- return_literal_function(true))));
- run_dependencies_labels->push_back(make_shared_ptr(new DependenciesRunLabel("RDEPEND",
- return_literal_function(true))));
- post_dependencies_labels->push_back(make_shared_ptr(new DependenciesPostLabel("PDEPEND",
- return_literal_function(true))));
- suggested_dependencies_labels->push_back(make_shared_ptr(new DependenciesSuggestionLabel("SDEPEND",
- return_literal_function(true))));
+ build_dependencies_labels->push_back(std::make_shared<DependenciesBuildLabel>("DEPEND",
+ return_literal_function(true)));
+ run_dependencies_labels->push_back(std::make_shared<DependenciesRunLabel>("RDEPEND",
+ return_literal_function(true)));
+ post_dependencies_labels->push_back(std::make_shared<DependenciesPostLabel>("PDEPEND",
+ return_literal_function(true)));
+ suggested_dependencies_labels->push_back(std::make_shared<DependenciesSuggestionLabel>("SDEPEND",
+ return_literal_function(true)));
}
};
}
@@ -1140,14 +1141,14 @@ FakePackageID::need_masks_added() const
if (keywords_key())
if (! _imp->env->accept_keywords(keywords_key()->value(), *this))
- add_mask(make_shared_ptr(new FakeUnacceptedMask('K', "keywords", keywords_key())));
+ add_mask(std::make_shared<FakeUnacceptedMask>('K', "keywords", keywords_key()));
if (license_key())
{
LicenceChecker c(_imp->env, &Environment::accept_license, this);
license_key()->value()->root()->accept(c);
if (! c.ok)
- add_mask(make_shared_ptr(new FakeUnacceptedMask('L', "license", license_key())));
+ add_mask(std::make_shared<FakeUnacceptedMask>('L', "license", license_key()));
}
if (! _imp->env->unmasked_by_user(*this))
@@ -1160,11 +1161,11 @@ FakePackageID::need_masks_added() const
{
std::shared_ptr<const Mask> user_mask(_imp->env->mask_for_user(*this, true));
if (user_mask)
- add_overridden_mask(make_shared_ptr(new OverriddenMask(
+ add_overridden_mask(std::make_shared<OverriddenMask>(
make_named_values<OverriddenMask>(
n::mask() = user_mask,
n::override_reason() = mro_overridden_by_user
- ))));
+ )));
}
std::shared_ptr<const Mask> breaks_mask(_imp->env->mask_for_breakage(*this));
diff --git a/paludis/repositories/fake/fake_repository.cc b/paludis/repositories/fake/fake_repository.cc
index a427397..d8e2d48 100644
--- a/paludis/repositories/fake/fake_repository.cc
+++ b/paludis/repositories/fake/fake_repository.cc
@@ -21,10 +21,10 @@
#include <paludis/repositories/fake/fake_package_id.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/distribution.hh>
#include <paludis/environment.hh>
#include <paludis/package_id.hh>
diff --git a/paludis/repositories/fake/fake_repository_base.cc b/paludis/repositories/fake/fake_repository_base.cc
index 692221e..7ef36f1 100644
--- a/paludis/repositories/fake/fake_repository_base.cc
+++ b/paludis/repositories/fake/fake_repository_base.cc
@@ -22,7 +22,6 @@
#include <paludis/util/stringify.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/set.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/wrapped_output_iterator.hh>
diff --git a/paludis/repositories/fake/registration.cc b/paludis/repositories/fake/registration.cc
index 056b2ae..afe87e9 100644
--- a/paludis/repositories/fake/registration.cc
+++ b/paludis/repositories/fake/registration.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2008, 2009, 2010 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
@@ -19,7 +19,6 @@
#include <paludis/repository_factory.hh>
#include <paludis/repositories/fake/fake_installed_repository.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/destringify.hh>
#include <paludis/util/set.hh>
#include <paludis/environment.hh>
diff --git a/paludis/repositories/gems/extra_distribution_data.cc b/paludis/repositories/gems/extra_distribution_data.cc
index 4a1edc9..031e1ed 100644
--- a/paludis/repositories/gems/extra_distribution_data.cc
+++ b/paludis/repositories/gems/extra_distribution_data.cc
@@ -19,7 +19,6 @@
#include <paludis/repositories/gems/extra_distribution_data.hh>
#include <paludis/util/make_named_values.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/singleton-impl.hh>
#include <paludis/distribution-impl.hh>
@@ -38,9 +37,9 @@ namespace paludis
static std::shared_ptr<GemsDistribution> make_data(const std::shared_ptr<const KeyValueConfigFile> & k)
{
- return make_shared_ptr(new GemsDistribution(make_named_values<GemsDistribution>(
+ return std::make_shared<GemsDistribution>(make_named_values<GemsDistribution>(
n::default_buildroot() = k->get("default_buildroot")
- )));
+ ));
}
};
}
diff --git a/paludis/repositories/gems/gem_specification.cc b/paludis/repositories/gems/gem_specification.cc
index d8cc15d..3f6fe70 100644
--- a/paludis/repositories/gems/gem_specification.cc
+++ b/paludis/repositories/gems/gem_specification.cc
@@ -23,6 +23,7 @@
#include <paludis/util/mutex.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/name.hh>
#include <paludis/version_spec.hh>
#include <paludis/repository.hh>
@@ -607,11 +608,11 @@ GemSpecification::need_masks_added() const
{
std::shared_ptr<const Mask> user_mask(_imp->environment->mask_for_user(*this, true));
if (user_mask)
- add_overridden_mask(make_shared_ptr(new OverriddenMask(
+ add_overridden_mask(std::make_shared<OverriddenMask>(
make_named_values<OverriddenMask>(
n::mask() = user_mask,
n::override_reason() = mro_overridden_by_user
- ))));
+ )));
}
/* break portage */
diff --git a/paludis/repositories/gems/gem_specifications.cc b/paludis/repositories/gems/gem_specifications.cc
index 3d0faaa..0df3021 100644
--- a/paludis/repositories/gems/gem_specifications.cc
+++ b/paludis/repositories/gems/gem_specifications.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010 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
@@ -25,7 +25,6 @@
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/log.hh>
#include <paludis/util/stringify.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/hashes.hh>
#include <unordered_map>
diff --git a/paludis/repositories/gems/gems_repository.cc b/paludis/repositories/gems/gems_repository.cc
index 9a9ea04..848bd57 100644
--- a/paludis/repositories/gems/gems_repository.cc
+++ b/paludis/repositories/gems/gems_repository.cc
@@ -26,7 +26,6 @@
#include <paludis/repositories/gems/extra_distribution_data.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/system.hh>
#include <paludis/util/set.hh>
#include <paludis/util/sequence.hh>
@@ -34,6 +33,7 @@
#include <paludis/util/hashes.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/safe_ifstream.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/action.hh>
#include <paludis/metadata_key.hh>
#include <paludis/literal_metadata_key.hh>
@@ -67,7 +67,7 @@ namespace paludis
std::shared_ptr<const MetadataValueKey<std::string> > sync_options_key;
std::shared_ptr<const MetadataValueKey<std::string> > format_key;
- Implementation(const gems::RepositoryParams p, std::shared_ptr<Mutex> m = make_shared_ptr(new Mutex)) :
+ Implementation(const gems::RepositoryParams p, std::shared_ptr<Mutex> m = std::make_shared<Mutex>()) :
params(p),
big_nasty_mutex(m),
has_category_names(false),
@@ -179,14 +179,14 @@ GemsRepository::package_names(const CategoryNamePart & c) const
Lock l(*_imp->big_nasty_mutex);
if (! has_category_named(c))
- return make_shared_ptr(new QualifiedPackageNameSet);
+ return std::make_shared<QualifiedPackageNameSet>();
need_ids();
std::unordered_map<CategoryNamePart, std::shared_ptr<const QualifiedPackageNameSet>, Hash<CategoryNamePart> >::const_iterator i(
_imp->package_names.find(c));
if (i == _imp->package_names.end())
- return make_shared_ptr(new QualifiedPackageNameSet);
+ return std::make_shared<QualifiedPackageNameSet>();
return i->second;
}
@@ -196,14 +196,14 @@ GemsRepository::package_ids(const QualifiedPackageName & q) const
Lock l(*_imp->big_nasty_mutex);
if (! has_package_named(q))
- return make_shared_ptr(new PackageIDSequence);
+ return std::make_shared<PackageIDSequence>();
need_ids();
std::unordered_map<QualifiedPackageName, std::shared_ptr<PackageIDSequence>, Hash<QualifiedPackageName> >::const_iterator i(
_imp->ids.find(q));
if (i == _imp->ids.end())
- return make_shared_ptr(new PackageIDSequence);
+ return std::make_shared<PackageIDSequence>();
return i->second;
}
@@ -252,7 +252,7 @@ GemsRepository::need_ids() const
std::unordered_map<QualifiedPackageName, std::shared_ptr<PackageIDSequence>, Hash<QualifiedPackageName> >::iterator
v(_imp->ids.find(i->first.first));
if (_imp->ids.end() == v)
- v = _imp->ids.insert(std::make_pair(i->first.first, make_shared_ptr(new PackageIDSequence))).first;
+ v = _imp->ids.insert(std::make_pair(i->first.first, std::make_shared<PackageIDSequence>())).first;
v->second->push_back(i->second);
}
@@ -382,14 +382,14 @@ GemsRepository::repository_factory_create(
builddir = gems::GemsExtraDistributionData::get_instance()->data_from_distribution(
*DistributionData::get_instance()->distribution_from_string(env->distribution()))->default_buildroot();
- return make_shared_ptr(new GemsRepository(make_named_values<gems::RepositoryParams>(
+ return std::make_shared<GemsRepository>(make_named_values<gems::RepositoryParams>(
n::builddir() = builddir,
n::environment() = env,
n::install_dir() = install_dir,
n::location() = location,
n::sync() = sync,
n::sync_options() = sync_options
- )));
+ ));
}
RepositoryName
@@ -405,7 +405,7 @@ GemsRepository::repository_factory_dependencies(
const Environment * const,
const std::function<std::string (const std::string &)> &)
{
- return make_shared_ptr(new RepositoryNameSet);
+ return std::make_shared<RepositoryNameSet>();
}
void
diff --git a/paludis/repositories/gems/gems_repository_TEST.cc b/paludis/repositories/gems/gems_repository_TEST.cc
index 858d953..d228075 100644
--- a/paludis/repositories/gems/gems_repository_TEST.cc
+++ b/paludis/repositories/gems/gems_repository_TEST.cc
@@ -21,7 +21,6 @@
#include <paludis/repositories/gems/gems_repository.hh>
#include <paludis/repositories/gems/params.hh>
#include <paludis/package_database.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/make_named_values.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
@@ -38,7 +37,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- env.package_database()->add_repository(1, make_shared_ptr(new GemsRepository(
+ env.package_database()->add_repository(1, std::make_shared<GemsRepository>(
make_named_values<gems::RepositoryParams>(
n::builddir() = FSEntry("gems_repository_TEST_dir/build"),
n::environment() = &env,
@@ -46,7 +45,7 @@ namespace test_cases
n::location() = FSEntry("gems_repository_TEST_dir/repo"),
n::sync() = "",
n::sync_options() = ""
- ))));
+ )));
}
} test_creation;
}
diff --git a/paludis/repositories/gems/installed_gems_repository.cc b/paludis/repositories/gems/installed_gems_repository.cc
index caebd7c..1c71e3f 100644
--- a/paludis/repositories/gems/installed_gems_repository.cc
+++ b/paludis/repositories/gems/installed_gems_repository.cc
@@ -31,13 +31,13 @@
#include <paludis/util/set.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/is_file_with_extension.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/system.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/log.hh>
#include <paludis/util/strip.hh>
#include <paludis/util/hashes.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/literal_metadata_key.hh>
#include <paludis/distribution.hh>
#include <paludis/action.hh>
@@ -75,7 +75,7 @@ namespace paludis
std::shared_ptr<const MetadataValueKey<std::string> > format_key;
Implementation(const gems::InstalledRepositoryParams p,
- std::shared_ptr<Mutex> m = make_shared_ptr(new Mutex)) :
+ std::shared_ptr<Mutex> m = std::make_shared<Mutex>()) :
big_nasty_mutex(m),
params(p),
has_category_names(false),
@@ -173,14 +173,14 @@ InstalledGemsRepository::package_names(const CategoryNamePart & c) const
Lock l(*_imp->big_nasty_mutex);
if (! has_category_named(c))
- return make_shared_ptr(new QualifiedPackageNameSet);
+ return std::make_shared<QualifiedPackageNameSet>();
need_ids();
std::unordered_map<CategoryNamePart, std::shared_ptr<const QualifiedPackageNameSet>, Hash<CategoryNamePart> >::const_iterator i(
_imp->package_names.find(c));
if (i == _imp->package_names.end())
- return make_shared_ptr(new QualifiedPackageNameSet);
+ return std::make_shared<QualifiedPackageNameSet>();
return i->second;
}
@@ -190,13 +190,13 @@ InstalledGemsRepository::package_ids(const QualifiedPackageName & q) const
Lock l(*_imp->big_nasty_mutex);
if (! has_package_named(q))
- return make_shared_ptr(new PackageIDSequence);
+ return std::make_shared<PackageIDSequence>();
need_ids();
IDMap::const_iterator i(_imp->ids.find(q));
if (i == _imp->ids.end())
- return make_shared_ptr(new PackageIDSequence);
+ return std::make_shared<PackageIDSequence>();
return i->second;
}
@@ -252,9 +252,9 @@ InstalledGemsRepository::need_ids() const
pkgs->insert(gems + p);
if (_imp->ids.end() == _imp->ids.find(gems + p))
- _imp->ids.insert(std::make_pair(gems + p, make_shared_ptr(new PackageIDSequence)));
- _imp->ids.find(gems + p)->second->push_back(make_shared_ptr(new gems::GemSpecification(
- _imp->params.environment(), shared_from_this(), p, v, *d)));
+ _imp->ids.insert(std::make_pair(gems + p, std::make_shared<PackageIDSequence>()));
+ _imp->ids.find(gems + p)->second->push_back(std::make_shared<gems::GemSpecification>(
+ _imp->params.environment(), shared_from_this(), p, v, *d));
}
}
@@ -396,7 +396,7 @@ InstalledGemsRepository::repository_factory_dependencies(
const Environment * const,
const std::function<std::string (const std::string &)> &)
{
- return make_shared_ptr(new RepositoryNameSet);
+ return std::make_shared<RepositoryNameSet>();
}
std::shared_ptr<Repository>
@@ -417,12 +417,12 @@ InstalledGemsRepository::repository_factory_create(
if (root.empty())
root = "/";
- return make_shared_ptr(new InstalledGemsRepository(make_named_values<gems::InstalledRepositoryParams>(
+ return std::make_shared<InstalledGemsRepository>(make_named_values<gems::InstalledRepositoryParams>(
n::builddir() = builddir,
n::environment() = env,
n::install_dir() = install_dir,
n::root() = root
- )));
+ ));
}
void
diff --git a/paludis/repositories/gems/registration.cc b/paludis/repositories/gems/registration.cc
index fbe81b6..d069836 100644
--- a/paludis/repositories/gems/registration.cc
+++ b/paludis/repositories/gems/registration.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010 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
@@ -22,7 +22,6 @@
#include <paludis/repositories/gems/installed_gems_repository.hh>
#include <paludis/repositories/gems/params.hh>
#include <paludis/repositories/gems/exceptions.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/set.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/destringify.hh>
diff --git a/paludis/repositories/gems/yaml.cc b/paludis/repositories/gems/yaml.cc
index 6bcd6fa..824d38c 100644
--- a/paludis/repositories/gems/yaml.cc
+++ b/paludis/repositories/gems/yaml.cc
@@ -20,7 +20,6 @@
#include "yaml.hh"
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/singleton-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <functional>
#include <syck.h>
@@ -389,7 +388,7 @@ NodeManager::manage_node(const void * const d, const Node * const n)
std::map<const void *, std::list<std::shared_ptr<const Node> > >::iterator i(_imp->store.find(d));
if (i == _imp->store.end())
throw InternalError(PALUDIS_HERE, "no such document");
- i->second.push_back(make_shared_ptr(n));
+ i->second.push_back(std::shared_ptr<const Node>(n));
}
ParseError::ParseError(const std::string & s) throw () :
diff --git a/paludis/repositories/repository/repository_id.cc b/paludis/repositories/repository/repository_id.cc
index b504a81..edf29f6 100644
--- a/paludis/repositories/repository/repository_id.cc
+++ b/paludis/repositories/repository/repository_id.cc
@@ -23,9 +23,9 @@
#include <paludis/util/stringify.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/set.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/hashes.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/name.hh>
#include <paludis/version_spec.hh>
#include <paludis/metadata_key.hh>
@@ -161,7 +161,7 @@ RepositoryID::perform_action(Action & a) const
std::shared_ptr<const Set<std::string> >
RepositoryID::breaks_portage() const
{
- return make_shared_ptr(new Set<std::string>);
+ return std::make_shared<Set<std::string>>();
}
bool
diff --git a/paludis/repositories/repository/repository_repository.cc b/paludis/repositories/repository/repository_repository.cc
index 7ff8a40..0f153d4 100644
--- a/paludis/repositories/repository/repository_repository.cc
+++ b/paludis/repositories/repository/repository_repository.cc
@@ -29,6 +29,7 @@
#include <paludis/util/simple_parser.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/util/safe_ofstream.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/literal_metadata_key.hh>
#include <paludis/action.hh>
#include <paludis/syncer.hh>
@@ -46,7 +47,7 @@ namespace
std::shared_ptr<RepositoryRepositoryStore>
make_store(const RepositoryRepository * const repo, const RepositoryRepositoryParams & p)
{
- return make_shared_ptr(new RepositoryRepositoryStore(p.environment(), repo));
+ return std::make_shared<RepositoryRepositoryStore>(p.environment(), repo);
}
}
@@ -316,7 +317,7 @@ RepositoryRepository::repository_factory_dependencies(
const Environment * const,
const std::function<std::string (const std::string &)> &)
{
- return make_shared_ptr(new RepositoryNameSet);
+ return std::make_shared<RepositoryNameSet>();
}
void
diff --git a/paludis/repositories/repository/repository_repository_store.cc b/paludis/repositories/repository/repository_repository_store.cc
index fb8a76c..96ae617 100644
--- a/paludis/repositories/repository/repository_repository_store.cc
+++ b/paludis/repositories/repository/repository_repository_store.cc
@@ -25,7 +25,6 @@
#include <paludis/util/set.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/hashes.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/is_file_with_extension.hh>
#include <paludis/util/log.hh>
#include <paludis/util/make_named_values.hh>
@@ -104,12 +103,12 @@ RepositoryRepositoryStore::_populate_one(const RepositoryName & repo_name)
PackageNames::iterator p(_imp->package_names.find(id->name().category()));
if (_imp->package_names.end() == p)
p = _imp->package_names.insert(std::make_pair(id->name().category(),
- make_shared_ptr(new QualifiedPackageNameSet))).first;
+ std::make_shared<QualifiedPackageNameSet>())).first;
p->second->insert(id->name());
IDs::iterator i(_imp->ids.find(id->name()));
if (_imp->ids.end() == i)
- i = _imp->ids.insert(std::make_pair(id->name(), make_shared_ptr(new PackageIDSequence))).first;
+ i = _imp->ids.insert(std::make_pair(id->name(), std::make_shared<PackageIDSequence>())).first;
i->second->push_back(id);
}
@@ -134,7 +133,7 @@ RepositoryRepositoryStore::category_names() const
std::shared_ptr<const CategoryNamePartSet>
RepositoryRepositoryStore::unimportant_category_names() const
{
- std::shared_ptr<CategoryNamePartSet> result(make_shared_ptr(new CategoryNamePartSet));
+ std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
result->insert(CategoryNamePart("repository"));
return result;
}
@@ -144,7 +143,7 @@ RepositoryRepositoryStore::package_names(const CategoryNamePart & c) const
{
PackageNames::iterator p(_imp->package_names.find(c));
if (_imp->package_names.end() == p)
- return make_shared_ptr(new QualifiedPackageNameSet);
+ return std::make_shared<QualifiedPackageNameSet>();
else
return p->second;
}
@@ -154,7 +153,7 @@ RepositoryRepositoryStore::package_ids(const QualifiedPackageName & p) const
{
IDs::iterator i(_imp->ids.find(p));
if (_imp->ids.end() == i)
- return make_shared_ptr(new PackageIDSequence);
+ return std::make_shared<PackageIDSequence>();
else
return i->second;
}
diff --git a/paludis/repositories/unavailable/unavailable_package_id.cc b/paludis/repositories/unavailable/unavailable_package_id.cc
index 21c99eb..1791225 100644
--- a/paludis/repositories/unavailable/unavailable_package_id.cc
+++ b/paludis/repositories/unavailable/unavailable_package_id.cc
@@ -23,9 +23,9 @@
#include <paludis/util/stringify.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/set.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/hashes.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/name.hh>
#include <paludis/version_spec.hh>
#include <paludis/metadata_key.hh>
@@ -173,7 +173,7 @@ UnavailablePackageID::perform_action(Action & a) const
std::shared_ptr<const Set<std::string> >
UnavailablePackageID::breaks_portage() const
{
- return make_shared_ptr(new Set<std::string>);
+ return std::make_shared<Set<std::string>>();
}
bool
diff --git a/paludis/repositories/unavailable/unavailable_repository.cc b/paludis/repositories/unavailable/unavailable_repository.cc
index 59ac8fe..d04a2ee 100644
--- a/paludis/repositories/unavailable/unavailable_repository.cc
+++ b/paludis/repositories/unavailable/unavailable_repository.cc
@@ -26,6 +26,7 @@
#include <paludis/util/tokeniser.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/extract_host_from_url.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/literal_metadata_key.hh>
#include <paludis/action.hh>
#include <paludis/syncer.hh>
@@ -40,7 +41,7 @@ namespace
std::shared_ptr<UnavailableRepositoryStore>
make_store(const UnavailableRepository * const repo, const UnavailableRepositoryParams & p)
{
- return make_shared_ptr(new UnavailableRepositoryStore(p.environment(), repo, p.location()));
+ return std::make_shared<UnavailableRepositoryStore>(p.environment(), repo, p.location());
}
}
@@ -348,7 +349,7 @@ UnavailableRepository::repository_factory_dependencies(
const Environment * const,
const std::function<std::string (const std::string &)> &)
{
- return make_shared_ptr(new RepositoryNameSet);
+ return std::make_shared<RepositoryNameSet>();
}
void
diff --git a/paludis/repositories/unavailable/unavailable_repository_dependencies_key.cc b/paludis/repositories/unavailable/unavailable_repository_dependencies_key.cc
index 5b134a4..d603bf8 100644
--- a/paludis/repositories/unavailable/unavailable_repository_dependencies_key.cc
+++ b/paludis/repositories/unavailable/unavailable_repository_dependencies_key.cc
@@ -20,7 +20,6 @@
#include <paludis/repositories/unavailable/unavailable_repository_dependencies_key.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/fs_entry.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/set.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/return_literal_function.hh>
@@ -55,7 +54,7 @@ namespace paludis
human_name(h),
type(t)
{
- labels->push_back(make_shared_ptr(new DependenciesBuildLabel("build", return_literal_function(true))));
+ labels->push_back(std::make_shared<DependenciesBuildLabel>("build", return_literal_function(true)));
}
};
}
diff --git a/paludis/repositories/unavailable/unavailable_repository_id.cc b/paludis/repositories/unavailable/unavailable_repository_id.cc
index 58b4a6b..882d65a 100644
--- a/paludis/repositories/unavailable/unavailable_repository_id.cc
+++ b/paludis/repositories/unavailable/unavailable_repository_id.cc
@@ -23,10 +23,10 @@
#include <paludis/util/stringify.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/set.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/hashes.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/name.hh>
#include <paludis/version_spec.hh>
#include <paludis/metadata_key.hh>
@@ -207,7 +207,7 @@ UnavailableRepositoryID::perform_action(Action & action) const
n::build_start_time() = build_start_time,
n::environment_file() = FSEntry("/dev/null"),
n::image_dir() = FSEntry("/dev/null"),
- n::merged_entries() = make_shared_ptr(new FSEntrySet),
+ n::merged_entries() = std::make_shared<FSEntrySet>(),
n::options() = MergerOptions(),
n::output_manager() = output_manager,
n::package_id() = shared_from_this(),
@@ -251,7 +251,7 @@ UnavailableRepositoryID::perform_action(Action & action) const
std::shared_ptr<const Set<std::string> >
UnavailableRepositoryID::breaks_portage() const
{
- return make_shared_ptr(new Set<std::string>);
+ return std::make_shared<Set<std::string>>();
}
bool
diff --git a/paludis/repositories/unavailable/unavailable_repository_store.cc b/paludis/repositories/unavailable/unavailable_repository_store.cc
index e1fa9b5..aa170b7 100644
--- a/paludis/repositories/unavailable/unavailable_repository_store.cc
+++ b/paludis/repositories/unavailable/unavailable_repository_store.cc
@@ -30,10 +30,10 @@
#include <paludis/util/set.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/hashes.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/is_file_with_extension.hh>
#include <paludis/util/log.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/name.hh>
#include <paludis/version_spec.hh>
#include <paludis/literal_metadata_key.hh>
@@ -157,7 +157,7 @@ UnavailableRepositoryStore::_populate_one(const Environment * const env, const F
PackageNames::iterator p(_imp->package_names.find((*i).name().category()));
if (_imp->package_names.end() == p)
p = _imp->package_names.insert(std::make_pair((*i).name().category(),
- make_shared_ptr(new QualifiedPackageNameSet))).first;
+ std::make_shared<QualifiedPackageNameSet>())).first;
pkgs = p->second;
}
@@ -167,12 +167,12 @@ UnavailableRepositoryStore::_populate_one(const Environment * const env, const F
IDs::iterator p(_imp->ids.find((*i).name()));
if (_imp->ids.end() == p)
p = _imp->ids.insert(std::make_pair((*i).name(),
- make_shared_ptr(new PackageIDSequence))).first;
+ std::make_shared<PackageIDSequence>())).first;
ids = p->second;
}
- ids->push_back(make_shared_ptr(new UnavailablePackageID(make_named_values<UnavailablePackageIDParams>(
+ ids->push_back(std::make_shared<UnavailablePackageID>(make_named_values<UnavailablePackageIDParams>(
n::description() = (*i).description(),
n::environment() = env,
n::from_repositories() = from_repositories,
@@ -183,7 +183,7 @@ UnavailableRepositoryStore::_populate_one(const Environment * const env, const F
n::repository_homepage() = repository_homepage,
n::slot() = (*i).slot(),
n::version() = (*i).version()
- ))));
+ )));
old_name = (*i).name();
}
@@ -215,12 +215,12 @@ UnavailableRepositoryStore::_populate_one(const Environment * const env, const F
PackageNames::iterator p(_imp->package_names.find(id->name().category()));
if (_imp->package_names.end() == p)
p = _imp->package_names.insert(std::make_pair(id->name().category(),
- make_shared_ptr(new QualifiedPackageNameSet))).first;
+ std::make_shared<QualifiedPackageNameSet>())).first;
p->second->insert(id->name());
IDs::iterator i(_imp->ids.find(id->name()));
if (_imp->ids.end() == i)
- i = _imp->ids.insert(std::make_pair(id->name(), make_shared_ptr(new PackageIDSequence))).first;
+ i = _imp->ids.insert(std::make_pair(id->name(), std::make_shared<PackageIDSequence>())).first;
i->second->push_back(id);
}
}
@@ -246,7 +246,7 @@ UnavailableRepositoryStore::category_names() const
std::shared_ptr<const CategoryNamePartSet>
UnavailableRepositoryStore::unimportant_category_names() const
{
- std::shared_ptr<CategoryNamePartSet> result(make_shared_ptr(new CategoryNamePartSet));
+ std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
result->insert(CategoryNamePart("virtual"));
result->insert(CategoryNamePart("repository"));
return result;
@@ -257,7 +257,7 @@ UnavailableRepositoryStore::package_names(const CategoryNamePart & c) const
{
PackageNames::iterator p(_imp->package_names.find(c));
if (_imp->package_names.end() == p)
- return make_shared_ptr(new QualifiedPackageNameSet);
+ return std::make_shared<QualifiedPackageNameSet>();
else
return p->second;
}
@@ -267,7 +267,7 @@ UnavailableRepositoryStore::package_ids(const QualifiedPackageName & p) const
{
IDs::iterator i(_imp->ids.find(p));
if (_imp->ids.end() == i)
- return make_shared_ptr(new PackageIDSequence);
+ return std::make_shared<PackageIDSequence>();
else
return i->second;
}
diff --git a/paludis/repositories/unpackaged/installed_id.cc b/paludis/repositories/unpackaged/installed_id.cc
index 5579489..20b1fd3 100644
--- a/paludis/repositories/unpackaged/installed_id.cc
+++ b/paludis/repositories/unpackaged/installed_id.cc
@@ -26,7 +26,6 @@
#include <paludis/util/fs_entry.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/dir_iterator.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/strip.hh>
#include <paludis/util/hashes.hh>
#include <paludis/util/make_named_values.hh>
@@ -34,6 +33,7 @@
#include <paludis/util/safe_ifstream.hh>
#include <paludis/util/return_literal_function.hh>
#include <paludis/util/timestamp.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/output_manager.hh>
#include <paludis/name.hh>
#include <paludis/version_spec.hh>
@@ -94,17 +94,17 @@ namespace
void create_file(Contents & c, const FSEntry & f)
{
- c.add(make_shared_ptr(new ContentsFileEntry(stringify(f))));
+ c.add(std::make_shared<ContentsFileEntry>(stringify(f)));
}
void create_dir(Contents & c, const FSEntry & f)
{
- c.add(make_shared_ptr(new ContentsDirEntry(stringify(f))));
+ c.add(std::make_shared<ContentsDirEntry>(stringify(f)));
}
void create_sym(Contents & c, const FSEntry & f, const FSEntry & t)
{
- c.add(make_shared_ptr(new ContentsSymEntry(stringify(f), stringify(t))));
+ c.add(std::make_shared<ContentsSymEntry>(stringify(f), stringify(t)));
}
class InstalledUnpackagedContentsKey :
@@ -430,10 +430,10 @@ namespace paludis
fs_location_key(new InstalledUnpackagedFSEntryKey(l)),
behaviours_key(new LiteralMetadataStringSetKey("behaviours", "behaviours", mkt_internal, behaviours_set))
{
- build_dependencies_labels->push_back(make_shared_ptr(new DependenciesBuildLabel("build_dependencies",
- return_literal_function(true))));
- run_dependencies_labels->push_back(make_shared_ptr(new DependenciesRunLabel("run_dependencies",
- return_literal_function(true))));
+ build_dependencies_labels->push_back(std::make_shared<DependenciesBuildLabel>("build_dependencies",
+ return_literal_function(true)));
+ run_dependencies_labels->push_back(std::make_shared<DependenciesRunLabel>("run_dependencies",
+ return_literal_function(true)));
if ((l / "contents").exists())
{
diff --git a/paludis/repositories/unpackaged/installed_repository.cc b/paludis/repositories/unpackaged/installed_repository.cc
index 74e532b..29cd3d8 100644
--- a/paludis/repositories/unpackaged/installed_repository.cc
+++ b/paludis/repositories/unpackaged/installed_repository.cc
@@ -24,7 +24,6 @@
#include <paludis/ndbam_merger.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/sequence.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/set.hh>
#include <paludis/util/dir_iterator.hh>
@@ -35,6 +34,7 @@
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/safe_ofstream.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/stringify_formatter.hh>
#include <paludis/action.hh>
#include <paludis/environment.hh>
@@ -364,7 +364,7 @@ InstalledUnpackagedRepository::merge(const MergeParams & m)
_imp->params.environment(), rewrite_ids_over_to_root, _1),
n::image() = m.image_dir(),
n::install_under() = install_under,
- n::merged_entries() = make_shared_ptr(new FSEntrySet),
+ n::merged_entries() = std::make_shared<FSEntrySet>(),
n::options() = m.options(),
n::output_manager() = m.output_manager(),
n::package_id() = m.package_id(),
@@ -465,12 +465,12 @@ InstalledUnpackagedRepository::repository_factory_create(
if (root.empty())
throw unpackaged_repositories::RepositoryConfigurationError("Key 'root' not specified or empty");
- return make_shared_ptr(new InstalledUnpackagedRepository(RepositoryName("installed-unpackaged"),
+ return std::make_shared<InstalledUnpackagedRepository>(RepositoryName("installed-unpackaged"),
make_named_values<unpackaged_repositories::InstalledUnpackagedRepositoryParams>(
n::environment() = env,
n::location() = location,
n::root() = root
- )));
+ ));
}
RepositoryName
@@ -486,7 +486,7 @@ InstalledUnpackagedRepository::repository_factory_dependencies(
const Environment * const,
const std::function<std::string (const std::string &)> &)
{
- return make_shared_ptr(new RepositoryNameSet);
+ return std::make_shared<RepositoryNameSet>();
}
void
diff --git a/paludis/repositories/unpackaged/installed_repository_TEST.cc b/paludis/repositories/unpackaged/installed_repository_TEST.cc
index fd1cc5a..c6ea021 100644
--- a/paludis/repositories/unpackaged/installed_repository_TEST.cc
+++ b/paludis/repositories/unpackaged/installed_repository_TEST.cc
@@ -35,6 +35,7 @@
#include <paludis/util/make_named_values.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/util/indirect_iterator-impl.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
#include <algorithm>
@@ -53,7 +54,7 @@ namespace
std::shared_ptr<OutputManager> make_standard_output_manager(const Action &)
{
- return make_shared_ptr(new StandardOutputManager);
+ return std::make_shared<StandardOutputManager>();
}
struct ContentsDumper
@@ -410,7 +411,7 @@ namespace test_cases
n::destination() = repo,
n::make_output_manager() = &make_standard_output_manager,
n::perform_uninstall() = &cannot_uninstall,
- n::replacing() = make_shared_ptr(new PackageIDSequence),
+ n::replacing() = std::make_shared<PackageIDSequence>(),
n::want_phase() = &want_all_phases
));
(*env[selection::RequireExactlyOne(generator::InRepository(RepositoryName("unpackaged")))]->begin())->perform_action(action);
@@ -467,7 +468,7 @@ namespace test_cases
n::destination() = repo,
n::make_output_manager() = &make_standard_output_manager,
n::perform_uninstall() = &cannot_uninstall,
- n::replacing() = make_shared_ptr(new PackageIDSequence),
+ n::replacing() = std::make_shared<PackageIDSequence>(),
n::want_phase() = &want_all_phases
));
(*env[selection::RequireExactlyOne(generator::InRepository(RepositoryName("unpackaged")))]->begin())->perform_action(action);
@@ -527,7 +528,7 @@ namespace test_cases
n::destination() = repo,
n::make_output_manager() = &make_standard_output_manager,
n::perform_uninstall() = &cannot_uninstall,
- n::replacing() = make_shared_ptr(new PackageIDSequence),
+ n::replacing() = std::make_shared<PackageIDSequence>(),
n::want_phase() = &want_all_phases
));
(*env[selection::RequireExactlyOne(generator::InRepository(RepositoryName("unpackaged")))]->begin())->perform_action(action);
diff --git a/paludis/repositories/unpackaged/unpackaged_id.cc b/paludis/repositories/unpackaged/unpackaged_id.cc
index ff23b0b..70a8045 100644
--- a/paludis/repositories/unpackaged/unpackaged_id.cc
+++ b/paludis/repositories/unpackaged/unpackaged_id.cc
@@ -24,11 +24,11 @@
#include <paludis/util/fs_entry.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/simple_visitor_cast.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/log.hh>
#include <paludis/util/hashes.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/return_literal_function.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/output_manager.hh>
#include <paludis/name.hh>
#include <paludis/version_spec.hh>
@@ -89,10 +89,10 @@ namespace paludis
description_key(new LiteralMetadataValueKey<std::string> ("description", "Description", mkt_significant, d)),
choices_key(new UnpackagedChoicesKey(env, "choices", "Choices", mkt_normal, id))
{
- build_dependencies_labels->push_back(make_shared_ptr(new DependenciesBuildLabel("build_dependencies",
- return_literal_function(true))));
- run_dependencies_labels->push_back(make_shared_ptr(new DependenciesRunLabel("run_dependencies",
- return_literal_function(true))));
+ build_dependencies_labels->push_back(std::make_shared<DependenciesBuildLabel>("build_dependencies",
+ return_literal_function(true)));
+ run_dependencies_labels->push_back(std::make_shared<DependenciesRunLabel>("run_dependencies",
+ return_literal_function(true)));
}
};
}
@@ -411,7 +411,7 @@ UnpackagedID::perform_action(Action & action) const
n::build_start_time() = build_start_time,
n::environment_file() = FSEntry("/dev/null"),
n::image_dir() = fs_location_key()->value(),
- n::merged_entries() = make_shared_ptr(new FSEntrySet),
+ n::merged_entries() = std::make_shared<FSEntrySet>(),
n::options() = (MergerOptions() + mo_rewrite_symlinks + mo_allow_empty_dirs)
| extra_merger_options,
n::output_manager() = output_manager,
diff --git a/paludis/repositories/unpackaged/unpackaged_key.cc b/paludis/repositories/unpackaged/unpackaged_key.cc
index b62d274..52551d5 100644
--- a/paludis/repositories/unpackaged/unpackaged_key.cc
+++ b/paludis/repositories/unpackaged/unpackaged_key.cc
@@ -22,7 +22,6 @@
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/mutex.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/set.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/choice.hh>
@@ -172,9 +171,9 @@ UnpackagedChoicesKey::value() const
n::raw_name() = canonical_build_options_raw_name(),
n::show_with_no_prefix() = false
)));
- build_options->add(make_shared_ptr(new ELikeSplitChoiceValue(_imp->id->shared_from_this(), _imp->env, build_options)));
- build_options->add(make_shared_ptr(new ELikeStripChoiceValue(_imp->id->shared_from_this(), _imp->env, build_options)));
- build_options->add(make_shared_ptr(new ELikePreserveWorkChoiceValue(_imp->id->shared_from_this(), _imp->env, build_options, true)));
+ build_options->add(std::make_shared<ELikeSplitChoiceValue>(_imp->id->shared_from_this(), _imp->env, build_options));
+ build_options->add(std::make_shared<ELikeStripChoiceValue>(_imp->id->shared_from_this(), _imp->env, build_options));
+ build_options->add(std::make_shared<ELikePreserveWorkChoiceValue>(_imp->id->shared_from_this(), _imp->env, build_options, true));
_imp->value->add(build_options);
}
diff --git a/paludis/repositories/unpackaged/unpackaged_repository.cc b/paludis/repositories/unpackaged/unpackaged_repository.cc
index b361129..b0a963e 100644
--- a/paludis/repositories/unpackaged/unpackaged_repository.cc
+++ b/paludis/repositories/unpackaged/unpackaged_repository.cc
@@ -23,10 +23,10 @@
#include <paludis/util/sequence.hh>
#include <paludis/util/set.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/destringify.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
#include <paludis/action.hh>
@@ -130,13 +130,13 @@ UnpackagedRepository::_add_metadata_keys() const
std::shared_ptr<const PackageIDSequence>
UnpackagedRepository::package_ids(const QualifiedPackageName & n) const
{
- return n == _imp->id->name() ? _imp->ids : make_shared_ptr(new PackageIDSequence);
+ return n == _imp->id->name() ? _imp->ids : std::make_shared<PackageIDSequence>();
}
std::shared_ptr<const QualifiedPackageNameSet>
UnpackagedRepository::package_names(const CategoryNamePart & c) const
{
- return c == _imp->id->name().category() ? _imp->package_names : make_shared_ptr(new QualifiedPackageNameSet);
+ return c == _imp->id->name().category() ? _imp->package_names : std::make_shared<QualifiedPackageNameSet>();
}
std::shared_ptr<const CategoryNamePartSet>
@@ -148,7 +148,7 @@ UnpackagedRepository::category_names() const
std::shared_ptr<const CategoryNamePartSet>
UnpackagedRepository::category_names_containing_package(const PackageNamePart & p) const
{
- return p == _imp->id->name().package() ? _imp->category_names : make_shared_ptr(new CategoryNamePartSet);
+ return p == _imp->id->name().package() ? _imp->category_names : std::make_shared<CategoryNamePartSet>();
}
bool
@@ -254,7 +254,7 @@ UnpackagedRepository::repository_factory_create(
rewrite_ids_over_to_root = destringify<int>(f("rewrite_ids_over_to_root"));
}
- return make_shared_ptr(new UnpackagedRepository(RepositoryName("unpackaged"),
+ return std::make_shared<UnpackagedRepository>(RepositoryName("unpackaged"),
make_named_values<unpackaged_repositories::UnpackagedRepositoryParams>(
n::build_dependencies() = build_dependencies,
n::description() = description,
@@ -266,7 +266,7 @@ UnpackagedRepository::repository_factory_create(
n::run_dependencies() = run_dependencies,
n::slot() = SlotName(slot),
n::version() = VersionSpec(version, user_version_spec_options())
- )));
+ ));
}
RepositoryName
@@ -282,7 +282,7 @@ UnpackagedRepository::repository_factory_dependencies(
const Environment * const,
const std::function<std::string (const std::string &)> &)
{
- return make_shared_ptr(new RepositoryNameSet);
+ return std::make_shared<RepositoryNameSet>();
}
void
diff --git a/paludis/repositories/unpackaged/unpackaged_repository_TEST.cc b/paludis/repositories/unpackaged/unpackaged_repository_TEST.cc
index 117a51e..3815578 100644
--- a/paludis/repositories/unpackaged/unpackaged_repository_TEST.cc
+++ b/paludis/repositories/unpackaged/unpackaged_repository_TEST.cc
@@ -50,7 +50,7 @@ namespace
std::shared_ptr<OutputManager> make_standard_output_manager(const Action &)
{
- return make_shared_ptr(new StandardOutputManager);
+ return std::make_shared<StandardOutputManager>();
}
void dummy_used_this_for_config_protect(const std::string &)
@@ -242,7 +242,7 @@ namespace test_cases
n::destination() = installed_repo,
n::make_output_manager() = &make_standard_output_manager,
n::perform_uninstall() = &cannot_uninstall,
- n::replacing() = make_shared_ptr(new PackageIDSequence),
+ n::replacing() = std::make_shared<PackageIDSequence>(),
n::want_phase() = &want_all_phases
));
id->perform_action(action);
@@ -298,7 +298,7 @@ namespace test_cases
n::destination() = installed_repo,
n::make_output_manager() = &make_standard_output_manager,
n::perform_uninstall() = &cannot_uninstall,
- n::replacing() = make_shared_ptr(new PackageIDSequence),
+ n::replacing() = std::make_shared<PackageIDSequence>(),
n::want_phase() = &want_all_phases
));
id->perform_action(action);
diff --git a/paludis/repositories/unwritten/unwritten_id.cc b/paludis/repositories/unwritten/unwritten_id.cc
index 72bb978..61270f3 100644
--- a/paludis/repositories/unwritten/unwritten_id.cc
+++ b/paludis/repositories/unwritten/unwritten_id.cc
@@ -23,8 +23,8 @@
#include <paludis/util/stringify.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/set.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/hashes.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/name.hh>
#include <paludis/version_spec.hh>
#include <paludis/metadata_key.hh>
@@ -178,7 +178,7 @@ UnwrittenID::perform_action(Action & a) const
std::shared_ptr<const Set<std::string> >
UnwrittenID::breaks_portage() const
{
- return make_shared_ptr(new Set<std::string>);
+ return std::make_shared<Set<std::string>>();
}
bool
diff --git a/paludis/repositories/unwritten/unwritten_repository.cc b/paludis/repositories/unwritten/unwritten_repository.cc
index 641e205..8e979b1 100644
--- a/paludis/repositories/unwritten/unwritten_repository.cc
+++ b/paludis/repositories/unwritten/unwritten_repository.cc
@@ -26,6 +26,7 @@
#include <paludis/util/tokeniser.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/extract_host_from_url.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/literal_metadata_key.hh>
#include <paludis/action.hh>
#include <paludis/syncer.hh>
@@ -40,7 +41,7 @@ namespace
std::shared_ptr<UnwrittenRepositoryStore>
make_store(const UnwrittenRepository * const repo, const UnwrittenRepositoryParams & p)
{
- return make_shared_ptr(new UnwrittenRepositoryStore(p.environment(), repo, p.location()));
+ return std::make_shared<UnwrittenRepositoryStore>(p.environment(), repo, p.location());
}
}
@@ -348,7 +349,7 @@ UnwrittenRepository::repository_factory_dependencies(
const Environment * const,
const std::function<std::string (const std::string &)> &)
{
- return make_shared_ptr(new RepositoryNameSet);
+ return std::make_shared<RepositoryNameSet>();
}
void
diff --git a/paludis/repositories/unwritten/unwritten_repository_file.cc b/paludis/repositories/unwritten/unwritten_repository_file.cc
index 6765004..28184c4 100644
--- a/paludis/repositories/unwritten/unwritten_repository_file.cc
+++ b/paludis/repositories/unwritten/unwritten_repository_file.cc
@@ -24,7 +24,6 @@
#include <paludis/util/simple_parser.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/tokeniser.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/join.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
@@ -310,7 +309,7 @@ UnwrittenRepositoryFile::_load(const FSEntry & f)
tokenise_whitespace(token2, std::back_inserter(tokens));
for (std::list<std::string>::const_iterator t(tokens.begin()), t_end(tokens.end()) ;
t != t_end ; ++t)
- tree->root()->append(make_shared_ptr(new SimpleURIDepSpec(*t)));
+ tree->root()->append(std::make_shared<SimpleURIDepSpec>(*t));
entry->homepage().reset(new UnwrittenHomepageKey("homepage", "Homepage", mkt_normal, tree));
}
else if (token == "comment")
diff --git a/paludis/repositories/unwritten/unwritten_repository_store.cc b/paludis/repositories/unwritten/unwritten_repository_store.cc
index 08e4530..bbb5d4e 100644
--- a/paludis/repositories/unwritten/unwritten_repository_store.cc
+++ b/paludis/repositories/unwritten/unwritten_repository_store.cc
@@ -28,7 +28,6 @@
#include <paludis/util/set.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/hashes.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/is_file_with_extension.hh>
#include <paludis/util/log.hh>
#include <paludis/util/make_named_values.hh>
@@ -118,7 +117,7 @@ UnwrittenRepositoryStore::_populate_one(const Environment * const env, const FSE
PackageNames::iterator p(_imp->package_names.find((*i).name().category()));
if (_imp->package_names.end() == p)
p = _imp->package_names.insert(std::make_pair((*i).name().category(),
- make_shared_ptr(new QualifiedPackageNameSet))).first;
+ std::make_shared<QualifiedPackageNameSet>())).first;
pkgs = p->second;
}
@@ -128,12 +127,12 @@ UnwrittenRepositoryStore::_populate_one(const Environment * const env, const FSE
IDs::iterator p(_imp->ids.find((*i).name()));
if (_imp->ids.end() == p)
p = _imp->ids.insert(std::make_pair((*i).name(),
- make_shared_ptr(new PackageIDSequence))).first;
+ std::make_shared<PackageIDSequence>())).first;
ids = p->second;
}
- ids->push_back(make_shared_ptr(new UnwrittenID(make_named_values<UnwrittenIDParams>(
+ ids->push_back(std::make_shared<UnwrittenID>(make_named_values<UnwrittenIDParams>(
n::added_by() = (*i).added_by(),
n::bug_ids() = (*i).bug_ids(),
n::comment() = (*i).comment(),
@@ -146,7 +145,7 @@ UnwrittenRepositoryStore::_populate_one(const Environment * const env, const FSE
n::repository() = _imp->repo,
n::slot() = (*i).slot(),
n::version() = (*i).version()
- ))));
+ )));
old_name = (*i).name();
}
@@ -173,7 +172,7 @@ UnwrittenRepositoryStore::category_names() const
std::shared_ptr<const CategoryNamePartSet>
UnwrittenRepositoryStore::unimportant_category_names() const
{
- std::shared_ptr<CategoryNamePartSet> result(make_shared_ptr(new CategoryNamePartSet));
+ std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
result->insert(CategoryNamePart("virtual"));
return result;
}
@@ -183,7 +182,7 @@ UnwrittenRepositoryStore::package_names(const CategoryNamePart & c) const
{
PackageNames::iterator p(_imp->package_names.find(c));
if (_imp->package_names.end() == p)
- return make_shared_ptr(new QualifiedPackageNameSet);
+ return std::make_shared<QualifiedPackageNameSet>();
else
return p->second;
}
@@ -193,7 +192,7 @@ UnwrittenRepositoryStore::package_ids(const QualifiedPackageName & p) const
{
IDs::iterator i(_imp->ids.find(p));
if (_imp->ids.end() == i)
- return make_shared_ptr(new PackageIDSequence);
+ return std::make_shared<PackageIDSequence>();
else
return i->second;
}
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository.cc b/paludis/repositories/virtuals/installed_virtuals_repository.cc
index 981517f..614114a 100644
--- a/paludis/repositories/virtuals/installed_virtuals_repository.cc
+++ b/paludis/repositories/virtuals/installed_virtuals_repository.cc
@@ -25,7 +25,6 @@
#include <paludis/package_database.hh>
#include <paludis/literal_metadata_key.hh>
#include <paludis/action.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/sequence.hh>
@@ -36,6 +35,7 @@
#include <paludis/util/make_named_values.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/wrapped_output_iterator.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <functional>
#include <unordered_map>
@@ -61,7 +61,7 @@ namespace paludis
std::shared_ptr<const MetadataValueKey<FSEntry> > root_key;
std::shared_ptr<const MetadataValueKey<std::string> > format_key;
- Implementation(const Environment * const e, const FSEntry & r, std::shared_ptr<Mutex> m = make_shared_ptr(new Mutex)) :
+ Implementation(const Environment * const e, const FSEntry & r, std::shared_ptr<Mutex> m = std::make_shared<Mutex>()) :
env(e),
root(r),
ids_mutex(m),
@@ -154,7 +154,7 @@ InstalledVirtualsRepository::need_ids() const
{
IDMap::iterator i(_imp->ids.find((*p).virtual_name()));
if (i == _imp->ids.end())
- i = _imp->ids.insert(std::make_pair((*p).virtual_name(), make_shared_ptr(new PackageIDSequence))).first;
+ i = _imp->ids.insert(std::make_pair((*p).virtual_name(), std::make_shared<PackageIDSequence>())).first;
std::shared_ptr<const PackageID> id(new virtuals::VirtualsPackageID(
_imp->env, shared_from_this(), (*p).virtual_name(), (*p).provided_by(), false));
@@ -309,7 +309,7 @@ InstalledVirtualsRepository::some_ids_might_not_be_masked() const
std::shared_ptr<const CategoryNamePartSet>
InstalledVirtualsRepository::unimportant_category_names() const
{
- std::shared_ptr<CategoryNamePartSet> result(make_shared_ptr(new CategoryNamePartSet));
+ std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
result->insert(CategoryNamePart("virtual"));
return result;
}
@@ -353,7 +353,7 @@ InstalledVirtualsRepository::repository_factory_create(
if (f("root").empty())
throw ConfigurationError("Key 'root' unspecified or empty");
- return make_shared_ptr(new InstalledVirtualsRepository(env, f("root")));
+ return std::make_shared<InstalledVirtualsRepository>(env, f("root"));
}
std::shared_ptr<const RepositoryNameSet>
@@ -361,7 +361,7 @@ InstalledVirtualsRepository::repository_factory_dependencies(
const Environment * const,
const std::function<std::string (const std::string &)> &)
{
- return make_shared_ptr(new RepositoryNameSet);
+ return std::make_shared<RepositoryNameSet>();
}
bool
diff --git a/paludis/repositories/virtuals/package_id.cc b/paludis/repositories/virtuals/package_id.cc
index 90a1b12..de93cc4 100644
--- a/paludis/repositories/virtuals/package_id.cc
+++ b/paludis/repositories/virtuals/package_id.cc
@@ -21,12 +21,12 @@
#include <paludis/repositories/virtuals/installed_virtuals_repository.hh>
#include <paludis/repositories/virtuals/virtuals_repository.hh>
#include <paludis/util/stringify.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/hashes.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/return_literal_function.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/name.hh>
#include <paludis/dep_spec.hh>
#include <paludis/version_spec.hh>
@@ -64,23 +64,23 @@ namespace paludis
const std::shared_ptr<const DependenciesLabelSequence> & l,
bool exact, const std::string & h, const std::string & r) :
env(e),
- value(new DependencySpecTree(make_shared_ptr(new AllDepSpec))),
+ value(new DependencySpecTree(std::make_shared<AllDepSpec>())),
labels(l),
spec(exact ?
- make_shared_ptr(new PackageDepSpec(
+ std::make_shared<PackageDepSpec>(
make_package_dep_spec(PartiallyMadePackageDepSpecOptions())
.package(v->name())
.version_requirement(make_named_values<VersionRequirement>(
n::version_operator() = vo_equal,
n::version_spec() = v->version()))
- .slot_requirement(make_shared_ptr(new UserSlotExactRequirement(
- v->slot_key() ? v->slot_key()->value() : SlotName("UNKNOWN"))))
- .in_repository(v->repository()->name())))
+ .slot_requirement(std::make_shared<UserSlotExactRequirement>(
+ v->slot_key() ? v->slot_key()->value() : SlotName("UNKNOWN")))
+ .in_repository(v->repository()->name()))
:
- make_shared_ptr(new PackageDepSpec(
+ std::make_shared<PackageDepSpec>(
make_package_dep_spec(PartiallyMadePackageDepSpecOptions())
.package(v->name())
- ))
+ )
),
raw_name(r),
human_name(h)
@@ -191,10 +191,10 @@ namespace paludis
rdep(new virtuals::VirtualsDepKey(e, "RDEPEND", "Run dependencies", p, rdep_labels, b)),
has_masks(false)
{
- bdep_labels->push_back(make_shared_ptr(new DependenciesBuildLabel("DEPEND",
- return_literal_function(true))));
- rdep_labels->push_back(make_shared_ptr(new DependenciesRunLabel("RDEPEND",
- return_literal_function(true))));
+ bdep_labels->push_back(std::make_shared<DependenciesBuildLabel>("DEPEND",
+ return_literal_function(true)));
+ rdep_labels->push_back(std::make_shared<DependenciesRunLabel>("RDEPEND",
+ return_literal_function(true)));
}
};
}
@@ -498,7 +498,7 @@ VirtualsPackageID::need_masks_added() const
return;
if (_imp->virtual_for->value()->masked())
- add_mask(make_shared_ptr(new VirtualsAssociationMask(_imp->virtual_for->value())));
+ add_mask(std::make_shared<VirtualsAssociationMask>(_imp->virtual_for->value()));
_imp->has_masks = true;
}
diff --git a/paludis/repositories/virtuals/virtuals_repository.cc b/paludis/repositories/virtuals/virtuals_repository.cc
index e680ae5..4b2d84b 100644
--- a/paludis/repositories/virtuals/virtuals_repository.cc
+++ b/paludis/repositories/virtuals/virtuals_repository.cc
@@ -32,7 +32,6 @@
#include <paludis/hook.hh>
#include <paludis/util/log.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/operators.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/map.hh>
@@ -43,6 +42,7 @@
#include <paludis/util/make_named_values.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/wrapped_output_iterator.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <functional>
#include <unordered_map>
@@ -71,7 +71,7 @@ namespace paludis
std::shared_ptr<const MetadataValueKey<std::string> > format_key;
- Implementation(const Environment * const e, std::shared_ptr<Mutex> m = make_shared_ptr(new Mutex)) :
+ Implementation(const Environment * const e, std::shared_ptr<Mutex> m = std::make_shared<Mutex>()) :
env(e),
big_nasty_mutex(m),
has_names(false),
@@ -236,7 +236,7 @@ VirtualsRepository::need_ids() const
{
IDMap::iterator i(my_ids.find(v->first));
if (my_ids.end() == i)
- i = my_ids.insert(std::make_pair(v->first, make_shared_ptr(new PackageIDSequence))).first;
+ i = my_ids.insert(std::make_pair(v->first, std::make_shared<PackageIDSequence>())).first;
std::shared_ptr<const PackageID> id(make_virtual_package_id(QualifiedPackageName(v->first), *m));
if (stringify(id->name().category()) != "virtual")
@@ -337,7 +337,7 @@ VirtualsRepository::make_virtual_package_id(
throw InternalError(PALUDIS_HERE, "tried to make a virtual package id using '" + stringify(virtual_name) + "', '"
+ stringify(*provider) + "'");
- return make_shared_ptr(new virtuals::VirtualsPackageID(_imp->env, shared_from_this(), virtual_name, provider, true));
+ return std::make_shared<virtuals::VirtualsPackageID>(_imp->env, shared_from_this(), virtual_name, provider, true);
}
bool
@@ -409,7 +409,7 @@ VirtualsRepository::some_ids_might_not_be_masked() const
std::shared_ptr<const CategoryNamePartSet>
VirtualsRepository::unimportant_category_names() const
{
- std::shared_ptr<CategoryNamePartSet> result(make_shared_ptr(new CategoryNamePartSet));
+ std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
result->insert(CategoryNamePart("virtual"));
return result;
}
@@ -450,7 +450,7 @@ VirtualsRepository::repository_factory_create(
const Environment * const env,
const std::function<std::string (const std::string &)> &)
{
- return make_shared_ptr(new VirtualsRepository(env));
+ return std::make_shared<VirtualsRepository>(env);
}
std::shared_ptr<const RepositoryNameSet>
@@ -458,7 +458,7 @@ VirtualsRepository::repository_factory_dependencies(
const Environment * const,
const std::function<std::string (const std::string &)> &)
{
- return make_shared_ptr(new RepositoryNameSet);
+ return std::make_shared<RepositoryNameSet>();
}
void
diff --git a/paludis/repositories/virtuals/virtuals_repository_TEST.cc b/paludis/repositories/virtuals/virtuals_repository_TEST.cc
index 11d574f..e7aece2 100644
--- a/paludis/repositories/virtuals/virtuals_repository_TEST.cc
+++ b/paludis/repositories/virtuals/virtuals_repository_TEST.cc
@@ -33,7 +33,6 @@
#include <paludis/util/sequence.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/indirect_iterator-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/options.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/user_dep_spec.hh>
@@ -71,8 +70,8 @@ namespace test_cases
repo->add_version("cat", "pkg", "1")->provide_key()->set_from_string("virtual/pkg");
repo->add_version("cat", "pkg", "2")->provide_key()->set_from_string("virtual/pkg");
- repo->add_virtual_package(QualifiedPackageName("virtual/pkg"), make_shared_ptr(new PackageDepSpec(
- parse_user_package_dep_spec(">=cat/pkg-2", &env, UserPackageDepSpecOptions()))));
+ repo->add_virtual_package(QualifiedPackageName("virtual/pkg"), std::make_shared<PackageDepSpec>(
+ parse_user_package_dep_spec(">=cat/pkg-2", &env, UserPackageDepSpecOptions())));
TEST_CHECK(repo->virtual_packages());
TEST_CHECK_EQUAL(std::distance(repo->virtual_packages()->begin(), repo->virtual_packages()->end()), 1);
@@ -117,15 +116,15 @@ namespace test_cases
repo1->add_version("cat", "pkg", "1")->provide_key()->set_from_string("virtual/pkg");
repo1->add_version("cat", "pkg", "2")->provide_key()->set_from_string("virtual/pkg");
- repo1->add_virtual_package(QualifiedPackageName("virtual/pkg"), make_shared_ptr(
- new PackageDepSpec(parse_user_package_dep_spec(">=cat/pkg-2", &env, UserPackageDepSpecOptions()))));
- repo1->add_virtual_package(QualifiedPackageName("virtual/foo"), make_shared_ptr(
- new PackageDepSpec(parse_user_package_dep_spec(">=cat/pkg-2", &env, UserPackageDepSpecOptions()))));
+ repo1->add_virtual_package(QualifiedPackageName("virtual/pkg"), std::make_shared<PackageDepSpec>(
+ parse_user_package_dep_spec(">=cat/pkg-2", &env, UserPackageDepSpecOptions())));
+ repo1->add_virtual_package(QualifiedPackageName("virtual/foo"), std::make_shared<PackageDepSpec>(
+ parse_user_package_dep_spec(">=cat/pkg-2", &env, UserPackageDepSpecOptions())));
- repo2->add_virtual_package(QualifiedPackageName("virtual/pkg"), make_shared_ptr(new PackageDepSpec(
- parse_user_package_dep_spec(">=cat/pkg-2", &env, UserPackageDepSpecOptions()))));
- repo2->add_virtual_package(QualifiedPackageName("virtual/foo"), make_shared_ptr(new PackageDepSpec(
- parse_user_package_dep_spec("<=cat/pkg-1", &env, UserPackageDepSpecOptions()))));
+ repo2->add_virtual_package(QualifiedPackageName("virtual/pkg"), std::make_shared<PackageDepSpec>(
+ parse_user_package_dep_spec(">=cat/pkg-2", &env, UserPackageDepSpecOptions())));
+ repo2->add_virtual_package(QualifiedPackageName("virtual/foo"), std::make_shared<PackageDepSpec>(
+ parse_user_package_dep_spec("<=cat/pkg-1", &env, UserPackageDepSpecOptions())));
TEST_CHECK(virtuals->has_category_named(CategoryNamePart("virtual")));
TEST_CHECK(virtuals->has_package_named(QualifiedPackageName("virtual/pkg")));
@@ -161,12 +160,12 @@ namespace test_cases
env.package_database()->add_repository(4, virtuals);
repo1->add_version("virtual", "gkp", "1")->provide_key()->set_from_string("virtual/pkg");
- repo1->add_virtual_package(QualifiedPackageName("virtual/pkg"), make_shared_ptr(
- new PackageDepSpec(parse_user_package_dep_spec("virtual/gkp", &env, UserPackageDepSpecOptions()))));
+ repo1->add_virtual_package(QualifiedPackageName("virtual/pkg"), std::make_shared<PackageDepSpec>(
+ parse_user_package_dep_spec("virtual/gkp", &env, UserPackageDepSpecOptions())));
repo2->add_version("virtual", "pkg", "2")->provide_key()->set_from_string("virtual/pkg");
- repo2->add_virtual_package(QualifiedPackageName("virtual/pkg"), make_shared_ptr(new PackageDepSpec(
- parse_user_package_dep_spec("virtual/pkg", &env, UserPackageDepSpecOptions()))));
+ repo2->add_virtual_package(QualifiedPackageName("virtual/pkg"), std::make_shared<PackageDepSpec>(
+ parse_user_package_dep_spec("virtual/pkg", &env, UserPackageDepSpecOptions())));
TEST_CHECK(virtuals->has_category_named(CategoryNamePart("virtual")));
TEST_CHECK(virtuals->has_package_named(QualifiedPackageName("virtual/pkg")));
diff --git a/paludis/repository.cc b/paludis/repository.cc
index 256711f..92f77c1 100644
--- a/paludis/repository.cc
+++ b/paludis/repository.cc
@@ -22,7 +22,6 @@
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/indirect_iterator-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/options.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/sequence-impl.hh>
@@ -106,10 +105,10 @@ namespace paludis
static std::shared_ptr<RepositoryDistribution> make_data(const std::shared_ptr<const KeyValueConfigFile> & k)
{
- return make_shared_ptr(new RepositoryDistribution(make_named_values<RepositoryDistribution>(
+ return std::make_shared<RepositoryDistribution>(make_named_values<RepositoryDistribution>(
n::repository_blacklist() = std::bind(std::mem_fn(&KeyValueConfigFile::get),
k, std::placeholders::_1)
- )));
+ ));
}
};
}
@@ -214,7 +213,7 @@ Repository::can_be_favourite_repository() const
std::shared_ptr<const CategoryNamePartSet>
Repository::unimportant_category_names() const
{
- return make_shared_ptr(new CategoryNamePartSet);
+ return std::make_shared<CategoryNamePartSet>();
}
void
diff --git a/paludis/resolver/constraint.cc b/paludis/resolver/constraint.cc
index a9b0d03..96bfeff 100644
--- a/paludis/resolver/constraint.cc
+++ b/paludis/resolver/constraint.cc
@@ -201,7 +201,7 @@ Constraint::deserialise(Deserialisation & d)
const std::shared_ptr<Reason> reason(v.member<std::shared_ptr<Reason> >("reason"));
IDFinder id_finder;
- return make_shared_ptr(new Constraint(make_named_values<Constraint>(
+ return std::make_shared<Constraint>(make_named_values<Constraint>(
n::destination_type() = destringify<DestinationType>(v.member<std::string>("destination_type")),
n::nothing_is_fine_too() = v.member<bool>("nothing_is_fine_too"),
n::reason() = reason,
@@ -209,7 +209,7 @@ Constraint::deserialise(Deserialisation & d)
reason->accept_returning<std::shared_ptr<const PackageID> >(id_finder)),
n::untaken() = v.member<bool>("untaken"),
n::use_existing() = destringify<UseExisting>(v.member<std::string>("use_existing"))
- )));
+ ));
}
template class PrivateImplementationPattern<Constraints>;
diff --git a/paludis/resolver/decider.cc b/paludis/resolver/decider.cc
index f9804a5..0ecd82c 100644
--- a/paludis/resolver/decider.cc
+++ b/paludis/resolver/decider.cc
@@ -35,7 +35,6 @@
#include <paludis/util/exception.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/make_named_values.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/make_shared_copy.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/wrapped_output_iterator.hh>
@@ -44,6 +43,7 @@
#include <paludis/util/tribool.hh>
#include <paludis/util/log.hh>
#include <paludis/util/simple_visitor_cast.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/environment.hh>
#include <paludis/notifier_callback.hh>
#include <paludis/repository.hh>
@@ -253,10 +253,10 @@ Decider::_resolve_dependents()
_apply_resolution_constraint(resolution, *c);
if ((! remove) && (! resolution->decision()))
- resolution->decision() = make_shared_ptr(new BreakDecision(
+ resolution->decision() = std::make_shared<BreakDecision>(
resolvent,
*s,
- true));
+ true);
}
return changed;
@@ -531,10 +531,10 @@ Decider::_make_destination_for(
throw InternalError(PALUDIS_HERE, stringify(repo->name()) + " is not a suitable destination for "
+ stringify(*decision.origin_id()));
- return make_shared_ptr(new Destination(make_named_values<Destination>(
+ return std::make_shared<Destination>(make_named_values<Destination>(
n::replacing() = _find_replacing(decision.origin_id(), repo),
n::repository() = repo->name()
- )));
+ ));
}
const ChangeType
@@ -649,11 +649,11 @@ Decider::_same_slot(const std::shared_ptr<const PackageID> & a,
const std::shared_ptr<Resolution>
Decider::_create_resolution_for_resolvent(const Resolvent & r) const
{
- return make_shared_ptr(new Resolution(make_named_values<Resolution>(
+ return std::make_shared<Resolution>(make_named_values<Resolution>(
n::constraints() = _initial_constraints_for(r),
n::decision() = make_null_shared_ptr(),
n::resolvent() = r
- )));
+ ));
}
const std::shared_ptr<Resolution>
@@ -686,14 +686,14 @@ Decider::_make_constraints_from_target(
if (spec.if_package())
{
const std::shared_ptr<ConstraintSequence> result(new ConstraintSequence);
- result->push_back(make_shared_ptr(new Constraint(make_named_values<Constraint>(
+ result->push_back(std::make_shared<Constraint>(make_named_values<Constraint>(
n::destination_type() = resolution->resolvent().destination_type(),
n::nothing_is_fine_too() = false,
n::reason() = reason,
n::spec() = spec,
n::untaken() = false,
n::use_existing() = _imp->fns.get_use_existing_fn()(resolution, *spec.if_package(), reason)
- ))));
+ )));
return result;
}
else if (spec.if_block())
@@ -712,14 +712,14 @@ Decider::_make_constraints_from_dependency(
if (dep.spec().if_package())
{
const std::shared_ptr<ConstraintSequence> result(new ConstraintSequence);
- result->push_back(make_shared_ptr(new Constraint(make_named_values<Constraint>(
+ result->push_back(std::make_shared<Constraint>(make_named_values<Constraint>(
n::destination_type() = resolution->resolvent().destination_type(),
n::nothing_is_fine_too() = false,
n::reason() = reason,
n::spec() = *dep.spec().if_package(),
n::untaken() = si_untaken == interest,
n::use_existing() = _imp->fns.get_use_existing_fn()(resolution, *dep.spec().if_package(), reason)
- ))));
+ )));
return result;
}
else if (dep.spec().if_block())
@@ -739,14 +739,14 @@ Decider::_make_constraints_from_blocker(
DestinationTypes destination_types(_get_destination_types_for_blocker(spec));
for (EnumIterator<DestinationType> t, t_end(last_dt) ; t != t_end ; ++t)
if (destination_types[*t])
- result->push_back(make_shared_ptr(new Constraint(make_named_values<Constraint>(
+ result->push_back(std::make_shared<Constraint>(make_named_values<Constraint>(
n::destination_type() = *t,
n::nothing_is_fine_too() = true,
n::reason() = reason,
n::spec() = spec,
n::untaken() = false,
n::use_existing() = ue_if_possible
- ))));
+ )));
return result;
}
@@ -967,7 +967,7 @@ Decider::_made_wrong_decision(
const std::shared_ptr<const Constraint> & constraint)
{
/* can we find a resolution that works for all our constraints? */
- std::shared_ptr<Resolution> adapted_resolution(make_shared_ptr(new Resolution(*resolution)));
+ std::shared_ptr<Resolution> adapted_resolution(std::make_shared<Resolution>(*resolution));
adapted_resolution->constraints()->add(constraint);
const std::shared_ptr<Decision> decision(_try_to_find_decision_for(adapted_resolution));
@@ -1004,15 +1004,15 @@ Decider::_make_constraint_for_preloading(
if (result->spec().if_package())
{
PackageDepSpec s(_make_spec_for_preloading(*result->spec().if_package()));
- result->spec().if_package() = make_shared_ptr(new PackageDepSpec(s));
+ result->spec().if_package() = std::make_shared<PackageDepSpec>(s);
}
else
{
PackageDepSpec s(_make_spec_for_preloading(result->spec().if_block()->blocking()));
- result->spec().if_block() = make_shared_ptr(new BlockDepSpec(
+ result->spec().if_block() = std::make_shared<BlockDepSpec>(
"!" + stringify(s),
s,
- result->spec().if_block()->strong()));
+ result->spec().if_block()->strong());
}
return result;
@@ -1374,7 +1374,7 @@ namespace
{
std::shared_ptr<SlotName> visit(const SlotExactRequirement & s)
{
- return make_shared_ptr(new SlotName(s.slot()));
+ return std::make_shared<SlotName>(s.slot());
}
std::shared_ptr<SlotName> visit(const SlotAnyUnlockedRequirement &)
@@ -1487,17 +1487,17 @@ Decider::_try_to_find_decision_for(
if (existing_resolvent_ids->empty())
{
/* nothing existing, but nothing's ok */
- return make_shared_ptr(new NothingNoChangeDecision(
+ return std::make_shared<NothingNoChangeDecision>(
resolution->resolvent(),
! resolution->constraints()->all_untaken()
- ));
+ );
}
}
if (installable_id && ! existing_id)
{
/* there's nothing suitable existing. */
- return make_shared_ptr(new ChangesToMakeDecision(
+ return std::make_shared<ChangesToMakeDecision>(
resolution->resolvent(),
installable_id,
best,
@@ -1505,7 +1505,7 @@ Decider::_try_to_find_decision_for(
! resolution->constraints()->all_untaken(),
make_null_shared_ptr(),
std::bind(&Decider::_fixup_changes_to_make_decision, this, resolution, std::placeholders::_1)
- ));
+ );
}
else if (existing_id && ! installable_id)
{
@@ -1532,14 +1532,14 @@ Decider::_try_to_find_decision_for(
break;
}
- return make_shared_ptr(new ExistingNoChangeDecision(
+ return std::make_shared<ExistingNoChangeDecision>(
resolution->resolvent(),
existing_id,
true,
true,
is_transient,
! resolution->constraints()->all_untaken()
- ));
+ );
}
else if ((! existing_id) && (! installable_id))
{
@@ -1547,11 +1547,11 @@ Decider::_try_to_find_decision_for(
* fix it by installing things. this might be an error, or we might be
* able to remove things. */
if (resolution->constraints()->nothing_is_fine_too() && _installed_but_allowed_to_remove(resolution))
- return make_shared_ptr(new RemoveDecision(
+ return std::make_shared<RemoveDecision>(
resolution->resolvent(),
_installed_ids(resolution),
! resolution->constraints()->all_untaken()
- ));
+ );
else
return make_null_shared_ptr();
}
@@ -1676,11 +1676,11 @@ Decider::_cannot_decide_for(
i != i_end ; ++i)
unsuitable_candidates->push_back(_make_unsuitable_candidate(resolution, *i, false));
- return make_shared_ptr(new UnableToMakeDecision(
+ return std::make_shared<UnableToMakeDecision>(
resolution->resolvent(),
unsuitable_candidates,
! resolution->constraints()->all_untaken()
- ));
+ );
}
UnsuitableCandidate
@@ -2247,7 +2247,7 @@ Decider::_collect_depped_upon(
const std::shared_ptr<const PackageID> & id,
const std::shared_ptr<const PackageIDSequence> & candidates) const
{
- DependentChecker<PackageIDSequence> c(_imp->env, candidates, make_shared_ptr(new PackageIDSequence));
+ DependentChecker<PackageIDSequence> c(_imp->env, candidates, std::make_shared<PackageIDSequence>());
if (id->dependencies_key())
id->dependencies_key()->value()->root()->accept(c);
else
@@ -2329,10 +2329,10 @@ namespace
result->push_back(make_shared_copy(make_named_values<Constraint>(
n::destination_type() = destination_type,
n::nothing_is_fine_too() = true,
- n::reason() = make_shared_ptr(new LikeOtherDestinationTypeReason(
+ n::reason() = std::make_shared<LikeOtherDestinationTypeReason>(
resolvent,
from_constraint->reason()
- )),
+ ),
n::spec() = from_constraint->spec(),
n::untaken() = from_constraint->untaken(),
n::use_existing() = ue_if_possible
diff --git a/paludis/resolver/decision.cc b/paludis/resolver/decision.cc
index 0d91a0d..6a969e1 100644
--- a/paludis/resolver/decision.cc
+++ b/paludis/resolver/decision.cc
@@ -28,6 +28,7 @@
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/serialise-impl.hh>
#include <sstream>
@@ -42,22 +43,22 @@ Decision::deserialise(Deserialisation & d)
if (d.class_name() == "NothingNoChangeDecision")
{
Deserialisator v(d, "NothingNoChangeDecision");
- return make_shared_ptr(new NothingNoChangeDecision(
+ return std::make_shared<NothingNoChangeDecision>(
v.member<Resolvent>("resolvent"),
v.member<bool>("taken")
- ));
+ );
}
else if (d.class_name() == "ExistingNoChangeDecision")
{
Deserialisator v(d, "ExistingNoChangeDecision");
- return make_shared_ptr(new ExistingNoChangeDecision(
+ return std::make_shared<ExistingNoChangeDecision>(
v.member<Resolvent>("resolvent"),
v.member<std::shared_ptr<const PackageID> >("existing_id"),
v.member<bool>("is_same"),
v.member<bool>("is_same_version"),
v.member<bool>("is_transient"),
v.member<bool>("taken")
- ));
+ );
}
else if (d.class_name() == "ChangesToMakeDecision")
{
@@ -156,11 +157,11 @@ UnableToMakeDecision::deserialise(Deserialisation & d)
for (int n(1), n_end(vv.member<int>("count") + 1) ; n != n_end ; ++n)
unsuitable_candidates->push_back(vv.member<UnsuitableCandidate>(stringify(n)));
- return make_shared_ptr(new UnableToMakeDecision(
+ return std::make_shared<UnableToMakeDecision>(
v.member<Resolvent>("resolvent"),
unsuitable_candidates,
v.member<bool>("taken")
- ));
+ );
}
const std::shared_ptr<RemoveDecision>
diff --git a/paludis/resolver/destination.cc b/paludis/resolver/destination.cc
index 12ab030..78a86b1 100644
--- a/paludis/resolver/destination.cc
+++ b/paludis/resolver/destination.cc
@@ -18,7 +18,6 @@
*/
#include <paludis/resolver/destination.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/make_named_values.hh>
@@ -40,10 +39,10 @@ Destination::deserialise(Deserialisation & d)
replacing->push_back(vv.member<std::shared_ptr<const PackageID> >(stringify(n)));
- return make_shared_ptr(new Destination(make_named_values<Destination>(
+ return std::make_shared<Destination>(make_named_values<Destination>(
n::replacing() = replacing,
n::repository() = RepositoryName(v.member<std::string>("repository"))
- )));
+ ));
}
void
diff --git a/paludis/resolver/job.cc b/paludis/resolver/job.cc
index 45de5c7..6a7adbd 100644
--- a/paludis/resolver/job.cc
+++ b/paludis/resolver/job.cc
@@ -21,7 +21,6 @@
#include <paludis/resolver/job_requirements.hh>
#include <paludis/resolver/job_state.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/sequence-impl.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/serialise-impl.hh>
@@ -66,10 +65,10 @@ const std::shared_ptr<PretendJob>
PretendJob::deserialise(Deserialisation & d)
{
Deserialisator v(d, "PretendJob");
- return make_shared_ptr(new PretendJob(
+ return std::make_shared<PretendJob>(
parse_user_package_dep_spec(v.member<std::string>("origin_id_spec"),
d.deserialiser().environment(), UserPackageDepSpecOptions() + updso_no_disambiguation)
- ));
+ );
}
void
diff --git a/paludis/resolver/job_state.cc b/paludis/resolver/job_state.cc
index 0d44f50..ab49d29 100644
--- a/paludis/resolver/job_state.cc
+++ b/paludis/resolver/job_state.cc
@@ -19,7 +19,7 @@
#include <paludis/resolver/job_state.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/serialise-impl.hh>
using namespace paludis;
@@ -81,7 +81,7 @@ const std::shared_ptr<JobPendingState>
JobPendingState::deserialise(Deserialisation & d)
{
Deserialisator v(d, "JobPendingState");
- return make_shared_ptr(new JobPendingState);
+ return std::make_shared<JobPendingState>();
}
void
@@ -95,7 +95,7 @@ const std::shared_ptr<JobSkippedState>
JobSkippedState::deserialise(Deserialisation & d)
{
Deserialisator v(d, "JobSkippedState");
- return make_shared_ptr(new JobSkippedState);
+ return std::make_shared<JobSkippedState>();
}
void
@@ -129,20 +129,20 @@ JobActiveState::output_manager() const
const std::shared_ptr<JobSucceededState>
JobActiveState::succeeded() const
{
- return make_shared_ptr(new JobSucceededState(_imp->output_manager));
+ return std::make_shared<JobSucceededState>(_imp->output_manager);
}
const std::shared_ptr<JobFailedState>
JobActiveState::failed() const
{
- return make_shared_ptr(new JobFailedState(_imp->output_manager));
+ return std::make_shared<JobFailedState>(_imp->output_manager);
}
const std::shared_ptr<JobActiveState>
JobActiveState::deserialise(Deserialisation & d)
{
Deserialisator v(d, "JobActiveState");
- return make_shared_ptr(new JobActiveState());
+ return std::make_shared<JobActiveState>();
}
void
@@ -171,7 +171,7 @@ const std::shared_ptr<JobSucceededState>
JobSucceededState::deserialise(Deserialisation & d)
{
Deserialisator v(d, "JobSucceededState");
- return make_shared_ptr(new JobSucceededState(make_null_shared_ptr()));
+ return std::make_shared<JobSucceededState>(make_null_shared_ptr());
}
void
@@ -200,7 +200,7 @@ const std::shared_ptr<JobFailedState>
JobFailedState::deserialise(Deserialisation & d)
{
Deserialisator v(d, "JobFailedState");
- return make_shared_ptr(new JobFailedState(make_null_shared_ptr()));
+ return std::make_shared<JobFailedState>(make_null_shared_ptr());
}
void
diff --git a/paludis/resolver/nag.cc b/paludis/resolver/nag.cc
index f26e79f..3e96bca 100644
--- a/paludis/resolver/nag.cc
+++ b/paludis/resolver/nag.cc
@@ -25,7 +25,6 @@
#include <paludis/util/exception.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/make_named_values.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/wrapped_output_iterator-impl.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/sequence.hh>
@@ -214,8 +213,8 @@ namespace
if (node_data->second.index() == node_data->second.lowlink())
{
StronglyConnectedComponent scc(make_named_values<StronglyConnectedComponent>(
- n::nodes() = make_shared_ptr(new Set<NAGIndex>),
- n::requirements() = make_shared_ptr(new Set<NAGIndex>)
+ n::nodes() = std::make_shared<Set<NAGIndex>>(),
+ n::requirements() = std::make_shared<Set<NAGIndex>>()
));
std::copy(stack.begin(), top_of_stack_before_node, scc.nodes()->inserter());
diff --git a/paludis/resolver/orderer.cc b/paludis/resolver/orderer.cc
index 5fd7392..317b952 100644
--- a/paludis/resolver/orderer.cc
+++ b/paludis/resolver/orderer.cc
@@ -41,7 +41,6 @@
#include <paludis/util/hashes.hh>
#include <paludis/util/join.hh>
#include <paludis/util/make_named_values.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/make_shared_copy.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/tribool.hh>
@@ -796,8 +795,8 @@ namespace
if (fetch_job_n == fetch_job_numbers.end())
throw InternalError(PALUDIS_HERE, "haven't scheduled the fetch for " + stringify(index.resolvent()) + " yet");
- resolved->job_lists()->pretend_job_list()->append(make_shared_ptr(new PretendJob(
- changes_to_make_decision.origin_id()->uniquely_identifying_spec())));
+ resolved->job_lists()->pretend_job_list()->append(std::make_shared<PretendJob>(
+ changes_to_make_decision.origin_id()->uniquely_identifying_spec()));
const std::shared_ptr<JobRequirements> requirements(new JobRequirements);
requirements->push_back(make_named_values<JobRequirement>(
@@ -824,13 +823,13 @@ namespace
i != i_end ; ++i)
replacing->push_back((*i)->uniquely_identifying_spec());
- JobNumber install_job_n(resolved->job_lists()->execute_job_list()->append(make_shared_ptr(new InstallJob(
+ JobNumber install_job_n(resolved->job_lists()->execute_job_list()->append(std::make_shared<InstallJob>(
requirements,
make_origin_spec(changes_to_make_decision),
changes_to_make_decision.destination()->repository(),
changes_to_make_decision.resolvent().destination_type(),
replacing
- ))));
+ )));
change_or_remove_job_numbers.insert(std::make_pair(index, install_job_n));
}
@@ -852,9 +851,9 @@ namespace
recursed
);
- JobNumber fetch_job_n(resolved->job_lists()->execute_job_list()->append(make_shared_ptr(new FetchJob(
+ JobNumber fetch_job_n(resolved->job_lists()->execute_job_list()->append(std::make_shared<FetchJob>(
requirements,
- make_origin_spec(changes_to_make_decision)))));
+ make_origin_spec(changes_to_make_decision))));
fetch_job_numbers.insert(std::make_pair(index.resolvent(), fetch_job_n));
}
return;
@@ -887,10 +886,10 @@ namespace
recursed
);
- JobNumber uninstall_job_n(resolved->job_lists()->execute_job_list()->append(make_shared_ptr(new UninstallJob(
+ JobNumber uninstall_job_n(resolved->job_lists()->execute_job_list()->append(std::make_shared<UninstallJob>(
requirements,
removing
- ))));
+ )));
change_or_remove_job_numbers.insert(std::make_pair(index, uninstall_job_n));
}
diff --git a/paludis/resolver/orderer_notes.cc b/paludis/resolver/orderer_notes.cc
index 077348a..8630dc5 100644
--- a/paludis/resolver/orderer_notes.cc
+++ b/paludis/resolver/orderer_notes.cc
@@ -18,7 +18,6 @@
*/
#include <paludis/resolver/orderer_notes.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/serialise-impl.hh>
@@ -38,8 +37,8 @@ OrdererNotes::deserialise(Deserialisation & d)
{
Deserialisator v(d, "OrdererNotes");
- return make_shared_ptr(new OrdererNotes(make_named_values<OrdererNotes>(
+ return std::make_shared<OrdererNotes>(make_named_values<OrdererNotes>(
n::cycle_breaking() = v.member<std::string>("cycle_breaking")
- )));
+ ));
}
diff --git a/paludis/resolver/package_or_block_dep_spec.cc b/paludis/resolver/package_or_block_dep_spec.cc
index 208bf0a..8d801d4 100644
--- a/paludis/resolver/package_or_block_dep_spec.cc
+++ b/paludis/resolver/package_or_block_dep_spec.cc
@@ -18,12 +18,12 @@
*/
#include <paludis/resolver/package_or_block_dep_spec.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/log.hh>
#include <paludis/util/map.hh>
#include <paludis/util/sequence-impl.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/serialise-impl.hh>
#include <paludis/metadata_key.hh>
#include <paludis/elike_package_dep_spec.hh>
@@ -43,14 +43,14 @@ paludis::resolver::operator<< (std::ostream & s, const PackageOrBlockDepSpec & d
}
PackageOrBlockDepSpec::PackageOrBlockDepSpec(const BlockDepSpec & s) :
- if_block(n::if_block() = make_shared_ptr(new BlockDepSpec(s))),
+ if_block(n::if_block() = std::make_shared<BlockDepSpec>(s)),
if_package(n::if_package() = make_null_shared_ptr())
{
}
PackageOrBlockDepSpec::PackageOrBlockDepSpec(const PackageDepSpec & s) :
if_block(n::if_block() = make_null_shared_ptr()),
- if_package(n::if_package() = make_shared_ptr(new PackageDepSpec(s)))
+ if_package(n::if_package() = std::make_shared<PackageDepSpec>(s))
{
}
diff --git a/paludis/resolver/reason.cc b/paludis/resolver/reason.cc
index dd77bdc..2e0e3b8 100644
--- a/paludis/resolver/reason.cc
+++ b/paludis/resolver/reason.cc
@@ -392,40 +392,40 @@ Reason::deserialise(Deserialisation & d)
if (d.class_name() == "TargetReason")
{
Deserialisator v(d, "TargetReason");
- return make_shared_ptr(new TargetReason(v.member<std::string>("extra_information")));
+ return std::make_shared<TargetReason>(v.member<std::string>("extra_information"));
}
else if (d.class_name() == "PresetReason")
{
Deserialisator v(d, "PresetReason");
- return make_shared_ptr(new PresetReason(
+ return std::make_shared<PresetReason>(
v.member<std::string>("maybe_explanation"),
v.member<std::shared_ptr<Reason> >("maybe_reason_for_preset")
- ));
+ );
}
else if (d.class_name() == "SetReason")
{
Deserialisator v(d, "SetReason");
- return make_shared_ptr(new SetReason(
+ return std::make_shared<SetReason>(
SetName(v.member<std::string>("set_name")),
v.member<std::shared_ptr<Reason> >("reason_for_set")
- ));
+ );
}
else if (d.class_name() == "DependencyReason")
{
Deserialisator v(d, "DependencyReason");
const std::shared_ptr<const PackageID> from_id(v.member<std::shared_ptr<const PackageID> >("from_id"));
- return make_shared_ptr(new DependencyReason(
+ return std::make_shared<DependencyReason>(
from_id,
v.member<Resolvent>("from_resolvent"),
SanitisedDependency::deserialise(*v.find_remove_member("sanitised_dependency"), from_id),
- v.member<bool>("already_met"))
+ v.member<bool>("already_met")
);
}
else if (d.class_name() == "DependentReason")
{
Deserialisator v(d, "DependentReason");
- return make_shared_ptr(new DependentReason(
- v.member<ChangeByResolvent>("id_and_resolvent_being_removed"))
+ return std::make_shared<DependentReason>(
+ v.member<ChangeByResolvent>("id_and_resolvent_being_removed")
);
}
else if (d.class_name() == "WasUsedByReason")
@@ -435,22 +435,22 @@ Reason::deserialise(Deserialisation & d)
std::shared_ptr<ChangeByResolventSequence> ids_and_resolvents_being_removed(new ChangeByResolventSequence);
for (int n(1), n_end(vv.member<int>("count") + 1) ; n != n_end ; ++n)
ids_and_resolvents_being_removed->push_back(vv.member<ChangeByResolvent>(stringify(n)));
- return make_shared_ptr(new WasUsedByReason(ids_and_resolvents_being_removed));
+ return std::make_shared<WasUsedByReason>(ids_and_resolvents_being_removed);
}
else if (d.class_name() == "LikeOtherDestinationTypeReason")
{
Deserialisator v(d, "LikeOtherDestinationTypeReason");
- return make_shared_ptr(new LikeOtherDestinationTypeReason(
+ return std::make_shared<LikeOtherDestinationTypeReason>(
v.member<Resolvent>("other_resolvent"),
v.member<std::shared_ptr<Reason> >("reason_for_other")
- ));
+ );
}
else if (d.class_name() == "ViaBinaryReason")
{
Deserialisator v(d, "ViaBinaryReason");
- return make_shared_ptr(new ViaBinaryReason(
+ return std::make_shared<ViaBinaryReason>(
v.member<Resolvent>("other_resolvent")
- ));
+ );
}
else
throw InternalError(PALUDIS_HERE, "unknown class '" + stringify(d.class_name()) + "'");
diff --git a/paludis/resolver/required_confirmations.cc b/paludis/resolver/required_confirmations.cc
index 49d6bec..dc9e1f6 100644
--- a/paludis/resolver/required_confirmations.cc
+++ b/paludis/resolver/required_confirmations.cc
@@ -48,7 +48,7 @@ const std::shared_ptr<DowngradeConfirmation>
DowngradeConfirmation::deserialise(Deserialisation & d)
{
Deserialisator v(d, "DowngradeConfirmation");
- return make_shared_ptr(new DowngradeConfirmation);
+ return std::make_shared<DowngradeConfirmation>();
}
void
@@ -62,7 +62,7 @@ const std::shared_ptr<NotBestConfirmation>
NotBestConfirmation::deserialise(Deserialisation & d)
{
Deserialisator v(d, "NotBestConfirmation");
- return make_shared_ptr(new NotBestConfirmation);
+ return std::make_shared<NotBestConfirmation>();
}
void
@@ -76,7 +76,7 @@ const std::shared_ptr<BreakConfirmation>
BreakConfirmation::deserialise(Deserialisation & d)
{
Deserialisator v(d, "BreakConfirmation");
- return make_shared_ptr(new BreakConfirmation);
+ return std::make_shared<BreakConfirmation>();
}
void
@@ -90,7 +90,7 @@ const std::shared_ptr<RemoveSystemPackageConfirmation>
RemoveSystemPackageConfirmation::deserialise(Deserialisation & d)
{
Deserialisator v(d, "RemoveSystemPackageConfirmation");
- return make_shared_ptr(new RemoveSystemPackageConfirmation);
+ return std::make_shared<RemoveSystemPackageConfirmation>();
}
void
diff --git a/paludis/resolver/resolution.cc b/paludis/resolver/resolution.cc
index c70acc8..7446f7d 100644
--- a/paludis/resolver/resolution.cc
+++ b/paludis/resolver/resolution.cc
@@ -25,7 +25,6 @@
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/make_named_values.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/serialise-impl.hh>
#include <sstream>
@@ -47,10 +46,10 @@ Resolution::deserialise(Deserialisation & d)
{
Deserialisator v(d, "Resolution");
- return make_shared_ptr(new Resolution(make_named_values<Resolution>(
+ return std::make_shared<Resolution>(make_named_values<Resolution>(
n::constraints() = v.member<std::shared_ptr<Constraints> >("constraints"),
n::decision() = v.member<std::shared_ptr<Decision> >("decision"),
n::resolvent() = v.member<Resolvent>("resolvent")
- )));
+ ));
}
diff --git a/paludis/resolver/resolvent.cc b/paludis/resolver/resolvent.cc
index a8eda41..2a9586d 100644
--- a/paludis/resolver/resolvent.cc
+++ b/paludis/resolver/resolvent.cc
@@ -23,6 +23,7 @@
#include <paludis/util/make_named_values.hh>
#include <paludis/util/destringify.hh>
#include <paludis/util/hashes.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/dep_spec.hh>
#include <paludis/filter.hh>
#include <paludis/package_id.hh>
@@ -84,7 +85,7 @@ Resolvent::Resolvent(
destination_type(n::destination_type() = t),
package(n::package() = *spec.package_ptr()),
slot(make_named_values<SlotNameOrNull>(
- n::name_or_null() = make_shared_ptr(new SlotName(s)),
+ n::name_or_null() = std::make_shared<SlotName>(s),
n::null_means_unknown() = false
))
{
@@ -110,7 +111,7 @@ Resolvent::Resolvent(
destination_type(n::destination_type() = t),
package(n::package() = n),
slot(make_named_values<SlotNameOrNull>(
- n::name_or_null() = make_shared_ptr(new SlotName(s)),
+ n::name_or_null() = std::make_shared<SlotName>(s),
n::null_means_unknown() = false
))
{
@@ -133,7 +134,7 @@ Resolvent::Resolvent(
package(id->name()),
slot(make_named_values<SlotNameOrNull>(
n::name_or_null() = id->slot_key() ?
- make_shared_ptr(new SlotName(id->slot_key()->value())) :
+ std::make_shared<SlotName>(id->slot_key()->value()) :
make_null_shared_ptr(),
n::null_means_unknown() = false
))
diff --git a/paludis/resolver/resolver.cc b/paludis/resolver/resolver.cc
index 3da23c6..dcded34 100644
--- a/paludis/resolver/resolver.cc
+++ b/paludis/resolver/resolver.cc
@@ -30,7 +30,6 @@
#include <paludis/resolver/job_lists.hh>
#include <paludis/resolver/nag.hh>
#include <paludis/util/stringify.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/make_named_values.hh>
@@ -65,17 +64,17 @@ namespace paludis
fns(f),
resolved(new Resolved(make_named_values<Resolved>(
n::job_lists() = make_shared_copy(make_named_values<JobLists>(
- n::execute_job_list() = make_shared_ptr(new JobList<ExecuteJob>),
- n::pretend_job_list() = make_shared_ptr(new JobList<PretendJob>)
+ n::execute_job_list() = std::make_shared<JobList<ExecuteJob>>(),
+ n::pretend_job_list() = std::make_shared<JobList<PretendJob>>()
)),
- n::nag() = make_shared_ptr(new NAG),
- n::resolutions_by_resolvent() = make_shared_ptr(new ResolutionsByResolvent),
- n::taken_change_or_remove_decisions() = make_shared_ptr(new OrderedChangeOrRemoveDecisions),
- n::taken_unable_to_make_decisions() = make_shared_ptr(new Decisions<UnableToMakeDecision>),
- n::taken_unconfirmed_decisions() = make_shared_ptr(new Decisions<ConfirmableDecision>),
- n::taken_unorderable_decisions() = make_shared_ptr(new OrderedChangeOrRemoveDecisions),
- n::untaken_change_or_remove_decisions() = make_shared_ptr(new Decisions<ChangeOrRemoveDecision>),
- n::untaken_unable_to_make_decisions() = make_shared_ptr(new Decisions<UnableToMakeDecision>)
+ n::nag() = std::make_shared<NAG>(),
+ n::resolutions_by_resolvent() = std::make_shared<ResolutionsByResolvent>(),
+ n::taken_change_or_remove_decisions() = std::make_shared<OrderedChangeOrRemoveDecisions>(),
+ n::taken_unable_to_make_decisions() = std::make_shared<Decisions<UnableToMakeDecision>>(),
+ n::taken_unconfirmed_decisions() = std::make_shared<Decisions<ConfirmableDecision>>(),
+ n::taken_unorderable_decisions() = std::make_shared<OrderedChangeOrRemoveDecisions>(),
+ n::untaken_change_or_remove_decisions() = std::make_shared<Decisions<ChangeOrRemoveDecision>>(),
+ n::untaken_unable_to_make_decisions() = std::make_shared<Decisions<UnableToMakeDecision>>()
))),
decider(new Decider(e, f, resolved->resolutions_by_resolvent())),
orderer(new Orderer(e, f, resolved))
@@ -96,7 +95,7 @@ Resolver::~Resolver()
void
Resolver::add_target(const PackageOrBlockDepSpec & spec, const std::string & extra_information)
{
- _imp->decider->add_target_with_reason(spec, make_shared_ptr(new TargetReason(extra_information)));
+ _imp->decider->add_target_with_reason(spec, std::make_shared<TargetReason>(extra_information));
}
namespace
@@ -131,7 +130,7 @@ namespace
throw NoSuchSetError(stringify(n.spec()->name()));
set->root()->accept(SetExpander(env, decider,
- make_shared_ptr(new SetReason(n.spec()->name(), reason)), recurse));
+ std::make_shared<SetReason>(n.spec()->name(), reason), recurse));
recurse.erase(n.spec()->name());
}
@@ -159,7 +158,7 @@ Resolver::add_target(const SetName & set_name, const std::string & extra_informa
throw NoSuchSetError(stringify(set_name));
RecursingNames recurse;
- set->root()->accept(SetExpander(_imp->env, _imp->decider, make_shared_ptr(new TargetReason(extra_information)), recurse));
+ set->root()->accept(SetExpander(_imp->env, _imp->decider, std::make_shared<TargetReason>(extra_information), recurse));
}
void
diff --git a/paludis/resolver/resolver_TEST_any.cc b/paludis/resolver/resolver_TEST_any.cc
index 6782af8..c189c9b 100644
--- a/paludis/resolver/resolver_TEST_any.cc
+++ b/paludis/resolver/resolver_TEST_any.cc
@@ -29,7 +29,6 @@
#include <paludis/util/make_named_values.hh>
#include <paludis/util/options.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/map-impl.hh>
#include <paludis/util/indirect_iterator-impl.hh>
diff --git a/paludis/resolver/resolver_TEST_blockers.cc b/paludis/resolver/resolver_TEST_blockers.cc
index 11167cb..f58ab04 100644
--- a/paludis/resolver/resolver_TEST_blockers.cc
+++ b/paludis/resolver/resolver_TEST_blockers.cc
@@ -28,7 +28,6 @@
#include <paludis/util/make_named_values.hh>
#include <paludis/util/options.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/map.hh>
#include <paludis/util/indirect_iterator-impl.hh>
diff --git a/paludis/resolver/resolver_TEST_continue_on_failure.cc b/paludis/resolver/resolver_TEST_continue_on_failure.cc
index 8465ecb..ec76f3f 100644
--- a/paludis/resolver/resolver_TEST_continue_on_failure.cc
+++ b/paludis/resolver/resolver_TEST_continue_on_failure.cc
@@ -32,7 +32,6 @@
#include <paludis/util/make_named_values.hh>
#include <paludis/util/options.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/map-impl.hh>
#include <paludis/util/indirect_iterator-impl.hh>
diff --git a/paludis/resolver/resolver_TEST_cycles.cc b/paludis/resolver/resolver_TEST_cycles.cc
index b736a17..3f0b3cd 100644
--- a/paludis/resolver/resolver_TEST_cycles.cc
+++ b/paludis/resolver/resolver_TEST_cycles.cc
@@ -28,7 +28,6 @@
#include <paludis/util/make_named_values.hh>
#include <paludis/util/options.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/map.hh>
#include <paludis/util/indirect_iterator-impl.hh>
diff --git a/paludis/resolver/resolver_TEST_errors.cc b/paludis/resolver/resolver_TEST_errors.cc
index acfd5f0..30effd7 100644
--- a/paludis/resolver/resolver_TEST_errors.cc
+++ b/paludis/resolver/resolver_TEST_errors.cc
@@ -28,7 +28,6 @@
#include <paludis/util/make_named_values.hh>
#include <paludis/util/options.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/map.hh>
#include <paludis/util/indirect_iterator-impl.hh>
diff --git a/paludis/resolver/resolver_TEST_fetches.cc b/paludis/resolver/resolver_TEST_fetches.cc
index ba647f2..2b517a5 100644
--- a/paludis/resolver/resolver_TEST_fetches.cc
+++ b/paludis/resolver/resolver_TEST_fetches.cc
@@ -32,7 +32,6 @@
#include <paludis/util/make_named_values.hh>
#include <paludis/util/options.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/map-impl.hh>
#include <paludis/util/indirect_iterator-impl.hh>
diff --git a/paludis/resolver/resolver_TEST_purges.cc b/paludis/resolver/resolver_TEST_purges.cc
index aa52286..82aa074 100644
--- a/paludis/resolver/resolver_TEST_purges.cc
+++ b/paludis/resolver/resolver_TEST_purges.cc
@@ -28,7 +28,6 @@
#include <paludis/util/make_named_values.hh>
#include <paludis/util/options.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/map.hh>
#include <paludis/util/indirect_iterator-impl.hh>
diff --git a/paludis/resolver/resolver_TEST_serialisation.cc b/paludis/resolver/resolver_TEST_serialisation.cc
index 7b918ae..28cda34 100644
--- a/paludis/resolver/resolver_TEST_serialisation.cc
+++ b/paludis/resolver/resolver_TEST_serialisation.cc
@@ -28,7 +28,6 @@
#include <paludis/util/make_named_values.hh>
#include <paludis/util/options.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/make_shared_copy.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/map.hh>
@@ -83,7 +82,7 @@ namespace test_cases
Deserialiser deser(&env, str);
Deserialisation desern("ResolverLists", deser);
- resolved = make_shared_ptr(new Resolved(Resolved::deserialise(desern)));
+ resolved = std::make_shared<Resolved>(Resolved::deserialise(desern));
}
check_resolved(resolved,
diff --git a/paludis/resolver/resolver_TEST_simple.cc b/paludis/resolver/resolver_TEST_simple.cc
index c707821..740802e 100644
--- a/paludis/resolver/resolver_TEST_simple.cc
+++ b/paludis/resolver/resolver_TEST_simple.cc
@@ -28,7 +28,6 @@
#include <paludis/util/make_named_values.hh>
#include <paludis/util/options.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/map.hh>
#include <paludis/util/indirect_iterator-impl.hh>
diff --git a/paludis/resolver/resolver_TEST_suggestions.cc b/paludis/resolver/resolver_TEST_suggestions.cc
index aa32563..c0b02ba 100644
--- a/paludis/resolver/resolver_TEST_suggestions.cc
+++ b/paludis/resolver/resolver_TEST_suggestions.cc
@@ -28,7 +28,6 @@
#include <paludis/util/make_named_values.hh>
#include <paludis/util/options.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/map.hh>
#include <paludis/util/indirect_iterator-impl.hh>
diff --git a/paludis/resolver/resolver_TEST_uninstalls.cc b/paludis/resolver/resolver_TEST_uninstalls.cc
index d2338ac..e4e4ca9 100644
--- a/paludis/resolver/resolver_TEST_uninstalls.cc
+++ b/paludis/resolver/resolver_TEST_uninstalls.cc
@@ -29,7 +29,6 @@
#include <paludis/util/make_named_values.hh>
#include <paludis/util/options.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/map.hh>
#include <paludis/util/indirect_iterator-impl.hh>
diff --git a/paludis/resolver/resolver_TEST_virtuals.cc b/paludis/resolver/resolver_TEST_virtuals.cc
index a4905f3..cda1512 100644
--- a/paludis/resolver/resolver_TEST_virtuals.cc
+++ b/paludis/resolver/resolver_TEST_virtuals.cc
@@ -28,7 +28,6 @@
#include <paludis/util/make_named_values.hh>
#include <paludis/util/options.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/map.hh>
#include <paludis/util/indirect_iterator-impl.hh>
diff --git a/paludis/resolver/resolver_test.cc b/paludis/resolver/resolver_test.cc
index 6cf5e62..820f77a 100644
--- a/paludis/resolver/resolver_test.cc
+++ b/paludis/resolver/resolver_test.cc
@@ -31,7 +31,6 @@
#include <paludis/resolver/change_by_resolvent.hh>
#include <paludis/resolver/labels_classifier.hh>
#include <paludis/util/map.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/accept_visitor.hh>
#include <paludis/util/fs_entry.hh>
@@ -80,7 +79,7 @@ paludis::resolver::resolver_test::initial_constraints_for_fn(
{
InitialConstraints::const_iterator i(initial_constraints.find(resolvent));
if (i == initial_constraints.end())
- return make_shared_ptr(new Constraints);
+ return std::make_shared<Constraints>();
else
return i->second;
}
@@ -237,8 +236,8 @@ paludis::resolver::resolver_test::get_constraints_for_dependent_fn(
PartiallyMadePackageDepSpec partial_spec((PartiallyMadePackageDepSpecOptions()));
partial_spec.package(id->name());
if (id->slot_key())
- partial_spec.slot_requirement(make_shared_ptr(new ELikeSlotExactRequirement(
- id->slot_key()->value(), false)));
+ partial_spec.slot_requirement(std::make_shared<ELikeSlotExactRequirement>(
+ id->slot_key()->value(), false));
PackageDepSpec spec(partial_spec);
for (ChangeByResolventSequence::ConstIterator i(ids->begin()), i_end(ids->end()) ;
@@ -246,14 +245,14 @@ paludis::resolver::resolver_test::get_constraints_for_dependent_fn(
{
const std::shared_ptr<DependentReason> reason(new DependentReason(*i));
- result->push_back(make_shared_ptr(new Constraint(make_named_values<Constraint>(
+ result->push_back(std::make_shared<Constraint>(make_named_values<Constraint>(
n::destination_type() = dt_install_to_slash,
n::nothing_is_fine_too() = true,
n::reason() = reason,
n::spec() = BlockDepSpec("!" + stringify(spec), spec, false),
n::untaken() = false,
n::use_existing() = ue_if_possible
- ))));
+ )));
}
return result;
@@ -270,20 +269,20 @@ paludis::resolver::resolver_test::get_constraints_for_purge_fn(
PartiallyMadePackageDepSpec partial_spec((PartiallyMadePackageDepSpecOptions()));
partial_spec.package(id->name());
if (id->slot_key())
- partial_spec.slot_requirement(make_shared_ptr(new ELikeSlotExactRequirement(
- id->slot_key()->value(), false)));
+ partial_spec.slot_requirement(std::make_shared<ELikeSlotExactRequirement>(
+ id->slot_key()->value(), false));
PackageDepSpec spec(partial_spec);
const std::shared_ptr<WasUsedByReason> reason(new WasUsedByReason(ids));
- result->push_back(make_shared_ptr(new Constraint(make_named_values<Constraint>(
+ result->push_back(std::make_shared<Constraint>(make_named_values<Constraint>(
n::destination_type() = dt_install_to_slash,
n::nothing_is_fine_too() = true,
n::reason() = reason,
n::spec() = BlockDepSpec("!" + stringify(spec), spec, false),
n::untaken() = false,
n::use_existing() = ue_if_possible
- ))));
+ )));
return result;
}
@@ -298,14 +297,14 @@ paludis::resolver::resolver_test::get_constraints_for_via_binary_fn(
PackageDepSpec spec(partial_spec);
std::shared_ptr<ConstraintSequence> result(new ConstraintSequence);
- result->push_back(make_shared_ptr(new Constraint(make_named_values<Constraint>(
+ result->push_back(std::make_shared<Constraint>(make_named_values<Constraint>(
n::destination_type() = resolution->resolvent().destination_type(),
n::nothing_is_fine_too() = false,
- n::reason() = make_shared_ptr(new ViaBinaryReason(because_resolution->resolvent())),
+ n::reason() = std::make_shared<ViaBinaryReason>(because_resolution->resolvent()),
n::spec() = spec,
n::untaken() = false,
n::use_existing() = ue_if_possible
- ))));
+ )));
return result;
}
@@ -418,7 +417,7 @@ ResolverTestCase::get_resolved(const PackageOrBlockDepSpec & target)
}
catch (const SuggestRestart & e)
{
- initial_constraints.insert(std::make_pair(e.resolvent(), make_shared_ptr(new Constraints))).first->second->add(e.suggested_preset());
+ initial_constraints.insert(std::make_pair(e.resolvent(), std::make_shared<Constraints>())).first->second->add(e.suggested_preset());
}
}
}
diff --git a/paludis/resolver/slot_name_or_null.cc b/paludis/resolver/slot_name_or_null.cc
index bbf0076..6664dcd 100644
--- a/paludis/resolver/slot_name_or_null.cc
+++ b/paludis/resolver/slot_name_or_null.cc
@@ -20,6 +20,7 @@
#include <paludis/resolver/slot_name_or_null.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/hashes.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/serialise-impl.hh>
#include <ostream>
@@ -70,7 +71,7 @@ SlotNameOrNull::deserialise(Deserialisation & d)
std::string s(v.member<std::string>("name_or_null"));
return make_named_values<SlotNameOrNull>(
- n::name_or_null() = s.empty() ? make_null_shared_ptr() : make_shared_ptr(new SlotName(s)),
+ n::name_or_null() = s.empty() ? make_null_shared_ptr() : std::make_shared<SlotName>(s),
n::null_means_unknown() = v.member<bool>("null_means_unknown")
);
}
diff --git a/paludis/resolver/spec_rewriter.cc b/paludis/resolver/spec_rewriter.cc
index 2cb19e9..95fcdce 100644
--- a/paludis/resolver/spec_rewriter.cc
+++ b/paludis/resolver/spec_rewriter.cc
@@ -26,6 +26,7 @@
#include <paludis/util/mutex.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/spec_tree.hh>
#include <paludis/dep_spec.hh>
#include <paludis/environment.hh>
@@ -48,7 +49,7 @@ typedef std::map<QualifiedPackageName, std::set<QualifiedPackageName> > Rewrites
const std::shared_ptr<const DependencySpecTree>
RewrittenSpec::as_spec_tree() const
{
- const std::shared_ptr<DependencySpecTree> result(new DependencySpecTree(make_shared_ptr(new AllDepSpec)));
+ const std::shared_ptr<DependencySpecTree> result(new DependencySpecTree(std::make_shared<AllDepSpec>()));
for (Sequence<PackageOrBlockDepSpec>::ConstIterator i(specs()->begin()), i_end(specs()->end()) ;
i != i_end ; ++i)
@@ -100,7 +101,7 @@ SpecRewriter::rewrite_if_special(const PackageOrBlockDepSpec & s, const std::sha
return make_null_shared_ptr();
const std::shared_ptr<RewrittenSpec> result(new RewrittenSpec(make_named_values<RewrittenSpec>(
- n::specs() = make_shared_ptr(new Sequence<PackageOrBlockDepSpec>)
+ n::specs() = std::make_shared<Sequence<PackageOrBlockDepSpec>>()
)));
for (std::set<QualifiedPackageName>::const_iterator n(r->second.begin()), n_end(r->second.end()) ;
@@ -120,7 +121,7 @@ SpecRewriter::rewrite_if_special(const PackageOrBlockDepSpec & s, const std::sha
return make_null_shared_ptr();
const std::shared_ptr<RewrittenSpec> result(new RewrittenSpec(make_named_values<RewrittenSpec>(
- n::specs() = make_shared_ptr(new Sequence<PackageOrBlockDepSpec>)
+ n::specs() = std::make_shared<Sequence<PackageOrBlockDepSpec>>()
)));
for (std::set<QualifiedPackageName>::const_iterator n(r->second.begin()), n_end(r->second.end()) ;
diff --git a/paludis/selection.cc b/paludis/selection.cc
index e18d207..74ab8f0 100644
--- a/paludis/selection.cc
+++ b/paludis/selection.cc
@@ -24,7 +24,6 @@
#include <paludis/util/set-impl.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/wrapped_output_iterator.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/iterator_funcs.hh>
#include <paludis/util/indirect_iterator-impl.hh>
@@ -315,7 +314,7 @@ namespace
SlotMap::iterator m(by_slot.find(std::make_pair((*i)->name(), slot_as_string(*i))));
if (m == by_slot.end())
m = by_slot.insert(std::make_pair(std::make_pair((*i)->name(), slot_as_string(*i)),
- make_shared_ptr(new PackageIDSequence))).first;
+ std::make_shared<PackageIDSequence>())).first;
m->second->push_back(*i);
}
@@ -381,7 +380,7 @@ namespace
SlotMap::iterator m(by_slot.find(std::make_pair((*i)->name(), slot_as_string(*i))));
if (m == by_slot.end())
m = by_slot.insert(std::make_pair(std::make_pair((*i)->name(), slot_as_string(*i)),
- make_shared_ptr(new PackageIDSequence))).first;
+ std::make_shared<PackageIDSequence>())).first;
m->second->push_back(*i);
}
@@ -427,15 +426,15 @@ namespace
std::shared_ptr<const RepositoryNameSet> r(_fg.filter().repositories(env, _fg.generator().repositories(env)));
if (r->empty())
- throw DidNotGetExactlyOneError(as_string(), make_shared_ptr(new PackageIDSet));
+ throw DidNotGetExactlyOneError(as_string(), std::make_shared<PackageIDSet>());
std::shared_ptr<const CategoryNamePartSet> c(_fg.filter().categories(env, r, _fg.generator().categories(env, r)));
if (c->empty())
- throw DidNotGetExactlyOneError(as_string(), make_shared_ptr(new PackageIDSet));
+ throw DidNotGetExactlyOneError(as_string(), std::make_shared<PackageIDSet>());
std::shared_ptr<const QualifiedPackageNameSet> p(_fg.filter().packages(env, r, _fg.generator().packages(env, r, c)));
if (p->empty())
- throw DidNotGetExactlyOneError(as_string(), make_shared_ptr(new PackageIDSet));
+ throw DidNotGetExactlyOneError(as_string(), std::make_shared<PackageIDSet>());
std::shared_ptr<const PackageIDSet> i(_fg.filter().ids(env, _fg.generator().ids(env, r, p)));
@@ -455,37 +454,37 @@ namespace
}
selection::SomeArbitraryVersion::SomeArbitraryVersion(const FilteredGenerator & f) :
- Selection(make_shared_ptr(new SomeArbitraryVersionSelectionHandler(f)))
+ Selection(std::make_shared<SomeArbitraryVersionSelectionHandler>(f))
{
}
selection::BestVersionOnly::BestVersionOnly(const FilteredGenerator & f) :
- Selection(make_shared_ptr(new BestVersionOnlySelectionHandler(f)))
+ Selection(std::make_shared<BestVersionOnlySelectionHandler>(f))
{
}
selection::AllVersionsSorted::AllVersionsSorted(const FilteredGenerator & f) :
- Selection(make_shared_ptr(new AllVersionsSortedSelectionHandler(f)))
+ Selection(std::make_shared<AllVersionsSortedSelectionHandler>(f))
{
}
selection::AllVersionsUnsorted::AllVersionsUnsorted(const FilteredGenerator & f) :
- Selection(make_shared_ptr(new AllVersionsUnsortedSelectionHandler(f)))
+ Selection(std::make_shared<AllVersionsUnsortedSelectionHandler>(f))
{
}
selection::AllVersionsGroupedBySlot::AllVersionsGroupedBySlot(const FilteredGenerator & f) :
- Selection(make_shared_ptr(new AllVersionsGroupedBySlotSelectioHandler(f)))
+ Selection(std::make_shared<AllVersionsGroupedBySlotSelectioHandler>(f))
{
}
selection::BestVersionInEachSlot::BestVersionInEachSlot(const FilteredGenerator & f) :
- Selection(make_shared_ptr(new BestVersionInEachSlotSelectionHandler(f)))
+ Selection(std::make_shared<BestVersionInEachSlotSelectionHandler>(f))
{
}
selection::RequireExactlyOne::RequireExactlyOne(const FilteredGenerator & f) :
- Selection(make_shared_ptr(new RequireExactlyOneSelectionHandler(f)))
+ Selection(std::make_shared<RequireExactlyOneSelectionHandler>(f))
{
}
diff --git a/paludis/serialise-impl.hh b/paludis/serialise-impl.hh
index 310aad4..578d3e6 100644
--- a/paludis/serialise-impl.hh
+++ b/paludis/serialise-impl.hh
@@ -23,9 +23,9 @@
#include <paludis/serialise.hh>
#include <paludis/util/remove_shared_ptr.hh>
#include <paludis/util/destringify.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/options.hh>
#include <paludis/util/tokeniser.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/package_id-fwd.hh>
#include <paludis/dep_spec-fwd.hh>
#include <type_traits>
diff --git a/paludis/set_file.cc b/paludis/set_file.cc
index c9eca10..2c57973 100644
--- a/paludis/set_file.cc
+++ b/paludis/set_file.cc
@@ -322,7 +322,7 @@ SimpleHandler::_create_contents() const
{
Context context("When parsing atoms in simple set file '" + stringify(_p.file_name()) + "':");
- _contents.reset(new SetSpecTree(make_shared_ptr(new AllDepSpec)));
+ _contents.reset(new SetSpecTree(std::make_shared<AllDepSpec>()));
for (std::list<std::string>::const_iterator i(_lines.begin()), i_end(_lines.end()) ;
i != i_end ; ++i)
{
@@ -451,7 +451,7 @@ PaludisConfHandler::_create_contents() const
{
Context context("When parsing atoms in paludis conf set file '" + stringify(_p.file_name()) + "':");
- _contents.reset(new SetSpecTree(make_shared_ptr(new AllDepSpec)));
+ _contents.reset(new SetSpecTree(std::make_shared<AllDepSpec>()));
for (std::list<std::string>::const_iterator i(_lines.begin()), i_end(_lines.end()) ;
i != i_end ; ++i)
do_one_conf_line(*i, _contents, _p);
@@ -532,7 +532,7 @@ PaludisBashHandler::PaludisBashHandler(const SetFileParams & p) :
_p(p)
{
Context context("When loading paludis bash set file '" + stringify(_p.file_name()) + "':");
- _contents.reset(new SetSpecTree(make_shared_ptr(new AllDepSpec)));
+ _contents.reset(new SetSpecTree(std::make_shared<AllDepSpec>()));
std::stringstream s;
Command cmd(Command("bash '" + stringify(_p.file_name()) + "'")
@@ -556,7 +556,7 @@ PaludisBashHandler::PaludisBashHandler(const SetFileParams & p) :
Log::get_instance()->message("set_file.script.failure", ll_warning, lc_context)
<< "Set file script '" << _p.file_name() << "' returned non-zero exit status '"
<< exit_status << "'";
- _contents.reset(new SetSpecTree(make_shared_ptr(new AllDepSpec)));
+ _contents.reset(new SetSpecTree(std::make_shared<AllDepSpec>()));
}
}
diff --git a/paludis/show_suggest_visitor.cc b/paludis/show_suggest_visitor.cc
index 2ceb5cb..8963c64 100644
--- a/paludis/show_suggest_visitor.cc
+++ b/paludis/show_suggest_visitor.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010 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
@@ -30,7 +30,6 @@
#include <paludis/util/log.hh>
#include <paludis/util/save.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/util/join.hh>
@@ -65,7 +64,7 @@ namespace paludis
dependency_tags(t),
only_if_suggested_label(l)
{
- labels.push_front(make_shared_ptr(new DependenciesLabelSequence));
+ labels.push_front(std::make_shared<DependenciesLabelSequence>());
}
};
}
diff --git a/paludis/spec_tree.cc b/paludis/spec_tree.cc
index 994a4b1..0b2e76a 100644
--- a/paludis/spec_tree.cc
+++ b/paludis/spec_tree.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2008, 2009, 2010 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
@@ -18,7 +18,6 @@
*/
#include <paludis/spec_tree.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/sequence-impl.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/indirect_iterator-impl.hh>
@@ -79,7 +78,7 @@ const std::shared_ptr<typename Tree_::template NodeType<T_>::Type>
BasicInnerNode<Tree_>::append(const std::shared_ptr<const T_> & t)
{
const std::shared_ptr<typename Tree_::template NodeType<T_>::Type> tt(
- make_shared_ptr(new typename Tree_::template NodeType<T_>::Type(t)));
+ std::make_shared<typename Tree_::template NodeType<T_>::Type>(t));
append_node(tt);
return tt;
}
@@ -107,13 +106,13 @@ InnerNode<Tree_, Item_>::spec() const
template <typename NodeList_, typename RootNode_>
SpecTree<NodeList_, RootNode_>::SpecTree(const std::shared_ptr<RootNode_> & spec) :
- _root(make_shared_ptr(new typename InnerNodeType<RootNode_>::Type(spec)))
+ _root(std::make_shared<typename InnerNodeType<RootNode_>::Type>(spec))
{
}
template <typename NodeList_, typename RootNode_>
SpecTree<NodeList_, RootNode_>::SpecTree(const std::shared_ptr<const RootNode_> & spec) :
- _root(make_shared_ptr(new typename InnerNodeType<RootNode_>::Type(spec)))
+ _root(std::make_shared<typename InnerNodeType<RootNode_>::Type>(spec))
{
}
@@ -152,7 +151,7 @@ namespace
template <typename T_>
void visit(const InnerNode<Tree_, T_> & n)
{
- result.append_node(make_shared_ptr(new InnerNode<OtherTree_, T_>(n)));
+ result.append_node(std::make_shared<InnerNode<OtherTree_, T_>>(n));
}
};
}
diff --git a/paludis/spec_tree.hh b/paludis/spec_tree.hh
index 8b7116a..9e7b2ad 100644
--- a/paludis/spec_tree.hh
+++ b/paludis/spec_tree.hh
@@ -28,7 +28,6 @@
#include <paludis/util/sequence.hh>
#include <paludis/util/accept_visitor.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <algorithm>
namespace paludis
diff --git a/paludis/standard_output_manager.cc b/paludis/standard_output_manager.cc
index b6c6ff5..c92cfdd 100644
--- a/paludis/standard_output_manager.cc
+++ b/paludis/standard_output_manager.cc
@@ -19,7 +19,6 @@
#include <paludis/standard_output_manager.hh>
#include <paludis/util/set.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <iostream>
using namespace paludis;
@@ -84,6 +83,6 @@ StandardOutputManager::factory_create(
const OutputManagerFactory::CreateChildFunction &,
const OutputManagerFactory::ReplaceVarsFunc &)
{
- return make_shared_ptr(new StandardOutputManager);
+ return std::make_shared<StandardOutputManager>();
}
diff --git a/paludis/stringify_formatter_TEST.cc b/paludis/stringify_formatter_TEST.cc
index 6864a05..95031d6 100644
--- a/paludis/stringify_formatter_TEST.cc
+++ b/paludis/stringify_formatter_TEST.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010 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
@@ -19,7 +19,6 @@
#include <paludis/stringify_formatter.hh>
#include <paludis/stringify_formatter-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/options.hh>
#include <paludis/dep_spec.hh>
#include <paludis/spec_tree.hh>
diff --git a/paludis/sync_task.cc b/paludis/sync_task.cc
index 5b6080c..abd4e13 100644
--- a/paludis/sync_task.cc
+++ b/paludis/sync_task.cc
@@ -24,7 +24,6 @@
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/action_queue.hh>
#include <paludis/util/mutex.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/package_database.hh>
#include <paludis/hook.hh>
#include <paludis/create_output_manager_info.hh>
diff --git a/paludis/tee_output_manager.cc b/paludis/tee_output_manager.cc
index 23ba89b..d4ec655 100644
--- a/paludis/tee_output_manager.cc
+++ b/paludis/tee_output_manager.cc
@@ -23,7 +23,6 @@
#include <paludis/util/sequence.hh>
#include <paludis/util/set.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <vector>
@@ -167,7 +166,7 @@ TeeOutputManager::factory_create(
c != c_end ; ++c)
messages_children->push_back(create_child(*c));
- return make_shared_ptr(new TeeOutputManager(children, messages_children));
+ return std::make_shared<TeeOutputManager>(children, messages_children);
}
template class PrivateImplementationPattern<TeeOutputManager>;
diff --git a/paludis/unchoices_key.cc b/paludis/unchoices_key.cc
index a534020..1e461ac 100644
--- a/paludis/unchoices_key.cc
+++ b/paludis/unchoices_key.cc
@@ -20,7 +20,6 @@
#include <paludis/unchoices_key.hh>
#include <paludis/metadata_key.hh>
#include <paludis/choice.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/set.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/make_named_values.hh>
@@ -39,7 +38,7 @@ namespace
UnChoicesKey() :
_value(new Choices)
{
- _value->add(make_shared_ptr(new Choice(make_named_values<ChoiceParams>(
+ _value->add(std::make_shared<Choice>(make_named_values<ChoiceParams>(
n::consider_added_or_changed() = false,
n::contains_every_value() = true,
n::hidden() = true,
@@ -47,7 +46,7 @@ namespace
n::prefix() = ChoicePrefixName(""),
n::raw_name() = "Choices",
n::show_with_no_prefix() = true
- ))));
+ )));
}
~UnChoicesKey()
diff --git a/paludis/uninstall_list.cc b/paludis/uninstall_list.cc
index e7308f1..ef472ba 100644
--- a/paludis/uninstall_list.cc
+++ b/paludis/uninstall_list.cc
@@ -26,7 +26,6 @@
#include <paludis/util/set.hh>
#include <paludis/util/set-impl.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/wrapped_output_iterator-impl.hh>
@@ -164,7 +163,7 @@ UninstallList::add_errors_for_system()
return;
std::shared_ptr<Set<std::shared_ptr<DepTag> > > tags(new Set<std::shared_ptr<DepTag> >);
- tags->insert(make_shared_ptr(new GeneralSetDepTag(SetName("system"), "")));
+ tags->insert(std::make_shared<GeneralSetDepTag>(SetName("system"), ""));
for (std::list<UninstallListEntry>::iterator l(_imp->uninstall_list.begin()), l_end(_imp->uninstall_list.end()) ;
l != l_end ; ++l)
@@ -254,7 +253,7 @@ UninstallList::add_package(const std::shared_ptr<const PackageID> & e, const std
_imp->uninstall_list.end(), make_named_values<UninstallListEntry>(
n::kind() = k,
n::package_id() = e,
- n::tags() = make_shared_ptr(new Set<std::shared_ptr<DepTag> >)
+ n::tags() = std::make_shared<Set<std::shared_ptr<DepTag> >>()
)));
if (t)
diff --git a/paludis/uninstall_list_TEST.cc b/paludis/uninstall_list_TEST.cc
index 1197390..dd038d7 100644
--- a/paludis/uninstall_list_TEST.cc
+++ b/paludis/uninstall_list_TEST.cc
@@ -389,8 +389,8 @@ namespace test_cases
UninstallListWithUnusedDepsWorldTest() :
UninstallListTestCaseBase("with unused deps world")
{
- std::shared_ptr<SetSpecTree> world(new SetSpecTree(make_shared_ptr(new AllDepSpec)));
- world->root()->append(make_shared_ptr(new PackageDepSpec(parse_user_package_dep_spec("foo/moo", &env, UserPackageDepSpecOptions()))));
+ std::shared_ptr<SetSpecTree> world(new SetSpecTree(std::make_shared<AllDepSpec>()));
+ world->root()->append(std::make_shared<PackageDepSpec>(parse_user_package_dep_spec("foo/moo", &env, UserPackageDepSpecOptions())));
env.add_set(SetName("world"), SetName("world"), make_k<std::shared_ptr<const SetSpecTree> >(world), false);
}
@@ -428,9 +428,9 @@ namespace test_cases
UninstallListWithUnusedDepsWorldTargetTest() :
UninstallListTestCaseBase("with unused deps world target")
{
- std::shared_ptr<SetSpecTree> world(new SetSpecTree(make_shared_ptr(new AllDepSpec)));
- world->root()->append(make_shared_ptr(new PackageDepSpec(parse_user_package_dep_spec("foo/moo", &env, UserPackageDepSpecOptions()))));
- world->root()->append(make_shared_ptr(new PackageDepSpec(parse_user_package_dep_spec("foo/bar", &env, UserPackageDepSpecOptions()))));
+ std::shared_ptr<SetSpecTree> world(new SetSpecTree(std::make_shared<AllDepSpec>()));
+ world->root()->append(std::make_shared<PackageDepSpec>(parse_user_package_dep_spec("foo/moo", &env, UserPackageDepSpecOptions())));
+ world->root()->append(std::make_shared<PackageDepSpec>(parse_user_package_dep_spec("foo/bar", &env, UserPackageDepSpecOptions())));
env.add_set(SetName("world"), SetName("world"), make_k(world), false);
}
@@ -468,11 +468,11 @@ namespace test_cases
UninstallListWithSlotsTest() :
UninstallListTestCaseBase("with slots")
{
- std::shared_ptr<SetSpecTree> world(new SetSpecTree(make_shared_ptr(new AllDepSpec)));
- world->root()->append(make_shared_ptr(new PackageDepSpec(parse_user_package_dep_spec("cat/needs-a", &env, UserPackageDepSpecOptions()))));
- world->root()->append(make_shared_ptr(new PackageDepSpec(parse_user_package_dep_spec("cat/needs-b", &env, UserPackageDepSpecOptions()))));
- world->root()->append(make_shared_ptr(new PackageDepSpec(parse_user_package_dep_spec("cat/needs-c", &env, UserPackageDepSpecOptions()))));
- world->root()->append(make_shared_ptr(new PackageDepSpec(parse_user_package_dep_spec("cat/needs-d", &env, UserPackageDepSpecOptions()))));
+ std::shared_ptr<SetSpecTree> world(new SetSpecTree(std::make_shared<AllDepSpec>()));
+ world->root()->append(std::make_shared<PackageDepSpec>(parse_user_package_dep_spec("cat/needs-a", &env, UserPackageDepSpecOptions())));
+ world->root()->append(std::make_shared<PackageDepSpec>(parse_user_package_dep_spec("cat/needs-b", &env, UserPackageDepSpecOptions())));
+ world->root()->append(std::make_shared<PackageDepSpec>(parse_user_package_dep_spec("cat/needs-c", &env, UserPackageDepSpecOptions())));
+ world->root()->append(std::make_shared<PackageDepSpec>(parse_user_package_dep_spec("cat/needs-d", &env, UserPackageDepSpecOptions())));
env.add_set(SetName("world"), SetName("world"), make_k(world), false);
}
diff --git a/paludis/uninstall_task.cc b/paludis/uninstall_task.cc
index 96d1270..f2c66a9 100644
--- a/paludis/uninstall_task.cc
+++ b/paludis/uninstall_task.cc
@@ -36,6 +36,7 @@
#include <paludis/util/options.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/indirect_iterator-impl.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/package_database.hh>
#include <paludis/hook.hh>
#include <paludis/dep_tag.hh>
@@ -315,7 +316,7 @@ UninstallTask::execute()
{
on_update_world_pre();
- std::shared_ptr<SetSpecTree> all(new SetSpecTree(make_shared_ptr(new AllDepSpec)));
+ std::shared_ptr<SetSpecTree> all(new SetSpecTree(std::make_shared<AllDepSpec>()));
std::map<QualifiedPackageName, std::set<VersionSpec> > being_removed;
for (UninstallList::ConstIterator i(list.begin()), i_end(list.end()) ; i != i_end ; ++i)
@@ -336,8 +337,8 @@ UninstallTask::execute()
remove = false;
if (remove)
- all->root()->append(make_shared_ptr(new PackageDepSpec(make_package_dep_spec(
- PartiallyMadePackageDepSpecOptions()).package(i->first))));
+ all->root()->append(std::make_shared<PackageDepSpec>(make_package_dep_spec(
+ PartiallyMadePackageDepSpecOptions()).package(i->first)));
}
world_remove_packages(all);
diff --git a/paludis/user_dep_spec.cc b/paludis/user_dep_spec.cc
index 3a12916..63d344d 100644
--- a/paludis/user_dep_spec.cc
+++ b/paludis/user_dep_spec.cc
@@ -29,7 +29,6 @@
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
#include <paludis/dep_label.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/options.hh>
#include <paludis/util/log.hh>
#include <paludis/util/make_named_values.hh>
@@ -212,7 +211,7 @@ namespace
std::string::size_type slot_p(s.rfind(':'));
if (std::string::npos != slot_p)
{
- result.slot_requirement(make_shared_ptr(new UserSlotExactRequirement(SlotName(s.substr(slot_p + 1)))));
+ result.slot_requirement(std::make_shared<UserSlotExactRequirement>(SlotName(s.substr(slot_p + 1))));
s.erase(slot_p);
}
}
diff --git a/paludis/user_dep_spec_TEST.cc b/paludis/user_dep_spec_TEST.cc
index b2dda6f..df32627 100644
--- a/paludis/user_dep_spec_TEST.cc
+++ b/paludis/user_dep_spec_TEST.cc
@@ -26,7 +26,6 @@
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/iterator_funcs.hh>
#include <paludis/util/options.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/version_requirements.hh>
diff --git a/paludis/util/active_object_ptr.hh b/paludis/util/active_object_ptr.hh
index 970b1e8..8d86daf 100644
--- a/paludis/util/active_object_ptr.hh
+++ b/paludis/util/active_object_ptr.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2008, 2009, 2010 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
@@ -22,7 +22,6 @@
#include <paludis/util/active_object_ptr-fwd.hh>
#include <paludis/util/mutex.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <memory>
namespace paludis
@@ -43,7 +42,7 @@ namespace paludis
public:
Deref(const ActiveObjectPtr * p) :
_ptr(p),
- _lock(make_shared_ptr(new Lock(*p->_mutex)))
+ _lock(std::make_shared<Lock>(*p->_mutex))
{
}
diff --git a/paludis/util/active_object_ptr_TEST.cc b/paludis/util/active_object_ptr_TEST.cc
index fcdc97d..6d204f2 100644
--- a/paludis/util/active_object_ptr_TEST.cc
+++ b/paludis/util/active_object_ptr_TEST.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2008, 2009, 2010 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
@@ -31,7 +31,7 @@ namespace test_cases
TESTCASE_SEMIREGULAR(ActiveIntPtr, ActiveIntPtr(new int(10)));
typedef ActiveObjectPtr<std::shared_ptr<int> > ActiveSharedIntPtr;
- TESTCASE_SEMIREGULAR(ActiveSharedIntPtr, ActiveSharedIntPtr(make_shared_ptr(new int(10))));
+ TESTCASE_SEMIREGULAR(ActiveSharedIntPtr, ActiveSharedIntPtr(std::make_shared<int>(10)));
struct TestDereference : TestCase
{
@@ -43,7 +43,7 @@ namespace test_cases
TEST_CHECK_EQUAL(p->length(), 6u);
ActiveObjectPtr<std::shared_ptr<std::string> > q(
- make_shared_ptr(new std::string("chimp")));
+ std::make_shared<std::string>("chimp"));
TEST_CHECK_EQUAL(q->length(), 5u);
}
} test_dereference;
@@ -58,7 +58,7 @@ namespace test_cases
TEST_CHECK_EQUAL(p.value()->length(), 6u);
ActiveObjectPtr<std::shared_ptr<std::string> > q(
- make_shared_ptr(new std::string("chimp")));
+ std::make_shared<std::string>("chimp"));
TEST_CHECK_EQUAL(q.value()->length(), 5u);
}
} test_value;
diff --git a/paludis/util/deferred_construction_ptr_TEST.cc b/paludis/util/deferred_construction_ptr_TEST.cc
index 4a9e42a..06ae1a8 100644
--- a/paludis/util/deferred_construction_ptr_TEST.cc
+++ b/paludis/util/deferred_construction_ptr_TEST.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008 Ciaran McCreesh
+ * Copyright (c) 2008, 2010 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
@@ -35,7 +35,7 @@ namespace
std::shared_ptr<int> make_ten_shared()
{
- return make_shared_ptr(new int(10));
+ return std::make_shared<int>(10);
}
std::string * make_monkey()
@@ -45,7 +45,7 @@ namespace
std::shared_ptr<std::string> make_chimp_shared()
{
- return make_shared_ptr(new std::string("chimp"));
+ return std::make_shared<std::string>("chimp");
}
}
@@ -99,7 +99,7 @@ namespace test_cases
static std::shared_ptr<Flag> make_flag()
{
- return make_shared_ptr(new Flag);
+ return std::make_shared<Flag>();
}
void run()
@@ -122,7 +122,7 @@ namespace test_cases
static std::shared_ptr<Flag> make_flag()
{
- return make_shared_ptr(new Flag);
+ return std::make_shared<Flag>();
}
void run()
diff --git a/paludis/util/elf.cc b/paludis/util/elf.cc
index d4a92f3..6ab6c4e 100644
--- a/paludis/util/elf.cc
+++ b/paludis/util/elf.cc
@@ -27,7 +27,6 @@
#include <paludis/util/elf_types.hh>
#include <paludis/util/byte_swap.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/iterator_funcs.hh>
@@ -332,17 +331,17 @@ ElfObject<ElfType_>::ElfObject(std::istream & stream) :
for (typename std::vector<typename ElfType_::SectionHeader>::iterator i = shdrs.begin(); i != shdrs.end(); ++i)
{
if (i->sh_type == SHT_STRTAB)
- _imp->sections.push_back(make_shared_ptr(new StringSection<ElfType_>(_imp->sections.size(), *i, stream, need_byte_swap)));
+ _imp->sections.push_back(std::make_shared<StringSection<ElfType_> >(_imp->sections.size(), *i, stream, need_byte_swap));
else if ( (i->sh_type == SHT_SYMTAB) || (i->sh_type == SHT_DYNSYM) )
- _imp->sections.push_back(make_shared_ptr(new SymbolSection<ElfType_>(_imp->sections.size(), *i, stream, need_byte_swap)));
+ _imp->sections.push_back(std::make_shared<SymbolSection<ElfType_> >(_imp->sections.size(), *i, stream, need_byte_swap));
else if (i->sh_type == SHT_DYNAMIC)
- _imp->sections.push_back(make_shared_ptr(new DynamicSection<ElfType_>(_imp->sections.size(), *i, stream, need_byte_swap)));
+ _imp->sections.push_back(std::make_shared<DynamicSection<ElfType_> >(_imp->sections.size(), *i, stream, need_byte_swap));
else if (i->sh_type == SHT_REL)
- _imp->sections.push_back(make_shared_ptr(new RelocationSection<ElfType_, Relocation<ElfType_> >(_imp->sections.size(), *i, stream, need_byte_swap)));
+ _imp->sections.push_back(std::make_shared<RelocationSection<ElfType_, Relocation<ElfType_> > >(_imp->sections.size(), *i, stream, need_byte_swap));
else if (i->sh_type == SHT_RELA)
- _imp->sections.push_back(make_shared_ptr(new RelocationSection<ElfType_, RelocationA<ElfType_> >(_imp->sections.size(), *i, stream, need_byte_swap)));
+ _imp->sections.push_back(std::make_shared<RelocationSection<ElfType_, RelocationA<ElfType_> > >(_imp->sections.size(), *i, stream, need_byte_swap));
else
- _imp->sections.push_back(make_shared_ptr(new GenericSection<ElfType_>(_imp->sections.size(), *i)));
+ _imp->sections.push_back(std::make_shared<GenericSection<ElfType_> >(_imp->sections.size(), *i));
}
if (! _hdr.e_shstrndx)
diff --git a/paludis/util/elf_dynamic_section.cc b/paludis/util/elf_dynamic_section.cc
index 1daab5a..a98ec72 100644
--- a/paludis/util/elf_dynamic_section.cc
+++ b/paludis/util/elf_dynamic_section.cc
@@ -28,7 +28,6 @@
#include <paludis/util/byte_swap.hh>
#include <paludis/util/clone-impl.hh>
#include <paludis/util/singleton-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/indirect_iterator-impl.hh>
@@ -256,14 +255,14 @@ template <typename ElfType_>
DynamicEntries<ElfType_>::DynamicEntries() :
PrivateImplementationPattern<DynamicEntries>(new Implementation<DynamicEntries>)
{
- register_type(DT_NEEDED, make_shared_ptr(new DynamicEntryString<ElfType_>("NEEDED")));
- register_type(DT_RPATH, make_shared_ptr(new DynamicEntryString<ElfType_>("RPATH")));
- register_type(DT_RUNPATH, make_shared_ptr(new DynamicEntryString<ElfType_>("RUNPATH")));
- register_type(DT_SONAME, make_shared_ptr(new DynamicEntryString<ElfType_>("SONAME")));
- register_type(DT_TEXTREL, make_shared_ptr(new DynamicEntryFlag<ElfType_>("TEXTREL")));
- register_type(DT_NULL, make_shared_ptr(new DynamicEntryFlag<ElfType_>("NULL")));
- register_type(DT_SYMTAB, make_shared_ptr(new DynamicEntryPointer<ElfType_>("SYMTAB")));
- register_type(DT_STRTAB, make_shared_ptr(new DynamicEntryPointer<ElfType_>("STRTAB")));
+ register_type(DT_NEEDED, std::make_shared<DynamicEntryString<ElfType_> >("NEEDED"));
+ register_type(DT_RPATH, std::make_shared<DynamicEntryString<ElfType_> >("RPATH"));
+ register_type(DT_RUNPATH, std::make_shared<DynamicEntryString<ElfType_> >("RUNPATH"));
+ register_type(DT_SONAME, std::make_shared<DynamicEntryString<ElfType_> >("SONAME"));
+ register_type(DT_TEXTREL, std::make_shared<DynamicEntryFlag<ElfType_> >("TEXTREL"));
+ register_type(DT_NULL, std::make_shared<DynamicEntryFlag<ElfType_> >("NULL"));
+ register_type(DT_SYMTAB, std::make_shared<DynamicEntryPointer<ElfType_> >("SYMTAB"));
+ register_type(DT_STRTAB, std::make_shared<DynamicEntryPointer<ElfType_> >("STRTAB"));
}
template <typename ElfType_>
@@ -285,7 +284,7 @@ DynamicEntries<ElfType_>::get_entry(typename ElfType_::DynamicTag tag) const
typename std::map<typename ElfType_::DynamicTag, std::shared_ptr<DynamicEntry<ElfType_> > >::const_iterator i;
if (( i = _imp->available_types.find(tag)) != _imp->available_types.end())
return i->second->clone();
- return make_shared_ptr(new DynamicEntryUnknown<ElfType_>());
+ return std::make_shared<DynamicEntryUnknown<ElfType_> >();
}
template <typename ElfType_>
diff --git a/paludis/util/executor.cc b/paludis/util/executor.cc
index 4106b9d..7618111 100644
--- a/paludis/util/executor.cc
+++ b/paludis/util/executor.cc
@@ -22,7 +22,6 @@
#include <paludis/util/mutex.hh>
#include <paludis/util/condition_variable.hh>
#include <paludis/util/thread.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/exception.hh>
#include <paludis/util/stringify.hh>
#include <map>
@@ -130,8 +129,8 @@ Executor::execute()
++_imp->active;
--_imp->pending;
(*q->second.begin())->pre_execute_exclusive();
- running.insert(std::make_pair(q->first, std::make_pair(make_shared_ptr(new Thread(
- std::bind(&Executor::_one, this, *q->second.begin()))), *q->second.begin())));
+ running.insert(std::make_pair(q->first, std::make_pair(std::make_shared<Thread>(
+ std::bind(&Executor::_one, this, *q->second.begin())), *q->second.begin())));
q->second.erase(q->second.begin());
if (q->second.empty())
_imp->queues.erase(q++);
diff --git a/paludis/util/files.m4 b/paludis/util/files.m4
index 246a889..480cff5 100644
--- a/paludis/util/files.m4
+++ b/paludis/util/files.m4
@@ -48,8 +48,8 @@ add(`is_file_with_extension', `hh', `cc', `se', `test', `testscript')
add(`join', `hh', `test')
add(`log', `hh', `cc', `se', `test')
add(`make_named_values', `hh', `cc')
+add(`make_null_shared_ptr', `hh')
add(`make_shared_copy', `hh', `fwd')
-add(`make_shared_ptr', `hh', `fwd')
add(`map', `hh', `fwd', `impl', `cc')
add(`member_iterator', `hh', `fwd', `impl', `test')
add(`md5', `hh', `cc', `test')
diff --git a/paludis/util/make_shared_ptr.hh b/paludis/util/make_null_shared_ptr.hh
index c84c316..fcbf529 100644
--- a/paludis/util/make_shared_ptr.hh
+++ b/paludis/util/make_null_shared_ptr.hh
@@ -1,6 +1,28 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
+ * Copyright (c) 2010 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
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef PALUDIS_GUARD_PALUDIS_UTIL_MAKE_NULL_SHARED_PTR_HH
+#define PALUDIS_GUARD_PALUDIS_UTIL_MAKE_NULL_SHARED_PTR_HH 1
+
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
* Copyright (c) 2007, 2008 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -20,11 +42,10 @@
#ifndef PALUDIS_GUARD_PALUDIS_UTIL_MAKE_SHARED_PTR_HH
#define PALUDIS_GUARD_PALUDIS_UTIL_MAKE_SHARED_PTR_HH 1
-#include <paludis/util/make_shared_ptr-fwd.hh>
#include <memory>
/** \file
- * Declarations for the make_shared_ptr function.
+ * Declarations for the make_null_shared_ptr function.
*
* \ingroup g_utils
*
@@ -35,13 +56,6 @@
namespace paludis
{
- template <typename T_>
- std::shared_ptr<T_>
- make_shared_ptr(T_ * const t)
- {
- return std::shared_ptr<T_>(t);
- }
-
/**
* An object that can convert itself into an empty std::shared_ptr<>
* of any type.
@@ -66,3 +80,5 @@ namespace paludis
}
#endif
+
+#endif
diff --git a/paludis/util/make_shared_copy.hh b/paludis/util/make_shared_copy.hh
index 8fb2940..61f90ee 100644
--- a/paludis/util/make_shared_copy.hh
+++ b/paludis/util/make_shared_copy.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009 Ciaran McCreesh
+ * Copyright (c) 2009, 2010 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
@@ -21,7 +21,7 @@
#define PALUDIS_GUARD_PALUDIS_UTIL_MAKE_SHARED_COPY_HH 1
#include <paludis/util/make_shared_copy-fwd.hh>
-#include <paludis/util/make_shared_ptr.hh>
+#include <memory>
/** \file
* Declarations for the make_shared_copy function.
@@ -39,7 +39,7 @@ namespace paludis
std::shared_ptr<T_>
make_shared_copy(const T_ & t)
{
- return make_shared_ptr(new T_(t));
+ return std::make_shared<T_>(t);
}
}
diff --git a/paludis/util/make_shared_ptr-fwd.hh b/paludis/util/make_shared_ptr-fwd.hh
deleted file mode 100644
index 33a47dd..0000000
--- a/paludis/util/make_shared_ptr-fwd.hh
+++ /dev/null
@@ -1,60 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2007, 2008 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
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef PALUDIS_GUARD_PALUDIS_UTIL_MAKE_SHARED_PTR_FWD_HH
-#define PALUDIS_GUARD_PALUDIS_UTIL_MAKE_SHARED_PTR_FWD_HH 1
-
-#include <paludis/util/attributes.hh>
-#include <memory>
-
-/** \file
- * Forward declarations for paludis/make_shared_ptr.hh .
- *
- * \ingroup g_utils
- */
-
-namespace paludis
-{
- /**
- * Convenience function for creating a std::shared_ptr<> from a newly
- * constructed object.
- *
- * Use this only with <code>new T_(whatever)</code> as the parameter. Do not
- * use it to try to create a std::shared_ptr<> from something that is not
- * newly allocated.
- *
- * \ingroup g_utils
- */
- template <typename T_>
- std::shared_ptr<T_>
- make_shared_ptr(T_ * const t) PALUDIS_ATTRIBUTE((warn_unused_result));
-
- struct NullSharedPtr;
-
- /**
- * Return an object that can convert itself to an empty
- * std::shared_ptr<> of any type.
- *
- * \ingroup g_utils
- * \since 0.32
- */
- inline NullSharedPtr make_null_shared_ptr() PALUDIS_ATTRIBUTE((warn_unused_result)) PALUDIS_VISIBLE;
-}
-
-#endif
diff --git a/paludis/util/singleton_TEST.cc b/paludis/util/singleton_TEST.cc
index 630181e..ece4df6 100644
--- a/paludis/util/singleton_TEST.cc
+++ b/paludis/util/singleton_TEST.cc
@@ -21,7 +21,6 @@
#include <paludis/util/singleton-impl.hh>
#include <paludis/util/thread.hh>
#include <paludis/util/mutex.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <functional>
#include <algorithm>
#include <vector>
@@ -164,7 +163,7 @@ namespace test_cases
{
std::vector<std::shared_ptr<Thread> > t(c);
for (int x(0) ; x < c ; ++x)
- t[x] = make_shared_ptr(new Thread(std::bind(&thread_func, &a[x])));
+ t[x] = std::make_shared<Thread>(std::bind(&thread_func, &a[x]));
}
TEST_CHECK_EQUAL(MyThreadedClass::instances, 1);
TEST_CHECK(0 == std::count(a.begin(), a.end(), static_cast<void *>(0)));
diff --git a/paludis/util/thread_pool.cc b/paludis/util/thread_pool.cc
index 7979802..deb310d 100644
--- a/paludis/util/thread_pool.cc
+++ b/paludis/util/thread_pool.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2010 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
@@ -19,7 +19,6 @@
#include <paludis/util/thread_pool.hh>
#include <paludis/util/thread.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <memory>
#include <deque>
@@ -47,7 +46,7 @@ ThreadPool::~ThreadPool()
void
ThreadPool::create_thread(const std::function<void () throw ()> & f)
{
- _imp->threads.push_back(make_shared_ptr(new Thread(f)));
+ _imp->threads.push_back(std::make_shared<Thread>(f));
}
unsigned
diff --git a/python/action.cc b/python/action.cc
index 23f8ff2..69e322d 100644
--- a/python/action.cc
+++ b/python/action.cc
@@ -22,9 +22,9 @@
#include <paludis/action.hh>
#include <paludis/util/make_named_values.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/return_literal_function.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/repository.hh>
#include <memory>
@@ -60,7 +60,7 @@ namespace
std::shared_ptr<OutputManager> make_standard_output_manager(const Action &)
{
- return make_shared_ptr(new StandardOutputManager);
+ return std::make_shared<StandardOutputManager>();
}
void cannot_perform_uninstall(const std::shared_ptr<const PackageID> & id, const UninstallActionOptions &)
@@ -80,7 +80,7 @@ namespace
n::destination() = r,
n::make_output_manager() = &make_standard_output_manager,
n::perform_uninstall() = &cannot_perform_uninstall,
- n::replacing() = make_shared_ptr(new PackageIDSequence),
+ n::replacing() = std::make_shared<PackageIDSequence>(),
n::want_phase() = &want_all_phases
));
}
@@ -130,7 +130,7 @@ namespace
parts += fp_unneeded;
return new FetchActionOptions(make_named_values<FetchActionOptions>(
- n::errors() = make_shared_ptr(new Sequence<FetchActionFailure>),
+ n::errors() = std::make_shared<Sequence<FetchActionFailure>>(),
n::exclude_unmirrorable() = exclude_unmirrorable,
n::fetch_parts() = parts,
n::ignore_not_in_manifest() = false,
diff --git a/python/dep_spec.cc b/python/dep_spec.cc
index 94c5347..d1b3365 100644
--- a/python/dep_spec.cc
+++ b/python/dep_spec.cc
@@ -30,7 +30,6 @@
#include <paludis/version_requirements.hh>
#include <paludis/util/save.hh>
#include <paludis/util/stringify.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/clone-impl.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
@@ -219,7 +218,7 @@ PythonPackageDepSpec::PythonPackageDepSpec(const PackageDepSpec & p) :
deep_copy(p.package_ptr()),
deep_copy(p.category_name_part_ptr()),
deep_copy(p.package_name_part_ptr()),
- make_shared_ptr(new VersionRequirements),
+ std::make_shared<VersionRequirements>(),
p.version_requirements_mode(),
p.slot_requirement_ptr(),
deep_copy(p.in_repository_ptr()),
@@ -241,7 +240,7 @@ PythonPackageDepSpec::PythonPackageDepSpec(const PythonPackageDepSpec & p) :
deep_copy(p.package_ptr()),
deep_copy(p.category_name_part_ptr()),
deep_copy(p.package_name_part_ptr()),
- make_shared_ptr(new VersionRequirements),
+ std::make_shared<VersionRequirements>(),
p.version_requirements_mode(),
p.slot_requirement_ptr(),
deep_copy(p.in_repository_ptr()),
@@ -302,7 +301,7 @@ PythonPackageDepSpec::operator PackageDepSpec() const
PythonPackageDepSpec::operator std::shared_ptr<PackageDepSpec>() const
{
- return make_shared_ptr(new PackageDepSpec(*this));
+ return std::make_shared<PackageDepSpec>(*this);
}
std::shared_ptr<const QualifiedPackageName>
@@ -445,7 +444,7 @@ PythonBlockDepSpec::PythonBlockDepSpec(const std::string & t, const std::shared_
PythonBlockDepSpec::PythonBlockDepSpec(const BlockDepSpec & d) :
PythonStringDepSpec(d.text()),
- _spec(make_shared_ptr(new PythonPackageDepSpec(d.blocking()))),
+ _spec(std::make_shared<PythonPackageDepSpec>(d.blocking())),
_strong(d.strong())
{
}
@@ -557,61 +556,61 @@ SpecTreeToPython::visit(const GenericSpecTree::NodeType<ConditionalDepSpec>::Typ
void
SpecTreeToPython::visit(const GenericSpecTree::NodeType<PackageDepSpec>::Type & node)
{
- _current_parent->add_child(make_shared_ptr(new PythonPackageDepSpec(*node.spec())));
+ _current_parent->add_child(std::make_shared<PythonPackageDepSpec>(*node.spec()));
}
void
SpecTreeToPython::visit(const GenericSpecTree::NodeType<PlainTextDepSpec>::Type & node)
{
- _current_parent->add_child(make_shared_ptr(new PythonPlainTextDepSpec(*node.spec())));
+ _current_parent->add_child(std::make_shared<PythonPlainTextDepSpec>(*node.spec()));
}
void
SpecTreeToPython::visit(const GenericSpecTree::NodeType<NamedSetDepSpec>::Type & node)
{
- _current_parent->add_child(make_shared_ptr(new PythonNamedSetDepSpec(*node.spec())));
+ _current_parent->add_child(std::make_shared<PythonNamedSetDepSpec>(*node.spec()));
}
void
SpecTreeToPython::visit(const GenericSpecTree::NodeType<LicenseDepSpec>::Type & node)
{
- _current_parent->add_child(make_shared_ptr(new PythonLicenseDepSpec(*node.spec())));
+ _current_parent->add_child(std::make_shared<PythonLicenseDepSpec>(*node.spec()));
}
void
SpecTreeToPython::visit(const GenericSpecTree::NodeType<SimpleURIDepSpec>::Type & node)
{
- _current_parent->add_child(make_shared_ptr(new PythonSimpleURIDepSpec(*node.spec())));
+ _current_parent->add_child(std::make_shared<PythonSimpleURIDepSpec>(*node.spec()));
}
void
SpecTreeToPython::visit(const GenericSpecTree::NodeType<FetchableURIDepSpec>::Type & node)
{
- _current_parent->add_child(make_shared_ptr(new PythonFetchableURIDepSpec(*node.spec())));
+ _current_parent->add_child(std::make_shared<PythonFetchableURIDepSpec>(*node.spec()));
}
void
SpecTreeToPython::visit(const GenericSpecTree::NodeType<BlockDepSpec>::Type & node)
{
- _current_parent->add_child(make_shared_ptr(new PythonBlockDepSpec(*node.spec())));
+ _current_parent->add_child(std::make_shared<PythonBlockDepSpec>(*node.spec()));
}
void
SpecTreeToPython::visit(const GenericSpecTree::NodeType<URILabelsDepSpec>::Type & node)
{
- _current_parent->add_child(make_shared_ptr(new PythonURILabelsDepSpec(*node.spec())));
+ _current_parent->add_child(std::make_shared<PythonURILabelsDepSpec>(*node.spec()));
}
void
SpecTreeToPython::visit(const GenericSpecTree::NodeType<PlainTextLabelDepSpec>::Type & node)
{
- _current_parent->add_child(make_shared_ptr(new PythonPlainTextLabelDepSpec(*node.spec())));
+ _current_parent->add_child(std::make_shared<PythonPlainTextLabelDepSpec>(*node.spec()));
}
void
SpecTreeToPython::visit(const GenericSpecTree::NodeType<DependenciesLabelsDepSpec>::Type & node)
{
- _current_parent->add_child(make_shared_ptr(new PythonDependenciesLabelsDepSpec(*node.spec())));
+ _current_parent->add_child(std::make_shared<PythonDependenciesLabelsDepSpec>(*node.spec()));
}
const std::shared_ptr<const PythonDepSpec>
@@ -730,7 +729,7 @@ void dispatch(SpecTreeFromPython<H_> * const v, const PyD_ & d)
template <typename H_>
SpecTreeFromPython<H_>::SpecTreeFromPython() :
- _result(new H_(make_shared_ptr(new AllDepSpec))),
+ _result(new H_(std::make_shared<AllDepSpec>())),
_add_to(_result->root())
{
}
@@ -835,7 +834,7 @@ template <typename H_>
void
SpecTreeFromPython<H_>::real_visit(const PythonAllDepSpec & d)
{
- Save<std::shared_ptr<typename H_::BasicInnerNode> > old_add_to(&_add_to, _add_to->append(make_shared_ptr(new AllDepSpec())));
+ Save<std::shared_ptr<typename H_::BasicInnerNode> > old_add_to(&_add_to, _add_to->append(std::make_shared<AllDepSpec>()));
std::for_each(indirect_iterator(d.begin()), indirect_iterator(d.end()), accept_visitor(*this));
}
@@ -843,7 +842,7 @@ template <typename H_>
void
SpecTreeFromPython<H_>::real_visit(const PythonAnyDepSpec & d)
{
- Save<std::shared_ptr<typename H_::BasicInnerNode> > old_add_to(&_add_to, _add_to->append(make_shared_ptr(new AnyDepSpec())));
+ Save<std::shared_ptr<typename H_::BasicInnerNode> > old_add_to(&_add_to, _add_to->append(std::make_shared<AnyDepSpec>()));
std::for_each(indirect_iterator(d.begin()), indirect_iterator(d.end()), accept_visitor(*this));
}
@@ -851,7 +850,7 @@ template <typename H_>
void
SpecTreeFromPython<H_>::real_visit(const PythonConditionalDepSpec & d)
{
- Save<std::shared_ptr<typename H_::BasicInnerNode> > old_add_to(&_add_to, _add_to->append(make_shared_ptr(new ConditionalDepSpec(d.data()))));
+ Save<std::shared_ptr<typename H_::BasicInnerNode> > old_add_to(&_add_to, _add_to->append(std::make_shared<ConditionalDepSpec>(d.data())));
std::for_each(indirect_iterator(d.begin()), indirect_iterator(d.end()), accept_visitor(*this));
}
@@ -859,70 +858,70 @@ template <typename H_>
void
SpecTreeFromPython<H_>::real_visit(const PythonPackageDepSpec & d)
{
- _add_to->append(make_shared_ptr(new PackageDepSpec(d)));
+ _add_to->append(std::make_shared<PackageDepSpec>(d));
}
template <typename H_>
void
SpecTreeFromPython<H_>::real_visit(const PythonLicenseDepSpec & d)
{
- _add_to->append(make_shared_ptr(new LicenseDepSpec(d.text())));
+ _add_to->append(std::make_shared<LicenseDepSpec>(d.text()));
}
template <typename H_>
void
SpecTreeFromPython<H_>::real_visit(const PythonSimpleURIDepSpec & d)
{
- _add_to->append(make_shared_ptr(new SimpleURIDepSpec(d.text())));
+ _add_to->append(std::make_shared<SimpleURIDepSpec>(d.text()));
}
template <typename H_>
void
SpecTreeFromPython<H_>::real_visit(const PythonPlainTextDepSpec & d)
{
- _add_to->append(make_shared_ptr(new PlainTextDepSpec(d.text())));
+ _add_to->append(std::make_shared<PlainTextDepSpec>(d.text()));
}
template <typename H_>
void
SpecTreeFromPython<H_>::real_visit(const PythonNamedSetDepSpec & d)
{
- _add_to->append(make_shared_ptr(new NamedSetDepSpec(d.name())));
+ _add_to->append(std::make_shared<NamedSetDepSpec>(d.name()));
}
template <typename H_>
void
SpecTreeFromPython<H_>::real_visit(const PythonFetchableURIDepSpec & d)
{
- _add_to->append(make_shared_ptr(new FetchableURIDepSpec(d.text())));
+ _add_to->append(std::make_shared<FetchableURIDepSpec>(d.text()));
}
template <typename H_>
void
SpecTreeFromPython<H_>::real_visit(const PythonURILabelsDepSpec &)
{
- _add_to->append(make_shared_ptr(new URILabelsDepSpec));
+ _add_to->append(std::make_shared<URILabelsDepSpec>());
}
template <typename H_>
void
SpecTreeFromPython<H_>::real_visit(const PythonPlainTextLabelDepSpec & s)
{
- _add_to->append(make_shared_ptr(new PlainTextLabelDepSpec(s.text())));
+ _add_to->append(std::make_shared<PlainTextLabelDepSpec>(s.text()));
}
template <typename H_>
void
SpecTreeFromPython<H_>::real_visit(const PythonDependenciesLabelsDepSpec &)
{
- _add_to->append(make_shared_ptr(new DependenciesLabelsDepSpec));
+ _add_to->append(std::make_shared<DependenciesLabelsDepSpec>());
}
template <typename H_>
void
SpecTreeFromPython<H_>::real_visit(const PythonBlockDepSpec & d)
{
- _add_to->append(make_shared_ptr(new BlockDepSpec(d.text(), *d.blocking(), d.strong())));
+ _add_to->append(std::make_shared<BlockDepSpec>(d.text(), *d.blocking(), d.strong()));
}
template <typename H_>
diff --git a/python/environment.cc b/python/environment.cc
index 18e5deb..8be1aef 100644
--- a/python/environment.cc
+++ b/python/environment.cc
@@ -33,8 +33,8 @@
#include <paludis/spec_tree.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/tribool.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/standard_output_manager.hh>
using namespace paludis;
@@ -435,7 +435,7 @@ class EnvironmentImplementationWrapper :
virtual const std::shared_ptr<OutputManager> create_output_manager(
const CreateOutputManagerInfo &) const
{
- return make_shared_ptr(new StandardOutputManager);
+ return std::make_shared<StandardOutputManager>();
}
virtual const std::shared_ptr<Repository> repository_from_new_config_file(
@@ -712,7 +712,7 @@ void expose_environment()
bp::init<const FSEntry &, const FSEntry &, const std::string &, const std::shared_ptr<const FSEntrySequence> &>(
(bp::arg("environment_dir"), bp::arg("write_cache_dir")="/var/empty",
bp::arg("master_repository_name")="",
- bp::arg("extra_repository_dirs") = make_shared_ptr(new FSEntrySequence)),
+ bp::arg("extra_repository_dirs") = std::make_shared<FSEntrySequence>()),
"__init__(environment_dir, write_cache_dir=\"/var/empty\", "
"master_repository_name=\"\", extra_repository_dirs=[])"
)
diff --git a/python/mask.cc b/python/mask.cc
index c25eac3..3228042 100644
--- a/python/mask.cc
+++ b/python/mask.cc
@@ -22,7 +22,6 @@
#include <paludis/mask.hh>
#include <paludis/util/make_named_values.hh>
-#include <paludis/util/make_shared_ptr.hh>
using namespace paludis;
using namespace paludis::python;
@@ -33,10 +32,10 @@ namespace
std::shared_ptr<RepositoryMaskInfo> make_repository_mask_info(
const std::shared_ptr<const Sequence<std::string> > & s, const FSEntry & f)
{
- return make_shared_ptr(new RepositoryMaskInfo(make_named_values<RepositoryMaskInfo>(
+ return std::make_shared<RepositoryMaskInfo>(make_named_values<RepositoryMaskInfo>(
n::comment() = s,
n::mask_file() = f
- )));
+ ));
}
}
diff --git a/python/metadata_key.cc b/python/metadata_key.cc
index 2ce58a1..f5afd79 100644
--- a/python/metadata_key.cc
+++ b/python/metadata_key.cc
@@ -27,7 +27,6 @@
#include <paludis/environment.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/set.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/timestamp.hh>
diff --git a/python/repository.cc b/python/repository.cc
index c40be49..5fd1961 100644
--- a/python/repository.cc
+++ b/python/repository.cc
@@ -106,10 +106,10 @@ namespace
std::shared_ptr<FakeRepository>
make_fake_repository(const Environment * const env, const RepositoryName & n)
{
- return make_shared_ptr(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ return std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = env,
n::name() = n
- )));
+ ));
}
}
diff --git a/ruby/action.cc b/ruby/action.cc
index 671d643..824e4e7 100644
--- a/ruby/action.cc
+++ b/ruby/action.cc
@@ -20,9 +20,9 @@
#include <paludis_ruby.hh>
#include <paludis/action.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/return_literal_function.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/standard_output_manager.hh>
#include <ruby.h>
@@ -178,19 +178,19 @@ namespace
try
{
if (Qtrue == rb_funcall2(action_class, rb_intern("<="), 1, install_action_value_ptr()))
- ptr = new std::shared_ptr<const SupportsActionTestBase>(make_shared_ptr(new SupportsActionTest<InstallAction>()));
+ ptr = new std::shared_ptr<const SupportsActionTestBase>(std::make_shared<SupportsActionTest<InstallAction>>());
else if (Qtrue == rb_funcall2(action_class, rb_intern("<="), 1, uninstall_action_value_ptr()))
- ptr = new std::shared_ptr<const SupportsActionTestBase>(make_shared_ptr(new SupportsActionTest<UninstallAction>()));
+ ptr = new std::shared_ptr<const SupportsActionTestBase>(std::make_shared<SupportsActionTest<UninstallAction>>());
else if (Qtrue == rb_funcall2(action_class, rb_intern("<="), 1, pretend_action_value_ptr()))
- ptr = new std::shared_ptr<const SupportsActionTestBase>(make_shared_ptr(new SupportsActionTest<PretendAction>()));
+ ptr = new std::shared_ptr<const SupportsActionTestBase>(std::make_shared<SupportsActionTest<PretendAction>>());
else if (Qtrue == rb_funcall2(action_class, rb_intern("<="), 1, config_action_value_ptr()))
- ptr = new std::shared_ptr<const SupportsActionTestBase>(make_shared_ptr(new SupportsActionTest<ConfigAction>()));
+ ptr = new std::shared_ptr<const SupportsActionTestBase>(std::make_shared<SupportsActionTest<ConfigAction>>());
else if (Qtrue == rb_funcall2(action_class, rb_intern("<="), 1, fetch_action_value_ptr()))
- ptr = new std::shared_ptr<const SupportsActionTestBase>(make_shared_ptr(new SupportsActionTest<FetchAction>()));
+ ptr = new std::shared_ptr<const SupportsActionTestBase>(std::make_shared<SupportsActionTest<FetchAction>>());
else if (Qtrue == rb_funcall2(action_class, rb_intern("<="), 1, info_action_value_ptr()))
- ptr = new std::shared_ptr<const SupportsActionTestBase>(make_shared_ptr(new SupportsActionTest<InfoAction>()));
+ ptr = new std::shared_ptr<const SupportsActionTestBase>(std::make_shared<SupportsActionTest<InfoAction>>());
else if (Qtrue == rb_funcall2(action_class, rb_intern("<="), 1, pretend_fetch_action_value_ptr()))
- ptr = new std::shared_ptr<const SupportsActionTestBase>(make_shared_ptr(new SupportsActionTest<PretendFetchAction>()));
+ ptr = new std::shared_ptr<const SupportsActionTestBase>(std::make_shared<SupportsActionTest<PretendFetchAction>>());
else
rb_raise(rb_eTypeError, "Can't convert %s into an Action subclass", rb_obj_classname(action_class));
@@ -207,7 +207,7 @@ namespace
std::shared_ptr<OutputManager> make_standard_output_manager(const Action &)
{
- return make_shared_ptr(new StandardOutputManager);
+ return std::make_shared<StandardOutputManager>();
}
/*
@@ -255,7 +255,7 @@ namespace
parts += fp_unneeded;
ptr = new FetchActionOptions(make_named_values<FetchActionOptions>(
- n::errors() = make_shared_ptr(new Sequence<FetchActionFailure>),
+ n::errors() = std::make_shared<Sequence<FetchActionFailure>>(),
n::exclude_unmirrorable() = v_exclude_unmirrorable,
n::fetch_parts() = parts,
n::ignore_not_in_manifest() = false,
@@ -531,7 +531,7 @@ namespace
n::destination() = v_destination,
n::make_output_manager() = &make_standard_output_manager,
n::perform_uninstall() = &cannot_perform_uninstall,
- n::replacing() = make_shared_ptr(new PackageIDSequence),
+ n::replacing() = std::make_shared<PackageIDSequence>(),
n::want_phase() = &want_all_phases
));
diff --git a/ruby/dep_label.cc b/ruby/dep_label.cc
index 949696b..e202ab2 100644
--- a/ruby/dep_label.cc
+++ b/ruby/dep_label.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
* Copyright (c) 2006, 2007, 2008 Richard Brown
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -22,7 +22,6 @@
#include <paludis/dep_list.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/sequence.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/options.hh>
#include <paludis/util/save.hh>
#include <paludis/util/member_iterator-impl.hh>
diff --git a/ruby/dep_spec.cc b/ruby/dep_spec.cc
index dc6ceb3..668f5b7 100644
--- a/ruby/dep_spec.cc
+++ b/ruby/dep_spec.cc
@@ -25,11 +25,11 @@
#include <paludis/version_operator.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/sequence.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/options.hh>
#include <paludis/util/save.hh>
#include <paludis/util/member_iterator-impl.hh>
#include <paludis/util/indirect_iterator-impl.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <list>
#include <ruby.h>
@@ -469,8 +469,8 @@ namespace
try
{
std::shared_ptr<const PackageDepSpec> pkg(value_to_package_dep_spec(spec));
- ptr = new std::shared_ptr<const WrappedSpecBase>(new WrappedSpec<BlockDepSpec>(make_shared_ptr(
- new BlockDepSpec(StringValuePtr(str), *pkg, value_to_bool(strong)))));
+ ptr = new std::shared_ptr<const WrappedSpecBase>(new WrappedSpec<BlockDepSpec>(
+ std::make_shared<BlockDepSpec>(StringValuePtr(str), *pkg, value_to_bool(strong))));
VALUE tdata(Data_Wrap_Struct(self, 0, &Common<std::shared_ptr<const WrappedSpecBase> >::free, ptr));
rb_obj_call_init(tdata, 3, &str);
return tdata;
@@ -493,8 +493,8 @@ namespace
{
std::shared_ptr<WrappedSpecBase> * p;
Data_Get_Struct(self, std::shared_ptr<WrappedSpecBase>, p);
- return package_dep_spec_to_value(make_shared_ptr(new PackageDepSpec(
- std::static_pointer_cast<const WrappedSpec<BlockDepSpec> >(*p)->spec()->blocking())));
+ return package_dep_spec_to_value(std::make_shared<PackageDepSpec>(
+ std::static_pointer_cast<const WrappedSpec<BlockDepSpec> >(*p)->spec()->blocking()));
}
template <typename A_>
@@ -506,7 +506,7 @@ namespace
std::shared_ptr<const WrappedSpecBase> * ptr(0);
try
{
- ptr = new std::shared_ptr<const WrappedSpecBase>(new WrappedSpec<A_>(make_shared_ptr(new A_)));
+ ptr = new std::shared_ptr<const WrappedSpecBase>(new WrappedSpec<A_>(std::make_shared<A_>()));
VALUE tdata(Data_Wrap_Struct(self, 0, &Common<std::shared_ptr<const WrappedSpecBase> >::free, ptr));
rb_obj_call_init(tdata, 0, &self);
return tdata;
@@ -524,7 +524,7 @@ namespace
std::shared_ptr<const WrappedSpecBase> * ptr(0);
try
{
- ptr = new std::shared_ptr<const WrappedSpecBase>(new WrappedSpec<A_>(make_shared_ptr(new A_(StringValuePtr(s)))));
+ ptr = new std::shared_ptr<const WrappedSpecBase>(new WrappedSpec<A_>(std::make_shared<A_>(StringValuePtr(s))));
VALUE tdata(Data_Wrap_Struct(self, 0, &Common<std::shared_ptr<const WrappedSpecBase> >::free, ptr));
rb_obj_call_init(tdata, 1, &s);
return tdata;
@@ -1059,7 +1059,7 @@ namespace
);
ptr = new std::shared_ptr<const WrappedSpecBase>(new WrappedSpec<PackageDepSpec>(
- make_shared_ptr(new PackageDepSpec(parse_user_package_dep_spec(s, e.get(), o, f)))));
+ std::make_shared<PackageDepSpec>(parse_user_package_dep_spec(s, e.get(), o, f))));
return Data_Wrap_Struct(c_package_dep_spec, 0,
&Common<std::shared_ptr<const WrappedSpecBase> >::free, ptr);
}
@@ -1389,7 +1389,7 @@ paludis::ruby::value_to_dep_tree(VALUE v)
}
else if (rb_obj_is_kind_of(v, c_dep_spec))
{
- ValueToTree<H_> vtt(v, make_shared_ptr(new H_(make_shared_ptr(new AllDepSpec))));
+ ValueToTree<H_> vtt(v, std::make_shared<H_>(std::make_shared<AllDepSpec>()));
return vtt.result;
}
else
diff --git a/src/clients/accerso/accerso.cc b/src/clients/accerso/accerso.cc
index a1d10f7..baac1b7 100644
--- a/src/clients/accerso/accerso.cc
+++ b/src/clients/accerso/accerso.cc
@@ -30,7 +30,6 @@
#include <paludis/util/sequence.hh>
#include <paludis/util/map.hh>
#include <paludis/util/make_named_values.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/pretty_print.hh>
#include <paludis/util/return_literal_function.hh>
#include <paludis/standard_output_manager.hh>
@@ -144,7 +143,7 @@ main(int argc, char *argv[])
OutputManagerFromEnvironment output_manager_holder(&env, *i, oe_exclusive, ClientOutputFeatures());
FetchAction a(make_named_values<FetchActionOptions>(
- n::errors() = make_shared_ptr(new Sequence<FetchActionFailure>),
+ n::errors() = std::make_shared<Sequence<FetchActionFailure>>(),
n::exclude_unmirrorable() = true,
n::fetch_parts() = FetchParts() + fp_regulars + fp_unneeded,
n::ignore_not_in_manifest() = false,
diff --git a/src/clients/adjutrix/downgrade_check.cc b/src/clients/adjutrix/downgrade_check.cc
index 836cd01..46b87af 100644
--- a/src/clients/adjutrix/downgrade_check.cc
+++ b/src/clients/adjutrix/downgrade_check.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010 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,7 +24,6 @@
#include <paludis/util/sequence.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/iterator_funcs.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/named_value.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/safe_ofstream.hh>
@@ -117,7 +116,7 @@ namespace
PartiallyMadePackageDepSpec part_spec((PartiallyMadePackageDepSpecOptions()));
part_spec.package(b->first.first);
if ("(none)" != b->first.second)
- part_spec.slot_requirement(make_shared_ptr(new UserSlotExactRequirement(SlotName(b->first.second))));
+ part_spec.slot_requirement(std::make_shared<UserSlotExactRequirement>(SlotName(b->first.second)));
if (! env[selection::SomeArbitraryVersion(generator::Matches(part_spec, MatchPackageOptions()))]->empty())
{
results.insert(std::make_pair(b->first, stringify(b->second) + " -> nothing on " + desc));
diff --git a/src/clients/appareo/appareo.cc b/src/clients/appareo/appareo.cc
index a4bea08..e3b6b0a 100644
--- a/src/clients/appareo/appareo.cc
+++ b/src/clients/appareo/appareo.cc
@@ -31,7 +31,6 @@
#include <paludis/util/sequence.hh>
#include <paludis/util/map.hh>
#include <paludis/util/make_named_values.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/return_literal_function.hh>
#include <paludis/repositories/e/e_repository_exceptions.hh>
#include <paludis/standard_output_manager.hh>
@@ -57,7 +56,7 @@ namespace
{
std::shared_ptr<OutputManager> make_standard_output_manager(const Action &)
{
- return make_shared_ptr(new StandardOutputManager);
+ return std::make_shared<StandardOutputManager>();
}
FSEntry get_location_and_add_filters()
diff --git a/src/clients/cave/cmd_config.cc b/src/clients/cave/cmd_config.cc
index ae0fa2f..f004bf3 100644
--- a/src/clients/cave/cmd_config.cc
+++ b/src/clients/cave/cmd_config.cc
@@ -22,7 +22,6 @@
#include <paludis/args/args.hh>
#include <paludis/args/do_help.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/environment.hh>
#include <paludis/package_database.hh>
@@ -116,6 +115,6 @@ ConfigCommand::run(
std::shared_ptr<args::ArgsHandler>
ConfigCommand::make_doc_cmdline()
{
- return make_shared_ptr(new ConfigCommandLine);
+ return std::make_shared<ConfigCommandLine>();
}
diff --git a/src/clients/cave/cmd_contents.cc b/src/clients/cave/cmd_contents.cc
index 48b1884..334e1db 100644
--- a/src/clients/cave/cmd_contents.cc
+++ b/src/clients/cave/cmd_contents.cc
@@ -27,7 +27,6 @@
#include <paludis/contents.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/iterator_funcs.hh>
#include <paludis/util/options.hh>
@@ -149,6 +148,6 @@ ContentsCommand::run(
std::shared_ptr<args::ArgsHandler>
ContentsCommand::make_doc_cmdline()
{
- return make_shared_ptr(new ContentsCommandLine);
+ return std::make_shared<ContentsCommandLine>();
}
diff --git a/src/clients/cave/cmd_display_resolution.cc b/src/clients/cave/cmd_display_resolution.cc
index 4312b16..fa20f97 100644
--- a/src/clients/cave/cmd_display_resolution.cc
+++ b/src/clients/cave/cmd_display_resolution.cc
@@ -25,7 +25,6 @@
#include "colour_formatter.hh"
#include "match_qpns.hh"
#include <paludis/args/do_help.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/util/system.hh>
#include <paludis/util/destringify.hh>
@@ -40,6 +39,7 @@
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/log.hh>
#include <paludis/util/pretty_print.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/resolver/resolutions_by_resolvent.hh>
#include <paludis/resolver/reason.hh>
#include <paludis/resolver/sanitised_dependencies.hh>
@@ -608,8 +608,7 @@ namespace
if (show_description)
choices_to_explain.insert(std::make_pair((*k)->human_name(),
ChoiceValuesToExplain())).first->second.insert(std::make_pair(
- (*i)->name_with_prefix(), make_shared_ptr(
- new PackageIDSequence))).first->second->push_back(id);
+ (*i)->name_with_prefix(), std::make_shared<PackageIDSequence>())).first->second->push_back(id);
}
}
@@ -1561,6 +1560,6 @@ DisplayResolutionCommand::run(
std::shared_ptr<args::ArgsHandler>
DisplayResolutionCommand::make_doc_cmdline()
{
- return make_shared_ptr(new DisplayResolutionCommandLine);
+ return std::make_shared<DisplayResolutionCommandLine>();
}
diff --git a/src/clients/cave/cmd_executables.cc b/src/clients/cave/cmd_executables.cc
index ad8bbed..87941ce 100644
--- a/src/clients/cave/cmd_executables.cc
+++ b/src/clients/cave/cmd_executables.cc
@@ -28,7 +28,6 @@
#include <paludis/args/do_help.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/indirect_iterator-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/system.hh>
#include <paludis/util/tokeniser.hh>
@@ -99,6 +98,6 @@ ExecutablesCommand::run(
std::shared_ptr<args::ArgsHandler>
ExecutablesCommand::make_doc_cmdline()
{
- return make_shared_ptr(new ExecutablesCommandLine);
+ return std::make_shared<ExecutablesCommandLine>();
}
diff --git a/src/clients/cave/cmd_execute_resolution.cc b/src/clients/cave/cmd_execute_resolution.cc
index f22035f..935339e 100644
--- a/src/clients/cave/cmd_execute_resolution.cc
+++ b/src/clients/cave/cmd_execute_resolution.cc
@@ -27,7 +27,6 @@
#include "resume_data.hh"
#include <paludis/args/do_help.hh>
#include <paludis/args/escape.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/util/safe_ofstream.hh>
#include <paludis/util/system.hh>
@@ -47,6 +46,7 @@
#include <paludis/util/executor.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/timestamp.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/resolver/resolutions_by_resolvent.hh>
#include <paludis/resolver/reason.hh>
#include <paludis/resolver/sanitised_dependencies.hh>
@@ -1207,7 +1207,7 @@ namespace
else if (! already_done)
{
Lock lock(job_mutex);
- job->set_state(make_shared_ptr(new JobSkippedState));
+ job->set_state(std::make_shared<JobSkippedState>());
}
}
@@ -1323,8 +1323,8 @@ namespace
for (JobList<ExecuteJob>::ConstIterator c(lists->execute_job_list()->begin()),
c_end(lists->execute_job_list()->end()) ;
c != c_end ; ++c)
- executor.add(make_shared_ptr(new ExecuteJobExecutive(env, cmdline, *c, lists, require_if, retcode_mutex,
- retcode, counts, old_heading)));
+ executor.add(std::make_shared<ExecuteJobExecutive>(env, cmdline, *c, lists, require_if, retcode_mutex,
+ retcode, counts, old_heading));
executor.execute();
@@ -1345,7 +1345,7 @@ namespace
c_end(lists->execute_job_list()->end()) ;
c != c_end ; ++c)
if (! (*c)->state())
- (*c)->set_state(make_shared_ptr(new JobPendingState));
+ (*c)->set_state(std::make_shared<JobPendingState>());
int retcode(0);
@@ -1627,6 +1627,6 @@ ExecuteResolutionCommand::run(
std::shared_ptr<args::ArgsHandler>
ExecuteResolutionCommand::make_doc_cmdline()
{
- return make_shared_ptr(new ExecuteResolutionCommandLine);
+ return std::make_shared<ExecuteResolutionCommandLine>();
}
diff --git a/src/clients/cave/cmd_find_candidates.cc b/src/clients/cave/cmd_find_candidates.cc
index f5e5524..8f9af29 100644
--- a/src/clients/cave/cmd_find_candidates.cc
+++ b/src/clients/cave/cmd_find_candidates.cc
@@ -27,7 +27,6 @@
#include <paludis/util/set.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/wrapped_output_iterator.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/make_shared_copy.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/simple_visitor_cast.hh>
@@ -218,7 +217,7 @@ FindCandidatesCommand::run_hosted(
generator::Matches m(parse_user_package_dep_spec(*k, env.get(), UserPackageDepSpecOptions() + updso_allow_wildcards), MatchPackageOptions());
if (match_generator)
- match_generator = make_shared_ptr(new generator::Union(*match_generator, m));
+ match_generator = std::make_shared<generator::Union>(*match_generator, m);
else
match_generator = make_shared_copy(m);
}
@@ -241,6 +240,6 @@ FindCandidatesCommand::run_hosted(
std::shared_ptr<args::ArgsHandler>
FindCandidatesCommand::make_doc_cmdline()
{
- return make_shared_ptr(new FindCandidatesCommandLine);
+ return std::make_shared<FindCandidatesCommandLine>();
}
diff --git a/src/clients/cave/cmd_fix_cache.cc b/src/clients/cave/cmd_fix_cache.cc
index b50628a..062de5e 100644
--- a/src/clients/cave/cmd_fix_cache.cc
+++ b/src/clients/cave/cmd_fix_cache.cc
@@ -26,7 +26,6 @@
#include <paludis/environment.hh>
#include <paludis/package_database.hh>
#include <paludis/repository.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <iostream>
@@ -152,5 +151,5 @@ FixCacheCommand::run(
std::shared_ptr<args::ArgsHandler>
FixCacheCommand::make_doc_cmdline()
{
- return make_shared_ptr(new FixCacheCommandLine);
+ return std::make_shared<FixCacheCommandLine>();
}
diff --git a/src/clients/cave/cmd_fix_linkage.cc b/src/clients/cave/cmd_fix_linkage.cc
index 03a7adf..6036246 100644
--- a/src/clients/cave/cmd_fix_linkage.cc
+++ b/src/clients/cave/cmd_fix_linkage.cc
@@ -23,10 +23,10 @@
#include "resolve_common.hh"
#include <paludis/args/do_help.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/join.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/broken_linkage_finder.hh>
#include <paludis/package_id.hh>
#include <paludis/name.hh>
@@ -213,7 +213,7 @@ FixLinkageCommand::run(
PartiallyMadePackageDepSpec part_spec((PartiallyMadePackageDepSpecOptions()));
part_spec.package((*pkg_it)->name());
if ((*pkg_it)->slot_key())
- part_spec.slot_requirement(make_shared_ptr(new UserSlotExactRequirement((*pkg_it)->slot_key()->value())));
+ part_spec.slot_requirement(std::make_shared<UserSlotExactRequirement>((*pkg_it)->slot_key()->value()));
if (cmdline.a_exact.specified())
part_spec.version_requirement(make_named_values<VersionRequirement>(
@@ -254,6 +254,6 @@ FixLinkageCommand::run(
std::shared_ptr<args::ArgsHandler>
FixLinkageCommand::make_doc_cmdline()
{
- return make_shared_ptr(new FixLinkageCommandLine);
+ return std::make_shared<FixLinkageCommandLine>();
}
diff --git a/src/clients/cave/cmd_help.cc b/src/clients/cave/cmd_help.cc
index ba460a9..baab367 100644
--- a/src/clients/cave/cmd_help.cc
+++ b/src/clients/cave/cmd_help.cc
@@ -25,7 +25,6 @@
#include <paludis/args/args.hh>
#include <paludis/args/do_help.hh>
#include <paludis/util/sequence.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include "command_factory.hh"
#include "command_command_line.hh"
@@ -148,7 +147,7 @@ HelpCommand::run(const std::shared_ptr<Environment> & env,
}
else
{
- std::shared_ptr< Sequence<std::string> > help(make_shared_ptr(new Sequence<std::string>));
+ std::shared_ptr< Sequence<std::string> > help(std::make_shared<Sequence<std::string>>());
help->push_back("--help");
return CommandFactory::get_instance()->create(*cmdline.begin_parameters())->run(env, help);
@@ -160,6 +159,6 @@ HelpCommand::run(const std::shared_ptr<Environment> & env,
std::shared_ptr<args::ArgsHandler>
HelpCommand::make_doc_cmdline()
{
- return make_shared_ptr(new HelpCommandLine);
+ return std::make_shared<HelpCommandLine>();
}
diff --git a/src/clients/cave/cmd_import.cc b/src/clients/cave/cmd_import.cc
index aa4799d..e8df8ef 100644
--- a/src/clients/cave/cmd_import.cc
+++ b/src/clients/cave/cmd_import.cc
@@ -23,7 +23,6 @@
#include <paludis/args/args.hh>
#include <paludis/args/do_help.hh>
#include <paludis/util/iterator_funcs.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/join.hh>
#include <paludis/util/map.hh>
#include <paludis/util/indirect_iterator-impl.hh>
@@ -289,6 +288,6 @@ ImportCommand::run(
std::shared_ptr<args::ArgsHandler>
ImportCommand::make_doc_cmdline()
{
- return make_shared_ptr(new ImportCommandLine);
+ return std::make_shared<ImportCommandLine>();
}
diff --git a/src/clients/cave/cmd_info.cc b/src/clients/cave/cmd_info.cc
index dbbeff1..cabbca2 100644
--- a/src/clients/cave/cmd_info.cc
+++ b/src/clients/cave/cmd_info.cc
@@ -38,7 +38,6 @@
#include <paludis/metadata_key.hh>
#include <paludis/util/set.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/pretty_print.hh>
#include <paludis/util/timestamp.hh>
@@ -430,6 +429,6 @@ InfoCommand::run(
std::shared_ptr<args::ArgsHandler>
InfoCommand::make_doc_cmdline()
{
- return make_shared_ptr(new InfoCommandLine);
+ return std::make_shared<InfoCommandLine>();
}
diff --git a/src/clients/cave/cmd_match.cc b/src/clients/cave/cmd_match.cc
index 05867da..0153374 100644
--- a/src/clients/cave/cmd_match.cc
+++ b/src/clients/cave/cmd_match.cc
@@ -27,7 +27,6 @@
#include <paludis/util/set.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/wrapped_output_iterator.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/iterator_funcs.hh>
@@ -427,6 +426,6 @@ MatchCommand::run_hosted(
std::shared_ptr<args::ArgsHandler>
MatchCommand::make_doc_cmdline()
{
- return make_shared_ptr(new MatchCommandLine);
+ return std::make_shared<MatchCommandLine>();
}
diff --git a/src/clients/cave/cmd_owner.cc b/src/clients/cave/cmd_owner.cc
index 7c032e3..15c9980 100644
--- a/src/clients/cave/cmd_owner.cc
+++ b/src/clients/cave/cmd_owner.cc
@@ -28,7 +28,6 @@
#include <paludis/args/args.hh>
#include <paludis/args/do_help.hh>
#include <paludis/util/indirect_iterator-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/stringify.hh>
@@ -108,6 +107,6 @@ OwnerCommand::run(
std::shared_ptr<args::ArgsHandler>
OwnerCommand::make_doc_cmdline()
{
- return make_shared_ptr(new OwnerCommandLine);
+ return std::make_shared<OwnerCommandLine>();
}
diff --git a/src/clients/cave/cmd_perform.cc b/src/clients/cave/cmd_perform.cc
index 65f6af2..8722c28 100644
--- a/src/clients/cave/cmd_perform.cc
+++ b/src/clients/cave/cmd_perform.cc
@@ -39,10 +39,10 @@
#include <paludis/ipc_output_manager.hh>
#include <paludis/util/set.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/iterator_funcs.hh>
#include <paludis/util/return_literal_function.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <cstdlib>
#include <iostream>
#include <algorithm>
@@ -460,7 +460,7 @@ PerformCommand::run(
OutputManagerFromIPCOrEnvironment output_manager_holder(env.get(), cmdline, id);
FetchActionOptions options(make_named_values<FetchActionOptions>(
- n::errors() = make_shared_ptr(new Sequence<FetchActionFailure>),
+ n::errors() = std::make_shared<Sequence<FetchActionFailure>>(),
n::exclude_unmirrorable() = cmdline.a_exclude_unmirrorable.specified(),
n::fetch_parts() = parts,
n::ignore_not_in_manifest() = false,
@@ -575,7 +575,6 @@ PerformCommand::run(
std::shared_ptr<args::ArgsHandler>
PerformCommand::make_doc_cmdline()
{
- return make_shared_ptr(new PerformCommandLine);
+ return std::make_shared<PerformCommandLine>();
}
-
diff --git a/src/clients/cave/cmd_print_categories.cc b/src/clients/cave/cmd_print_categories.cc
index 445267f..e8d24ad 100644
--- a/src/clients/cave/cmd_print_categories.cc
+++ b/src/clients/cave/cmd_print_categories.cc
@@ -26,7 +26,6 @@
#include <paludis/repository.hh>
#include <paludis/util/set.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <cstdlib>
#include <iostream>
#include <algorithm>
@@ -129,6 +128,6 @@ PrintCategoriesCommand::run(
std::shared_ptr<args::ArgsHandler>
PrintCategoriesCommand::make_doc_cmdline()
{
- return make_shared_ptr(new PrintCategoriesCommandLine);
+ return std::make_shared<PrintCategoriesCommandLine>();
}
diff --git a/src/clients/cave/cmd_print_commands.cc b/src/clients/cave/cmd_print_commands.cc
index 46d899e..6fcf8ae 100644
--- a/src/clients/cave/cmd_print_commands.cc
+++ b/src/clients/cave/cmd_print_commands.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008 Ciaran McCreesh
+ * Copyright (c) 2008, 2010 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
@@ -19,7 +19,6 @@
#include "cmd_print_commands.hh"
#include "command_factory.hh"
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/stringify.hh>
#include <paludis/args/args.hh>
#include <paludis/args/do_help.hh>
@@ -103,6 +102,6 @@ PrintCommandsCommand::run(
std::shared_ptr<args::ArgsHandler>
PrintCommandsCommand::make_doc_cmdline()
{
- return make_shared_ptr(new PrintCommandsCommandLine);
+ return std::make_shared<PrintCommandsCommandLine>();
}
diff --git a/src/clients/cave/cmd_print_environment_metadata.cc b/src/clients/cave/cmd_print_environment_metadata.cc
index a3e2751..deab367 100644
--- a/src/clients/cave/cmd_print_environment_metadata.cc
+++ b/src/clients/cave/cmd_print_environment_metadata.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2008, 2009, 2010 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
@@ -22,7 +22,6 @@
#include "exceptions.hh"
#include <paludis/args/args.hh>
#include <paludis/args/do_help.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/set.hh>
#include <paludis/environment.hh>
@@ -140,6 +139,6 @@ PrintEnvironmentMetadataCommand::run(
std::shared_ptr<args::ArgsHandler>
PrintEnvironmentMetadataCommand::make_doc_cmdline()
{
- return make_shared_ptr(new PrintEnvironmentMetadataCommandLine);
+ return std::make_shared<PrintEnvironmentMetadataCommandLine>();
}
diff --git a/src/clients/cave/cmd_print_id_actions.cc b/src/clients/cave/cmd_print_id_actions.cc
index c61927b..20be20a 100644
--- a/src/clients/cave/cmd_print_id_actions.cc
+++ b/src/clients/cave/cmd_print_id_actions.cc
@@ -21,7 +21,6 @@
#include "exceptions.hh"
#include <paludis/args/args.hh>
#include <paludis/args/do_help.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/set.hh>
#include <paludis/util/iterator_funcs.hh>
#include <paludis/util/stringify.hh>
@@ -130,6 +129,6 @@ PrintIDActionsCommand::run(
std::shared_ptr<args::ArgsHandler>
PrintIDActionsCommand::make_doc_cmdline()
{
- return make_shared_ptr(new PrintIDActionsCommandLine);
+ return std::make_shared<PrintIDActionsCommandLine>();
}
diff --git a/src/clients/cave/cmd_print_id_contents.cc b/src/clients/cave/cmd_print_id_contents.cc
index 1cc8f43..c4b1e21 100644
--- a/src/clients/cave/cmd_print_id_contents.cc
+++ b/src/clients/cave/cmd_print_id_contents.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2008, 2009, 2010 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
@@ -26,7 +26,6 @@
#include <paludis/contents.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/iterator_funcs.hh>
#include <paludis/util/options.hh>
@@ -137,6 +136,6 @@ PrintIDContentsCommand::run(
std::shared_ptr<args::ArgsHandler>
PrintIDContentsCommand::make_doc_cmdline()
{
- return make_shared_ptr(new PrintContentsCommandLine);
+ return std::make_shared<PrintContentsCommandLine>();
}
diff --git a/src/clients/cave/cmd_print_id_executables.cc b/src/clients/cave/cmd_print_id_executables.cc
index 670f68f..9607d69 100644
--- a/src/clients/cave/cmd_print_id_executables.cc
+++ b/src/clients/cave/cmd_print_id_executables.cc
@@ -25,7 +25,6 @@
#include <paludis/args/do_help.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/indirect_iterator-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/system.hh>
#include <paludis/util/tokeniser.hh>
@@ -97,6 +96,6 @@ PrintIDExecutablesCommand::run(
std::shared_ptr<args::ArgsHandler>
PrintIDExecutablesCommand::make_doc_cmdline()
{
- return make_shared_ptr(new PrintIDExecutablesCommandLine);
+ return std::make_shared<PrintIDExecutablesCommandLine>();
}
diff --git a/src/clients/cave/cmd_print_id_masks.cc b/src/clients/cave/cmd_print_id_masks.cc
index 4d401ee..8123f21 100644
--- a/src/clients/cave/cmd_print_id_masks.cc
+++ b/src/clients/cave/cmd_print_id_masks.cc
@@ -23,13 +23,13 @@
#include "format_string.hh"
#include <paludis/args/args.hh>
#include <paludis/args/do_help.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/set.hh>
#include <paludis/util/iterator_funcs.hh>
#include <paludis/util/options.hh>
#include <paludis/util/map.hh>
#include <paludis/util/stringify.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/environment.hh>
#include <paludis/metadata_key.hh>
#include <paludis/user_dep_spec.hh>
@@ -208,6 +208,6 @@ PrintIDMasksCommand::run(
std::shared_ptr<args::ArgsHandler>
PrintIDMasksCommand::make_doc_cmdline()
{
- return make_shared_ptr(new PrintIDMasksCommandLine);
+ return std::make_shared<PrintIDMasksCommandLine>();
}
diff --git a/src/clients/cave/cmd_print_id_metadata.cc b/src/clients/cave/cmd_print_id_metadata.cc
index aaa0c59..f922839 100644
--- a/src/clients/cave/cmd_print_id_metadata.cc
+++ b/src/clients/cave/cmd_print_id_metadata.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2008, 2009, 2010 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
@@ -22,7 +22,6 @@
#include "exceptions.hh"
#include <paludis/args/args.hh>
#include <paludis/args/do_help.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/set.hh>
#include <paludis/util/iterator_funcs.hh>
@@ -168,6 +167,6 @@ PrintIDMetadataCommand::run(
std::shared_ptr<args::ArgsHandler>
PrintIDMetadataCommand::make_doc_cmdline()
{
- return make_shared_ptr(new PrintIDMetadataCommandLine);
+ return std::make_shared<PrintIDMetadataCommandLine>();
}
diff --git a/src/clients/cave/cmd_print_ids.cc b/src/clients/cave/cmd_print_ids.cc
index 64201bb..45be918 100644
--- a/src/clients/cave/cmd_print_ids.cc
+++ b/src/clients/cave/cmd_print_ids.cc
@@ -27,7 +27,6 @@
#include <paludis/repository.hh>
#include <paludis/util/set.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/map.hh>
@@ -240,7 +239,7 @@ namespace
Filter
{
WithMaskFilter(const PrintIDsCommandLine & c, const std::string & f) :
- Filter(make_shared_ptr(new WithMaskFilterHandler(c, f)))
+ Filter(std::make_shared<WithMaskFilterHandler>(c, f))
{
}
};
@@ -342,6 +341,6 @@ PrintIDsCommand::run(
std::shared_ptr<args::ArgsHandler>
PrintIDsCommand::make_doc_cmdline()
{
- return make_shared_ptr(new PrintIDsCommandLine);
+ return std::make_shared<PrintIDsCommandLine>();
}
diff --git a/src/clients/cave/cmd_print_owners.cc b/src/clients/cave/cmd_print_owners.cc
index 33ebb77..4624399 100644
--- a/src/clients/cave/cmd_print_owners.cc
+++ b/src/clients/cave/cmd_print_owners.cc
@@ -23,7 +23,6 @@
#include "owner_common.hh"
#include <paludis/args/args.hh>
#include <paludis/args/do_help.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <iostream>
#include <cstdlib>
@@ -99,6 +98,6 @@ PrintOwnersCommand::run(
std::shared_ptr<args::ArgsHandler>
PrintOwnersCommand::make_doc_cmdline()
{
- return make_shared_ptr(new PrintOwnersCommandLine);
+ return std::make_shared<PrintOwnersCommandLine>();
}
diff --git a/src/clients/cave/cmd_print_packages.cc b/src/clients/cave/cmd_print_packages.cc
index 5f1cf58..87f90a4 100644
--- a/src/clients/cave/cmd_print_packages.cc
+++ b/src/clients/cave/cmd_print_packages.cc
@@ -26,7 +26,6 @@
#include <paludis/environment.hh>
#include <paludis/package_database.hh>
#include <paludis/repository.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/set.hh>
@@ -102,5 +101,5 @@ PrintPackagesCommand::run(
std::shared_ptr<args::ArgsHandler>
PrintPackagesCommand::make_doc_cmdline()
{
- return make_shared_ptr(new PrintPackagesCommandLine);
+ return std::make_shared<PrintPackagesCommandLine>();
}
diff --git a/src/clients/cave/cmd_print_repositories.cc b/src/clients/cave/cmd_print_repositories.cc
index 862fb94..841d0c9 100644
--- a/src/clients/cave/cmd_print_repositories.cc
+++ b/src/clients/cave/cmd_print_repositories.cc
@@ -24,7 +24,6 @@
#include <paludis/environment.hh>
#include <paludis/package_database.hh>
#include <paludis/repository.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/set.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/indirect_iterator-impl.hh>
@@ -122,5 +121,5 @@ PrintRepositoriesCommand::run(
std::shared_ptr<args::ArgsHandler>
PrintRepositoriesCommand::make_doc_cmdline()
{
- return make_shared_ptr(new PrintRepositoriesCommandLine);
+ return std::make_shared<PrintRepositoriesCommandLine>();
}
diff --git a/src/clients/cave/cmd_print_repository_formats.cc b/src/clients/cave/cmd_print_repository_formats.cc
index faba2e7..5b89af6 100644
--- a/src/clients/cave/cmd_print_repository_formats.cc
+++ b/src/clients/cave/cmd_print_repository_formats.cc
@@ -22,7 +22,6 @@
#include <paludis/args/args.hh>
#include <paludis/args/do_help.hh>
#include <paludis/repository_factory.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/set.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/indirect_iterator-impl.hh>
@@ -93,5 +92,5 @@ PrintRepositoryFormatsCommand::run(
std::shared_ptr<args::ArgsHandler>
PrintRepositoryFormatsCommand::make_doc_cmdline()
{
- return make_shared_ptr(new PrintRepositoryFormatsCommandLine);
+ return std::make_shared<PrintRepositoryFormatsCommandLine>();
}
diff --git a/src/clients/cave/cmd_print_repository_metadata.cc b/src/clients/cave/cmd_print_repository_metadata.cc
index 8eeecfc..3796ef9 100644
--- a/src/clients/cave/cmd_print_repository_metadata.cc
+++ b/src/clients/cave/cmd_print_repository_metadata.cc
@@ -22,7 +22,6 @@
#include "exceptions.hh"
#include <paludis/args/args.hh>
#include <paludis/args/do_help.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/set.hh>
#include <paludis/util/iterator_funcs.hh>
@@ -146,6 +145,6 @@ PrintRepositoryMetadataCommand::run(
std::shared_ptr<args::ArgsHandler>
PrintRepositoryMetadataCommand::make_doc_cmdline()
{
- return make_shared_ptr(new PrintRepositoryMetadataCommandLine);
+ return std::make_shared<PrintRepositoryMetadataCommandLine>();
}
diff --git a/src/clients/cave/cmd_print_set.cc b/src/clients/cave/cmd_print_set.cc
index b2c7209..c336811 100644
--- a/src/clients/cave/cmd_print_set.cc
+++ b/src/clients/cave/cmd_print_set.cc
@@ -29,7 +29,6 @@
#include <paludis/spec_tree.hh>
#include <paludis/util/set.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/map.hh>
@@ -153,6 +152,6 @@ PrintSetCommand::run(
std::shared_ptr<args::ArgsHandler>
PrintSetCommand::make_doc_cmdline()
{
- return make_shared_ptr(new PrintSetCommandLine);
+ return std::make_shared<PrintSetCommandLine>();
}
diff --git a/src/clients/cave/cmd_print_sets.cc b/src/clients/cave/cmd_print_sets.cc
index 7ade521..0df75fa 100644
--- a/src/clients/cave/cmd_print_sets.cc
+++ b/src/clients/cave/cmd_print_sets.cc
@@ -25,7 +25,6 @@
#include <paludis/package_database.hh>
#include <paludis/repository.hh>
#include <paludis/util/indirect_iterator-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/set.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
@@ -89,5 +88,5 @@ PrintSetsCommand::run(
std::shared_ptr<args::ArgsHandler>
PrintSetsCommand::make_doc_cmdline()
{
- return make_shared_ptr(new PrintSetsCommandLine);
+ return std::make_shared<PrintSetsCommandLine>();
}
diff --git a/src/clients/cave/cmd_print_sync_protocols.cc b/src/clients/cave/cmd_print_sync_protocols.cc
index 89c8fca..9c2f4ed 100644
--- a/src/clients/cave/cmd_print_sync_protocols.cc
+++ b/src/clients/cave/cmd_print_sync_protocols.cc
@@ -26,7 +26,6 @@
#include <paludis/repository.hh>
#include <paludis/util/dir_iterator.hh>
#include <paludis/util/fs_entry.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <cstdlib>
#include <iostream>
@@ -113,5 +112,6 @@ PrintSyncProtocolsCommand::run(
std::shared_ptr<args::ArgsHandler>
PrintSyncProtocolsCommand::make_doc_cmdline()
{
- return make_shared_ptr(new PrintSyncProtocolsCommandLine);
+ return std::make_shared<PrintSyncProtocolsCommandLine>();
}
+
diff --git a/src/clients/cave/cmd_purge.cc b/src/clients/cave/cmd_purge.cc
index deee0a5..2729ff3 100644
--- a/src/clients/cave/cmd_purge.cc
+++ b/src/clients/cave/cmd_purge.cc
@@ -22,8 +22,8 @@
#include "resolve_common.hh"
#include "exceptions.hh"
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/stringify.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/selection.hh>
#include <paludis/generator.hh>
@@ -53,10 +53,10 @@ namespace
std::shared_ptr<ResolveCommandLineProgramOptions> program_options;
PurgeCommandLine(const bool for_docs) :
- resolution_options(for_docs ? make_null_shared_ptr() : make_shared_ptr(new ResolveCommandLineResolutionOptions(this))),
- execution_options(for_docs ? make_null_shared_ptr() : make_shared_ptr(new ResolveCommandLineExecutionOptions(this))),
- display_options(for_docs ? make_null_shared_ptr() : make_shared_ptr(new ResolveCommandLineDisplayOptions(this))),
- program_options(for_docs ? make_null_shared_ptr() : make_shared_ptr(new ResolveCommandLineProgramOptions(this)))
+ resolution_options(for_docs ? make_null_shared_ptr() : std::make_shared<ResolveCommandLineResolutionOptions>(this)),
+ execution_options(for_docs ? make_null_shared_ptr() : std::make_shared<ResolveCommandLineExecutionOptions>(this)),
+ display_options(for_docs ? make_null_shared_ptr() : std::make_shared<ResolveCommandLineDisplayOptions>(this)),
+ program_options(for_docs ? make_null_shared_ptr() : std::make_shared<ResolveCommandLineProgramOptions>(this))
{
add_usage_line("[ -x|--execute ]");
add_note("All options available for 'cave resolve' are also permitted. See 'man cave-resolve' for details.");
@@ -114,6 +114,6 @@ PurgeCommand::run(
std::shared_ptr<args::ArgsHandler>
PurgeCommand::make_doc_cmdline()
{
- return make_shared_ptr(new PurgeCommandLine(true));
+ return std::make_shared<PurgeCommandLine>(true);
}
diff --git a/src/clients/cave/cmd_resolve.cc b/src/clients/cave/cmd_resolve.cc
index eb714ec..1b7a82b 100644
--- a/src/clients/cave/cmd_resolve.cc
+++ b/src/clients/cave/cmd_resolve.cc
@@ -20,8 +20,7 @@
#include "cmd_resolve.hh"
#include "cmd_resolve_cmdline.hh"
#include "resolve_common.hh"
-
-#include <paludis/util/make_shared_ptr.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <iostream>
#include <cstdlib>
@@ -109,6 +108,6 @@ ResolveCommand::run(
std::shared_ptr<args::ArgsHandler>
ResolveCommand::make_doc_cmdline()
{
- return make_shared_ptr(new ResolveCommandLine);
+ return std::make_shared<ResolveCommandLine>();
}
diff --git a/src/clients/cave/cmd_resume.cc b/src/clients/cave/cmd_resume.cc
index 5883e41..44b8ece 100644
--- a/src/clients/cave/cmd_resume.cc
+++ b/src/clients/cave/cmd_resume.cc
@@ -27,7 +27,6 @@
#include "resume_data.hh"
#include <paludis/args/do_help.hh>
#include <paludis/args/escape.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/safe_ifstream.hh>
#include <paludis/util/safe_ofstream.hh>
#include <paludis/util/system.hh>
@@ -234,13 +233,13 @@ namespace
(*c)->state()->accept(s);
if (s.is_active)
- (*c)->set_state(make_shared_ptr(new JobPendingState));
+ (*c)->set_state(std::make_shared<JobPendingState>());
else if (cmdline.a_retry_failed.specified() && s.is_failed)
- (*c)->set_state(make_shared_ptr(new JobPendingState));
+ (*c)->set_state(std::make_shared<JobPendingState>());
else if (cmdline.a_skip_failed.specified() && s.is_failed)
- (*c)->set_state(make_shared_ptr(new JobSkippedState));
+ (*c)->set_state(std::make_shared<JobSkippedState>());
else if (cmdline.a_retry_skipped.specified() && s.is_skipped)
- (*c)->set_state(make_shared_ptr(new JobPendingState));
+ (*c)->set_state(std::make_shared<JobPendingState>());
}
}
}
@@ -287,6 +286,6 @@ ResumeCommand::run(
std::shared_ptr<args::ArgsHandler>
ResumeCommand::make_doc_cmdline()
{
- return make_shared_ptr(new ResumeCommandLine);
+ return std::make_shared<ResumeCommandLine>();
}
diff --git a/src/clients/cave/cmd_search.cc b/src/clients/cave/cmd_search.cc
index 87e2d27..6d6e08e 100644
--- a/src/clients/cave/cmd_search.cc
+++ b/src/clients/cave/cmd_search.cc
@@ -37,7 +37,6 @@
#include <paludis/metadata_key.hh>
#include <paludis/util/set.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/util/mutex.hh>
@@ -320,6 +319,6 @@ SearchCommand::run(
std::shared_ptr<args::ArgsHandler>
SearchCommand::make_doc_cmdline()
{
- return make_shared_ptr(new SearchCommandLine);
+ return std::make_shared<SearchCommandLine>();
}
diff --git a/src/clients/cave/cmd_show.cc b/src/clients/cave/cmd_show.cc
index 091a709..09a4563 100644
--- a/src/clients/cave/cmd_show.cc
+++ b/src/clients/cave/cmd_show.cc
@@ -38,11 +38,11 @@
#include <paludis/metadata_key.hh>
#include <paludis/util/set.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/pretty_print.hh>
#include <paludis/util/timestamp.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/action.hh>
#include <paludis/mask.hh>
#include <paludis/choice.hh>
@@ -1121,6 +1121,6 @@ ShowCommand::run(
std::shared_ptr<args::ArgsHandler>
ShowCommand::make_doc_cmdline()
{
- return make_shared_ptr(new ShowCommandLine);
+ return std::make_shared<ShowCommandLine>();
}
diff --git a/src/clients/cave/cmd_sync.cc b/src/clients/cave/cmd_sync.cc
index 5740ee2..141a624 100644
--- a/src/clients/cave/cmd_sync.cc
+++ b/src/clients/cave/cmd_sync.cc
@@ -21,7 +21,6 @@
#include "exceptions.hh"
#include "formats.hh"
#include "format_general.hh"
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/package_database.hh>
#include <paludis/util/action_queue.hh>
#include <paludis/util/mutex.hh>
@@ -412,6 +411,6 @@ SyncCommand::run(
std::shared_ptr<args::ArgsHandler>
SyncCommand::make_doc_cmdline()
{
- return make_shared_ptr(new SyncCommandLine);
+ return std::make_shared<SyncCommandLine>();
}
diff --git a/src/clients/cave/cmd_uninstall.cc b/src/clients/cave/cmd_uninstall.cc
index e66aa6c..9075509 100644
--- a/src/clients/cave/cmd_uninstall.cc
+++ b/src/clients/cave/cmd_uninstall.cc
@@ -22,10 +22,10 @@
#include "resolve_common.hh"
#include "exceptions.hh"
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/wrapped_output_iterator.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/selection.hh>
#include <paludis/generator.hh>
@@ -62,10 +62,10 @@ namespace
g_target_options(main_options_section(), "Target options", "Target options"),
a_all_versions(&g_target_options, "all-versions", 'a', "If a supplied spec matches multiple versions, "
"uninstall all versions rather than erroring", true),
- resolution_options(for_docs ? make_null_shared_ptr() : make_shared_ptr(new ResolveCommandLineResolutionOptions(this))),
- execution_options(for_docs ? make_null_shared_ptr() : make_shared_ptr(new ResolveCommandLineExecutionOptions(this))),
- display_options(for_docs ? make_null_shared_ptr() : make_shared_ptr(new ResolveCommandLineDisplayOptions(this))),
- program_options(for_docs ? make_null_shared_ptr() : make_shared_ptr(new ResolveCommandLineProgramOptions(this)))
+ resolution_options(for_docs ? make_null_shared_ptr() : std::make_shared<ResolveCommandLineResolutionOptions>(this)),
+ execution_options(for_docs ? make_null_shared_ptr() : std::make_shared<ResolveCommandLineExecutionOptions>(this)),
+ display_options(for_docs ? make_null_shared_ptr() : std::make_shared<ResolveCommandLineDisplayOptions>(this)),
+ program_options(for_docs ? make_null_shared_ptr() : std::make_shared<ResolveCommandLineProgramOptions>(this))
{
add_usage_line("[ -x|--execute ] [ --uninstalls-may-break */* ] [ --remove-if-dependent */* ] spec ...");
add_note("All options available for 'cave resolve' are also permitted. See 'man cave-resolve' for details.");
@@ -192,6 +192,6 @@ UninstallCommand::run(
std::shared_ptr<args::ArgsHandler>
UninstallCommand::make_doc_cmdline()
{
- return make_shared_ptr(new UninstallCommandLine(true));
+ return std::make_shared<UninstallCommandLine>(true);
}
diff --git a/src/clients/cave/cmd_update_world.cc b/src/clients/cave/cmd_update_world.cc
index a2d508b..a4a1f6a 100644
--- a/src/clients/cave/cmd_update_world.cc
+++ b/src/clients/cave/cmd_update_world.cc
@@ -23,7 +23,6 @@
#include <paludis/environment.hh>
#include <paludis/package_database.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/iterator_funcs.hh>
#include <paludis/util/options.hh>
@@ -154,6 +153,6 @@ UpdateWorldCommand::run(
std::shared_ptr<args::ArgsHandler>
UpdateWorldCommand::make_doc_cmdline()
{
- return make_shared_ptr(new UpdateWorldCommandLine);
+ return std::make_shared<UpdateWorldCommandLine>();
}
diff --git a/src/clients/cave/cmd_verify.cc b/src/clients/cave/cmd_verify.cc
index f8a7b60..c682e82 100644
--- a/src/clients/cave/cmd_verify.cc
+++ b/src/clients/cave/cmd_verify.cc
@@ -24,7 +24,6 @@
#include <paludis/args/args.hh>
#include <paludis/args/do_help.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/accept_visitor.hh>
#include <paludis/util/indirect_iterator-impl.hh>
@@ -232,6 +231,6 @@ VerifyCommand::run(
std::shared_ptr<args::ArgsHandler>
VerifyCommand::make_doc_cmdline()
{
- return make_shared_ptr(new VerifyCommandLine);
+ return std::make_shared<VerifyCommandLine>();
}
diff --git a/src/clients/cave/command_factory.cc b/src/clients/cave/command_factory.cc
index cb5e18e..a0c723d 100644
--- a/src/clients/cave/command_factory.cc
+++ b/src/clients/cave/command_factory.cc
@@ -22,7 +22,6 @@
#include <paludis/util/singleton-impl.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <paludis/util/member_iterator-impl.hh>
#include <paludis/util/tokeniser.hh>
@@ -100,12 +99,12 @@ namespace
template <typename T_>
const std::shared_ptr<T_> make_command()
{
- return make_shared_ptr(new T_);
+ return std::make_shared<T_>();
}
const std::shared_ptr<ScriptCommand> make_script_command(const std::string & s, const FSEntry & f)
{
- return make_shared_ptr(new ScriptCommand(s, f));
+ return std::make_shared<ScriptCommand>(s, f);
}
}
diff --git a/src/clients/cave/executables_common.cc b/src/clients/cave/executables_common.cc
index f7f9477..ea08d23 100644
--- a/src/clients/cave/executables_common.cc
+++ b/src/clients/cave/executables_common.cc
@@ -31,7 +31,6 @@
#include <paludis/user_dep_spec.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/indirect_iterator-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/system.hh>
#include <paludis/util/tokeniser.hh>
diff --git a/src/clients/cave/owner_common.cc b/src/clients/cave/owner_common.cc
index 3dc0f34..4c75444 100644
--- a/src/clients/cave/owner_common.cc
+++ b/src/clients/cave/owner_common.cc
@@ -32,7 +32,6 @@
#include <paludis/repository.hh>
#include <paludis/selection.hh>
#include <paludis/util/indirect_iterator-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <algorithm>
#include <functional>
diff --git a/src/clients/cave/resolve_common.cc b/src/clients/cave/resolve_common.cc
index 89ae9b1..0beaabc 100644
--- a/src/clients/cave/resolve_common.cc
+++ b/src/clients/cave/resolve_common.cc
@@ -26,7 +26,6 @@
#include "command_command_line.hh"
#include "match_qpns.hh"
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/make_named_values.hh>
@@ -42,6 +41,7 @@
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/sequence-impl.hh>
#include <paludis/util/wrapped_forward_iterator-impl.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/args/do_help.hh>
#include <paludis/args/escape.hh>
#include <paludis/resolver/resolver.hh>
@@ -527,14 +527,14 @@ namespace
if ((-1 != n) && installed_is_scm_older_than(env, resolution_options, all_binary_repos_generator, resolvent, n)
&& ! use_existing_from_withish(env, resolvent.package(), without))
{
- result->add(make_shared_ptr(new Constraint(make_named_values<Constraint>(
+ result->add(std::make_shared<Constraint>(make_named_values<Constraint>(
n::destination_type() = resolvent.destination_type(),
n::nothing_is_fine_too() = true,
- n::reason() = make_shared_ptr(new PresetReason("is scm", make_null_shared_ptr())),
+ n::reason() = std::make_shared<PresetReason>("is scm", make_null_shared_ptr()),
n::spec() = make_package_dep_spec(PartiallyMadePackageDepSpecOptions()).package(resolvent.package()),
n::untaken() = false,
n::use_existing() = ue_only_if_transient
- ))));
+ )));
}
return result;
@@ -1202,9 +1202,9 @@ namespace
PartiallyMadePackageDepSpec partial_spec((PartiallyMadePackageDepSpecOptions()));
partial_spec.package(id->name());
if (id->slot_key())
- partial_spec.slot_requirement(make_shared_ptr(new ELikeSlotExactRequirement(
- id->slot_key()->value(), false)));
- spec = make_shared_ptr(new PackageDepSpec(partial_spec));
+ partial_spec.slot_requirement(std::make_shared<ELikeSlotExactRequirement>(
+ id->slot_key()->value(), false));
+ spec = std::make_shared<PackageDepSpec>(partial_spec);
}
for (ChangeByResolventSequence::ConstIterator i(ids->begin()), i_end(ids->end()) ;
@@ -1212,14 +1212,14 @@ namespace
{
const std::shared_ptr<DependentReason> reason(new DependentReason(*i));
- result->push_back(make_shared_ptr(new Constraint(make_named_values<Constraint>(
+ result->push_back(std::make_shared<Constraint>(make_named_values<Constraint>(
n::destination_type() = dt_install_to_slash,
n::nothing_is_fine_too() = true,
n::reason() = reason,
n::spec() = BlockDepSpec("!" + stringify(*spec), *spec, false),
n::untaken() = false,
n::use_existing() = ue_if_possible
- ))));
+ )));
}
return result;
@@ -1237,20 +1237,20 @@ namespace
PartiallyMadePackageDepSpec partial_spec((PartiallyMadePackageDepSpecOptions()));
partial_spec.package(id->name());
if (id->slot_key())
- partial_spec.slot_requirement(make_shared_ptr(new ELikeSlotExactRequirement(
- id->slot_key()->value(), false)));
+ partial_spec.slot_requirement(std::make_shared<ELikeSlotExactRequirement>(
+ id->slot_key()->value(), false));
PackageDepSpec spec(partial_spec);
const std::shared_ptr<WasUsedByReason> reason(new WasUsedByReason(ids));
- result->push_back(make_shared_ptr(new Constraint(make_named_values<Constraint>(
+ result->push_back(std::make_shared<Constraint>(make_named_values<Constraint>(
n::destination_type() = dt_install_to_slash,
n::nothing_is_fine_too() = true,
n::reason() = reason,
n::spec() = BlockDepSpec("!" + stringify(spec), spec, false),
n::untaken() = ! match_any(env, list, id),
n::use_existing() = ue_if_possible
- ))));
+ )));
return result;
}
@@ -1268,14 +1268,14 @@ namespace
const std::shared_ptr<ViaBinaryReason> reason(new ViaBinaryReason(other_resolution->resolvent()));
- result->push_back(make_shared_ptr(new Constraint(make_named_values<Constraint>(
+ result->push_back(std::make_shared<Constraint>(make_named_values<Constraint>(
n::destination_type() = resolution->resolvent().destination_type(),
n::nothing_is_fine_too() = false,
n::reason() = reason,
n::spec() = spec,
n::untaken() = true,
n::use_existing() = ue_never
- ))));
+ )));
return result;
}
@@ -1889,7 +1889,7 @@ paludis::cave::resolve_common(
initial_constraints.insert(std::make_pair(e.resolvent(), make_initial_constraints_for(
env.get(), resolution_options, all_binary_repos_generator, without, e.resolvent()))).first->second->add(
e.suggested_preset());
- resolver = make_shared_ptr(new Resolver(env.get(), resolver_functions));
+ resolver = std::make_shared<Resolver>(env.get(), resolver_functions);
if (restarts.size() > 9000)
throw InternalError(PALUDIS_HERE, "Restarted over nine thousand times. Something's "
@@ -1906,7 +1906,7 @@ paludis::cave::resolve_common(
retcode |= display_resolution(env, resolver->resolved(), resolution_options,
display_options, program_options, keys_if_import,
- purge ? make_shared_ptr(new const Sequence<std::pair<std::string, std::string> >) : targets_if_not_purge);
+ purge ? std::make_shared<const Sequence<std::pair<std::string, std::string> > >() : targets_if_not_purge);
if (! resolver->resolved()->taken_unable_to_make_decisions()->empty())
retcode |= 1;
@@ -1920,7 +1920,7 @@ paludis::cave::resolve_common(
if (0 == retcode)
return perform_resolution(env, resolver->resolved(), resolution_options,
execution_options, program_options, keys_if_import,
- purge ? make_shared_ptr(new const Sequence<std::pair<std::string, std::string> >) : targets_if_not_purge,
+ purge ? std::make_shared<const Sequence<std::pair<std::string, std::string> > >() : targets_if_not_purge,
world_specs_if_not_auto ? world_specs_if_not_auto : targets_cleaned_up,
is_set);
}
diff --git a/src/clients/inquisitio/do_search.cc b/src/clients/inquisitio/do_search.cc
index 0427ee7..7b029a5 100644
--- a/src/clients/inquisitio/do_search.cc
+++ b/src/clients/inquisitio/do_search.cc
@@ -33,7 +33,6 @@
#include <paludis/notifier_callback.hh>
#include <paludis/util/set.hh>
#include <paludis/util/sequence.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/create_iterator-impl.hh>
#include <paludis/util/forward_parallel_for_each.hh>
#include <paludis/util/system.hh>
@@ -336,14 +335,14 @@ do_search(Environment & env)
std::list<std::shared_ptr<Extractor> > extractors;
if (CommandLine::get_instance()->a_keys.begin_args() == CommandLine::get_instance()->a_keys.end_args())
- extractors.push_back(make_shared_ptr(new NameDescriptionExtractor));
+ extractors.push_back(std::make_shared<NameDescriptionExtractor>());
else
for (args::StringSetArg::ConstIterator i(CommandLine::get_instance()->a_keys.begin_args()),
i_end(CommandLine::get_instance()->a_keys.end_args()) ; i != i_end ; ++i)
- extractors.push_back(make_shared_ptr(new KeyExtractor(*i,
+ extractors.push_back(std::make_shared<KeyExtractor>(*i,
CommandLine::get_instance()->a_flatten.specified(),
CommandLine::get_instance()->a_enabled_only.specified(),
- env)));
+ env));
std::list<std::shared_ptr<const Repository> > repos;
for (PackageDatabase::RepositoryConstIterator r(env.package_database()->begin_repositories()),
diff --git a/src/clients/paludis/query.cc b/src/clients/paludis/query.cc
index 105d03b..aa0a9e7 100644
--- a/src/clients/paludis/query.cc
+++ b/src/clients/paludis/query.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2010 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
@@ -126,8 +126,8 @@ void do_one_query(
try
{
- do_one_package_query(env, masks_to_explain, make_shared_ptr(new PackageDepSpec(
- parse_user_package_dep_spec(q, env.get(), UserPackageDepSpecOptions() + updso_throw_if_set + updso_allow_wildcards))));
+ do_one_package_query(env, masks_to_explain, std::make_shared<PackageDepSpec>(
+ parse_user_package_dep_spec(q, env.get(), UserPackageDepSpecOptions() + updso_throw_if_set + updso_allow_wildcards)));
}
catch (const GotASetNotAPackageDepSpec &)
{
diff --git a/src/clients/reconcilio/fix_linkage.cc b/src/clients/reconcilio/fix_linkage.cc
index 8025440..afe4c6a 100644
--- a/src/clients/reconcilio/fix_linkage.cc
+++ b/src/clients/reconcilio/fix_linkage.cc
@@ -24,7 +24,6 @@
#include <paludis/util/fs_entry.hh>
#include <paludis/util/join.hh>
#include <paludis/util/log.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/make_named_values.hh>
@@ -100,7 +99,7 @@ do_fix_linkage(const std::shared_ptr<Environment> & env)
PartiallyMadePackageDepSpec part_spec((PartiallyMadePackageDepSpecOptions()));
part_spec.package((*pkg_it)->name());
if ((*pkg_it)->slot_key())
- part_spec.slot_requirement(make_shared_ptr(new UserSlotExactRequirement((*pkg_it)->slot_key()->value())));
+ part_spec.slot_requirement(std::make_shared<UserSlotExactRequirement>((*pkg_it)->slot_key()->value()));
if (CommandLine::get_instance()->a_exact.specified())
part_spec.version_requirement(make_named_values<VersionRequirement>(
diff --git a/src/output/console_install_task.cc b/src/output/console_install_task.cc
index 0101f5d..12b0f75 100644
--- a/src/output/console_install_task.cc
+++ b/src/output/console_install_task.cc
@@ -26,7 +26,6 @@
#include <paludis/util/iterator_funcs.hh>
#include <paludis/util/join.hh>
#include <paludis/util/log.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/pretty_print.hh>
#include <paludis/util/safe_ofstream.hh>