aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-07-23 21:14:33 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-07-23 21:15:08 +0100
commit1e88d3f531a7d9cac4cd08db1484a3a87679af3c (patch)
tree9c2852177fbfc30366d24947658bf52a5c9e6d0c
parentc3802f0aec7d89a518cf74145aa73bf2ea688e35 (diff)
downloadpaludis-1e88d3f531a7d9cac4cd08db1484a3a87679af3c.tar.gz
paludis-1e88d3f531a7d9cac4cd08db1484a3a87679af3c.tar.xz
Avoid more explicit newage
-rw-r--r--doc/api/cplusplus/examples/example_action.cc2
-rw-r--r--paludis/about_metadata.cc12
-rw-r--r--paludis/args/args_handler.cc4
-rw-r--r--paludis/args/args_option.cc14
-rw-r--r--paludis/args/install_args_group.cc10
-rw-r--r--paludis/broken_linkage_finder.cc4
-rw-r--r--paludis/buffer_output_manager.cc2
-rw-r--r--paludis/comma_separated_dep_parser.cc4
-rw-r--r--paludis/common_sets.cc2
-rw-r--r--paludis/create_output_manager_info.cc4
-rw-r--r--paludis/dep_list.cc36
-rw-r--r--paludis/dep_list_TEST.cc46
-rw-r--r--paludis/dep_list_TEST.hh4
-rw-r--r--paludis/dep_spec.cc26
-rw-r--r--paludis/dep_tag.cc8
-rw-r--r--paludis/distribution-impl.hh2
-rw-r--r--paludis/elike_dep_parser.cc4
-rw-r--r--paludis/elike_package_dep_spec.cc2
-rw-r--r--paludis/elike_use_requirement.cc2
-rw-r--r--paludis/elike_use_requirement_TEST.cc28
-rw-r--r--paludis/environment_implementation.cc14
-rw-r--r--paludis/environments/no_config/no_config_environment.cc15
-rw-r--r--paludis/environments/no_config/registration.cc6
-rw-r--r--paludis/environments/paludis/keywords_conf.cc2
-rw-r--r--paludis/environments/paludis/licenses_conf.cc2
-rw-r--r--paludis/environments/paludis/mirrors_conf.cc2
-rw-r--r--paludis/environments/paludis/output_conf.cc2
-rw-r--r--paludis/environments/paludis/package_mask_conf.cc2
-rw-r--r--paludis/environments/paludis/paludis_config.cc22
-rw-r--r--paludis/environments/paludis/paludis_environment.cc16
-rw-r--r--paludis/environments/paludis/paludis_environment_TEST.cc10
-rw-r--r--paludis/environments/paludis/registration.cc6
-rw-r--r--paludis/environments/paludis/use_conf.cc2
-rw-r--r--paludis/environments/paludis/world.cc2
-rw-r--r--paludis/environments/paludis/world_TEST.cc2
-rw-r--r--paludis/environments/portage/portage_environment.cc30
-rw-r--r--paludis/environments/portage/portage_environment_TEST.cc4
-rw-r--r--paludis/environments/portage/registration.cc6
-rw-r--r--paludis/environments/test/test_environment.cc4
-rw-r--r--paludis/file_output_manager.cc4
-rw-r--r--paludis/filter.cc20
-rw-r--r--paludis/filter_TEST.cc6
-rw-r--r--paludis/find_unused_packages_task.cc2
-rw-r--r--paludis/format_messages_output_manager.cc4
-rw-r--r--paludis/forward_at_finish_output_manager.cc2
-rw-r--r--paludis/fuzzy_finder.cc2
-rw-r--r--paludis/fuzzy_finder_TEST.cc14
-rw-r--r--paludis/generator.cc42
-rw-r--r--paludis/generator_TEST.cc6
-rw-r--r--paludis/generator_handler.cc10
-rw-r--r--paludis/hooker.cc10
-rw-r--r--paludis/install_task.cc24
-rw-r--r--paludis/ipc_output_manager.cc2
-rw-r--r--paludis/ndbam.cc4
-rw-r--r--paludis/override_functions.cc6
-rw-r--r--paludis/package_database_TEST.cc14
-rw-r--r--paludis/paludislike_options_conf.cc4
-rw-r--r--paludis/python_hooks.cc2
-rw-r--r--paludis/range_rewriter.cc6
-rw-r--r--paludis/range_rewriter_TEST.cc2
-rw-r--r--paludis/repositories/accounts/accounts_dep_key.cc8
-rw-r--r--paludis/repositories/accounts/accounts_id.cc6
-rw-r--r--paludis/repositories/accounts/accounts_repository.cc16
-rw-r--r--paludis/repositories/accounts/accounts_repository_TEST.cc2
-rw-r--r--paludis/repositories/accounts/accounts_repository_store.cc6
-rw-r--r--paludis/repositories/accounts/installed_accounts_id.cc6
-rw-r--r--paludis/repositories/accounts/registration.cc6
-rw-r--r--paludis/repositories/cran/cran_dep_parser.cc4
-rw-r--r--paludis/repositories/cran/cran_installed_repository.cc24
-rw-r--r--paludis/repositories/cran/cran_installed_repository_TEST.cc4
-rw-r--r--paludis/repositories/cran/cran_package_id.cc12
-rw-r--r--paludis/repositories/cran/cran_repository.cc24
-rw-r--r--paludis/repositories/cran/cran_repository_TEST.cc6
-rw-r--r--paludis/repositories/cran/keys.cc2
-rw-r--r--paludis/repositories/cran/package_dep_spec.cc2
-rw-r--r--paludis/repositories/cran/registration.cc6
-rw-r--r--paludis/repositories/e/aa_visitor_TEST.cc2
-rw-r--r--paludis/repositories/e/check_fetched_files_visitor.cc4
-rw-r--r--paludis/repositories/e/dep_parser.cc36
-rw-r--r--paludis/repositories/e/dep_parser_TEST.cc32
-rw-r--r--paludis/repositories/e/dep_spec_pretty_printer_TEST.cc4
-rw-r--r--paludis/repositories/e/depend_rdepend_TEST.cc8
-rw-r--r--paludis/repositories/e/dependencies_rewriter.cc4
-rw-r--r--paludis/repositories/e/e_choices_key.cc10
-rw-r--r--paludis/repositories/e/e_installed_repository.cc8
-rw-r--r--paludis/repositories/e/e_installed_repository_id.cc12
-rw-r--r--paludis/repositories/e/e_key.cc10
-rw-r--r--paludis/repositories/e/e_repository.cc85
-rw-r--r--paludis/repositories/e/e_repository_TEST.cc55
-rw-r--r--paludis/repositories/e/e_repository_TEST_0.cc8
-rw-r--r--paludis/repositories/e/e_repository_TEST_1.cc4
-rw-r--r--paludis/repositories/e/e_repository_TEST_2.cc4
-rw-r--r--paludis/repositories/e/e_repository_TEST_3.cc4
-rw-r--r--paludis/repositories/e/e_repository_TEST_4.cc4
-rw-r--r--paludis/repositories/e/e_repository_TEST_dependencies_rewriter.cc3
-rw-r--r--paludis/repositories/e/e_repository_TEST_ever.cc8
-rw-r--r--paludis/repositories/e/e_repository_TEST_exheres_0.cc8
-rw-r--r--paludis/repositories/e/e_repository_TEST_exlibs.cc4
-rw-r--r--paludis/repositories/e/e_repository_TEST_pbin.cc6
-rw-r--r--paludis/repositories/e/e_repository_TEST_phases.cc8
-rw-r--r--paludis/repositories/e/e_repository_TEST_replacing.cc4
-rw-r--r--paludis/repositories/e/e_repository_TEST_symlink_rewriting.cc2
-rw-r--r--paludis/repositories/e/e_repository_id.cc4
-rw-r--r--paludis/repositories/e/e_repository_mask_file.cc6
-rw-r--r--paludis/repositories/e/e_repository_sets.cc12
-rw-r--r--paludis/repositories/e/e_repository_sets_TEST.cc13
-rw-r--r--paludis/repositories/e/eapi.cc4
-rw-r--r--paludis/repositories/e/ebuild_flat_metadata_cache_TEST.cc86
-rw-r--r--paludis/repositories/e/ebuild_id.cc12
-rw-r--r--paludis/repositories/e/exheres_layout.cc34
-rw-r--r--paludis/repositories/e/exheres_profile.cc22
-rw-r--r--paludis/repositories/e/exndbam_repository.cc18
-rw-r--r--paludis/repositories/e/exndbam_repository_TEST.cc6
-rw-r--r--paludis/repositories/e/extra_distribution_data.cc2
-rw-r--r--paludis/repositories/e/fetch_visitor_TEST.cc4
-rw-r--r--paludis/repositories/e/fix_locked_dependencies.cc2
-rw-r--r--paludis/repositories/e/fix_locked_dependencies_TEST.cc4
-rw-r--r--paludis/repositories/e/info_metadata_key.cc2
-rw-r--r--paludis/repositories/e/layout.cc2
-rw-r--r--paludis/repositories/e/myoptions_requirements_verifier.cc2
-rw-r--r--paludis/repositories/e/pipe_command_handler.cc4
-rw-r--r--paludis/repositories/e/profile.cc4
-rw-r--r--paludis/repositories/e/registration.cc6
-rw-r--r--paludis/repositories/e/source_uri_finder_TEST.cc6
-rw-r--r--paludis/repositories/e/traditional_layout.cc34
-rw-r--r--paludis/repositories/e/traditional_profile.cc30
-rw-r--r--paludis/repositories/e/vdb_repository.cc38
-rw-r--r--paludis/repositories/e/vdb_repository_TEST.cc33
-rw-r--r--paludis/repositories/e/vdb_unmerger_TEST.cc2
-rw-r--r--paludis/repositories/e/xml_things.cc6
-rw-r--r--paludis/repositories/fake/fake_installed_repository.cc6
-rw-r--r--paludis/repositories/fake/fake_installed_repository_TEST.cc2
-rw-r--r--paludis/repositories/fake/fake_package_id.cc22
-rw-r--r--paludis/repositories/fake/fake_repository.cc4
-rw-r--r--paludis/repositories/fake/fake_repository_TEST.cc2
-rw-r--r--paludis/repositories/fake/fake_repository_base.cc14
-rw-r--r--paludis/repositories/fake/registration.cc2
-rw-r--r--paludis/repositories/gems/gem_specification.cc4
-rw-r--r--paludis/repositories/gems/gem_specifications.cc2
-rw-r--r--paludis/repositories/gems/gems_repository.cc16
-rw-r--r--paludis/repositories/gems/installed_gems_repository.cc12
-rw-r--r--paludis/repositories/gems/installed_gems_repository_TEST.cc4
-rw-r--r--paludis/repositories/gems/registration.cc4
-rw-r--r--paludis/repositories/repository/registration.cc2
-rw-r--r--paludis/repositories/repository/repository_id.cc4
-rw-r--r--paludis/repositories/repository/repository_repository.cc10
-rw-r--r--paludis/repositories/repository/repository_repository_store.cc4
-rw-r--r--paludis/repositories/unavailable/registration.cc4
-rw-r--r--paludis/repositories/unavailable/unavailable_package_id.cc2
-rw-r--r--paludis/repositories/unavailable/unavailable_repository.cc12
-rw-r--r--paludis/repositories/unavailable/unavailable_repository_TEST.cc6
-rw-r--r--paludis/repositories/unavailable/unavailable_repository_dependencies_key.cc2
-rw-r--r--paludis/repositories/unavailable/unavailable_repository_file.cc2
-rw-r--r--paludis/repositories/unavailable/unavailable_repository_store.cc12
-rw-r--r--paludis/repositories/unpackaged/installed_id.cc14
-rw-r--r--paludis/repositories/unpackaged/installed_repository.cc8
-rw-r--r--paludis/repositories/unpackaged/installed_repository_TEST.cc30
-rw-r--r--paludis/repositories/unpackaged/registration.cc6
-rw-r--r--paludis/repositories/unpackaged/unpackaged_id.cc18
-rw-r--r--paludis/repositories/unpackaged/unpackaged_key.cc2
-rw-r--r--paludis/repositories/unpackaged/unpackaged_repository.cc26
-rw-r--r--paludis/repositories/unpackaged/unpackaged_repository_TEST.cc16
-rw-r--r--paludis/repositories/unwritten/registration.cc4
-rw-r--r--paludis/repositories/unwritten/unwritten_repository.cc12
-rw-r--r--paludis/repositories/unwritten/unwritten_repository_TEST.cc4
-rw-r--r--paludis/repositories/unwritten/unwritten_repository_file.cc8
-rw-r--r--paludis/repositories/unwritten/unwritten_repository_store.cc4
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository.cc16
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository_TEST.cc4
-rw-r--r--paludis/repositories/virtuals/package_id.cc12
-rw-r--r--paludis/repositories/virtuals/registration.cc6
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.cc15
-rw-r--r--paludis/repositories/virtuals/virtuals_repository_TEST.cc20
-rw-r--r--paludis/repository.cc2
-rw-r--r--paludis/repository_name_cache.cc6
-rw-r--r--paludis/repository_name_cache_TEST.cc14
-rw-r--r--paludis/resolver/constraint.cc2
-rw-r--r--paludis/resolver/decider.cc90
-rw-r--r--paludis/resolver/decision.cc10
-rw-r--r--paludis/resolver/decisions.cc2
-rw-r--r--paludis/resolver/destination.cc2
-rw-r--r--paludis/resolver/job.cc20
-rw-r--r--paludis/resolver/job_list.cc2
-rw-r--r--paludis/resolver/nag.cc4
-rw-r--r--paludis/resolver/orderer.cc10
-rw-r--r--paludis/resolver/package_or_block_dep_spec.cc2
-rw-r--r--paludis/resolver/reason.cc2
-rw-r--r--paludis/resolver/resolutions_by_resolvent.cc2
-rw-r--r--paludis/resolver/resolver.cc6
-rw-r--r--paludis/resolver/resolver_test.cc20
-rw-r--r--paludis/resolver/sanitised_dependencies.cc2
-rw-r--r--paludis/resolver/spec_rewriter.cc6
-rw-r--r--paludis/selection.cc18
-rw-r--r--paludis/selection_TEST.cc10
-rw-r--r--paludis/selection_cache.cc4
-rw-r--r--paludis/selinux/security_context.cc6
-rw-r--r--paludis/serialise.cc2
-rw-r--r--paludis/set_file.cc16
-rw-r--r--paludis/show_suggest_visitor.cc2
-rw-r--r--paludis/spec_tree.cc2
-rw-r--r--paludis/standard_output_manager.cc2
-rw-r--r--paludis/tee_output_manager.cc6
-rw-r--r--paludis/unchoices_key.cc4
-rw-r--r--paludis/uninstall_list.cc27
-rw-r--r--paludis/uninstall_list_TEST.cc10
-rw-r--r--paludis/uninstall_task.cc12
-rw-r--r--paludis/user_dep_spec.cc2
-rw-r--r--paludis/user_dep_spec_TEST.cc8
-rw-r--r--paludis/util/active_object_ptr.hh2
-rw-r--r--paludis/util/clone-impl.hh2
-rw-r--r--paludis/util/config_file.cc6
-rw-r--r--paludis/util/config_file_TEST.cc4
-rw-r--r--paludis/util/dir_iterator.cc2
-rw-r--r--paludis/util/exception.cc2
-rw-r--r--paludis/util/graph-impl.hh2
-rw-r--r--paludis/util/indirect_iterator_TEST.cc10
-rw-r--r--paludis/util/system.cc2
-rw-r--r--paludis/util/tail_output_stream.cc2
-rw-r--r--paludis/util/wildcard_expander.cc2
-rw-r--r--python/additional_tests.cc4
-rw-r--r--python/dep_spec.cc10
-rw-r--r--python/environment.cc2
-rw-r--r--ruby/action.cc9
-rw-r--r--ruby/contents.cc6
-rw-r--r--ruby/dep_list.cc10
-rw-r--r--ruby/dep_spec.cc32
-rw-r--r--ruby/dep_tag.cc8
-rw-r--r--ruby/environment.cc8
-rw-r--r--ruby/repository.cc2
-rw-r--r--src/clients/accerso/accerso.cc4
-rw-r--r--src/clients/adjutrix/adjutrix.cc2
-rw-r--r--src/clients/adjutrix/display_default_system_resolution.cc2
-rw-r--r--src/clients/adjutrix/find_reverse_deps.cc2
-rw-r--r--src/clients/adjutrix/find_stable_candidates.cc2
-rw-r--r--src/clients/adjutrix/what_needs_keywording.cc2
-rw-r--r--src/clients/appareo/appareo.cc6
-rw-r--r--src/clients/cave/cave.cc2
-rw-r--r--src/clients/cave/cmd_execute_resolution.cc14
-rw-r--r--src/clients/cave/cmd_find_candidates.cc2
-rw-r--r--src/clients/cave/cmd_fix_linkage.cc2
-rw-r--r--src/clients/cave/cmd_import.cc6
-rw-r--r--src/clients/cave/cmd_info.cc2
-rw-r--r--src/clients/cave/cmd_match.cc2
-rw-r--r--src/clients/cave/cmd_perform.cc4
-rw-r--r--src/clients/cave/cmd_print_id_masks.cc2
-rw-r--r--src/clients/cave/cmd_print_ids.cc4
-rw-r--r--src/clients/cave/cmd_resolve.cc2
-rw-r--r--src/clients/cave/cmd_resolve_cmdline.cc2
-rw-r--r--src/clients/cave/cmd_resume.cc2
-rw-r--r--src/clients/cave/cmd_search.cc6
-rw-r--r--src/clients/cave/cmd_show.cc2
-rw-r--r--src/clients/cave/cmd_sync.cc2
-rw-r--r--src/clients/cave/cmd_uninstall.cc6
-rw-r--r--src/clients/cave/format_general.cc16
-rw-r--r--src/clients/cave/format_plain_contents_entry.cc4
-rw-r--r--src/clients/cave/format_plain_metadata_key.cc2
-rw-r--r--src/clients/cave/resolve_common.cc30
-rw-r--r--src/clients/cave/resume_data.cc4
-rw-r--r--src/clients/importare/importare.cc4
-rw-r--r--src/clients/importare/install.cc2
-rw-r--r--src/clients/inquisitio/matcher.cc2
-rw-r--r--src/clients/instruo/instruo.cc4
-rw-r--r--src/clients/paludis/applets.cc14
-rw-r--r--src/clients/paludis/do_config.cc2
-rw-r--r--src/clients/paludis/do_contents.cc4
-rw-r--r--src/clients/paludis/do_executables.cc2
-rw-r--r--src/clients/paludis/info.cc4
-rw-r--r--src/clients/paludis/install.cc2
-rw-r--r--src/clients/paludis/query.cc2
-rw-r--r--src/clients/reconcilio/fix_linkage.cc2
-rw-r--r--src/output/console_install_task.cc6
-rw-r--r--src/output/console_query_task.cc2
272 files changed, 1215 insertions, 1236 deletions
diff --git a/doc/api/cplusplus/examples/example_action.cc b/doc/api/cplusplus/examples/example_action.cc
index 9af459c..05bdb6f 100644
--- a/doc/api/cplusplus/examples/example_action.cc
+++ b/doc/api/cplusplus/examples/example_action.cc
@@ -58,7 +58,7 @@ int main(int argc, char * argv[])
i != i_end ; ++i)
{
/* Failures go here: */
- const std::shared_ptr<Sequence<FetchActionFailure> > failures(new Sequence<FetchActionFailure>);
+ const std::shared_ptr<Sequence<FetchActionFailure> > failures(std::make_shared<Sequence<FetchActionFailure>>());
/* Do we support a FetchAction? We find out by creating a
* SupportsActionTest<FetchAction> object, and querying via the
diff --git a/paludis/about_metadata.cc b/paludis/about_metadata.cc
index aa1658b..fed8f65 100644
--- a/paludis/about_metadata.cc
+++ b/paludis/about_metadata.cc
@@ -39,22 +39,22 @@ namespace paludis
std::shared_ptr<LiteralMetadataValueKey<std::string> > build_date_key;
Imp() :
- package_key(new LiteralMetadataValueKey<std::string>("PALUDIS_PACKAGE", "Package Name", mkt_significant, PALUDIS_PACKAGE)),
- version_key(new LiteralMetadataValueKey<std::string>("PALUDIS_VERSION", "Package Version", mkt_significant,
+ package_key(std::make_shared<LiteralMetadataValueKey<std::string>>("PALUDIS_PACKAGE", "Package Name", mkt_significant, PALUDIS_PACKAGE)),
+ version_key(std::make_shared<LiteralMetadataValueKey<std::string>>("PALUDIS_VERSION", "Package Version", mkt_significant,
stringify(PALUDIS_VERSION_MAJOR) + "." + stringify(PALUDIS_VERSION_MINOR) + "." +
stringify(PALUDIS_VERSION_MICRO) + PALUDIS_VERSION_SUFFIX + (std::string(PALUDIS_GIT_HEAD).empty() ? "" :
" " + stringify(PALUDIS_GIT_HEAD)))),
- build_cxxflags_key(new LiteralMetadataValueKey<std::string>("PALUDIS_BUILD_CXXFLAGS", "Built with CXXFLAGS", mkt_normal,
+ build_cxxflags_key(std::make_shared<LiteralMetadataValueKey<std::string>>("PALUDIS_BUILD_CXXFLAGS", "Built with CXXFLAGS", mkt_normal,
PALUDIS_BUILD_CXXFLAGS)),
- build_ldflags_key(new LiteralMetadataValueKey<std::string>("PALUDIS_BUILD_LDFLAGS", "Built with LDFLAGS", mkt_normal,
+ build_ldflags_key(std::make_shared<LiteralMetadataValueKey<std::string>>("PALUDIS_BUILD_LDFLAGS", "Built with LDFLAGS", mkt_normal,
PALUDIS_BUILD_LDFLAGS)),
- build_cxx_key(new LiteralMetadataValueKey<std::string>("PALUDIS_BUILD_CXX", "Built with CXX", mkt_normal,
+ build_cxx_key(std::make_shared<LiteralMetadataValueKey<std::string>>("PALUDIS_BUILD_CXX", "Built with CXX", mkt_normal,
stringify(PALUDIS_BUILD_CXX)
#ifdef __VERSION__
+ " " + stringify(__VERSION__)
#endif
)),
- build_date_key(new LiteralMetadataValueKey<std::string>("PALUDIS_BUILD_DATE", "Build Date", mkt_normal,
+ build_date_key(std::make_shared<LiteralMetadataValueKey<std::string>>("PALUDIS_BUILD_DATE", "Build Date", mkt_normal,
PALUDIS_BUILD_DATE))
{
}
diff --git a/paludis/args/args_handler.cc b/paludis/args/args_handler.cc
index 82b993a..0e8bff5 100644
--- a/paludis/args/args_handler.cc
+++ b/paludis/args/args_handler.cc
@@ -67,7 +67,7 @@ namespace paludis
std::shared_ptr<ArgsSection> main_options_section;
Imp() :
- separate_after_dashes_args(new Sequence<std::string>)
+ separate_after_dashes_args(std::make_shared<Sequence<std::string>>())
{
}
};
@@ -292,7 +292,7 @@ ArgsHandler::run(
const std::string & env_prefix,
const ArgsHandlerOptions & options)
{
- std::shared_ptr<Sequence<std::string> > s(new Sequence<std::string>);
+ std::shared_ptr<Sequence<std::string> > s(std::make_shared<Sequence<std::string>>());
std::copy(&argv[1], &argv[argc], create_inserter<std::string>(s->back_inserter()));
run(s, client, env_var, env_prefix, options);
}
diff --git a/paludis/args/args_option.cc b/paludis/args/args_option.cc
index 63fbc26..e9df5c6 100644
--- a/paludis/args/args_option.cc
+++ b/paludis/args/args_option.cc
@@ -104,7 +104,7 @@ SwitchArg::forwardable_string() const
const std::shared_ptr<Sequence<std::string> >
SwitchArg::forwardable_args() const
{
- std::shared_ptr<Sequence<std::string> > result(new Sequence<std::string>);
+ std::shared_ptr<Sequence<std::string> > result(std::make_shared<Sequence<std::string>>());
if (specified())
result->push_back("--" + long_name());
return result;
@@ -125,7 +125,7 @@ AliasArg::forwardable_string() const
const std::shared_ptr<Sequence<std::string> >
AliasArg::forwardable_args() const
{
- std::shared_ptr<Sequence<std::string> > result(new Sequence<std::string>);
+ std::shared_ptr<Sequence<std::string> > result(std::make_shared<Sequence<std::string>>());
return result;
}
@@ -156,7 +156,7 @@ StringArg::forwardable_string() const
const std::shared_ptr<Sequence<std::string> >
StringArg::forwardable_args() const
{
- std::shared_ptr<Sequence<std::string> > result(new Sequence<std::string>);
+ std::shared_ptr<Sequence<std::string> > result(std::make_shared<Sequence<std::string>>());
if (specified())
{
result->push_back("--" + long_name());
@@ -256,7 +256,7 @@ StringSetArg::forwardable_string() const
const std::shared_ptr<Sequence<std::string> >
StringSetArg::forwardable_args() const
{
- std::shared_ptr<Sequence<std::string> > result(new Sequence<std::string>);
+ std::shared_ptr<Sequence<std::string> > result(std::make_shared<Sequence<std::string>>());
if (specified())
{
for (ConstIterator i(begin_args()), i_end(end_args()) ;
@@ -327,7 +327,7 @@ StringSequenceArg::forwardable_string() const
const std::shared_ptr<Sequence<std::string> >
StringSequenceArg::forwardable_args() const
{
- std::shared_ptr<Sequence<std::string> > result(new Sequence<std::string>);
+ std::shared_ptr<Sequence<std::string> > result(std::make_shared<Sequence<std::string>>());
if (specified())
{
for (ConstIterator i(begin_args()), i_end(end_args()) ;
@@ -358,7 +358,7 @@ IntegerArg::forwardable_string() const
const std::shared_ptr<Sequence<std::string> >
IntegerArg::forwardable_args() const
{
- std::shared_ptr<Sequence<std::string> > result(new Sequence<std::string>);
+ std::shared_ptr<Sequence<std::string> > result(std::make_shared<Sequence<std::string>>());
if (specified())
{
result->push_back("--" + long_name());
@@ -533,7 +533,7 @@ EnumArg::forwardable_string() const
const std::shared_ptr<Sequence<std::string> >
EnumArg::forwardable_args() const
{
- std::shared_ptr<Sequence<std::string> > result(new Sequence<std::string>);
+ std::shared_ptr<Sequence<std::string> > result(std::make_shared<Sequence<std::string>>());
if (specified())
{
result->push_back("--" + long_name());
diff --git a/paludis/args/install_args_group.cc b/paludis/args/install_args_group.cc
index d219ccb..efbb948 100644
--- a/paludis/args/install_args_group.cc
+++ b/paludis/args/install_args_group.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
* Copyright (c) 2007 David Leverton
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -97,7 +97,7 @@ InstallArgsGroup::destinations(Environment * env) const
{
Context local_context("When building destinations collection:");
- std::shared_ptr<DestinationsSet> d(new DestinationsSet);
+ std::shared_ptr<DestinationsSet> d(std::make_shared<DestinationsSet>());
for (args::StringSetArg::ConstIterator i(a_destinations.begin_args()),
i_end(a_destinations.end_args()) ;
i != i_end ; ++i)
@@ -149,15 +149,15 @@ InstallArgsGroup::populate_install_task(const Environment *, InstallTask & task)
else
throw args::DoHelp("bad value for --change-phases-for");
- std::shared_ptr<Set<std::string> > skip_phases(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > skip_phases(std::make_shared<Set<std::string>>());
std::copy(a_skip_phase.begin_args(), a_skip_phase.end_args(), skip_phases->inserter());
task.set_skip_phases(skip_phases);
- std::shared_ptr<Set<std::string> > abort_at_phases(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > abort_at_phases(std::make_shared<Set<std::string>>());
std::copy(a_abort_at_phase.begin_args(), a_abort_at_phase.end_args(), abort_at_phases->inserter());
task.set_abort_at_phases(abort_at_phases);
- std::shared_ptr<Set<std::string> > skip_until_phases(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > skip_until_phases(std::make_shared<Set<std::string>>());
std::copy(a_skip_until_phase.begin_args(), a_skip_until_phase.end_args(), skip_until_phases->inserter());
task.set_skip_until_phases(skip_until_phases);
}
diff --git a/paludis/broken_linkage_finder.cc b/paludis/broken_linkage_finder.cc
index d2beb27..98f4f59 100644
--- a/paludis/broken_linkage_finder.cc
+++ b/paludis/broken_linkage_finder.cc
@@ -146,9 +146,9 @@ BrokenLinkageFinder::BrokenLinkageFinder(const Environment * env, const std::str
Context ctx("When checking for broken linkage in '" + stringify(env->root()) + "':");
- _imp->checkers.push_back(std::shared_ptr<LinkageChecker>(new ElfLinkageChecker(env->root(), library)));
+ _imp->checkers.push_back(std::shared_ptr<LinkageChecker>(std::make_shared<ElfLinkageChecker>(env->root(), library)));
if (library.empty())
- _imp->checkers.push_back(std::shared_ptr<LinkageChecker>(new LibtoolLinkageChecker(env->root())));
+ _imp->checkers.push_back(std::shared_ptr<LinkageChecker>(std::make_shared<LibtoolLinkageChecker>(env->root())));
std::vector<FSEntry> search_dirs_nosyms, search_dirs_pruned;
std::transform(_imp->config.begin_search_dirs(), _imp->config.end_search_dirs(),
diff --git a/paludis/buffer_output_manager.cc b/paludis/buffer_output_manager.cc
index 7b91213..e4be376 100644
--- a/paludis/buffer_output_manager.cc
+++ b/paludis/buffer_output_manager.cc
@@ -100,7 +100,7 @@ BufferOutputManager::nothing_more_to_come()
const std::shared_ptr<const Set<std::string> >
BufferOutputManager::factory_managers()
{
- std::shared_ptr<Set<std::string> > result(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > result(std::make_shared<Set<std::string>>());
result->insert("buffer");
return result;
}
diff --git a/paludis/comma_separated_dep_parser.cc b/paludis/comma_separated_dep_parser.cc
index ce0d3e6..d33153b 100644
--- a/paludis/comma_separated_dep_parser.cc
+++ b/paludis/comma_separated_dep_parser.cc
@@ -34,7 +34,7 @@ CommaSeparatedDepParser::parse(const Environment * const env, const std::string
{
Context context("When parsing '" + s + "':");
- std::shared_ptr<DependencySpecTree> result(new DependencySpecTree(std::make_shared<AllDepSpec>()));
+ std::shared_ptr<DependencySpecTree> result(std::make_shared<DependencySpecTree>(std::make_shared<AllDepSpec>()));
std::list<std::string> tokens;
tokenise<delim_kind::AnyOfTag, delim_mode::DelimiterTag>(s, ",", "", std::back_inserter(tokens));
@@ -48,7 +48,7 @@ CommaSeparatedDepParser::parse(const Environment * const env, const std::string
if (a.empty())
continue;
- std::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(parse_user_package_dep_spec(a, env,
+ std::shared_ptr<PackageDepSpec> spec(std::make_shared<PackageDepSpec>(parse_user_package_dep_spec(a, env,
UserPackageDepSpecOptions() + updso_no_disambiguation)));
result->root()->append(spec);
}
diff --git a/paludis/common_sets.cc b/paludis/common_sets.cc
index 518f58a..ed61f12 100644
--- a/paludis/common_sets.cc
+++ b/paludis/common_sets.cc
@@ -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(std::make_shared<AllDepSpec>()));
+ std::shared_ptr<SetSpecTree> result(std::make_shared<SetSpecTree>(std::make_shared<AllDepSpec>()));
std::shared_ptr<const PackageIDSequence> ids;
if (slots)
diff --git a/paludis/create_output_manager_info.cc b/paludis/create_output_manager_info.cc
index c05f912..d1188d0 100644
--- a/paludis/create_output_manager_info.cc
+++ b/paludis/create_output_manager_info.cc
@@ -53,7 +53,7 @@ namespace
std::shared_ptr<Set<std::string> > visit(const FetchAction & a) const
{
- std::shared_ptr<Set<std::string> > result(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > result(std::make_shared<Set<std::string>>());
if (a.options.ignore_unfetched())
result->insert(FetchAction::ignore_unfetched_flag_name());
return result;
@@ -203,7 +203,7 @@ CreateOutputManagerForPackageIDActionInfo::deserialise(Deserialisation & d)
{
Deserialisator v(d, "CreateOutputManagerForPackageIDActionInfo");
- std::shared_ptr<Set<std::string> > action_flags(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > action_flags(std::make_shared<Set<std::string>>());
Deserialisator vv(*v.find_remove_member("action_flags"), "c");
for (int n(1), n_end(vv.member<int>("count") + 1) ; n != n_end ; ++n)
action_flags->insert(vv.member<std::string>(stringify(n)));
diff --git a/paludis/dep_list.cc b/paludis/dep_list.cc
index cf3d476..0b9b528 100644
--- a/paludis/dep_list.cc
+++ b/paludis/dep_list.cc
@@ -132,7 +132,7 @@ namespace paludis
Imp(const Environment * const e, const DepListOptions & o) :
env(e),
- opts(new DepListOptions(o)),
+ opts(std::make_shared<DepListOptions>(o)),
current_merge_list_entry(merge_list.end()),
merge_list_insert_position(merge_list.end()),
merge_list_generation(0),
@@ -190,7 +190,7 @@ namespace
/* see EffSTL 9 for why this is so painful */
if (e.tags()->empty())
return;
- std::shared_ptr<DepListEntryTags> t(new DepListEntryTags);
+ std::shared_ptr<DepListEntryTags> t(std::make_shared<DepListEntryTags>());
GenerationGreaterThan pred(g);
for (DepListEntryTags::ConstIterator i(e.tags()->begin()), i_end(e.tags()->end()) ;
i != i_end ; ++i)
@@ -450,7 +450,7 @@ DepList::AddVisitor::visit(const DependencySpecTree::NodeType<PackageDepSpec>::T
if (d->_imp->opts->dependency_tags() && d->_imp->current_package_id())
existing_merge_list_entry->tags()->insert(make_named_values<DepTagEntry>(
n::generation() = d->_imp->merge_list_generation,
- n::tag() = std::shared_ptr<DepTag>(new DependencyDepTag(d->_imp->current_package_id(), *node.spec()))
+ n::tag() = std::shared_ptr<DepTag>(std::make_shared<DependencyDepTag>(d->_imp->current_package_id(), *node.spec()))
));
/* add an appropriate destination */
@@ -602,7 +602,7 @@ DepList::AddVisitor::visit(const DependencySpecTree::NodeType<PackageDepSpec>::T
}
}
- std::shared_ptr<PackageIDSequence> already_installed_in_same_slot(new PackageIDSequence);
+ std::shared_ptr<PackageIDSequence> already_installed_in_same_slot(std::make_shared<PackageIDSequence>());
for (PackageIDSequence::ConstIterator aa(already_installed->begin()),
aa_end(already_installed->end()) ; aa != aa_end ; ++aa)
if (slot_is_same(**aa, *best_visible_candidate))
@@ -1046,7 +1046,7 @@ DepList::AddVisitor::visit(const DependencySpecTree::NodeType<BlockDepSpec>::Typ
void
DepList::AddVisitor::visit(const DependencySpecTree::NodeType<DependenciesLabelsDepSpec>::Type & node)
{
- std::shared_ptr<DependenciesLabelSequence> labels(new DependenciesLabelSequence);
+ std::shared_ptr<DependenciesLabelSequence> labels(std::make_shared<DependenciesLabelSequence>());
std::copy(node.spec()->begin(), node.spec()->end(), labels->back_inserter());
*d->_imp->labels.begin() = labels;
}
@@ -1138,12 +1138,12 @@ DepList::add_package(const std::shared_ptr<const PackageID> & p, const std::shar
n::destination() = p->virtual_for_key() ? std::shared_ptr<Repository>() : find_destination(*p, destinations),
n::generation() = _imp->merge_list_generation,
n::handled() = p->virtual_for_key() ?
- std::shared_ptr<DepListEntryHandled>(new DepListEntryNoHandlingRequired) :
- std::shared_ptr<DepListEntryHandled>(new DepListEntryUnhandled),
+ std::shared_ptr<DepListEntryHandled>(std::make_shared<DepListEntryNoHandlingRequired>()) :
+ std::shared_ptr<DepListEntryHandled>(std::make_shared<DepListEntryUnhandled>()),
n::kind() = p->virtual_for_key() ? dlk_virtual : dlk_package,
n::package_id() = p,
n::state() = dle_no_deps,
- n::tags() = std::shared_ptr<DepListEntryTags>(new DepListEntryTags)
+ n::tags() = std::shared_ptr<DepListEntryTags>(std::make_shared<DepListEntryTags>())
))),
our_merge_entry_post_position(our_merge_entry_position);
@@ -1158,7 +1158,7 @@ DepList::add_package(const std::shared_ptr<const PackageID> & p, const std::shar
if (_imp->opts->dependency_tags() && _imp->current_package_id())
our_merge_entry_position->tags()->insert(make_named_values<DepTagEntry>(
n::generation() = _imp->merge_list_generation,
- n::tag() = std::shared_ptr<DepTag>(new DependencyDepTag(_imp->current_package_id(), pds))
+ n::tag() = std::shared_ptr<DepTag>(std::make_shared<DependencyDepTag>(_imp->current_package_id(), pds))
));
Save<MergeList::const_iterator> save_current_merge_list_entry(&_imp->current_merge_list_entry,
@@ -1179,7 +1179,7 @@ DepList::add_package(const std::shared_ptr<const PackageID> & p, const std::shar
for (DepSpecFlattener<ProvideSpecTree, PackageDepSpec>::ConstIterator i(f.begin()), i_end(f.end()) ; i != i_end ; ++i)
{
- std::shared_ptr<PackageDepSpec> pp(new PackageDepSpec(make_package_dep_spec(PartiallyMadePackageDepSpecOptions())
+ std::shared_ptr<PackageDepSpec> pp(std::make_shared<PackageDepSpec>(make_package_dep_spec(PartiallyMadePackageDepSpecOptions())
.package(*(*i)->package_ptr())
.version_requirement(make_named_values<VersionRequirement>(
n::version_operator() = vo_equal,
@@ -1209,7 +1209,7 @@ DepList::add_package(const std::shared_ptr<const PackageID> & p, const std::shar
RepositoryName("virtuals"))).make_virtuals_interface()->make_virtual_package_id(
QualifiedPackageName((*i)->text()), p),
n::state() = dle_has_all_deps,
- n::tags() = std::shared_ptr<DepListEntryTags>(new DepListEntryTags)
+ n::tags() = std::shared_ptr<DepListEntryTags>(std::make_shared<DepListEntryTags>())
)));
_imp->merge_list_index.insert(std::make_pair((*i)->text(), our_merge_entry_post_position));
}
@@ -1278,7 +1278,7 @@ DepList::add_error_package(const std::shared_ptr<const PackageID> & p, const Dep
if (_imp->current_package_id())
pp.first->second->tags()->insert(make_named_values<DepTagEntry>(
n::generation() = _imp->merge_list_generation,
- n::tag() = std::shared_ptr<DepTag>(new DependencyDepTag(_imp->current_package_id(), pds))
+ n::tag() = std::shared_ptr<DepTag>(std::make_shared<DependencyDepTag>(_imp->current_package_id(), pds))
));
return;
}
@@ -1294,13 +1294,13 @@ DepList::add_error_package(const std::shared_ptr<const PackageID> & p, const Dep
n::kind() = kind,
n::package_id() = p,
n::state() = dle_has_all_deps,
- n::tags() = std::shared_ptr<DepListEntryTags>(new DepListEntryTags)
+ n::tags() = std::shared_ptr<DepListEntryTags>(std::make_shared<DepListEntryTags>())
)));
if (_imp->current_package_id())
our_merge_entry_position->tags()->insert(make_named_values<DepTagEntry>(
n::generation() = _imp->merge_list_generation,
- n::tag() = std::shared_ptr<DepTag>(new DependencyDepTag(_imp->current_package_id(), pds))
+ n::tag() = std::shared_ptr<DepTag>(std::make_shared<DependencyDepTag>(_imp->current_package_id(), pds))
));
_imp->merge_list_index.insert(std::make_pair(p->name(), our_merge_entry_position));
@@ -1331,13 +1331,13 @@ DepList::add_suggested_package(const std::shared_ptr<const PackageID> & p,
n::kind() = dlk_suggested,
n::package_id() = p,
n::state() = dle_has_all_deps,
- n::tags() = std::shared_ptr<DepListEntryTags>(new DepListEntryTags)
+ n::tags() = std::shared_ptr<DepListEntryTags>(std::make_shared<DepListEntryTags>())
)));
if (_imp->current_package_id())
our_merge_entry_position->tags()->insert(make_named_values<DepTagEntry>(
n::generation() = _imp->merge_list_generation,
- n::tag() = std::shared_ptr<DepTag>(new DependencyDepTag(_imp->current_package_id(), pds))
+ n::tag() = std::shared_ptr<DepTag>(std::make_shared<DependencyDepTag>(_imp->current_package_id(), pds))
));
_imp->merge_list_index.insert(std::make_pair(p->name(), our_merge_entry_position));
@@ -1416,7 +1416,7 @@ DepList::add_already_installed_package(const std::shared_ptr<const PackageID> &
n::kind() = dlk_already_installed,
n::package_id() = p,
n::state() = dle_has_pre_deps,
- n::tags() = std::shared_ptr<DepListEntryTags>(new DepListEntryTags)
+ n::tags() = std::shared_ptr<DepListEntryTags>(std::make_shared<DepListEntryTags>())
)));
_imp->merge_list_index.insert(std::make_pair(p->name(), our_merge_entry));
@@ -1429,7 +1429,7 @@ DepList::add_already_installed_package(const std::shared_ptr<const PackageID> &
if (_imp->opts->dependency_tags() && _imp->current_package_id())
our_merge_entry->tags()->insert(make_named_values<DepTagEntry>(
n::generation() = _imp->merge_list_generation,
- n::tag() = std::shared_ptr<DepTag>(new DependencyDepTag(_imp->current_package_id(), pds))
+ n::tag() = std::shared_ptr<DepTag>(std::make_shared<DependencyDepTag>(_imp->current_package_id(), pds))
));
Save<MergeList::const_iterator> save_current_merge_list_entry(&_imp->current_merge_list_entry,
diff --git a/paludis/dep_list_TEST.cc b/paludis/dep_list_TEST.cc
index 14df29f..fbec87c 100644
--- a/paludis/dep_list_TEST.cc
+++ b/paludis/dep_list_TEST.cc
@@ -1929,11 +1929,11 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo"))));
env.package_database()->add_repository(1, repo);
- std::shared_ptr<FakeInstalledRepository> destination_repo(new FakeInstalledRepository(
+ std::shared_ptr<FakeInstalledRepository> destination_repo(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("installed_repo"),
@@ -1976,11 +1976,11 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo"))));
env.package_database()->add_repository(1, repo);
- std::shared_ptr<FakeInstalledRepository> destination_repo(new FakeInstalledRepository(
+ std::shared_ptr<FakeInstalledRepository> destination_repo(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("installed_repo"),
@@ -2024,13 +2024,13 @@ namespace test_cases
{
TestEnvironment env;
- std::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo"))));
env.package_database()->add_repository(1, repo);
repo->add_version("cat", "one", "1");
- std::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(
+ std::shared_ptr<FakeInstalledRepository> installed_repo(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("installed_repo"),
@@ -2058,13 +2058,13 @@ namespace test_cases
{
TestEnvironment env;
- std::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo"))));
env.package_database()->add_repository(1, repo);
repo->add_version("cat", "one", "1")->build_dependencies_key()->set_from_string("cat/two");
- std::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(
+ std::shared_ptr<FakeInstalledRepository> installed_repo(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("installed_repo"),
@@ -2093,13 +2093,13 @@ namespace test_cases
{
TestEnvironment env;
- std::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo"))));
env.package_database()->add_repository(1, repo);
repo->add_version("cat", "one", "1")->build_dependencies_key()->set_from_string("cat/two");
- std::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(
+ std::shared_ptr<FakeInstalledRepository> installed_repo(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("installed_repo"),
@@ -2130,13 +2130,13 @@ namespace test_cases
{
TestEnvironment env;
- std::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo"))));
env.package_database()->add_repository(1, repo);
repo->add_version("cat", "one", "1")->build_dependencies_key()->set_from_string("cat/two");
- std::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(
+ std::shared_ptr<FakeInstalledRepository> installed_repo(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("installed_repo"),
@@ -2164,13 +2164,13 @@ 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(std::make_shared<AllDepSpec>()));
+ std::shared_ptr<SetSpecTree> t3(std::make_shared<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(std::make_shared<AllDepSpec>()));
+ std::shared_ptr<SetSpecTree> t4(std::make_shared<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);
@@ -2188,14 +2188,14 @@ namespace test_cases
{
TestEnvironment env;
- std::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo"))));
env.package_database()->add_repository(1, repo);
repo->add_version("cat", "one", "1")->build_dependencies_key()->set_from_string("cat/two");
repo->add_version("cat", "two", "2");
- std::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(
+ std::shared_ptr<FakeInstalledRepository> installed_repo(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("installed_repo"),
@@ -2214,7 +2214,7 @@ namespace test_cases
DepList d2(&env, DepListOptions());
d2.options()->upgrade() = dl_upgrade_as_needed;
- std::shared_ptr<SetSpecTree> t2(new SetSpecTree(std::make_shared<AllDepSpec>()));
+ std::shared_ptr<SetSpecTree> t2(std::make_shared<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());
@@ -2233,7 +2233,7 @@ namespace test_cases
{
TestEnvironment env;
- std::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo"))));
env.package_database()->add_repository(1, repo);
@@ -2246,7 +2246,7 @@ namespace test_cases
repo->add_version("cat", "five-svn", "0");
repo->add_version("cat", "six-darcs", "0");
- std::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(
+ std::shared_ptr<FakeInstalledRepository> installed_repo(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("installed_repo"),
@@ -2282,7 +2282,7 @@ namespace test_cases
{
TestEnvironment env;
- std::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo"))));
env.package_database()->add_repository(1, repo);
@@ -2293,7 +2293,7 @@ namespace test_cases
repo->add_version("cat", "three", "0.9");
repo->add_version("cat", "four", "1");
- std::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(
+ std::shared_ptr<FakeInstalledRepository> installed_repo(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("installed_repo"),
@@ -2306,11 +2306,11 @@ namespace test_cases
d1.options()->dependency_tags() = true;
PackageDepSpec with_target_tag(parse_user_package_dep_spec("cat/one",
&env, UserPackageDepSpecOptions()));
- with_target_tag.set_tag(std::shared_ptr<const DepTag>(new TargetDepTag));
+ with_target_tag.set_tag(std::shared_ptr<const DepTag>(std::make_shared<TargetDepTag>()));
d1.add(with_target_tag, env.default_destinations());
PackageDepSpec with_set_tag(parse_user_package_dep_spec("cat/two",
&env, UserPackageDepSpecOptions()));
- with_set_tag.set_tag(std::shared_ptr<const DepTag>(new GeneralSetDepTag(SetName("set"), "test")));
+ with_set_tag.set_tag(std::shared_ptr<const DepTag>(std::make_shared<GeneralSetDepTag>(SetName("set"), "test")));
d1.add(with_set_tag, env.default_destinations());
TEST_CHECK_EQUAL(join(d1.begin(), d1.end(), " "), "cat/three-0.9:0::repo cat/one-1:0::repo "
diff --git a/paludis/dep_list_TEST.hh b/paludis/dep_list_TEST.hh
index a216ecd..9ade902 100644
--- a/paludis/dep_list_TEST.hh
+++ b/paludis/dep_list_TEST.hh
@@ -126,10 +126,10 @@ namespace test_cases
DepListTestCaseBase(const std::string & s) :
TestCase(s),
env(),
- repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo")))),
- installed_repo(new FakeInstalledRepository(
+ installed_repo(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("installed"),
diff --git a/paludis/dep_spec.cc b/paludis/dep_spec.cc
index e247a31..6a0e8e2 100644
--- a/paludis/dep_spec.cc
+++ b/paludis/dep_spec.cc
@@ -95,7 +95,7 @@ AnyDepSpec::AnyDepSpec()
std::shared_ptr<DepSpec>
AnyDepSpec::clone() const
{
- std::shared_ptr<AnyDepSpec> result(new AnyDepSpec);
+ std::shared_ptr<AnyDepSpec> result(std::make_shared<AnyDepSpec>());
result->set_annotations_key(annotations_key());
return result;
}
@@ -118,7 +118,7 @@ AllDepSpec::need_keys_added() const
std::shared_ptr<DepSpec>
AllDepSpec::clone() const
{
- std::shared_ptr<AllDepSpec> result(new AllDepSpec);
+ std::shared_ptr<AllDepSpec> result(std::make_shared<AllDepSpec>());
result->set_annotations_key(annotations_key());
return result;
}
@@ -240,7 +240,7 @@ NamedSetDepSpec::name() const
std::shared_ptr<DepSpec>
NamedSetDepSpec::clone() const
{
- std::shared_ptr<NamedSetDepSpec> result(new NamedSetDepSpec(_name));
+ std::shared_ptr<NamedSetDepSpec> result(std::make_shared<NamedSetDepSpec>(_name));
result->set_annotations_key(annotations_key());
return result;
}
@@ -368,7 +368,7 @@ PlainTextDepSpec::PlainTextDepSpec(const std::string & s) :
std::shared_ptr<DepSpec>
PlainTextDepSpec::clone() const
{
- std::shared_ptr<PlainTextDepSpec> result(new PlainTextDepSpec(text()));
+ std::shared_ptr<PlainTextDepSpec> result(std::make_shared<PlainTextDepSpec>(text()));
result->set_annotations_key(annotations_key());
return result;
}
@@ -390,7 +390,7 @@ PlainTextLabelDepSpec::~PlainTextLabelDepSpec()
std::shared_ptr<DepSpec>
PlainTextLabelDepSpec::clone() const
{
- std::shared_ptr<PlainTextLabelDepSpec> result(new PlainTextLabelDepSpec(text()));
+ std::shared_ptr<PlainTextLabelDepSpec> result(std::make_shared<PlainTextLabelDepSpec>(text()));
result->set_annotations_key(annotations_key());
return result;
}
@@ -414,7 +414,7 @@ LicenseDepSpec::LicenseDepSpec(const std::string & s) :
std::shared_ptr<DepSpec>
LicenseDepSpec::clone() const
{
- std::shared_ptr<LicenseDepSpec> result(new LicenseDepSpec(text()));
+ std::shared_ptr<LicenseDepSpec> result(std::make_shared<LicenseDepSpec>(text()));
result->set_annotations_key(annotations_key());
return result;
}
@@ -432,7 +432,7 @@ SimpleURIDepSpec::SimpleURIDepSpec(const std::string & s) :
std::shared_ptr<DepSpec>
SimpleURIDepSpec::clone() const
{
- std::shared_ptr<SimpleURIDepSpec> result(new SimpleURIDepSpec(text()));
+ std::shared_ptr<SimpleURIDepSpec> result(std::make_shared<SimpleURIDepSpec>(text()));
result->set_annotations_key(annotations_key());
return result;
}
@@ -457,7 +457,7 @@ BlockDepSpec::strong() const
std::shared_ptr<DepSpec>
BlockDepSpec::clone() const
{
- std::shared_ptr<BlockDepSpec> result(new BlockDepSpec(*this));
+ std::shared_ptr<BlockDepSpec> result(std::make_shared<BlockDepSpec>(*this));
result->set_annotations_key(annotations_key());
return result;
}
@@ -516,7 +516,7 @@ FetchableURIDepSpec::filename() const
std::shared_ptr<DepSpec>
FetchableURIDepSpec::clone() const
{
- std::shared_ptr<FetchableURIDepSpec> result(new FetchableURIDepSpec(text()));
+ std::shared_ptr<FetchableURIDepSpec> result(std::make_shared<FetchableURIDepSpec>(text()));
result->set_annotations_key(annotations_key());
return result;
}
@@ -559,7 +559,7 @@ std::shared_ptr<DepSpec>
LabelsDepSpec<T_>::clone() const
{
using namespace std::placeholders;
- std::shared_ptr<LabelsDepSpec<T_> > my_clone(new LabelsDepSpec<T_>);
+ std::shared_ptr<LabelsDepSpec<T_> > my_clone(std::make_shared<LabelsDepSpec<T_>>());
my_clone->set_annotations_key(annotations_key());
std::for_each(begin(), end(), std::bind(std::mem_fn(&LabelsDepSpec<T_>::add_label), my_clone.get(), _1));
return my_clone;
@@ -1071,17 +1071,17 @@ namespace paludis
std::shared_ptr<PartiallyMadePackageDepSpecData> data;
Imp(const PartiallyMadePackageDepSpecOptions & o) :
- data(new PartiallyMadePackageDepSpecData(o))
+ data(std::make_shared<PartiallyMadePackageDepSpecData>(o))
{
}
Imp(const Imp & other) :
- data(new PartiallyMadePackageDepSpecData(*other.data))
+ data(std::make_shared<PartiallyMadePackageDepSpecData>(*other.data))
{
}
Imp(const PackageDepSpec & other) :
- data(new PartiallyMadePackageDepSpecData(*other.data()))
+ data(std::make_shared<PartiallyMadePackageDepSpecData>(*other.data()))
{
}
};
diff --git a/paludis/dep_tag.cc b/paludis/dep_tag.cc
index af3f7d5..792e2b6 100644
--- a/paludis/dep_tag.cc
+++ b/paludis/dep_tag.cc
@@ -46,7 +46,7 @@ namespace
std::shared_ptr<DepTagCategory>
make_glsa_dep_tag()
{
- return std::shared_ptr<DepTagCategory>(new DepTagCategory(
+ return std::shared_ptr<DepTagCategory>(std::make_shared<DepTagCategory>(
true,
"glsa",
"Security advisories",
@@ -57,7 +57,7 @@ namespace
std::shared_ptr<DepTagCategory>
make_general_set_dep_tag()
{
- return std::shared_ptr<DepTagCategory>(new DepTagCategory(
+ return std::shared_ptr<DepTagCategory>(std::make_shared<DepTagCategory>(
true,
"general",
"General sets",
@@ -68,7 +68,7 @@ namespace
std::shared_ptr<DepTagCategory>
make_dependency_set_dep_tag()
{
- return std::shared_ptr<DepTagCategory>(new DepTagCategory(
+ return std::shared_ptr<DepTagCategory>(std::make_shared<DepTagCategory>(
false,
"dependency",
"Dependencies",
@@ -79,7 +79,7 @@ namespace
std::shared_ptr<DepTagCategory>
make_target_dep_tag()
{
- return std::shared_ptr<DepTagCategory>(new DepTagCategory(
+ return std::shared_ptr<DepTagCategory>(std::make_shared<DepTagCategory>(
false,
"target",
"Targets",
diff --git a/paludis/distribution-impl.hh b/paludis/distribution-impl.hh
index c74704e..6b4dee0 100644
--- a/paludis/distribution-impl.hh
+++ b/paludis/distribution-impl.hh
@@ -61,7 +61,7 @@ namespace paludis
if (this->_imp->values.end() != v)
return v->second;
- std::shared_ptr<KeyValueConfigFile> k(new KeyValueConfigFile(d.extra_data_dir() / ExtraDistributionDataData<Data_>::config_file_name(),
+ std::shared_ptr<KeyValueConfigFile> k(std::make_shared<KeyValueConfigFile>(d.extra_data_dir() / ExtraDistributionDataData<Data_>::config_file_name(),
KeyValueConfigFileOptions(), &KeyValueConfigFile::no_defaults, &KeyValueConfigFile::no_transformation));
std::shared_ptr<const Data_> data(ExtraDistributionDataData<Data_>::make_data(k));
this->_imp->values.insert(std::make_pair(d.name(), data));
diff --git a/paludis/elike_dep_parser.cc b/paludis/elike_dep_parser.cc
index b919177..682a67e 100644
--- a/paludis/elike_dep_parser.cc
+++ b/paludis/elike_dep_parser.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
@@ -48,7 +48,7 @@ namespace
if (! parser.consume(+simple_parser::any_of(" \t\r\n")))
error(parser, callbacks, "Expected space after '[['");
- std::shared_ptr<Map<std::string, std::string> > annotations(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > annotations(std::make_shared<Map<std::string, std::string>>());
while (true)
{
std::string word;
diff --git a/paludis/elike_package_dep_spec.cc b/paludis/elike_package_dep_spec.cc
index cfe1782..af9a802 100644
--- a/paludis/elike_package_dep_spec.cc
+++ b/paludis/elike_package_dep_spec.cc
@@ -196,7 +196,7 @@ paludis::elike_remove_trailing_square_bracket_if_exists(std::string & s, Partial
Log::get_instance()->message("e.package_dep_spec.key_not_allowed", ll_warning, lc_context)
<< "Key requirements not safe for use here";
}
- std::shared_ptr<const AdditionalPackageDepSpecRequirement> req(new UserKeyRequirement(flag.substr(1)));
+ std::shared_ptr<const AdditionalPackageDepSpecRequirement> req(std::make_shared<UserKeyRequirement>(flag.substr(1)));
result.additional_requirement(req);
}
break;
diff --git a/paludis/elike_use_requirement.cc b/paludis/elike_use_requirement.cc
index 9aecd4c..1134561 100644
--- a/paludis/elike_use_requirement.cc
+++ b/paludis/elike_use_requirement.cc
@@ -692,7 +692,7 @@ paludis::parse_elike_use_requirement(const std::string & s,
{
Context context("When parsing use requirement '" + s + "':");
- std::shared_ptr<UseRequirements> result(new UseRequirements("[" + s + "]"));
+ std::shared_ptr<UseRequirements> result(std::make_shared<UseRequirements>("[" + s + "]"));
std::string::size_type pos(0);
for (;;)
{
diff --git a/paludis/elike_use_requirement_TEST.cc b/paludis/elike_use_requirement_TEST.cc
index 65d18bd..6c367cc 100644
--- a/paludis/elike_use_requirement_TEST.cc
+++ b/paludis/elike_use_requirement_TEST.cc
@@ -61,7 +61,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- const std::shared_ptr<FakeRepository> fake(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> fake(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
@@ -102,7 +102,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- const std::shared_ptr<FakeRepository> fake(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> fake(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
@@ -143,7 +143,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- const std::shared_ptr<FakeRepository> fake(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> fake(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("fake")
)));
@@ -190,7 +190,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- const std::shared_ptr<FakeRepository> fake(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> fake(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("fake")
)));
@@ -293,7 +293,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- const std::shared_ptr<FakeRepository> fake(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> fake(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("fake")
)));
@@ -368,7 +368,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- const std::shared_ptr<FakeRepository> fake(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> fake(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("fake")
)));
@@ -499,7 +499,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- const std::shared_ptr<FakeRepository> fake(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> fake(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("fake")
)));
@@ -529,7 +529,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- const std::shared_ptr<FakeRepository> fake(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> fake(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("fake")
)));
@@ -563,7 +563,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- const std::shared_ptr<FakeRepository> fake(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> fake(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("fake")
)));
@@ -592,7 +592,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- const std::shared_ptr<FakeRepository> fake(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> fake(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("fake")
)));
@@ -723,7 +723,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- const std::shared_ptr<FakeRepository> fake(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> fake(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("fake")
)));
@@ -854,7 +854,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- const std::shared_ptr<FakeRepository> fake(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> fake(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("fake")
)));
@@ -895,7 +895,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- const std::shared_ptr<FakeRepository> fake(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> fake(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("fake")
)));
@@ -924,7 +924,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- const std::shared_ptr<FakeRepository> fake(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> fake(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("fake")
)));
diff --git a/paludis/environment_implementation.cc b/paludis/environment_implementation.cc
index 548806b..594f770 100644
--- a/paludis/environment_implementation.cc
+++ b/paludis/environment_implementation.cc
@@ -58,8 +58,8 @@ namespace
}
CombineSets() :
- root(new AllDepSpec),
- tree(new SetSpecTree(root))
+ root(std::make_shared<AllDepSpec>()),
+ tree(std::make_shared<SetSpecTree>(root))
{
}
@@ -143,7 +143,7 @@ EnvironmentImplementation::bashrc_files() const
std::shared_ptr<const FSEntrySequence>
EnvironmentImplementation::syncers_dirs() const
{
- std::shared_ptr<FSEntrySequence> result(new FSEntrySequence);
+ std::shared_ptr<FSEntrySequence> result(std::make_shared<FSEntrySequence>());
result->push_back(FSEntry(DATADIR "/paludis/syncers"));
result->push_back(FSEntry(LIBEXECDIR "/paludis/syncers"));
return result;
@@ -152,7 +152,7 @@ EnvironmentImplementation::syncers_dirs() const
std::shared_ptr<const FSEntrySequence>
EnvironmentImplementation::fetchers_dirs() const
{
- std::shared_ptr<FSEntrySequence> result(new FSEntrySequence);
+ std::shared_ptr<FSEntrySequence> result(std::make_shared<FSEntrySequence>());
std::string fetchers_dir(getenv_with_default("PALUDIS_FETCHERS_DIR", ""));
if (fetchers_dir.empty())
{
@@ -167,7 +167,7 @@ EnvironmentImplementation::fetchers_dirs() const
std::shared_ptr<const DestinationsSet>
EnvironmentImplementation::default_destinations() const
{
- std::shared_ptr<DestinationsSet> result(new DestinationsSet);
+ std::shared_ptr<DestinationsSet> result(std::make_shared<DestinationsSet>());
for (PackageDatabase::RepositoryConstIterator r(package_database()->begin_repositories()),
r_end(package_database()->end_repositories()) ;
@@ -254,7 +254,7 @@ EnvironmentImplementation::add_set(
if (! _imp->sets.insert(std::make_pair(combined_name, std::make_pair(cache(func), CombiningFunction()))).second)
throw DuplicateSetError(combined_name);
- std::shared_ptr<CombineSets> c_s(new CombineSets);
+ std::shared_ptr<CombineSets> c_s(std::make_shared<CombineSets>());
CombiningFunction c_func(_imp->sets.insert(std::make_pair(name, std::make_pair(
std::bind(&CombineSets::result, c_s),
std::bind(&CombineSets::add, c_s, std::placeholders::_1)
@@ -319,7 +319,7 @@ 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(std::make_shared<AllDepSpec>()));
+ std::shared_ptr<SetSpecTree> result(std::make_shared<SetSpecTree>(std::make_shared<AllDepSpec>()));
result->root()->append(std::make_shared<NamedSetDepSpec>(SetName("installed-packages")));
return result;
}
diff --git a/paludis/environments/no_config/no_config_environment.cc b/paludis/environments/no_config/no_config_environment.cc
index 276ac6c..6c13024 100644
--- a/paludis/environments/no_config/no_config_environment.cc
+++ b/paludis/environments/no_config/no_config_environment.cc
@@ -161,9 +161,9 @@ Imp<NoConfigEnvironment>::Imp(
accept_unstable(p.accept_unstable()),
is_vdb(is_vdb_repository(p.repository_dir(), p.repository_type())),
paludis_command("false"),
- package_database(new PackageDatabase(env)),
- format_key(new LiteralMetadataValueKey<std::string>("format", "Format", mkt_significant, "no_config")),
- repository_dir_key(new LiteralMetadataValueKey<FSEntry>("repository_dir", "Repository dir",
+ package_database(std::make_shared<PackageDatabase>(env)),
+ format_key(std::make_shared<LiteralMetadataValueKey<std::string>>("format", "Format", mkt_significant, "no_config")),
+ repository_dir_key(std::make_shared<LiteralMetadataValueKey<FSEntry>>("repository_dir", "Repository dir",
mkt_normal, p.repository_dir()))
{
}
@@ -203,7 +203,7 @@ Imp<NoConfigEnvironment>::initialise(NoConfigEnvironment * const env)
{
Context local_context("When reading repository at location '" + stringify(r->first) + "':");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
if (params.extra_params())
std::copy(params.extra_params()->begin(), params.extra_params()->end(), keys->inserter());
@@ -312,7 +312,7 @@ Imp<NoConfigEnvironment>::initialise(NoConfigEnvironment * const env)
throw ConfigurationError("Can't find repository '" + params.master_repository_name() + "'");
#ifdef ENABLE_VIRTUALS_REPOSITORY
- std::shared_ptr<Map<std::string, std::string> > v_keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > v_keys(std::make_shared<Map<std::string, std::string>>());
v_keys->insert("format", "virtuals");
if ((*DistributionData::get_instance()->distribution_from_string(env->distribution())).support_old_style_virtuals())
package_database->add_repository(-2, RepositoryFactory::get_instance()->create(env,
@@ -323,7 +323,7 @@ Imp<NoConfigEnvironment>::initialise(NoConfigEnvironment * const env)
{
Log::get_instance()->message("no_config_environment.vdb_detected", ll_debug, lc_context) << "VDB, using vdb_db";
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
if (params.extra_params())
std::copy(params.extra_params()->begin(), params.extra_params()->end(), keys->inserter());
@@ -335,8 +335,7 @@ Imp<NoConfigEnvironment>::initialise(NoConfigEnvironment * const env)
package_database->add_repository(1, RepositoryFactory::get_instance()->create(env,
std::bind(from_keys, keys, std::placeholders::_1)));
- std::shared_ptr<Map<std::string, std::string> > iv_keys(
- new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > iv_keys(std::make_shared<Map<std::string, std::string>>());
iv_keys->insert("root", "/");
iv_keys->insert("format", "installed_virtuals");
diff --git a/paludis/environments/no_config/registration.cc b/paludis/environments/no_config/registration.cc
index 45548c8..f7353e8 100644
--- a/paludis/environments/no_config/registration.cc
+++ b/paludis/environments/no_config/registration.cc
@@ -40,7 +40,7 @@ namespace
std::shared_ptr<Map<std::string, std::string> > extra_params(
std::make_shared<Map<std::string, std::string>>());
FSEntry repository_dir(FSEntry::cwd());
- std::shared_ptr<FSEntrySequence> extra_repository_dirs(new FSEntrySequence);
+ std::shared_ptr<FSEntrySequence> extra_repository_dirs(std::make_shared<FSEntrySequence>());
FSEntry write_cache("/var/empty");
std::string profile;
std::string master_repository_name;
@@ -87,7 +87,7 @@ namespace
}
}
- return std::shared_ptr<Environment>(new NoConfigEnvironment(
+ return std::shared_ptr<Environment>(std::make_shared<NoConfigEnvironment>(
make_named_values<no_config_environment::Params>(
n::accept_unstable() = accept_unstable,
n::disable_metadata_cache() = disable_metadata_cache,
@@ -114,7 +114,7 @@ namespace paludis
void register_environment<environment_groups::no_config>(const environment_groups::no_config * const,
EnvironmentFactory * const factory)
{
- std::shared_ptr<Set<std::string> > no_config_formats(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > no_config_formats(std::make_shared<Set<std::string>>());
no_config_formats->insert("no_config");
no_config_formats->insert("no-config");
factory->add_environment_format(no_config_formats, &make_no_config_environment);
diff --git a/paludis/environments/paludis/keywords_conf.cc b/paludis/environments/paludis/keywords_conf.cc
index 3f75a1b..73189e3 100644
--- a/paludis/environments/paludis/keywords_conf.cc
+++ b/paludis/environments/paludis/keywords_conf.cc
@@ -102,7 +102,7 @@ KeywordsConf::add(const FSEntry & filename)
try
{
- std::shared_ptr<PackageDepSpec> d(new PackageDepSpec(parse_user_package_dep_spec(
+ std::shared_ptr<PackageDepSpec> d(std::make_shared<PackageDepSpec>(parse_user_package_dep_spec(
tokens.at(0), _imp->env,
UserPackageDepSpecOptions() + updso_allow_wildcards + updso_no_disambiguation + updso_throw_if_set)));
if (d->package_ptr())
diff --git a/paludis/environments/paludis/licenses_conf.cc b/paludis/environments/paludis/licenses_conf.cc
index 05866f9..06aa3d8 100644
--- a/paludis/environments/paludis/licenses_conf.cc
+++ b/paludis/environments/paludis/licenses_conf.cc
@@ -101,7 +101,7 @@ LicensesConf::add(const FSEntry & filename)
try
{
- std::shared_ptr<PackageDepSpec> d(new PackageDepSpec(parse_user_package_dep_spec(
+ std::shared_ptr<PackageDepSpec> d(std::make_shared<PackageDepSpec>(parse_user_package_dep_spec(
tokens.at(0), _imp->env,
UserPackageDepSpecOptions() + updso_allow_wildcards + updso_no_disambiguation + updso_throw_if_set)));
if (d->package_ptr())
diff --git a/paludis/environments/paludis/mirrors_conf.cc b/paludis/environments/paludis/mirrors_conf.cc
index 928cbab..21934f6 100644
--- a/paludis/environments/paludis/mirrors_conf.cc
+++ b/paludis/environments/paludis/mirrors_conf.cc
@@ -91,7 +91,7 @@ MirrorsConf::add(const FSEntry & filename)
std::shared_ptr<const MirrorsSequence>
MirrorsConf::query(const std::string & m) const
{
- std::shared_ptr<MirrorsSequence> result(new MirrorsSequence);
+ std::shared_ptr<MirrorsSequence> result(std::make_shared<MirrorsSequence>());
std::pair<Mirrors::const_iterator, Mirrors::const_iterator> p(_imp->mirrors.equal_range(m));
std::transform(p.first, p.second, result->back_inserter(),
std::mem_fn(&std::pair<const std::string, std::string>::second));
diff --git a/paludis/environments/paludis/output_conf.cc b/paludis/environments/paludis/output_conf.cc
index 42b6b6f..98cd327 100644
--- a/paludis/environments/paludis/output_conf.cc
+++ b/paludis/environments/paludis/output_conf.cc
@@ -283,7 +283,7 @@ namespace
const Environment * const env,
const CreateOutputManagerInfo & i)
{
- std::shared_ptr<Map<std::string, std::string> > result(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > result(std::make_shared<Map<std::string, std::string>>());
CreateVarsFromInfo v(env, result);
i.accept(v);
return result;
diff --git a/paludis/environments/paludis/package_mask_conf.cc b/paludis/environments/paludis/package_mask_conf.cc
index f25ef0d..fb0bbb3 100644
--- a/paludis/environments/paludis/package_mask_conf.cc
+++ b/paludis/environments/paludis/package_mask_conf.cc
@@ -86,7 +86,7 @@ PackageMaskConf::add(const FSEntry & filename)
{
try
{
- _imp->masks.push_back(std::shared_ptr<PackageDepSpec>(new PackageDepSpec(parse_user_package_dep_spec(
+ _imp->masks.push_back(std::shared_ptr<PackageDepSpec>(std::make_shared<PackageDepSpec>(parse_user_package_dep_spec(
*line, _imp->env,
UserPackageDepSpecOptions() + updso_allow_wildcards + updso_no_disambiguation + updso_throw_if_set))));
}
diff --git a/paludis/environments/paludis/paludis_config.cc b/paludis/environments/paludis/paludis_config.cc
index 0a4be66..6f346c2 100644
--- a/paludis/environments/paludis/paludis_config.cc
+++ b/paludis/environments/paludis/paludis_config.cc
@@ -206,18 +206,18 @@ namespace paludis
env(e),
paludis_command("paludis"),
config_dir("(unset)"),
- bashrc_files(new FSEntrySequence),
- keywords_conf(new KeywordsConf(e)),
- use_conf(new UseConf(e)),
- licenses_conf(new LicensesConf(e)),
- package_mask_conf(new PackageMaskConf(e)),
- package_unmask_conf(new PackageMaskConf(e)),
- mirrors_conf(new MirrorsConf(e)),
- output_conf(new OutputConf(e)),
+ bashrc_files(std::make_shared<FSEntrySequence>()),
+ keywords_conf(std::make_shared<KeywordsConf>(e)),
+ use_conf(std::make_shared<UseConf>(e)),
+ licenses_conf(std::make_shared<LicensesConf>(e)),
+ package_mask_conf(std::make_shared<PackageMaskConf>(e)),
+ package_unmask_conf(std::make_shared<PackageMaskConf>(e)),
+ mirrors_conf(std::make_shared<MirrorsConf>(e)),
+ output_conf(std::make_shared<OutputConf>(e)),
has_general_conf(false),
accept_all_breaks_portage(false),
reduced_username(getenv_with_default("PALUDIS_REDUCED_USERNAME", "paludisbuild")),
- commandline_environment(new Map<std::string, std::string>)
+ commandline_environment(std::make_shared<Map<std::string, std::string>>())
{
}
@@ -641,12 +641,12 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
/* add virtuals repositories */
if ((*DistributionData::get_instance()->distribution_from_string(distribution())).support_old_style_virtuals())
{
- std::shared_ptr<Map<std::string, std::string> > iv_keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > iv_keys(std::make_shared<Map<std::string, std::string>>());
iv_keys->insert("root", _imp->root_prefix.empty() ? "/" : _imp->root_prefix);
iv_keys->insert("format", "installed_virtuals");
_imp->repos.push_back(std::bind(&from_keys, iv_keys, std::placeholders::_1));
- std::shared_ptr<Map<std::string, std::string> > v_keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > v_keys(std::make_shared<Map<std::string, std::string>>());
v_keys->insert("format", "virtuals");
_imp->repos.push_back(std::bind(&from_keys, v_keys, std::placeholders::_1));
}
diff --git a/paludis/environments/paludis/paludis_environment.cc b/paludis/environments/paludis/paludis_environment.cc
index 184ab91..52125b4 100644
--- a/paludis/environments/paludis/paludis_environment.cc
+++ b/paludis/environments/paludis/paludis_environment.cc
@@ -91,9 +91,9 @@ namespace paludis
done_hooks(false),
config(c),
paludis_command("paludis"),
- package_database(new PackageDatabase(e)),
- format_key(new LiteralMetadataValueKey<std::string>("format", "Format", mkt_significant, "paludis")),
- config_location_key(new LiteralMetadataValueKey<FSEntry>("conf_dir", "Config dir", mkt_normal,
+ package_database(std::make_shared<PackageDatabase>(e)),
+ format_key(std::make_shared<LiteralMetadataValueKey<std::string>>("format", "Format", mkt_significant, "paludis")),
+ config_location_key(std::make_shared<LiteralMetadataValueKey<FSEntry>>("conf_dir", "Config dir", mkt_normal,
config->config_dir())),
world_file_key(config->world()->location_if_set() ? std::make_shared<LiteralMetadataValueKey<FSEntry>>("world_file", "World file", mkt_normal,
*config->world()->location_if_set())
@@ -141,7 +141,7 @@ namespace paludis
}
PaludisEnvironment::PaludisEnvironment(const std::string & s) :
- Pimp<PaludisEnvironment>(this, std::shared_ptr<PaludisConfig>(new PaludisConfig(this, s))),
+ Pimp<PaludisEnvironment>(this, std::shared_ptr<PaludisConfig>(std::make_shared<PaludisConfig>(this, s))),
_imp(Pimp<PaludisEnvironment>::_imp)
{
Context context("When loading paludis environment:");
@@ -230,7 +230,7 @@ PaludisEnvironment::hook_dirs() const
_imp->need_hook_dirs(_imp->config->config_dir());
- std::shared_ptr<FSEntrySequence> result(new FSEntrySequence);
+ std::shared_ptr<FSEntrySequence> result(std::make_shared<FSEntrySequence>());
std::transform(_imp->hook_dirs.begin(), _imp->hook_dirs.end(), result->back_inserter(),
std::mem_fn(&std::pair<FSEntry, bool>::first));
@@ -240,7 +240,7 @@ PaludisEnvironment::hook_dirs() const
std::shared_ptr<const FSEntrySequence>
PaludisEnvironment::fetchers_dirs() const
{
- std::shared_ptr<FSEntrySequence> result(new FSEntrySequence);
+ std::shared_ptr<FSEntrySequence> result(std::make_shared<FSEntrySequence>());
result->push_back(FSEntry(_imp->config->config_dir()) / "fetchers");
@@ -256,7 +256,7 @@ PaludisEnvironment::fetchers_dirs() const
std::shared_ptr<const FSEntrySequence>
PaludisEnvironment::syncers_dirs() const
{
- std::shared_ptr<FSEntrySequence> result(new FSEntrySequence);
+ std::shared_ptr<FSEntrySequence> result(std::make_shared<FSEntrySequence>());
result->push_back(FSEntry(_imp->config->config_dir()) / "syncers");
@@ -500,7 +500,7 @@ namespace
{
Context context("When making set '" + stringify(f) + "':");
- const std::shared_ptr<GeneralSetDepTag> tag(new GeneralSetDepTag(n, stringify(f.basename())));
+ const std::shared_ptr<GeneralSetDepTag> tag(std::make_shared<GeneralSetDepTag>(n, stringify(f.basename())));
SetFile s(make_named_values<SetFileParams>(
n::environment() = env,
diff --git a/paludis/environments/paludis/paludis_environment_TEST.cc b/paludis/environments/paludis/paludis_environment_TEST.cc
index d619a97..df28465 100644
--- a/paludis/environments/paludis/paludis_environment_TEST.cc
+++ b/paludis/environments/paludis/paludis_environment_TEST.cc
@@ -61,7 +61,7 @@ namespace test_cases
setenv("PALUDIS_HOME", stringify(FSEntry::cwd() / "paludis_environment_TEST_dir" / "home1").c_str(), 1);
unsetenv("PALUDIS_SKIP_CONFIG");
- std::shared_ptr<Environment> env(new PaludisEnvironment(""));
+ std::shared_ptr<Environment> env(std::make_shared<PaludisEnvironment>(""));
const std::shared_ptr<const PackageID> one(*(*env)[selection::RequireExactlyOne(
generator::Matches(PackageDepSpec(parse_user_package_dep_spec("=cat-one/pkg-one-1",
env.get(), UserPackageDepSpecOptions())), MatchPackageOptions()))]->begin());
@@ -94,7 +94,7 @@ namespace test_cases
setenv("PALUDIS_HOME", stringify(FSEntry::cwd() / "paludis_environment_TEST_dir" / "home5").c_str(), 1);
unsetenv("PALUDIS_SKIP_CONFIG");
- std::shared_ptr<Environment> env(new PaludisEnvironment(""));
+ std::shared_ptr<Environment> env(std::make_shared<PaludisEnvironment>(""));
const std::shared_ptr<const PackageID> id1(*(*env)[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat-one/pkg-one-1",
@@ -120,7 +120,7 @@ namespace test_cases
setenv("PALUDIS_HOME", stringify(FSEntry::cwd() / "paludis_environment_TEST_dir" / "home2").c_str(), 1);
unsetenv("PALUDIS_SKIP_CONFIG");
- std::shared_ptr<Environment> env(new PaludisEnvironment(""));
+ std::shared_ptr<Environment> env(std::make_shared<PaludisEnvironment>(""));
const std::shared_ptr<const PackageID> one(*(*env)[selection::RequireExactlyOne(
generator::Matches(PackageDepSpec(parse_user_package_dep_spec("=cat-one/pkg-one-1",
@@ -153,7 +153,7 @@ namespace test_cases
setenv("PALUDIS_HOME", stringify(FSEntry::cwd() / "paludis_environment_TEST_dir" / "home3").c_str(), 1);
unsetenv("PALUDIS_SKIP_CONFIG");
- std::shared_ptr<Environment> env(new PaludisEnvironment(""));
+ std::shared_ptr<Environment> env(std::make_shared<PaludisEnvironment>(""));
const std::shared_ptr<const PackageID> one(*(*env)[selection::RequireExactlyOne(
generator::Matches(PackageDepSpec(parse_user_package_dep_spec("=cat-one/pkg-one-1",
@@ -186,7 +186,7 @@ namespace test_cases
setenv("PALUDIS_HOME", stringify(FSEntry::cwd() / "paludis_environment_TEST_dir" / "home4").c_str(), 1);
unsetenv("PALUDIS_SKIP_CONFIG");
- std::shared_ptr<Environment> env(new PaludisEnvironment(""));
+ std::shared_ptr<Environment> env(std::make_shared<PaludisEnvironment>(""));
TEST_CHECK(bool(env->package_database()->fetch_repository(RepositoryName("first"))));
TEST_CHECK(bool(env->package_database()->fetch_repository(RepositoryName("second"))));
diff --git a/paludis/environments/paludis/registration.cc b/paludis/environments/paludis/registration.cc
index cb2a256..70f045e 100644
--- a/paludis/environments/paludis/registration.cc
+++ b/paludis/environments/paludis/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
@@ -29,7 +29,7 @@ namespace
std::shared_ptr<Environment>
make_paludis_environment(const std::string & s)
{
- return std::shared_ptr<Environment>(new PaludisEnvironment(s));
+ return std::shared_ptr<Environment>(std::make_shared<PaludisEnvironment>(s));
}
}
@@ -44,7 +44,7 @@ namespace paludis
void register_environment<environment_groups::paludis>(const environment_groups::paludis * const,
EnvironmentFactory * const factory)
{
- std::shared_ptr<Set<std::string> > paludis_formats(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > paludis_formats(std::make_shared<Set<std::string>>());
paludis_formats->insert("paludis");
factory->add_environment_format(paludis_formats, &make_paludis_environment);
}
diff --git a/paludis/environments/paludis/use_conf.cc b/paludis/environments/paludis/use_conf.cc
index 120e188..e671272 100644
--- a/paludis/environments/paludis/use_conf.cc
+++ b/paludis/environments/paludis/use_conf.cc
@@ -40,7 +40,7 @@ namespace paludis
Imp(const PaludisEnvironment * const e) :
env(e),
- handler(new PaludisLikeOptionsConf(make_named_values<PaludisLikeOptionsConfParams>(
+ handler(std::make_shared<PaludisLikeOptionsConf>(make_named_values<PaludisLikeOptionsConfParams>(
n::allow_locking() = false,
n::environment() = e,
n::make_config_file() = &make_bashable_conf
diff --git a/paludis/environments/paludis/world.cc b/paludis/environments/paludis/world.cc
index ba6faec..3304a33 100644
--- a/paludis/environments/paludis/world.cc
+++ b/paludis/environments/paludis/world.cc
@@ -176,7 +176,7 @@ World::world_set() const
{
using namespace std::placeholders;
- std::shared_ptr<GeneralSetDepTag> tag(new GeneralSetDepTag(SetName("world"), "Environment"));
+ std::shared_ptr<GeneralSetDepTag> tag(std::make_shared<GeneralSetDepTag>(SetName("world"), "Environment"));
if (_imp->maybe_world_file)
{
diff --git a/paludis/environments/paludis/world_TEST.cc b/paludis/environments/paludis/world_TEST.cc
index d646fc3..45e7846 100644
--- a/paludis/environments/paludis/world_TEST.cc
+++ b/paludis/environments/paludis/world_TEST.cc
@@ -38,7 +38,7 @@ namespace test_cases
void run()
{
- std::shared_ptr<FSEntry> w(new FSEntry(FSEntry::cwd() / "world_TEST_dir" / "world"));
+ std::shared_ptr<FSEntry> w(std::make_shared<FSEntry>(FSEntry::cwd() / "world_TEST_dir" / "world"));
{
TestEnvironment env;
diff --git a/paludis/environments/portage/portage_environment.cc b/paludis/environments/portage/portage_environment.cc
index 3e3f4dc..b4678db 100644
--- a/paludis/environments/portage/portage_environment.cc
+++ b/paludis/environments/portage/portage_environment.cc
@@ -117,12 +117,12 @@ namespace paludis
ignore_all_breaks_portage(false),
done_hooks(false),
overlay_importance(10),
- package_database(new PackageDatabase(e)),
+ package_database(std::make_shared<PackageDatabase>(e)),
world_file(s + "/var/lib/portage/world"),
- format_key(new LiteralMetadataValueKey<std::string>("format", "Format", mkt_significant, "portage")),
- config_location_key(new LiteralMetadataValueKey<FSEntry>("conf_dir", "Config dir", mkt_normal,
+ format_key(std::make_shared<LiteralMetadataValueKey<std::string>>("format", "Format", mkt_significant, "portage")),
+ config_location_key(std::make_shared<LiteralMetadataValueKey<FSEntry>>("conf_dir", "Config dir", mkt_normal,
conf_dir)),
- world_file_key(new LiteralMetadataValueKey<FSEntry>("world_file", "World file", mkt_normal,
+ world_file_key(std::make_shared<LiteralMetadataValueKey<FSEntry>>("world_file", "World file", mkt_normal,
world_file))
{
}
@@ -372,7 +372,7 @@ PortageEnvironment::_load_atom_file(const FSEntry & f, I_ i, const std::string &
if (tokens.empty())
continue;
- std::shared_ptr<PackageDepSpec> p(new PackageDepSpec(parse_user_package_dep_spec(
+ std::shared_ptr<PackageDepSpec> p(std::make_shared<PackageDepSpec>(parse_user_package_dep_spec(
tokens.at(0), this, UserPackageDepSpecOptions() + updso_no_disambiguation)));
if (reject_additional && p->additional_requirements_ptr())
{
@@ -418,7 +418,7 @@ PortageEnvironment::_load_lined_file(const FSEntry & f, I_ i)
LineConfigFile file(f, LineConfigFileOptions() + lcfo_disallow_continuations);
for (LineConfigFile::ConstIterator line(file.begin()), line_end(file.end()) ;
line != line_end ; ++line)
- *i++ = std::shared_ptr<PackageDepSpec>(new PackageDepSpec(
+ *i++ = std::shared_ptr<PackageDepSpec>(std::make_shared<PackageDepSpec>(
parse_user_package_dep_spec(strip_trailing(strip_leading(*line, " \t"), " \t"),
this, UserPackageDepSpecOptions() + updso_no_disambiguation)));
}
@@ -451,7 +451,7 @@ void
PortageEnvironment::_add_virtuals_repository()
{
#ifdef ENABLE_VIRTUALS_REPOSITORY
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "virtuals");
package_database()->add_repository(-2,
RepositoryFactory::get_instance()->create(this, std::bind(from_keys, keys, std::placeholders::_1)));
@@ -462,7 +462,7 @@ void
PortageEnvironment::_add_installed_virtuals_repository()
{
#ifdef ENABLE_VIRTUALS_REPOSITORY
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("root", stringify(root()));
keys->insert("format", "installed_virtuals");
package_database()->add_repository(-1,
@@ -481,7 +481,7 @@ void
PortageEnvironment::_add_ebuild_repository(const FSEntry & portdir, const std::string & master,
const std::string & sync, int importance)
{
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("root", stringify(root()));
keys->insert("location", stringify(portdir));
keys->insert("profiles", stringify((_imp->conf_dir / "make.profile").realpath()) + " " +
@@ -513,7 +513,7 @@ PortageEnvironment::_add_vdb_repository()
{
Context context("When creating vdb repository:");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("root", stringify(root()));
keys->insert("location", stringify(root() / "/var/db/pkg"));
keys->insert("format", "vdb");
@@ -679,7 +679,7 @@ PortageEnvironment::known_choice_value_names(const std::shared_ptr<const Package
{
Context context("When loading known use expand names for prefix '" + stringify(choice->prefix()) + ":");
- std::shared_ptr<Set<UnprefixedChoiceName> > result(new Set<UnprefixedChoiceName>);
+ std::shared_ptr<Set<UnprefixedChoiceName> > result(std::make_shared<Set<UnprefixedChoiceName>>());
std::string prefix_lower(stringify(choice->prefix()) + "_");
std::pair<std::multimap<ChoicePrefixName, std::string>::const_iterator,
@@ -724,7 +724,7 @@ PortageEnvironment::hook_dirs() const
{
Lock l(_imp->hook_mutex);
_imp->need_hook_dirs();
- std::shared_ptr<FSEntrySequence> result(new FSEntrySequence);
+ std::shared_ptr<FSEntrySequence> result(std::make_shared<FSEntrySequence>());
std::copy(_imp->hook_dirs.begin(), _imp->hook_dirs.end(), result->back_inserter());
return result;
}
@@ -732,7 +732,7 @@ PortageEnvironment::hook_dirs() const
std::shared_ptr<const FSEntrySequence>
PortageEnvironment::bashrc_files() const
{
- std::shared_ptr<FSEntrySequence> result(new FSEntrySequence);
+ std::shared_ptr<FSEntrySequence> result(std::make_shared<FSEntrySequence>());
if (! getenv_with_default("PALUDIS_PORTAGE_BASHRC", "").empty())
result->push_back(FSEntry(getenv_with_default("PALUDIS_PORTAGE_BASHRC", "")).realpath());
else
@@ -759,7 +759,7 @@ PortageEnvironment::mirrors(const std::string & m) const
{
std::pair<std::multimap<std::string, std::string>::const_iterator, std::multimap<std::string, std::string>::const_iterator>
p(_imp->mirrors.equal_range(m));
- std::shared_ptr<MirrorsSequence> result(new MirrorsSequence);
+ std::shared_ptr<MirrorsSequence> result(std::make_shared<MirrorsSequence>());
std::transform(p.first, p.second, result->back_inserter(),
std::mem_fn(&std::pair<const std::string, std::string>::second));
return result;
@@ -1003,7 +1003,7 @@ namespace
return std::make_shared<SetSpecTree>(std::make_shared<AllDepSpec>());
}
- const std::shared_ptr<GeneralSetDepTag> tag(new GeneralSetDepTag(SetName("world::environment"), "Environment"));
+ const std::shared_ptr<GeneralSetDepTag> tag(std::make_shared<GeneralSetDepTag>(SetName("world::environment"), "Environment"));
SetFile world(make_named_values<SetFileParams>(
n::environment() = env,
n::file_name() = f,
diff --git a/paludis/environments/portage/portage_environment_TEST.cc b/paludis/environments/portage/portage_environment_TEST.cc
index ebe5816..c4ad45f 100644
--- a/paludis/environments/portage/portage_environment_TEST.cc
+++ b/paludis/environments/portage/portage_environment_TEST.cc
@@ -58,7 +58,7 @@ namespace
bool accept_keyword(const TestPortageEnvironment & env,
const KeywordName & k, const PackageID & e)
{
- std::shared_ptr<KeywordNameSet> kk(new KeywordNameSet);
+ std::shared_ptr<KeywordNameSet> kk(std::make_shared<KeywordNameSet>());
kk->insert(k);
return env.accept_keywords(kk, e);
}
@@ -176,7 +176,7 @@ namespace test_cases
generator::Matches(PackageDepSpec(parse_user_package_dep_spec("=cat-one/pkg-four-1",
&env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->begin());
TEST_CHECK(accept_keyword(env, KeywordName("fred"), *id4));
- std::shared_ptr<const KeywordNameSet> empty(new KeywordNameSet);
+ std::shared_ptr<const KeywordNameSet> empty(std::make_shared<KeywordNameSet>());
TEST_CHECK(env.accept_keywords(empty, *id4));
const std::shared_ptr<const PackageID> id5(*env[selection::RequireExactlyOne(
diff --git a/paludis/environments/portage/registration.cc b/paludis/environments/portage/registration.cc
index 0764143..bb606f1 100644
--- a/paludis/environments/portage/registration.cc
+++ b/paludis/environments/portage/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
@@ -29,7 +29,7 @@ namespace
std::shared_ptr<Environment>
make_portage_environment(const std::string & s)
{
- return std::shared_ptr<Environment>(new PortageEnvironment(s));
+ return std::shared_ptr<Environment>(std::make_shared<PortageEnvironment>(s));
}
}
@@ -44,7 +44,7 @@ namespace paludis
void register_environment<environment_groups::portage>(const environment_groups::portage * const,
EnvironmentFactory * const factory)
{
- std::shared_ptr<Set<std::string> > portage_formats(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > portage_formats(std::make_shared<Set<std::string>>());
portage_formats->insert("portage");
factory->add_environment_format(portage_formats, &make_portage_environment);
}
diff --git a/paludis/environments/test/test_environment.cc b/paludis/environments/test/test_environment.cc
index 521a911..da4ee72 100644
--- a/paludis/environments/test/test_environment.cc
+++ b/paludis/environments/test/test_environment.cc
@@ -55,7 +55,7 @@ namespace paludis
Sets sets;
Imp(Environment * const e, const FSEntry & r) :
- package_database(new PackageDatabase(e)),
+ package_database(std::make_shared<PackageDatabase>(e)),
paludis_command(""),
root(r)
{
@@ -150,7 +150,7 @@ TestEnvironment::root() const
std::shared_ptr<const MirrorsSequence>
TestEnvironment::mirrors(const std::string & s) const
{
- std::shared_ptr<MirrorsSequence> result(new MirrorsSequence);
+ std::shared_ptr<MirrorsSequence> result(std::make_shared<MirrorsSequence>());
if (s == "example")
{
diff --git a/paludis/file_output_manager.cc b/paludis/file_output_manager.cc
index 40a54d6..e7b965b 100644
--- a/paludis/file_output_manager.cc
+++ b/paludis/file_output_manager.cc
@@ -50,7 +50,7 @@ namespace paludis
const std::string & s
) :
filename(o),
- stream(new SafeOFStream(filename)),
+ stream(std::make_shared<SafeOFStream>(filename)),
keep_on_success(k),
keep_on_empty(l),
summary_output_manager(m),
@@ -148,7 +148,7 @@ FileOutputManager::nothing_more_to_come()
const std::shared_ptr<const Set<std::string> >
FileOutputManager::factory_managers()
{
- std::shared_ptr<Set<std::string> > result(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > result(std::make_shared<Set<std::string>>());
result->insert("file");
return result;
}
diff --git a/paludis/filter.cc b/paludis/filter.cc
index 8eb9b56..1ef209f 100644
--- a/paludis/filter.cc
+++ b/paludis/filter.cc
@@ -131,7 +131,7 @@ namespace
const Environment * const env,
const std::shared_ptr<const RepositoryNameSet> & repos) const
{
- std::shared_ptr<RepositoryNameSet> result(new RepositoryNameSet);
+ std::shared_ptr<RepositoryNameSet> result(std::make_shared<RepositoryNameSet>());
for (RepositoryNameSet::ConstIterator r(repos->begin()), r_end(repos->end()) ;
r != r_end ; ++r)
@@ -147,7 +147,7 @@ namespace
const Environment * const,
const std::shared_ptr<const PackageIDSet> & id) const
{
- std::shared_ptr<PackageIDSet> result(new PackageIDSet);
+ std::shared_ptr<PackageIDSet> result(std::make_shared<PackageIDSet>());
for (PackageIDSet::ConstIterator i(id->begin()), i_end(id->end()) ;
i != i_end ; ++i)
@@ -172,7 +172,7 @@ namespace
const Environment * const env,
const std::shared_ptr<const RepositoryNameSet> & repos) const
{
- std::shared_ptr<RepositoryNameSet> result(new RepositoryNameSet);
+ std::shared_ptr<RepositoryNameSet> result(std::make_shared<RepositoryNameSet>());
for (RepositoryNameSet::ConstIterator r(repos->begin()), r_end(repos->end()) ;
r != r_end ; ++r)
@@ -188,7 +188,7 @@ namespace
const Environment * const,
const std::shared_ptr<const PackageIDSet> & id) const
{
- std::shared_ptr<PackageIDSet> result(new PackageIDSet);
+ std::shared_ptr<PackageIDSet> result(std::make_shared<PackageIDSet>());
for (PackageIDSet::ConstIterator i(id->begin()), i_end(id->end()) ;
i != i_end ; ++i)
@@ -218,7 +218,7 @@ namespace
const Environment * const env,
const std::shared_ptr<const RepositoryNameSet> & repos) const
{
- std::shared_ptr<RepositoryNameSet> result(new RepositoryNameSet);
+ std::shared_ptr<RepositoryNameSet> result(std::make_shared<RepositoryNameSet>());
for (RepositoryNameSet::ConstIterator r(repos->begin()), r_end(repos->end()) ;
r != r_end ; ++r)
@@ -234,7 +234,7 @@ namespace
const Environment * const,
const std::shared_ptr<const PackageIDSet> & id) const
{
- std::shared_ptr<PackageIDSet> result(new PackageIDSet);
+ std::shared_ptr<PackageIDSet> result(std::make_shared<PackageIDSet>());
for (PackageIDSet::ConstIterator i(id->begin()), i_end(id->end()) ;
i != i_end ; ++i)
@@ -311,7 +311,7 @@ namespace
const Environment * const,
const std::shared_ptr<const PackageIDSet> & id) const
{
- std::shared_ptr<PackageIDSet> result(new PackageIDSet);
+ std::shared_ptr<PackageIDSet> result(std::make_shared<PackageIDSet>());
for (PackageIDSet::ConstIterator i(id->begin()), i_end(id->end()) ;
i != i_end ; ++i)
@@ -349,7 +349,7 @@ namespace
const Environment * const,
const std::shared_ptr<const PackageIDSet> & id) const
{
- std::shared_ptr<PackageIDSet> result(new PackageIDSet);
+ std::shared_ptr<PackageIDSet> result(std::make_shared<PackageIDSet>());
for (PackageIDSet::ConstIterator i(id->begin()), i_end(id->end()) ;
i != i_end ; ++i)
@@ -372,7 +372,7 @@ namespace
const Environment * const,
const std::shared_ptr<const PackageIDSet> & id) const
{
- std::shared_ptr<PackageIDSet> result(new PackageIDSet);
+ std::shared_ptr<PackageIDSet> result(std::make_shared<PackageIDSet>());
for (PackageIDSet::ConstIterator i(id->begin()), i_end(id->end()) ;
i != i_end ; ++i)
@@ -404,7 +404,7 @@ namespace
const Environment * const env,
const std::shared_ptr<const PackageIDSet> & id) const
{
- std::shared_ptr<PackageIDSet> result(new PackageIDSet);
+ std::shared_ptr<PackageIDSet> result(std::make_shared<PackageIDSet>());
for (PackageIDSet::ConstIterator i(id->begin()), i_end(id->end()) ;
i != i_end ; ++i)
diff --git a/paludis/filter_TEST.cc b/paludis/filter_TEST.cc
index df9f3ab..099005d 100644
--- a/paludis/filter_TEST.cc
+++ b/paludis/filter_TEST.cc
@@ -54,15 +54,15 @@ namespace test_cases
FilterTestCaseBase(const std::string & s, const Filter & f) :
TestCase("filter " + s + " with " + stringify(f)),
filter(f),
- repo1(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ repo1(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo1")
))),
- repo2(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ repo2(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo2")
))),
- inst_repo1(new FakeInstalledRepository(
+ inst_repo1(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("inst_repo1"),
diff --git a/paludis/find_unused_packages_task.cc b/paludis/find_unused_packages_task.cc
index cae431f..173dd16 100644
--- a/paludis/find_unused_packages_task.cc
+++ b/paludis/find_unused_packages_task.cc
@@ -54,7 +54,7 @@ FindUnusedPackagesTask::~FindUnusedPackagesTask()
std::shared_ptr<const PackageIDSequence>
FindUnusedPackagesTask::execute(const QualifiedPackageName & package)
{
- std::shared_ptr<PackageIDSequence> result(new PackageIDSequence);
+ std::shared_ptr<PackageIDSequence> result(std::make_shared<PackageIDSequence>());
std::shared_ptr<const PackageIDSequence> packages((*_env)[selection::AllVersionsGroupedBySlot(
generator::InRepository(_repo->name()) &
generator::Package(package)
diff --git a/paludis/format_messages_output_manager.cc b/paludis/format_messages_output_manager.cc
index 775b190..54ae949 100644
--- a/paludis/format_messages_output_manager.cc
+++ b/paludis/format_messages_output_manager.cc
@@ -152,7 +152,7 @@ FormatMessagesOutputManager::nothing_more_to_come()
const std::shared_ptr<const Set<std::string> >
FormatMessagesOutputManager::factory_managers()
{
- std::shared_ptr<Set<std::string> > result(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > result(std::make_shared<Set<std::string>>());
result->insert("format_messages");
return result;
}
@@ -164,7 +164,7 @@ namespace
const std::string & f,
const std::string & s)
{
- std::shared_ptr<Map<std::string, std::string> > m(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > m(std::make_shared<Map<std::string, std::string>>());
m->insert("message", s);
return r(f, m);
}
diff --git a/paludis/forward_at_finish_output_manager.cc b/paludis/forward_at_finish_output_manager.cc
index 57eb81b..823eefb 100644
--- a/paludis/forward_at_finish_output_manager.cc
+++ b/paludis/forward_at_finish_output_manager.cc
@@ -128,7 +128,7 @@ ForwardAtFinishOutputManager::nothing_more_to_come()
const std::shared_ptr<const Set<std::string> >
ForwardAtFinishOutputManager::factory_managers()
{
- std::shared_ptr<Set<std::string> > result(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > result(std::make_shared<Set<std::string>>());
result->insert("forward_at_finish");
return result;
}
diff --git a/paludis/fuzzy_finder.cc b/paludis/fuzzy_finder.cc
index c28fe6e..848e34a 100644
--- a/paludis/fuzzy_finder.cc
+++ b/paludis/fuzzy_finder.cc
@@ -93,7 +93,7 @@ namespace
const std::shared_ptr<const RepositoryNameSet> &,
const std::shared_ptr<const QualifiedPackageNameSet> & pkgs) const
{
- std::shared_ptr<QualifiedPackageNameSet> result(new QualifiedPackageNameSet);
+ std::shared_ptr<QualifiedPackageNameSet> result(std::make_shared<QualifiedPackageNameSet>());
for (QualifiedPackageNameSet::ConstIterator p(pkgs->begin()),
p_end(pkgs->end()); p_end != p; ++p)
diff --git a/paludis/fuzzy_finder_TEST.cc b/paludis/fuzzy_finder_TEST.cc
index a3577d3..c282091 100644
--- a/paludis/fuzzy_finder_TEST.cc
+++ b/paludis/fuzzy_finder_TEST.cc
@@ -42,7 +42,7 @@ namespace test_cases
{
TestEnvironment e;
- const std::shared_ptr<FakeRepository> r1(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> r1(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &e,
n::name() = RepositoryName("r1")
)));
@@ -52,7 +52,7 @@ namespace test_cases
r1->add_version("some-cat", "one-two-three", "1");
e.package_database()->add_repository(1, r1);
- const std::shared_ptr<FakeRepository> r2(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> r2(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &e,
n::name() = RepositoryName("r2")
)));
@@ -88,19 +88,19 @@ namespace test_cases
TestEnvironment e;
PackageDatabase & p(*e.package_database());
- p.add_repository(1, std::shared_ptr<FakeRepository>(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ p.add_repository(1, std::shared_ptr<FakeRepository>(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &e,
n::name() = RepositoryName("my-main-repository")))));
- p.add_repository(1, std::shared_ptr<FakeRepository>(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ p.add_repository(1, std::shared_ptr<FakeRepository>(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &e,
n::name() = RepositoryName("x-new-repository")))));
- p.add_repository(1, std::shared_ptr<FakeRepository>(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ p.add_repository(1, std::shared_ptr<FakeRepository>(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &e,
n::name() = RepositoryName("bar-overlay")))));
- p.add_repository(1, std::shared_ptr<FakeRepository>(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ p.add_repository(1, std::shared_ptr<FakeRepository>(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &e,
n::name() = RepositoryName("baz-overlay")))));
- p.add_repository(1, std::shared_ptr<FakeRepository>(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ p.add_repository(1, std::shared_ptr<FakeRepository>(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &e,
n::name() = RepositoryName("sunrise")))));
diff --git a/paludis/generator.cc b/paludis/generator.cc
index fc54ba3..e04c836 100644
--- a/paludis/generator.cc
+++ b/paludis/generator.cc
@@ -136,7 +136,7 @@ namespace
const Environment * const env) const
{
using namespace std::placeholders;
- std::shared_ptr<RepositoryNameSet> result(new RepositoryNameSet);
+ std::shared_ptr<RepositoryNameSet> result(std::make_shared<RepositoryNameSet>());
if (env->package_database()->has_repository_named(name))
result->insert(name);
return result;
@@ -163,7 +163,7 @@ namespace
const std::shared_ptr<const RepositoryNameSet> & repos,
const std::shared_ptr<const QualifiedPackageNameSet> & qpns) const
{
- std::shared_ptr<PackageIDSet> result(new PackageIDSet);
+ std::shared_ptr<PackageIDSet> result(std::make_shared<PackageIDSet>());
for (RepositoryNameSet::ConstIterator r(repos->begin()), r_end(repos->end()) ;
r != r_end ; ++r)
@@ -205,7 +205,7 @@ namespace
const std::shared_ptr<const RepositoryNameSet> & repos
) const
{
- std::shared_ptr<CategoryNamePartSet> result(new CategoryNamePartSet);
+ std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
for (RepositoryNameSet::ConstIterator r(repos->begin()), r_end(repos->end()) ;
r != r_end ; ++r)
@@ -239,7 +239,7 @@ namespace
const std::shared_ptr<const RepositoryNameSet> & repos
) const
{
- std::shared_ptr<CategoryNamePartSet> result(new CategoryNamePartSet);
+ std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
for (RepositoryNameSet::ConstIterator r(repos->begin()), r_end(repos->end()) ;
r != r_end ; ++r)
@@ -257,7 +257,7 @@ namespace
const std::shared_ptr<const RepositoryNameSet> & repos,
const std::shared_ptr<const CategoryNamePartSet> & cats) const
{
- std::shared_ptr<QualifiedPackageNameSet> result(new QualifiedPackageNameSet);
+ std::shared_ptr<QualifiedPackageNameSet> result(std::make_shared<QualifiedPackageNameSet>());
for (RepositoryNameSet::ConstIterator r(repos->begin()), r_end(repos->end()) ;
r != r_end ; ++r)
for (CategoryNamePartSet::ConstIterator c(cats->begin()), c_end(cats->end()) ;
@@ -305,7 +305,7 @@ namespace
)))
return AllGeneratorHandlerBase::repositories(env);
- std::shared_ptr<RepositoryNameSet> result(new RepositoryNameSet);
+ std::shared_ptr<RepositoryNameSet> result(std::make_shared<RepositoryNameSet>());
if (spec.in_repository_ptr())
{
@@ -353,7 +353,7 @@ namespace
{
if (spec.category_name_part_ptr())
{
- std::shared_ptr<CategoryNamePartSet> result(new CategoryNamePartSet);
+ std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
for (RepositoryNameSet::ConstIterator r(repos->begin()), r_end(repos->end()) ;
r != r_end ; ++r)
if (env->package_database()->fetch_repository(*r)->has_category_named(*spec.category_name_part_ptr()))
@@ -366,7 +366,7 @@ namespace
}
else if (spec.package_name_part_ptr())
{
- std::shared_ptr<CategoryNamePartSet> result(new CategoryNamePartSet);
+ std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
for (RepositoryNameSet::ConstIterator r(repos->begin()), r_end(repos->end()) ;
r != r_end ; ++r)
{
@@ -380,7 +380,7 @@ namespace
}
else if (spec.package_ptr())
{
- std::shared_ptr<CategoryNamePartSet> result(new CategoryNamePartSet);
+ std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
for (RepositoryNameSet::ConstIterator r(repos->begin()), r_end(repos->end()) ;
r != r_end ; ++r)
if (env->package_database()->fetch_repository(*r)->has_category_named(spec.package_ptr()->category()))
@@ -402,7 +402,7 @@ namespace
{
if (spec.package_name_part_ptr())
{
- std::shared_ptr<QualifiedPackageNameSet> result(new QualifiedPackageNameSet);
+ std::shared_ptr<QualifiedPackageNameSet> result(std::make_shared<QualifiedPackageNameSet>());
for (RepositoryNameSet::ConstIterator r(repos->begin()), r_end(repos->end()) ;
r != r_end ; ++r)
for (CategoryNamePartSet::ConstIterator c(cats->begin()), c_end(cats->end()) ;
@@ -414,7 +414,7 @@ namespace
}
else if (spec.package_ptr())
{
- std::shared_ptr<QualifiedPackageNameSet> result(new QualifiedPackageNameSet);
+ std::shared_ptr<QualifiedPackageNameSet> result(std::make_shared<QualifiedPackageNameSet>());
for (RepositoryNameSet::ConstIterator r(repos->begin()), r_end(repos->end()) ;
r != r_end ; ++r)
if (env->package_database()->fetch_repository(*r)->has_package_named(*spec.package_ptr()))
@@ -434,7 +434,7 @@ namespace
const std::shared_ptr<const RepositoryNameSet> & repos,
const std::shared_ptr<const QualifiedPackageNameSet> & qpns) const
{
- std::shared_ptr<PackageIDSet> result(new PackageIDSet);
+ std::shared_ptr<PackageIDSet> result(std::make_shared<PackageIDSet>());
for (RepositoryNameSet::ConstIterator r(repos->begin()), r_end(repos->end()) ;
r != r_end ; ++r)
@@ -486,7 +486,7 @@ namespace
if (r2->empty())
return r2;
- std::shared_ptr<RepositoryNameSet> result(new RepositoryNameSet);
+ std::shared_ptr<RepositoryNameSet> result(std::make_shared<RepositoryNameSet>());
std::set_intersection(
r1->begin(), r1->end(),
r2->begin(), r2->end(),
@@ -506,7 +506,7 @@ namespace
if (c2->empty())
return c2;
- std::shared_ptr<CategoryNamePartSet> result(new CategoryNamePartSet);
+ std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
std::set_intersection(
c1->begin(), c1->end(),
c2->begin(), c2->end(),
@@ -527,7 +527,7 @@ namespace
if (q2->empty())
return q2;
- std::shared_ptr<QualifiedPackageNameSet> result(new QualifiedPackageNameSet);
+ std::shared_ptr<QualifiedPackageNameSet> result(std::make_shared<QualifiedPackageNameSet>());
std::set_intersection(
q1->begin(), q1->end(),
q2->begin(), q2->end(),
@@ -548,7 +548,7 @@ namespace
if (i2->empty())
return i2;
- std::shared_ptr<PackageIDSet> result(new PackageIDSet);
+ std::shared_ptr<PackageIDSet> result(std::make_shared<PackageIDSet>());
std::set_intersection(
i1->begin(), i1->end(),
i2->begin(), i2->end(),
@@ -580,7 +580,7 @@ namespace
{
std::shared_ptr<const RepositoryNameSet> r1(g1.repositories(env));
std::shared_ptr<const RepositoryNameSet> r2(g2.repositories(env));
- std::shared_ptr<RepositoryNameSet> result(new RepositoryNameSet);
+ std::shared_ptr<RepositoryNameSet> result(std::make_shared<RepositoryNameSet>());
std::set_union(
r1->begin(), r1->end(),
r2->begin(), r2->end(),
@@ -594,7 +594,7 @@ namespace
{
std::shared_ptr<const CategoryNamePartSet> c1(g1.categories(env, repos));
std::shared_ptr<const CategoryNamePartSet> c2(g2.categories(env, repos));
- std::shared_ptr<CategoryNamePartSet> result(new CategoryNamePartSet);
+ std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
std::set_union(
c1->begin(), c1->end(),
c2->begin(), c2->end(),
@@ -609,7 +609,7 @@ namespace
{
std::shared_ptr<const QualifiedPackageNameSet> q1(g1.packages(env, repos, cats));
std::shared_ptr<const QualifiedPackageNameSet> q2(g2.packages(env, repos, cats));
- std::shared_ptr<QualifiedPackageNameSet> result(new QualifiedPackageNameSet);
+ std::shared_ptr<QualifiedPackageNameSet> result(std::make_shared<QualifiedPackageNameSet>());
std::set_union(
q1->begin(), q1->end(),
q2->begin(), q2->end(),
@@ -624,7 +624,7 @@ namespace
{
std::shared_ptr<const PackageIDSet> i1(g1.ids(env, repos, qpns));
std::shared_ptr<const PackageIDSet> i2(g2.ids(env, repos, qpns));
- std::shared_ptr<PackageIDSet> result(new PackageIDSet);
+ std::shared_ptr<PackageIDSet> result(std::make_shared<PackageIDSet>());
std::set_union(
i1->begin(), i1->end(),
i2->begin(), i2->end(),
@@ -655,7 +655,7 @@ namespace
virtual std::shared_ptr<const RepositoryNameSet> repositories(
const Environment * const env) const
{
- std::shared_ptr<RepositoryNameSet> result(new RepositoryNameSet);
+ std::shared_ptr<RepositoryNameSet> result(std::make_shared<RepositoryNameSet>());
for (PackageDatabase::RepositoryConstIterator i(env->package_database()->begin_repositories()),
i_end(env->package_database()->end_repositories()) ; i != i_end ; ++i)
if ((*i)->some_ids_might_support_action(SupportsActionTest<A_>()))
diff --git a/paludis/generator_TEST.cc b/paludis/generator_TEST.cc
index ad4314d..c8e602e 100644
--- a/paludis/generator_TEST.cc
+++ b/paludis/generator_TEST.cc
@@ -54,13 +54,13 @@ namespace test_cases
GeneratorTestCaseBase(const std::string & s, const Generator & f) :
TestCase("generator " + s + " with " + stringify(f)),
generator(f),
- repo1(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ repo1(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo1")))),
- repo2(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ repo2(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo2")))),
- inst_repo1(new FakeInstalledRepository(
+ inst_repo1(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("inst_repo1"),
diff --git a/paludis/generator_handler.cc b/paludis/generator_handler.cc
index a929c58..aeb5fd9 100644
--- a/paludis/generator_handler.cc
+++ b/paludis/generator_handler.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
@@ -39,7 +39,7 @@ AllGeneratorHandlerBase::repositories(
const Environment * const env) const
{
using namespace std::placeholders;
- std::shared_ptr<RepositoryNameSet> result(new RepositoryNameSet);
+ std::shared_ptr<RepositoryNameSet> result(std::make_shared<RepositoryNameSet>());
std::transform(env->package_database()->begin_repositories(), env->package_database()->end_repositories(),
result->inserter(), std::bind(&Repository::name, _1));
return result;
@@ -50,7 +50,7 @@ AllGeneratorHandlerBase::categories(
const Environment * const env,
const std::shared_ptr<const RepositoryNameSet> & repos) const
{
- std::shared_ptr<CategoryNamePartSet> result(new CategoryNamePartSet);
+ std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
for (RepositoryNameSet::ConstIterator r(repos->begin()), r_end(repos->end()) ;
r != r_end ; ++r)
@@ -68,7 +68,7 @@ AllGeneratorHandlerBase::packages(
const std::shared_ptr<const RepositoryNameSet> & repos,
const std::shared_ptr<const CategoryNamePartSet> & cats) const
{
- std::shared_ptr<QualifiedPackageNameSet> result(new QualifiedPackageNameSet);
+ std::shared_ptr<QualifiedPackageNameSet> result(std::make_shared<QualifiedPackageNameSet>());
for (RepositoryNameSet::ConstIterator r(repos->begin()), r_end(repos->end()) ;
r != r_end ; ++r)
@@ -91,7 +91,7 @@ AllGeneratorHandlerBase::ids(
const std::shared_ptr<const RepositoryNameSet> & repos,
const std::shared_ptr<const QualifiedPackageNameSet> & qpns) const
{
- std::shared_ptr<PackageIDSet> result(new PackageIDSet);
+ std::shared_ptr<PackageIDSet> result(std::make_shared<PackageIDSet>());
for (RepositoryNameSet::ConstIterator r(repos->begin()), r_end(repos->end()) ;
r != r_end ; ++r)
diff --git a/paludis/hooker.cc b/paludis/hooker.cc
index f753551..204aa3b 100644
--- a/paludis/hooker.cc
+++ b/paludis/hooker.cc
@@ -282,7 +282,7 @@ FancyHookFile::auto_hook_names() const
if (0 == exit_status)
{
- std::shared_ptr<Sequence<std::string> > result(new Sequence<std::string>);
+ std::shared_ptr<Sequence<std::string> > result(std::make_shared<Sequence<std::string>>());
tokenise_whitespace(output, result->back_inserter());
Log::get_instance()->message("hook.fancy.success", ll_debug, lc_no_context) << "Hook '" << file_name()
<< "' returned success '" << exit_status << "' for auto hook names, result ("
@@ -576,21 +576,21 @@ Hooker::_find_hooks(const Hook & hook) const
if (is_file_with_extension(*e, ".bash", IsFileWithOptions()))
if (! hook_files.insert(std::make_pair(strip_trailing_string(e->basename(), ".bash"),
- std::shared_ptr<HookFile>(new BashHookFile(*e, d->second, _imp->env)))).second)
+ std::shared_ptr<HookFile>(std::make_shared<BashHookFile>(*e, d->second, _imp->env)))).second)
Log::get_instance()->message("hook.discarding", ll_warning, lc_context) << "Discarding hook file '" << *e
<< "' because of naming conflict with '" <<
hook_files.find(stringify(strip_trailing_string(e->basename(), ".bash")))->second->file_name() << "'";
if (is_file_with_extension(*e, ".hook", IsFileWithOptions()))
if (! hook_files.insert(std::make_pair(strip_trailing_string(e->basename(), ".hook"),
- std::shared_ptr<HookFile>(new FancyHookFile(*e, d->second, _imp->env)))).second)
+ std::shared_ptr<HookFile>(std::make_shared<FancyHookFile>(*e, d->second, _imp->env)))).second)
Log::get_instance()->message("hook.discarding", ll_warning, lc_context) << "Discarding hook file '" << *e
<< "' because of naming conflict with '" <<
hook_files.find(stringify(strip_trailing_string(e->basename(), ".hook")))->second->file_name() << "'";
if (is_file_with_extension(*e, so_suffix, IsFileWithOptions()))
if (! hook_files.insert(std::make_pair(strip_trailing_string(e->basename(), so_suffix),
- std::shared_ptr<HookFile>(new SoHookFile(*e, d->second, _imp->env)))).second)
+ std::shared_ptr<HookFile>(std::make_shared<SoHookFile>(*e, d->second, _imp->env)))).second)
Log::get_instance()->message("hook.discarding", ll_warning, lc_context) << "Discarding hook file '" << *e
<< "' because of naming conflict with '" <<
hook_files.find(stringify(strip_trailing_string(e->basename(), so_suffix)))->second->file_name() << "'";
@@ -691,7 +691,7 @@ Hooker::_find_hooks(const Hook & hook) const
}
}
- std::shared_ptr<Sequence<std::shared_ptr<HookFile> > > result(new Sequence<std::shared_ptr<HookFile> >);
+ std::shared_ptr<Sequence<std::shared_ptr<HookFile> > > result(std::make_shared<Sequence<std::shared_ptr<HookFile> >>());
for (std::list<std::string>::const_iterator o(ordered.begin()), o_end(ordered.end()) ;
o != o_end ; ++o)
result->push_back(hook_files.find(*o)->second);
diff --git a/paludis/install_task.cc b/paludis/install_task.cc
index f4af427..606b65f 100644
--- a/paludis/install_task.cc
+++ b/paludis/install_task.cc
@@ -152,7 +152,7 @@ namespace paludis
std::shared_ptr<const DestinationsSet> d) :
env(e),
dep_list(e, o),
- targets(new SetSpecTree(std::make_shared<AllDepSpec>())),
+ targets(std::make_shared<SetSpecTree>(std::make_shared<AllDepSpec>())),
destinations(d),
pretend(false),
fetch_only(false),
@@ -162,9 +162,9 @@ namespace paludis
had_package_targets(false),
override_target_type(false),
continue_on_failure(itcof_if_fetch_only),
- abort_at_phases(new Set<std::string>),
- skip_phases(new Set<std::string>),
- skip_until_phases(new Set<std::string>),
+ abort_at_phases(std::make_shared<Set<std::string>>()),
+ skip_phases(std::make_shared<Set<std::string>>()),
+ skip_until_phases(std::make_shared<Set<std::string>>()),
phase_options_apply_to_first(false),
phase_options_apply_to_last(false),
phase_options_apply_to_all(false),
@@ -466,7 +466,7 @@ InstallTask::_add_target(const std::string & target)
try
{
- std::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(parse_user_package_dep_spec(target,
+ std::shared_ptr<PackageDepSpec> spec(std::make_shared<PackageDepSpec>(parse_user_package_dep_spec(target,
_imp->env, UserPackageDepSpecOptions() + updso_throw_if_set + updso_allow_wildcards,
filter::SupportsAction<InstallAction>())));
@@ -496,7 +496,7 @@ InstallTask::_add_target(const std::string & target)
if (spec->package_ptr())
{
/* no wildcards */
- spec->set_tag(std::shared_ptr<const DepTag>(new TargetDepTag));
+ spec->set_tag(std::shared_ptr<const DepTag>(std::make_shared<TargetDepTag>()));
_imp->targets->root()->append(spec);
}
else
@@ -507,7 +507,7 @@ InstallTask::_add_target(const std::string & target)
if (names->empty())
{
/* no match. we'll get an error from this later anyway. */
- spec->set_tag(std::shared_ptr<const DepTag>(new TargetDepTag));
+ spec->set_tag(std::shared_ptr<const DepTag>(std::make_shared<TargetDepTag>()));
_imp->targets->root()->append(spec);
}
else
@@ -516,8 +516,8 @@ InstallTask::_add_target(const std::string & target)
{
PartiallyMadePackageDepSpec p(*spec);
p.package((*i)->name());
- std::shared_ptr<PackageDepSpec> specn(new PackageDepSpec(p));
- specn->set_tag(std::shared_ptr<const DepTag>(new TargetDepTag));
+ std::shared_ptr<PackageDepSpec> specn(std::make_shared<PackageDepSpec>(p));
+ specn->set_tag(std::shared_ptr<const DepTag>(std::make_shared<TargetDepTag>()));
_imp->targets->root()->append(specn);
}
}
@@ -566,7 +566,7 @@ InstallTask::_add_package_id(const std::shared_ptr<const PackageID> & target)
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));
+ spec->set_tag(std::shared_ptr<const DepTag>(std::make_shared<TargetDepTag>()));
_imp->targets->root()->append(spec);
_imp->raw_targets.push_back(stringify(*spec));
@@ -1165,7 +1165,7 @@ InstallTask::_do_world_updates()
"() \t\r\n"));
}
- std::shared_ptr<SetSpecTree> all(new SetSpecTree(std::make_shared<AllDepSpec>()));
+ std::shared_ptr<SetSpecTree> all(std::make_shared<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())))
@@ -1805,7 +1805,7 @@ InstallTask::_dependent(const DepListEntry & e) const
{
Context context("When checking whether dependencies for '" + stringify(*e.package_id()) + "' are independent of failed packages:");
- std::shared_ptr<PackageIDSet> already_checked(new PackageIDSet);
+ std::shared_ptr<PackageIDSet> already_checked(std::make_shared<PackageIDSet>());
CheckIndependentVisitor v(environment(), _imp->dep_list, e.package_id(), already_checked);
already_checked->insert(e.package_id());
diff --git a/paludis/ipc_output_manager.cc b/paludis/ipc_output_manager.cc
index 494d7a4..6a55a64 100644
--- a/paludis/ipc_output_manager.cc
+++ b/paludis/ipc_output_manager.cc
@@ -62,7 +62,7 @@ namespace paludis
std::shared_ptr<SafeOFStream> pipe_command_write_stream;
Imp(int r, int w) :
- pipe_command_write_stream(new SafeOFStream(w))
+ pipe_command_write_stream(std::make_shared<SafeOFStream>(w))
{
*pipe_command_write_stream << "PING 1 GOAT" << '\0' << std::flush;
diff --git a/paludis/ndbam.cc b/paludis/ndbam.cc
index 87cc2b6..5583e51 100644
--- a/paludis/ndbam.cc
+++ b/paludis/ndbam.cc
@@ -230,7 +230,7 @@ NDBAM::has_category_named(const CategoryNamePart & c)
{
if (FSEntry(_imp->location / "indices" / "categories" / stringify(c)).is_directory_or_symlink_to_directory())
{
- _imp->category_contents_map.insert(std::make_pair(c, new CategoryContents));
+ _imp->category_contents_map.insert(std::make_pair(c, std::make_shared<CategoryContents>()));
return true;
}
_imp->category_contents_map.insert(std::make_pair(c, std::shared_ptr<CategoryContents>()));
@@ -427,7 +427,7 @@ NDBAM::remove_entry(const QualifiedPackageName & q, const FSEntry & d)
if (pc.entries)
{
- std::shared_ptr<NDBAMEntrySequence> new_entries(new NDBAMEntrySequence);
+ std::shared_ptr<NDBAMEntrySequence> new_entries(std::make_shared<NDBAMEntrySequence>());
std::remove_copy_if(pc.entries->begin(), pc.entries->end(), new_entries->back_inserter(), FSLocationIs(d));
pc.entries = new_entries;
}
diff --git a/paludis/override_functions.cc b/paludis/override_functions.cc
index 4a85e01..57b227f 100644
--- a/paludis/override_functions.cc
+++ b/paludis/override_functions.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
@@ -44,7 +44,7 @@ paludis::override_tilde_keywords(const Environment * const e, const PackageID &
if (! k)
return false;
- std::shared_ptr<KeywordNameSet> kk(new KeywordNameSet);
+ std::shared_ptr<KeywordNameSet> kk(std::make_shared<KeywordNameSet>());
for (KeywordNameSet::ConstIterator i(k->value()->begin()), i_end(k->value()->end()) ;
i != i_end ; ++i)
{
@@ -69,7 +69,7 @@ paludis::override_unkeyworded(const Environment * const e, const PackageID & id,
if (! k)
return false;
- std::shared_ptr<KeywordNameSet> kk(new KeywordNameSet);
+ std::shared_ptr<KeywordNameSet> kk(std::make_shared<KeywordNameSet>());
for (KeywordNameSet::ConstIterator i(k->value()->begin()), i_end(k->value()->end()) ;
i != i_end ; ++i)
if ('-' == stringify(*i).at(0))
diff --git a/paludis/package_database_TEST.cc b/paludis/package_database_TEST.cc
index 206a0fb..84b012b 100644
--- a/paludis/package_database_TEST.cc
+++ b/paludis/package_database_TEST.cc
@@ -52,11 +52,11 @@ namespace test_cases
TestEnvironment e;
PackageDatabase & p(*e.package_database());
- const std::shared_ptr<FakeRepository> r1(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> r1(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &e,
n::name() = RepositoryName("repo1")
)));
- const std::shared_ptr<FakeRepository> r2(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> r2(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &e,
n::name() = RepositoryName("repo2")
)));
@@ -114,7 +114,7 @@ namespace test_cases
std::shared_ptr<const CategoryNamePartSet> unimportant_category_names() const
{
- std::shared_ptr<CategoryNamePartSet> result(new CategoryNamePartSet);
+ std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
result->insert(CategoryNamePart("bad-cat1"));
result->insert(CategoryNamePart("bad-cat2"));
return result;
@@ -126,7 +126,7 @@ namespace test_cases
TestEnvironment e;
PackageDatabase & p(*e.package_database());
- std::shared_ptr<FakeRepository> r1(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ std::shared_ptr<FakeRepository> r1(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &e,
n::name() = RepositoryName("repo1"))));
r1->add_version(CategoryNamePart("cat-one") + PackageNamePart("pkg-one"), VersionSpec("0", VersionSpecOptions()));
@@ -136,7 +136,7 @@ namespace test_cases
p.add_repository(10, r1);
TEST_CHECK(true);
- std::shared_ptr<FakeRepository> r2(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ std::shared_ptr<FakeRepository> r2(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &e,
n::name() = RepositoryName("repo2"))));
r2->add_version(CategoryNamePart("cat-three") + PackageNamePart("pkg-three"), VersionSpec("0", VersionSpecOptions()));
@@ -144,7 +144,7 @@ namespace test_cases
p.add_repository(10, r2);
TEST_CHECK(true);
- std::shared_ptr<FakeRepository> r3(new CoolFakeRepository(&e, RepositoryName("repo3")));
+ std::shared_ptr<FakeRepository> r3(std::make_shared<CoolFakeRepository>(&e, RepositoryName("repo3")));
r3->add_version(CategoryNamePart("bad-cat1") + PackageNamePart("pkg-important"), VersionSpec("0", VersionSpecOptions()));
r3->add_version(CategoryNamePart("good-cat1") + PackageNamePart("pkg-important"), VersionSpec("0", VersionSpecOptions()));
@@ -167,7 +167,7 @@ namespace test_cases
p.add_repository(10, r3);
TEST_CHECK(true);
- std::shared_ptr<FakeInstalledRepository> r4(new FakeInstalledRepository(
+ std::shared_ptr<FakeInstalledRepository> r4(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
n::environment() = &e,
n::name() = RepositoryName("repo4"),
diff --git a/paludis/paludislike_options_conf.cc b/paludis/paludislike_options_conf.cc
index 0c23f36..dc70fd6 100644
--- a/paludis/paludislike_options_conf.cc
+++ b/paludis/paludislike_options_conf.cc
@@ -195,7 +195,7 @@ PaludisLikeOptionsConf::add_file(const FSEntry & f)
ValuesGroups * values_groups(0);
try
{
- std::shared_ptr<PackageDepSpec> d(new PackageDepSpec(parse_user_package_dep_spec(
+ std::shared_ptr<PackageDepSpec> d(std::make_shared<PackageDepSpec>(parse_user_package_dep_spec(
tokens.at(0), _imp->params.environment(),
UserPackageDepSpecOptions() + updso_allow_wildcards + updso_no_disambiguation + updso_throw_if_set)));
@@ -590,7 +590,7 @@ PaludisLikeOptionsConf::known_choice_value_names(
const ChoicePrefixName & prefix
) const
{
- const std::shared_ptr<Set<UnprefixedChoiceName> > result(new Set<UnprefixedChoiceName>);
+ const std::shared_ptr<Set<UnprefixedChoiceName> > result(std::make_shared<Set<UnprefixedChoiceName>>());
/* Any specific matches? */
if (maybe_id)
diff --git a/paludis/python_hooks.cc b/paludis/python_hooks.cc
index 8f98ea4..328671b 100644
--- a/paludis/python_hooks.cc
+++ b/paludis/python_hooks.cc
@@ -440,5 +440,5 @@ PyHookFile::_get_traceback() const
std::shared_ptr<HookFile>
create_py_hook_file(const FSEntry & f, const bool b, const Environment * const e)
{
- return std::shared_ptr<HookFile>(new PyHookFile(f, b, e));
+ return std::shared_ptr<HookFile>(std::make_shared<PyHookFile>(f, b, e));
}
diff --git a/paludis/range_rewriter.cc b/paludis/range_rewriter.cc
index 3965e52..8266ffc 100644
--- a/paludis/range_rewriter.cc
+++ b/paludis/range_rewriter.cc
@@ -145,8 +145,8 @@ namespace
}
RangeRewrittenPackageDepSpecData(const PackageDepSpec & spec) :
- package(new QualifiedPackageName(*spec.package_ptr())),
- version_requirements(new VersionRequirements),
+ package(std::make_shared<QualifiedPackageName>(*spec.package_ptr())),
+ version_requirements(std::make_shared<VersionRequirements>()),
version_requirements_mode_v(vr_or)
{
strings.push_back(stringify(spec));
@@ -308,6 +308,6 @@ RangeRewriter::spec() const
if (_imp->invalid || ! _imp->spec_data)
return std::shared_ptr<PackageDepSpec>();
- return std::shared_ptr<PackageDepSpec>(new PackageDepSpec(_imp->spec_data));
+ return std::shared_ptr<PackageDepSpec>(std::make_shared<PackageDepSpec>(_imp->spec_data));
}
diff --git a/paludis/range_rewriter_TEST.cc b/paludis/range_rewriter_TEST.cc
index 77763af..1ec50c1 100644
--- a/paludis/range_rewriter_TEST.cc
+++ b/paludis/range_rewriter_TEST.cc
@@ -42,7 +42,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::shared_ptr<DependencySpecTree> a(new DependencySpecTree(std::make_shared<AllDepSpec>()));
+ std::shared_ptr<DependencySpecTree> a(std::make_shared<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",
diff --git a/paludis/repositories/accounts/accounts_dep_key.cc b/paludis/repositories/accounts/accounts_dep_key.cc
index dc8d8d9..25e1cc7 100644
--- a/paludis/repositories/accounts/accounts_dep_key.cc
+++ b/paludis/repositories/accounts/accounts_dep_key.cc
@@ -47,14 +47,14 @@ namespace paludis
Imp(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(std::make_shared<AllDepSpec>())),
- initial_labels(new DependenciesLabelSequence)
+ specs(std::make_shared<std::list<std::shared_ptr<PackageDepSpec> >>()),
+ tree(std::make_shared<DependencySpecTree>(std::make_shared<AllDepSpec>())),
+ initial_labels(std::make_shared<DependenciesLabelSequence>())
{
for (Set<std::string>::ConstIterator i(s->begin()), i_end(s->end()) ;
i != i_end ; ++i)
{
- std::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(make_package_dep_spec(PartiallyMadePackageDepSpecOptions())
+ std::shared_ptr<PackageDepSpec> spec(std::make_shared<PackageDepSpec>(make_package_dep_spec(PartiallyMadePackageDepSpecOptions())
.package(CategoryNamePart("group") + PackageNamePart(*i))));
specs->push_back(spec);
tree->root()->append(spec);
diff --git a/paludis/repositories/accounts/accounts_id.cc b/paludis/repositories/accounts/accounts_id.cc
index 2929580..9d62949 100644
--- a/paludis/repositories/accounts/accounts_id.cc
+++ b/paludis/repositories/accounts/accounts_id.cc
@@ -84,7 +84,7 @@ namespace paludis
name(q),
version("0", VersionSpecOptions()),
repository(r),
- fs_location_key(new LiteralMetadataValueKey<FSEntry>("location", "Location", mkt_internal, l)),
+ fs_location_key(std::make_shared<LiteralMetadataValueKey<FSEntry>>("location", "Location", mkt_internal, l)),
from_repositories_key(f),
mask(m ? std::make_shared<AccountsInstalledMask>() : make_null_shared_ptr()),
is_user(u),
@@ -180,11 +180,11 @@ AccountsID::_need_file_keys() const
_imp->home_key = std::make_shared<LiteralMetadataValueKey<std::string>>("home", "Home Directory",
mkt_normal, k.get("home"));
- std::shared_ptr<Set<std::string> > all_groups_s(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > all_groups_s(std::make_shared<Set<std::string>>());
if (! k.get("extra_groups").empty())
{
- std::shared_ptr<Set<std::string> > groups_s(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > groups_s(std::make_shared<Set<std::string>>());
tokenise_whitespace(k.get("extra_groups"), groups_s->inserter());
std::copy(groups_s->begin(), groups_s->end(), all_groups_s->inserter());
_imp->extra_groups_key = std::make_shared<LiteralMetadataStringSetKey>("extra_groups", "Extra Groups",
diff --git a/paludis/repositories/accounts/accounts_repository.cc b/paludis/repositories/accounts/accounts_repository.cc
index a0367bb..c475be4 100644
--- a/paludis/repositories/accounts/accounts_repository.cc
+++ b/paludis/repositories/accounts/accounts_repository.cc
@@ -85,19 +85,19 @@ namespace paludis
const ActiveObjectPtr<DeferredConstructionPtr<std::shared_ptr<AccountsRepositoryStore> > > store;
Imp(AccountsRepository * const repo, const AccountsRepositoryParams & p) :
- params_if_not_installed(new AccountsRepositoryParams(p)),
- format_key(new LiteralMetadataValueKey<std::string> ("format", "format", mkt_significant, "accounts")),
+ params_if_not_installed(std::make_shared<AccountsRepositoryParams>(p)),
+ format_key(std::make_shared<LiteralMetadataValueKey<std::string> >("format", "format", mkt_significant, "accounts")),
store(DeferredConstructionPtr<std::shared_ptr<AccountsRepositoryStore> > (
std::bind(&make_store, repo, std::cref(*params_if_not_installed))))
{
}
Imp(AccountsRepository * const repo, const InstalledAccountsRepositoryParams & p) :
- params_if_installed(new InstalledAccountsRepositoryParams(p)),
+ params_if_installed(std::make_shared<InstalledAccountsRepositoryParams>(p)),
handler_if_installed(make_handler(p.handler())),
- format_key(new LiteralMetadataValueKey<std::string> ("format", "format", mkt_significant, "installed-accounts")),
- handler_key(new LiteralMetadataValueKey<std::string> ("handler", "handler", mkt_normal, p.handler())),
- installed_root_key(new LiteralMetadataValueKey<FSEntry>("root", "root", mkt_normal, p.root())),
+ format_key(std::make_shared<LiteralMetadataValueKey<std::string> >("format", "format", mkt_significant, "installed-accounts")),
+ handler_key(std::make_shared<LiteralMetadataValueKey<std::string> >("handler", "handler", mkt_normal, p.handler())),
+ installed_root_key(std::make_shared<LiteralMetadataValueKey<FSEntry>>("root", "root", mkt_normal, p.root())),
store(DeferredConstructionPtr<std::shared_ptr<AccountsRepositoryStore> > (
std::bind(&make_installed_store, repo, std::cref(*params_if_installed))))
{
@@ -171,7 +171,7 @@ AccountsRepository::repository_factory_create(
if (name_str.empty())
name_str = "accounts";
- return std::shared_ptr<AccountsRepository>(new AccountsRepository(
+ return std::shared_ptr<AccountsRepository>(std::make_shared<AccountsRepository>(
make_named_values<AccountsRepositoryParams>(
n::environment() = env,
n::name() = RepositoryName(name_str)
@@ -200,7 +200,7 @@ AccountsRepository::repository_factory_installed_create(
if (root_str != "/")
throw AccountsRepositoryConfigurationError("Values other than '/' for 'root' not yet supported");
- return std::shared_ptr<AccountsRepository>(new AccountsRepository(
+ return std::shared_ptr<AccountsRepository>(std::make_shared<AccountsRepository>(
make_named_values<InstalledAccountsRepositoryParams>(
n::environment() = env,
n::handler() = handler,
diff --git a/paludis/repositories/accounts/accounts_repository_TEST.cc b/paludis/repositories/accounts/accounts_repository_TEST.cc
index ea5581a..9c45e59 100644
--- a/paludis/repositories/accounts/accounts_repository_TEST.cc
+++ b/paludis/repositories/accounts/accounts_repository_TEST.cc
@@ -47,7 +47,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::shared_ptr<AccountsRepository> repo(new AccountsRepository(
+ std::shared_ptr<AccountsRepository> repo(std::make_shared<AccountsRepository>(
make_named_values<AccountsRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("accounts")
diff --git a/paludis/repositories/accounts/accounts_repository_store.cc b/paludis/repositories/accounts/accounts_repository_store.cc
index 029f887..18f5527 100644
--- a/paludis/repositories/accounts/accounts_repository_store.cc
+++ b/paludis/repositories/accounts/accounts_repository_store.cc
@@ -74,7 +74,7 @@ namespace paludis
env(e),
repo(r),
installed(i),
- categories(new CategoryNamePartSet)
+ categories(std::make_shared<CategoryNamePartSet>())
{
categories->insert(CategoryNamePart("user"));
categories->insert(CategoryNamePart("group"));
@@ -130,9 +130,9 @@ AccountsRepositoryStore::_load(const std::shared_ptr<const Repository> & repo)
continue;
}
- std::shared_ptr<Set<std::string> > r_set(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > r_set(std::make_shared<Set<std::string>>());
r_set->insert(stringify((*r)->name()));
- std::shared_ptr<LiteralMetadataStringSetKey> r_key(new LiteralMetadataStringSetKey("defined_by", "Defined by repository", mkt_internal, r_set));
+ std::shared_ptr<LiteralMetadataStringSetKey> r_key(std::make_shared<LiteralMetadataStringSetKey>("defined_by", "Defined by repository", mkt_internal, r_set));
_load_one(repo, r_key, dir);
}
}
diff --git a/paludis/repositories/accounts/installed_accounts_id.cc b/paludis/repositories/accounts/installed_accounts_id.cc
index 017f858..b674f62 100644
--- a/paludis/repositories/accounts/installed_accounts_id.cc
+++ b/paludis/repositories/accounts/installed_accounts_id.cc
@@ -72,7 +72,7 @@ namespace paludis
name(q),
version("0", VersionSpecOptions()),
repository(r),
- behaviours_key(new LiteralMetadataStringSetKey("behaviours", "Behaviours", mkt_internal,
+ behaviours_key(std::make_shared<LiteralMetadataStringSetKey>("behaviours", "Behaviours", mkt_internal,
behaviours_set)),
is_user(u)
{
@@ -84,7 +84,7 @@ namespace
{
std::shared_ptr<Set<std::string> > make_behaviours()
{
- std::shared_ptr<Set<std::string> > result(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > result(std::make_shared<Set<std::string>>());
result->insert("transient");
result->insert("used");
return result;
@@ -112,7 +112,7 @@ InstalledAccountsID::need_keys_added() const
if (_imp->is_user && ! _imp->dependencies_key)
{
- std::shared_ptr<Set<std::string> > groups(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > groups(std::make_shared<Set<std::string>>());
/* depend upon our primary group */
{
diff --git a/paludis/repositories/accounts/registration.cc b/paludis/repositories/accounts/registration.cc
index 2be47da..d51abeb 100644
--- a/paludis/repositories/accounts/registration.cc
+++ b/paludis/repositories/accounts/registration.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
void register_repositories<repository_groups::accounts>(const repository_groups::accounts * const,
RepositoryFactory * const factory)
{
- std::shared_ptr<Set<std::string> > accounts_formats(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > accounts_formats(std::make_shared<Set<std::string>>());
accounts_formats->insert("accounts");
factory->add_repository_format(accounts_formats,
@@ -58,7 +58,7 @@ namespace paludis
&AccountsRepository::repository_factory_dependencies
);
- std::shared_ptr<Set<std::string> > installed_accounts_formats(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > installed_accounts_formats(std::make_shared<Set<std::string>>());
installed_accounts_formats->insert("installed_accounts");
installed_accounts_formats->insert("installed-accounts");
diff --git a/paludis/repositories/cran/cran_dep_parser.cc b/paludis/repositories/cran/cran_dep_parser.cc
index 73d84f5..e96d488 100644
--- a/paludis/repositories/cran/cran_dep_parser.cc
+++ b/paludis/repositories/cran/cran_dep_parser.cc
@@ -36,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(std::make_shared<AllDepSpec>()));
+ std::shared_ptr<DependencySpecTree> result(std::make_shared<DependencySpecTree>(std::make_shared<AllDepSpec>()));
std::list<std::string> specs;
@@ -66,7 +66,7 @@ cranrepository::parse_depends(const std::string & s)
{
Context local_context("When processing token '" + *a + "':");
- std::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(cranrepository::parse_cran_package_dep_spec(
+ std::shared_ptr<PackageDepSpec> spec(std::make_shared<PackageDepSpec>(cranrepository::parse_cran_package_dep_spec(
strip_leading(strip_trailing(*a, " \r\n\t"), " \r\n\t"))));
result->root()->append(spec);
}
diff --git a/paludis/repositories/cran/cran_installed_repository.cc b/paludis/repositories/cran/cran_installed_repository.cc
index f5644bc..e772294 100644
--- a/paludis/repositories/cran/cran_installed_repository.cc
+++ b/paludis/repositories/cran/cran_installed_repository.cc
@@ -84,9 +84,9 @@ namespace paludis
Imp<CRANInstalledRepository>::Imp(const CRANInstalledRepositoryParams & p) :
params(p),
has_ids(false),
- location_key(new LiteralMetadataValueKey<FSEntry> ("location", "location", mkt_significant, params.location())),
- installed_root_key(new LiteralMetadataValueKey<FSEntry> ("root", "root", mkt_normal, params.root())),
- format_key(new LiteralMetadataValueKey<std::string> ("format", "format", mkt_significant, "installed_cran"))
+ location_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("location", "location", mkt_significant, params.location())),
+ installed_root_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("root", "root", mkt_normal, params.root())),
+ format_key(std::make_shared<LiteralMetadataValueKey<std::string> >("format", "format", mkt_significant, "installed_cran"))
{
}
@@ -217,7 +217,7 @@ CRANInstalledRepository::has_package_named(const QualifiedPackageName & q) const
std::shared_ptr<const CategoryNamePartSet>
CRANInstalledRepository::category_names() const
{
- std::shared_ptr<CategoryNamePartSet> result(new CategoryNamePartSet);
+ std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
result->insert(CategoryNamePart("cran"));
return result;
}
@@ -228,7 +228,7 @@ CRANInstalledRepository::package_names(const CategoryNamePart & c) const
Context context("When fetching package names in category '" + stringify(c)
+ "' in " + stringify(name()) + ":");
- std::shared_ptr<QualifiedPackageNameSet> result(new QualifiedPackageNameSet);
+ std::shared_ptr<QualifiedPackageNameSet> result(std::make_shared<QualifiedPackageNameSet>());
if (! has_category_named(c))
return result;
@@ -246,7 +246,7 @@ CRANInstalledRepository::package_ids(const QualifiedPackageName & n) const
Context context("When fetching versions of '" + stringify(n) + "' in "
+ stringify(name()) + ":");
- std::shared_ptr<PackageIDSequence> result(new PackageIDSequence);
+ std::shared_ptr<PackageIDSequence> result(std::make_shared<PackageIDSequence>());
if (! has_package_named(n))
return result;
@@ -264,7 +264,7 @@ CRANInstalledRepository::do_contents(const Package ID & id) const
{
Context context("When fetching contents for " + stringify(id) + ":");
- std::shared_ptr<Contents> result(new Contents);
+ std::shared_ptr<Contents> result(std::make_shared<Contents>());
if (! _imp->entries_valid)
_imp->load_entries();
@@ -308,11 +308,11 @@ CRANInstalledRepository::do_contents(const Package ID & id) const
}
if ("obj" == tokens.at(0))
- result->add(std::shared_ptr<ContentsEntry>(new ContentsFileEntry(tokens.at(1))));
+ result->add(std::shared_ptr<ContentsEntry>(std::make_shared<ContentsFileEntry>(tokens.at(1))));
else if ("dir" == tokens.at(0))
- result->add(std::shared_ptr<ContentsEntry>(new ContentsDirEntry(tokens.at(1))));
+ result->add(std::shared_ptr<ContentsEntry>(std::make_shared<ContentsDirEntry>(tokens.at(1))));
else if ("misc" == tokens.at(0))
- result->add(std::shared_ptr<ContentsEntry>(new ContentsMiscEntry(tokens.at(1))));
+ result->add(std::shared_ptr<ContentsEntry>(std::make_shared<ContentsMiscEntry>(tokens.at(1))));
else if ("sym" == tokens.at(0))
{
if (tokens.size() < 4)
@@ -324,7 +324,7 @@ CRANInstalledRepository::do_contents(const Package ID & id) const
continue;
}
- result->add(std::shared_ptr<ContentsEntry>(new ContentsSymEntry(
+ result->add(std::shared_ptr<ContentsEntry>(std::make_shared<ContentsSymEntry>(
tokens.at(1), tokens.at(3))));
}
}
@@ -393,7 +393,7 @@ CRANInstalledRepository::repository_factory_create(
if (! f("world").empty())
throw CRANInstalledRepositoryConfigurationError("Key 'world' is no longer supported.");
- return std::shared_ptr<Repository>(new CRANInstalledRepository(make_named_values<CRANInstalledRepositoryParams>(
+ return std::shared_ptr<Repository>(std::make_shared<CRANInstalledRepository>(make_named_values<CRANInstalledRepositoryParams>(
n::environment() = env,
n::location() = location,
n::root() = root
diff --git a/paludis/repositories/cran/cran_installed_repository_TEST.cc b/paludis/repositories/cran/cran_installed_repository_TEST.cc
index 3c0351f..0f7a4b7 100644
--- a/paludis/repositories/cran/cran_installed_repository_TEST.cc
+++ b/paludis/repositories/cran/cran_installed_repository_TEST.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
@@ -54,7 +54,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "cran_installed");
keys->insert("library", "cran_installed_repository_TEST_dir/library");
keys->insert("location", "cran_installed_repository_TEST_dir/repo1");
diff --git a/paludis/repositories/cran/cran_package_id.cc b/paludis/repositories/cran/cran_package_id.cc
index 66fc6a5..3233882 100644
--- a/paludis/repositories/cran/cran_package_id.cc
+++ b/paludis/repositories/cran/cran_package_id.cc
@@ -83,8 +83,8 @@ namespace paludis
cran_repository(r),
name("cran/" + cran_name_to_internal(strip_trailing_string(f.basename(), ".DESCRIPTION"))),
version("0", VersionSpecOptions()),
- suggests_labels(new DependenciesLabelSequence),
- depends_labels(new DependenciesLabelSequence)
+ suggests_labels(std::make_shared<DependenciesLabelSequence>()),
+ depends_labels(std::make_shared<DependenciesLabelSequence>())
{
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)));
@@ -97,9 +97,9 @@ namespace paludis
cran_repository(c),
name("cran/" + cran_name_to_internal(t)),
version(r->version()),
- contained_in_key(new PackageIDKey("Contained", "Contained in", r, mkt_normal)),
- suggests_labels(new DependenciesLabelSequence),
- depends_labels(new DependenciesLabelSequence)
+ contained_in_key(std::make_shared<PackageIDKey>("Contained", "Contained in", r, mkt_normal)),
+ suggests_labels(std::make_shared<DependenciesLabelSequence>()),
+ depends_labels(std::make_shared<DependenciesLabelSequence>())
{
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)));
@@ -429,7 +429,7 @@ CRANPackageID::arbitrary_less_than_comparison(const PackageID &) const
std::shared_ptr<const Set<std::string> >
CRANPackageID::breaks_portage() const
{
- std::shared_ptr<Set<std::string> > why(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > why(std::make_shared<Set<std::string>>());
why->insert("format");
return why;
}
diff --git a/paludis/repositories/cran/cran_repository.cc b/paludis/repositories/cran/cran_repository.cc
index 83a5204..125b0b8 100644
--- a/paludis/repositories/cran/cran_repository.cc
+++ b/paludis/repositories/cran/cran_repository.cc
@@ -90,13 +90,13 @@ Imp<CRANRepository>::Imp(const CRANRepositoryParams & p, const std::shared_ptr<M
params(p),
big_nasty_mutex(m),
has_ids(false),
- location_key(new LiteralMetadataValueKey<FSEntry> ("location", "location", mkt_significant, params.location())),
- distdir_key(new LiteralMetadataValueKey<FSEntry> ("distdir", "distdir", mkt_normal, params.distdir())),
- format_key(new LiteralMetadataValueKey<std::string> ("format", "format", mkt_significant, "cran")),
- builddir_key(new LiteralMetadataValueKey<FSEntry> ("builddir", "builddir", mkt_normal, params.builddir())),
- library_key(new LiteralMetadataValueKey<FSEntry> ("library", "library", mkt_normal, params.library())),
- sync_key(new LiteralMetadataValueKey<std::string> ("sync", "sync", mkt_normal, params.sync())),
- sync_host_key(new LiteralMetadataValueKey<std::string> ("sync_host", "sync_host", mkt_internal, extract_host_from_url(params.sync())))
+ location_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("location", "location", mkt_significant, params.location())),
+ distdir_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("distdir", "distdir", mkt_normal, params.distdir())),
+ format_key(std::make_shared<LiteralMetadataValueKey<std::string> >("format", "format", mkt_significant, "cran")),
+ builddir_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("builddir", "builddir", mkt_normal, params.builddir())),
+ library_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("library", "library", mkt_normal, params.library())),
+ sync_key(std::make_shared<LiteralMetadataValueKey<std::string> >("sync", "sync", mkt_normal, params.sync())),
+ sync_host_key(std::make_shared<LiteralMetadataValueKey<std::string> >("sync_host", "sync_host", mkt_internal, extract_host_from_url(params.sync())))
{
}
@@ -165,7 +165,7 @@ CRANRepository::category_names() const
Context context("When fetching category names in " + stringify(name()) + ":");
Lock l(*_imp->big_nasty_mutex);
- std::shared_ptr<CategoryNamePartSet> result(new CategoryNamePartSet);
+ std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
result->insert(CategoryNamePart("cran"));
return result;
@@ -178,7 +178,7 @@ CRANRepository::package_names(const CategoryNamePart & c) const
+ "' in " + stringify(name()) + ":");
Lock l(*_imp->big_nasty_mutex);
- std::shared_ptr<QualifiedPackageNameSet> result(new QualifiedPackageNameSet);
+ std::shared_ptr<QualifiedPackageNameSet> result(std::make_shared<QualifiedPackageNameSet>());
if (! has_category_named(c))
return result;
@@ -197,7 +197,7 @@ CRANRepository::package_ids(const QualifiedPackageName & n) const
+ stringify(name()) + ":");
Lock l(*_imp->big_nasty_mutex);
- std::shared_ptr<PackageIDSequence> result(new PackageIDSequence);
+ std::shared_ptr<PackageIDSequence> result(std::make_shared<PackageIDSequence>());
if (! has_package_named(n))
return result;
@@ -222,7 +222,7 @@ CRANRepository::need_ids() const
for (DirIterator d(_imp->params.location()), d_end ; d != d_end ; ++d)
if (is_file_with_extension(*d, ".DESCRIPTION", IsFileWithOptions()))
{
- std::shared_ptr<cranrepository::CRANPackageID> id(new cranrepository::CRANPackageID(_imp->params.environment(),
+ std::shared_ptr<cranrepository::CRANPackageID> id(std::make_shared<cranrepository::CRANPackageID>(_imp->params.environment(),
shared_from_this(), *d));
if (! _imp->ids.insert(std::make_pair(id->name(), id)).second)
Log::get_instance()->message("cran.id.duplicate", ll_warning, lc_context)
@@ -420,7 +420,7 @@ CRANRepository::repository_factory_create(
if (builddir.empty())
builddir = "/var/tmp/paludis";
- return std::shared_ptr<Repository>(new CRANRepository(make_named_values<CRANRepositoryParams>(
+ return std::shared_ptr<Repository>(std::make_shared<CRANRepository>(make_named_values<CRANRepositoryParams>(
n::builddir() = builddir,
n::distdir() = distdir,
n::environment() = env,
diff --git a/paludis/repositories/cran/cran_repository_TEST.cc b/paludis/repositories/cran/cran_repository_TEST.cc
index cefa23e..6f11f2c 100644
--- a/paludis/repositories/cran/cran_repository_TEST.cc
+++ b/paludis/repositories/cran/cran_repository_TEST.cc
@@ -2,7 +2,7 @@
/*
* Copyright (c) 2006 Danny van Dyk
- * 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
@@ -55,7 +55,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "cran");
keys->insert("library", "cran_repository_TEST_dir/library");
keys->insert("location", "cran_repository_TEST_dir/repo1");
@@ -75,7 +75,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "cran");
keys->insert("library", "cran_repository_TEST_dir/library");
keys->insert("location", "cran_repository_TEST_dir/repo2");
diff --git a/paludis/repositories/cran/keys.cc b/paludis/repositories/cran/keys.cc
index 10d4d1f..1aee8aa 100644
--- a/paludis/repositories/cran/keys.cc
+++ b/paludis/repositories/cran/keys.cc
@@ -40,7 +40,7 @@ using namespace paludis::cranrepository;
PackageIDSequenceKey::PackageIDSequenceKey(const Environment * const e,
const std::string & r, const std::string & h, const MetadataKeyType t) :
_env(e),
- _v(new PackageIDSequence),
+ _v(std::make_shared<PackageIDSequence>()),
_r(r),
_h(h),
_t(t)
diff --git a/paludis/repositories/cran/package_dep_spec.cc b/paludis/repositories/cran/package_dep_spec.cc
index 939ad0e..e96b039 100644
--- a/paludis/repositories/cran/package_dep_spec.cc
+++ b/paludis/repositories/cran/package_dep_spec.cc
@@ -164,7 +164,7 @@ paludis::cranrepository::parse_cran_package_dep_spec(const std::string & ss)
{
Context context("When parsing CRAN package dep spec '" + ss + "':");
- std::shared_ptr<CRANPackageDepSpecData> data(new CRANPackageDepSpecData);
+ std::shared_ptr<CRANPackageDepSpecData> data(std::make_shared<CRANPackageDepSpecData>());
std::string s(ss);
std::string::size_type p(s.find('('));
diff --git a/paludis/repositories/cran/registration.cc b/paludis/repositories/cran/registration.cc
index 1d178ba..811cb89 100644
--- a/paludis/repositories/cran/registration.cc
+++ b/paludis/repositories/cran/registration.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
*
* 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
@@ -47,7 +47,7 @@ namespace paludis
template <>
void register_repositories<repository_groups::cran>(const repository_groups::cran * const, RepositoryFactory * const factory)
{
- std::shared_ptr<Set<std::string> > cran_formats(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > cran_formats(std::make_shared<Set<std::string>>());
cran_formats->insert("cran");
factory->add_repository_format(
@@ -58,7 +58,7 @@ namespace paludis
&CRANRepository::repository_factory_dependencies
);
- std::shared_ptr<Set<std::string> > installed_cran_formats(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > installed_cran_formats(std::make_shared<Set<std::string>>());
installed_cran_formats->insert("installed_cran");
installed_cran_formats->insert("installed-cran");
diff --git a/paludis/repositories/e/aa_visitor_TEST.cc b/paludis/repositories/e/aa_visitor_TEST.cc
index 9e5d40a..6b39e33 100644
--- a/paludis/repositories/e/aa_visitor_TEST.cc
+++ b/paludis/repositories/e/aa_visitor_TEST.cc
@@ -42,7 +42,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo"))));
env.package_database()->add_repository(1, repo);
diff --git a/paludis/repositories/e/check_fetched_files_visitor.cc b/paludis/repositories/e/check_fetched_files_visitor.cc
index 03fe767..0b6cfa9 100644
--- a/paludis/repositories/e/check_fetched_files_visitor.cc
+++ b/paludis/repositories/e/check_fetched_files_visitor.cc
@@ -95,10 +95,10 @@ namespace paludis
exclude_unmirrorable(x),
ignore_unfetched(u),
ignore_not_in_manifest(nm),
- failures(new Sequence<FetchActionFailure>),
+ failures(std::make_shared<Sequence<FetchActionFailure>>()),
need_nofetch(false),
in_nofetch(n),
- m2r(new Manifest2Reader(m2)),
+ m2r(std::make_shared<Manifest2Reader>(m2)),
use_manifest(um),
output_manager(md)
{
diff --git a/paludis/repositories/e/dep_parser.cc b/paludis/repositories/e/dep_parser.cc
index b200d6b..ab225ac 100644
--- a/paludis/repositories/e/dep_parser.cc
+++ b/paludis/repositories/e/dep_parser.cc
@@ -85,7 +85,7 @@ namespace
const EAPI & eapi,
const std::shared_ptr<const PackageID> & id)
{
- std::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(
+ std::shared_ptr<PackageDepSpec> spec(std::make_shared<PackageDepSpec>(
parse_elike_package_dep_spec(s, eapi.supported()->package_dep_spec_parse_options(),
eapi.supported()->version_spec_options(), id)));
h.begin()->item()->append(spec);
@@ -117,7 +117,7 @@ namespace
strong = true;
}
- std::shared_ptr<BlockDepSpec> spec(new BlockDepSpec(
+ std::shared_ptr<BlockDepSpec> spec(std::make_shared<BlockDepSpec>(
s,
parse_elike_package_dep_spec(s.substr(specstart),
eapi.supported()->package_dep_spec_parse_options(),
@@ -137,7 +137,7 @@ namespace
const typename ParseStackTypes<T_>::AnnotationsGoHere & annotations_go_here,
const std::string & s)
{
- std::shared_ptr<LicenseDepSpec> spec(new LicenseDepSpec(s));
+ std::shared_ptr<LicenseDepSpec> spec(std::make_shared<LicenseDepSpec>(s));
h.begin()->item()->append(spec);
annotations_go_here(spec);
}
@@ -148,7 +148,7 @@ namespace
const typename ParseStackTypes<T_>::AnnotationsGoHere & annotations_go_here,
const std::string & s)
{
- std::shared_ptr<PlainTextDepSpec> spec(new PlainTextDepSpec(s));
+ std::shared_ptr<PlainTextDepSpec> spec(std::make_shared<PlainTextDepSpec>(s));
h.begin()->item()->append(spec);
annotations_go_here(spec);
}
@@ -159,7 +159,7 @@ namespace
const typename ParseStackTypes<T_>::AnnotationsGoHere & annotations_go_here,
const std::string & s)
{
- std::shared_ptr<SimpleURIDepSpec> spec(new SimpleURIDepSpec(s));
+ std::shared_ptr<SimpleURIDepSpec> spec(std::make_shared<SimpleURIDepSpec>(s));
h.begin()->item()->append(spec);
annotations_go_here(spec);
}
@@ -175,7 +175,7 @@ namespace
{
if (t.empty() || eapi.supported()->dependency_spec_tree_parse_options()[dstpo_uri_supports_arrow])
{
- std::shared_ptr<FetchableURIDepSpec> spec(new FetchableURIDepSpec(t.empty() ? f : f + " -> " + t));
+ std::shared_ptr<FetchableURIDepSpec> spec(std::make_shared<FetchableURIDepSpec>(t.empty() ? f : f + " -> " + t));
h.begin()->item()->append(spec);
annotations_go_here(spec);
}
@@ -250,7 +250,7 @@ namespace
template <typename T_, typename A_>
void any_all_handler(typename ParseStackTypes<T_>::Stack & stack)
{
- std::shared_ptr<A_> spec(new A_);
+ std::shared_ptr<A_> spec(std::make_shared<A_>());
stack.push_front(make_named_values<typename ParseStackTypes<T_>::Item>(
n::item() = stack.begin()->item()->append(spec),
n::spec() = spec
@@ -264,7 +264,7 @@ namespace
const Environment * const env,
const std::shared_ptr<const PackageID> & id)
{
- std::shared_ptr<ConditionalDepSpec> spec(new ConditionalDepSpec(parse_elike_conditional_dep_spec(
+ std::shared_ptr<ConditionalDepSpec> spec(std::make_shared<ConditionalDepSpec>(parse_elike_conditional_dep_spec(
u, env, id, bool(id->repository()->installed_root_key()))));
stack.push_front(make_named_values<typename ParseStackTypes<T_>::Item>(
n::item() = stack.begin()->item()->append(spec),
@@ -303,7 +303,7 @@ namespace
void set_annotations(std::shared_ptr<DepSpec> & spec, const std::shared_ptr<const Map<std::string, std::string> > & m)
{
- std::shared_ptr<ELikeAnnotations> key(new ELikeAnnotations(m));
+ std::shared_ptr<ELikeAnnotations> key(std::make_shared<ELikeAnnotations>(m));
spec->set_annotations_key(key);
}
@@ -320,7 +320,7 @@ paludis::erepository::parse_depend(const std::string & s,
using namespace std::placeholders;
ParseStackTypes<DependencySpecTree>::Stack stack;
- std::shared_ptr<AllDepSpec> spec(new AllDepSpec);
+ std::shared_ptr<AllDepSpec> spec(std::make_shared<AllDepSpec>());
std::shared_ptr<DepSpec> thing_to_annotate(spec);
std::shared_ptr<DependencySpecTree> top(std::make_shared<DependencySpecTree>(spec));
stack.push_front(make_named_values<ParseStackTypes<DependencySpecTree>::Item>(
@@ -363,7 +363,7 @@ paludis::erepository::parse_provide(const std::string & s,
using namespace std::placeholders;
ParseStackTypes<ProvideSpecTree>::Stack stack;
- std::shared_ptr<AllDepSpec> spec(new AllDepSpec);
+ std::shared_ptr<AllDepSpec> spec(std::make_shared<AllDepSpec>());
std::shared_ptr<DepSpec> thing_to_annotate(spec);
std::shared_ptr<ProvideSpecTree> top(std::make_shared<ProvideSpecTree>(spec));
stack.push_front(make_named_values<ParseStackTypes<ProvideSpecTree>::Item>(
@@ -402,7 +402,7 @@ paludis::erepository::parse_fetchable_uri(const std::string & s,
using namespace std::placeholders;
ParseStackTypes<FetchableURISpecTree>::Stack stack;
- std::shared_ptr<AllDepSpec> spec(new AllDepSpec);
+ std::shared_ptr<AllDepSpec> spec(std::make_shared<AllDepSpec>());
std::shared_ptr<DepSpec> thing_to_annotate(spec);
std::shared_ptr<FetchableURISpecTree> top(std::make_shared<FetchableURISpecTree>(spec));
stack.push_front(make_named_values<ParseStackTypes<FetchableURISpecTree>::Item>(
@@ -445,7 +445,7 @@ paludis::erepository::parse_simple_uri(const std::string & s,
using namespace std::placeholders;
ParseStackTypes<SimpleURISpecTree>::Stack stack;
- std::shared_ptr<AllDepSpec> spec(new AllDepSpec);
+ std::shared_ptr<AllDepSpec> spec(std::make_shared<AllDepSpec>());
std::shared_ptr<DepSpec> thing_to_annotate(spec);
std::shared_ptr<SimpleURISpecTree> top(std::make_shared<SimpleURISpecTree>(spec));
stack.push_front(make_named_values<ParseStackTypes<SimpleURISpecTree>::Item>(
@@ -484,7 +484,7 @@ paludis::erepository::parse_license(const std::string & s,
using namespace std::placeholders;
ParseStackTypes<LicenseSpecTree>::Stack stack;
- std::shared_ptr<AllDepSpec> spec(new AllDepSpec);
+ std::shared_ptr<AllDepSpec> spec(std::make_shared<AllDepSpec>());
std::shared_ptr<DepSpec> thing_to_annotate(spec);
std::shared_ptr<LicenseSpecTree> top(std::make_shared<LicenseSpecTree>(spec));
stack.push_front(make_named_values<ParseStackTypes<LicenseSpecTree>::Item>(
@@ -523,7 +523,7 @@ paludis::erepository::parse_plain_text(const std::string & s,
using namespace std::placeholders;
ParseStackTypes<PlainTextSpecTree>::Stack stack;
- std::shared_ptr<AllDepSpec> spec(new AllDepSpec);
+ std::shared_ptr<AllDepSpec> spec(std::make_shared<AllDepSpec>());
std::shared_ptr<DepSpec> thing_to_annotate(spec);
std::shared_ptr<PlainTextSpecTree> top(std::make_shared<PlainTextSpecTree>(spec));
stack.push_front(make_named_values<ParseStackTypes<PlainTextSpecTree>::Item>(
@@ -562,7 +562,7 @@ paludis::erepository::parse_myoptions(const std::string & s,
using namespace std::placeholders;
ParseStackTypes<PlainTextSpecTree>::Stack stack;
- std::shared_ptr<AllDepSpec> spec(new AllDepSpec);
+ std::shared_ptr<AllDepSpec> spec(std::make_shared<AllDepSpec>());
std::shared_ptr<DepSpec> thing_to_annotate(spec);
std::shared_ptr<PlainTextSpecTree> top(std::make_shared<PlainTextSpecTree>(spec));
stack.push_front(make_named_values<ParseStackTypes<PlainTextSpecTree>::Item>(
@@ -608,7 +608,7 @@ paludis::erepository::parse_uri_label(const std::string & s, const EAPI & e)
if (c.empty())
throw EDepParseError(s, "Unknown label");
- std::shared_ptr<URILabelsDepSpec> l(new URILabelsDepSpec);
+ std::shared_ptr<URILabelsDepSpec> l(std::make_shared<URILabelsDepSpec>());
if (c == "URIMirrorsThenListedLabel")
l->add_label(std::make_shared<URIMirrorsThenListedLabel>(s.substr(0, s.length() - 1)));
@@ -688,7 +688,7 @@ paludis::erepository::parse_dependency_label(
std::string label(s.substr(0, s.length() - 1));
tokenise<delim_kind::AnyOfTag, delim_mode::DelimiterTag>(label, "+", "", std::inserter(labels, labels.end()));
- std::shared_ptr<DependenciesLabelsDepSpec> l(new DependenciesLabelsDepSpec);
+ std::shared_ptr<DependenciesLabelsDepSpec> l(std::make_shared<DependenciesLabelsDepSpec>());
for (std::set<std::string>::iterator it = labels.begin(), it_e = labels.end(); it != it_e; ++it)
{
diff --git a/paludis/repositories/e/dep_parser_TEST.cc b/paludis/repositories/e/dep_parser_TEST.cc
index 0e5f9d8..579081d 100644
--- a/paludis/repositories/e/dep_parser_TEST.cc
+++ b/paludis/repositories/e/dep_parser_TEST.cc
@@ -52,7 +52,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
@@ -78,7 +78,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- const std::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
@@ -104,7 +104,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- const std::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
@@ -131,7 +131,7 @@ namespace test_cases
{
StringifyFormatter ff;
TestEnvironment env;
- const std::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
@@ -167,7 +167,7 @@ namespace test_cases
{
StringifyFormatter ff;
TestEnvironment env;
- const std::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
@@ -189,7 +189,7 @@ namespace test_cases
{
StringifyFormatter ff;
TestEnvironment env;
- const std::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
@@ -211,7 +211,7 @@ namespace test_cases
{
StringifyFormatter ff;
TestEnvironment env;
- const std::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
@@ -245,7 +245,7 @@ namespace test_cases
{
StringifyFormatter ff;
TestEnvironment env;
- const std::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
@@ -271,7 +271,7 @@ namespace test_cases
{
StringifyFormatter ff;
TestEnvironment env;
- const std::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
@@ -296,7 +296,7 @@ namespace test_cases
{
StringifyFormatter ff;
TestEnvironment env;
- const std::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
@@ -317,7 +317,7 @@ namespace test_cases
{
StringifyFormatter ff;
TestEnvironment env;
- const std::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
@@ -349,7 +349,7 @@ namespace test_cases
{
StringifyFormatter ff;
TestEnvironment env;
- const std::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
@@ -382,7 +382,7 @@ namespace test_cases
{
StringifyFormatter ff;
TestEnvironment env;
- const std::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
@@ -437,7 +437,7 @@ namespace test_cases
{
StringifyFormatter ff;
TestEnvironment env;
- const std::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
@@ -461,7 +461,7 @@ namespace test_cases
{
StringifyFormatter ff;
TestEnvironment env;
- const std::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
@@ -484,7 +484,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- const std::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
diff --git a/paludis/repositories/e/dep_spec_pretty_printer_TEST.cc b/paludis/repositories/e/dep_spec_pretty_printer_TEST.cc
index 33c6c78..7fb6a36 100644
--- a/paludis/repositories/e/dep_spec_pretty_printer_TEST.cc
+++ b/paludis/repositories/e/dep_spec_pretty_printer_TEST.cc
@@ -43,7 +43,7 @@ namespace test_cases
{
StringifyFormatter ff;
TestEnvironment env;
- const std::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
@@ -85,7 +85,7 @@ namespace test_cases
{
StringifyFormatter ff;
TestEnvironment env;
- const std::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
diff --git a/paludis/repositories/e/depend_rdepend_TEST.cc b/paludis/repositories/e/depend_rdepend_TEST.cc
index d63e6d9..0e409c6 100644
--- a/paludis/repositories/e/depend_rdepend_TEST.cc
+++ b/paludis/repositories/e/depend_rdepend_TEST.cc
@@ -107,7 +107,7 @@ namespace
FSEntry root(FSEntry::cwd() / "depend_rdepend_TEST_dir" / "root");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "depend_rdepend_TEST_dir" / "repo"));
@@ -123,7 +123,7 @@ namespace
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
- std::shared_ptr<Map<std::string, std::string> > v_keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > v_keys(std::make_shared<Map<std::string, std::string>>());
v_keys->insert("format", "vdb");
v_keys->insert("names_cache", "/var/empty");
v_keys->insert("provides_cache", "/var/empty");
@@ -134,12 +134,12 @@ namespace
env.package_database()->add_repository(1, v_repo);
#ifdef ENABLE_VIRTUALS_REPOSITORY
- std::shared_ptr<Map<std::string, std::string> > iv_keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > iv_keys(std::make_shared<Map<std::string, std::string>>());
iv_keys->insert("root", "/");
iv_keys->insert("format", "installed_virtuals");
env.package_database()->add_repository(-2, RepositoryFactory::get_instance()->create(&env,
std::bind(from_keys, iv_keys, std::placeholders::_1)));
- std::shared_ptr<Map<std::string, std::string> > v_keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > v_keys(std::make_shared<Map<std::string, std::string>>());
v_keys->insert("format", "virtuals");
env.package_database()->add_repository(-2, RepositoryFactory::get_instance()->create(&env,
std::bind(from_keys, v_keys, std::placeholders::_1)));
diff --git a/paludis/repositories/e/dependencies_rewriter.cc b/paludis/repositories/e/dependencies_rewriter.cc
index ef91959..95543ca 100644
--- a/paludis/repositories/e/dependencies_rewriter.cc
+++ b/paludis/repositories/e/dependencies_rewriter.cc
@@ -72,7 +72,7 @@ namespace paludis
LabelsStack labels;
Imp() :
- default_labels(new DependenciesLabelSequence)
+ default_labels(std::make_shared<DependenciesLabelSequence>())
{
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)));
@@ -133,7 +133,7 @@ DependenciesRewriter::visit(const DependencySpecTree::NodeType<DependenciesLabel
_imp->rdepend.append(" " + stringify(*node.spec()) + get_annotations(*node.spec()));
_imp->pdepend.append(" " + stringify(*node.spec()) + get_annotations(*node.spec()));
- std::shared_ptr<DependenciesLabelSequence> labels(new DependenciesLabelSequence);
+ std::shared_ptr<DependenciesLabelSequence> labels(std::make_shared<DependenciesLabelSequence>());
std::copy(node.spec()->begin(), node.spec()->end(), labels->back_inserter());
*_imp->labels.begin() = labels;
}
diff --git a/paludis/repositories/e/e_choices_key.cc b/paludis/repositories/e/e_choices_key.cc
index 144c74c..395249d 100644
--- a/paludis/repositories/e/e_choices_key.cc
+++ b/paludis/repositories/e/e_choices_key.cc
@@ -293,7 +293,7 @@ EChoicesKey::populate_myoptions() const
{
Context local_context("When using raw_myoptions_key to populate choices:");
- std::shared_ptr<Choice> options(new Choice(make_named_values<ChoiceParams>(
+ std::shared_ptr<Choice> options(std::make_shared<Choice>(make_named_values<ChoiceParams>(
n::consider_added_or_changed() = true,
n::contains_every_value() = false,
n::hidden() = false,
@@ -321,7 +321,7 @@ EChoicesKey::populate_myoptions() const
std::string lower_u;
std::transform(u->begin(), u->end(), std::back_inserter(lower_u), &::tolower);
- std::shared_ptr<Choice> exp(new Choice(make_named_values<ChoiceParams>(
+ std::shared_ptr<Choice> exp(std::make_shared<Choice>(make_named_values<ChoiceParams>(
n::consider_added_or_changed() = true,
n::contains_every_value() = false,
n::hidden() = hidden ? hidden->end() != hidden->find(*u) : false,
@@ -367,7 +367,7 @@ EChoicesKey::populate_iuse() const
{
Context local_context("When using raw_iuse_key and raw_use_key to populate choices:");
- std::shared_ptr<Choice> use(new Choice(make_named_values<ChoiceParams>(
+ std::shared_ptr<Choice> use(std::make_shared<Choice>(make_named_values<ChoiceParams>(
n::consider_added_or_changed() = true,
n::contains_every_value() = false,
n::hidden() = false,
@@ -475,7 +475,7 @@ EChoicesKey::populate_iuse() const
std::string env_arch(_imp->id->eapi()->supported()->ebuild_environment_variables()->env_arch());
if ((! env_arch.empty()) && _imp->maybe_e_repository && ! _imp->id->eapi()->supported()->ebuild_options()->require_use_expand_in_iuse())
{
- std::shared_ptr<Choice> arch(new Choice(make_named_values<ChoiceParams>(
+ std::shared_ptr<Choice> arch(std::make_shared<Choice>(make_named_values<ChoiceParams>(
n::consider_added_or_changed() = false,
n::contains_every_value() = false,
n::hidden() = true,
@@ -499,7 +499,7 @@ EChoicesKey::populate_iuse() const
{
std::string lower_u;
std::transform(u->begin(), u->end(), std::back_inserter(lower_u), &::tolower);
- std::shared_ptr<Choice> exp(new Choice(make_named_values<ChoiceParams>(
+ std::shared_ptr<Choice> exp(std::make_shared<Choice>(make_named_values<ChoiceParams>(
n::consider_added_or_changed() = true,
n::contains_every_value() = ! _imp->id->eapi()->supported()->ebuild_options()->require_use_expand_in_iuse(),
n::hidden() = hidden ? hidden->end() != hidden->find(*u) : false,
diff --git a/paludis/repositories/e/e_installed_repository.cc b/paludis/repositories/e/e_installed_repository.cc
index 01754ad..5881861 100644
--- a/paludis/repositories/e/e_installed_repository.cc
+++ b/paludis/repositories/e/e_installed_repository.cc
@@ -232,10 +232,10 @@ EInstalledRepository::perform_config(
FSEntry ver_dir(id->fs_location_key()->value());
- std::shared_ptr<FSEntrySequence> eclassdirs(new FSEntrySequence);
+ std::shared_ptr<FSEntrySequence> eclassdirs(std::make_shared<FSEntrySequence>());
eclassdirs->push_back(ver_dir);
- std::shared_ptr<FSEntry> load_env(new FSEntry(ver_dir / "environment.bz2"));
+ std::shared_ptr<FSEntry> load_env(std::make_shared<FSEntry>(ver_dir / "environment.bz2"));
EAPIPhases phases(id->eapi()->supported()->ebuild_phases()->ebuild_config());
for (EAPIPhases::ConstIterator phase(phases.begin_phases()), phase_end(phases.end_phases()) ;
@@ -287,10 +287,10 @@ EInstalledRepository::perform_info(
FSEntry ver_dir(id->fs_location_key()->value());
- std::shared_ptr<FSEntrySequence> eclassdirs(new FSEntrySequence);
+ std::shared_ptr<FSEntrySequence> eclassdirs(std::make_shared<FSEntrySequence>());
eclassdirs->push_back(ver_dir);
- std::shared_ptr<FSEntry> load_env(new FSEntry(ver_dir / "environment.bz2"));
+ std::shared_ptr<FSEntry> load_env(std::make_shared<FSEntry>(ver_dir / "environment.bz2"));
EAPIPhases phases(id->eapi()->supported()->ebuild_phases()->ebuild_info());
diff --git a/paludis/repositories/e/e_installed_repository_id.cc b/paludis/repositories/e/e_installed_repository_id.cc
index 9afdf7c..1c276c1 100644
--- a/paludis/repositories/e/e_installed_repository_id.cc
+++ b/paludis/repositories/e/e_installed_repository_id.cc
@@ -139,10 +139,10 @@ namespace paludis
environment(e),
repository(r),
dir(f),
- raw_dependencies_labels(new DependenciesLabelSequence),
- build_dependencies_labels(new DependenciesLabelSequence),
- run_dependencies_labels(new DependenciesLabelSequence),
- post_dependencies_labels(new DependenciesLabelSequence)
+ raw_dependencies_labels(std::make_shared<DependenciesLabelSequence>()),
+ build_dependencies_labels(std::make_shared<DependenciesLabelSequence>()),
+ run_dependencies_labels(std::make_shared<DependenciesLabelSequence>()),
+ post_dependencies_labels(std::make_shared<DependenciesLabelSequence>())
{
raw_dependencies_labels->push_back(std::make_shared<DependenciesBuildLabel>("build",
return_literal_function(true)));
@@ -497,7 +497,7 @@ EInstalledRepositoryID::need_keys_added() const
add_metadata_key(_imp->keys->choices);
- std::shared_ptr<Set<std::string> > from_repositories_value(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > from_repositories_value(std::make_shared<Set<std::string>>());
if ((_imp->dir / "REPOSITORY").exists())
from_repositories_value->insert(file_contents(_imp->dir / "REPOSITORY"));
if ((_imp->dir / "repository").exists())
@@ -1037,7 +1037,7 @@ EInstalledRepositoryID::add_build_options(const std::shared_ptr<Choices> & choic
{
if (eapi()->supported())
{
- std::shared_ptr<Choice> build_options(new Choice(make_named_values<ChoiceParams>(
+ std::shared_ptr<Choice> build_options(std::make_shared<Choice>(make_named_values<ChoiceParams>(
n::consider_added_or_changed() = false,
n::contains_every_value() = false,
n::hidden() = false,
diff --git a/paludis/repositories/e/e_key.cc b/paludis/repositories/e/e_key.cc
index c567aff..0e46838 100644
--- a/paludis/repositories/e/e_key.cc
+++ b/paludis/repositories/e/e_key.cc
@@ -824,7 +824,7 @@ EKeywordsKey::pretty_print_flat(const Formatter<KeywordName> & f) const
if (! result.empty())
result.append(" ");
- std::shared_ptr<KeywordNameSet> k(new KeywordNameSet);
+ std::shared_ptr<KeywordNameSet> k(std::make_shared<KeywordNameSet>());
k->insert(*i);
if (_imp->env->accept_keywords(k, *_imp->id))
result.append(f.format(*i, format::Accepted()));
@@ -1010,7 +1010,7 @@ EContentsKey::value() const
if ("obj" == tokens.at(0))
{
- std::shared_ptr<ContentsEntry> e(new ContentsFileEntry(tokens.at(1)));
+ std::shared_ptr<ContentsEntry> e(std::make_shared<ContentsFileEntry>(tokens.at(1)));
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)));
@@ -1018,18 +1018,18 @@ EContentsKey::value() const
}
else if ("dir" == tokens.at(0))
{
- std::shared_ptr<ContentsEntry> e(new ContentsDirEntry(tokens.at(1)));
+ std::shared_ptr<ContentsEntry> e(std::make_shared<ContentsDirEntry>(tokens.at(1)));
_imp->value->add(e);
}
else if ("sym" == tokens.at(0))
{
- std::shared_ptr<ContentsEntry> e(new ContentsSymEntry(tokens.at(1), tokens.at(2)));
+ std::shared_ptr<ContentsEntry> e(std::make_shared<ContentsSymEntry>(tokens.at(1), tokens.at(2)));
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))
- _imp->value->add(std::shared_ptr<ContentsEntry>(new ContentsOtherEntry(tokens.at(1))));
+ _imp->value->add(std::shared_ptr<ContentsEntry>(std::make_shared<ContentsOtherEntry>(tokens.at(1))));
else
Log::get_instance()->message("e.contents.unknown", ll_warning, lc_context) << "CONTENTS has unsupported entry type '" <<
tokens.at(0) << "', skipping";
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index 81f5916..a374896 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -266,61 +266,61 @@ namespace paludis
repo(r),
params(p),
mutexes(m),
- names_cache(new RepositoryNameCache(p.names_cache(), r)),
+ names_cache(std::make_shared<RepositoryNameCache>(p.names_cache(), r)),
has_repo_mask(false),
has_mirrors(false),
- sets_ptr(new ERepositorySets(params.environment(), r, p)),
+ sets_ptr(std::make_shared<ERepositorySets>(params.environment(), r, p)),
layout(LayoutFactory::get_instance()->create(params.layout(), r, params.location(), get_master_locations(
params.master_repositories()))),
- format_key(new LiteralMetadataValueKey<std::string> ("format", "format",
+ format_key(std::make_shared<LiteralMetadataValueKey<std::string> >("format", "format",
mkt_significant, params.entry_format())),
- layout_key(new LiteralMetadataValueKey<std::string> ("layout", "layout",
+ layout_key(std::make_shared<LiteralMetadataValueKey<std::string> >("layout", "layout",
mkt_normal, params.layout())),
- profile_layout_key(new LiteralMetadataValueKey<std::string> ("profile_layout", "profile_layout",
+ profile_layout_key(std::make_shared<LiteralMetadataValueKey<std::string> >("profile_layout", "profile_layout",
mkt_normal, params.profile_layout())),
- location_key(new LiteralMetadataValueKey<FSEntry> ("location", "location",
+ location_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("location", "location",
mkt_significant, params.location())),
- profiles_key(new LiteralMetadataFSEntrySequenceKey(
+ profiles_key(std::make_shared<LiteralMetadataFSEntrySequenceKey>(
"profiles", "profiles", mkt_normal, params.profiles())),
- cache_key(new LiteralMetadataValueKey<FSEntry> ("cache", "cache",
+ cache_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("cache", "cache",
mkt_normal, params.cache())),
- write_cache_key(new LiteralMetadataValueKey<FSEntry> ("write_cache", "write_cache",
+ write_cache_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("write_cache", "write_cache",
mkt_normal, params.write_cache())),
- append_repository_name_to_write_cache_key(new LiteralMetadataValueKey<std::string> (
+ append_repository_name_to_write_cache_key(std::make_shared<LiteralMetadataValueKey<std::string> >(
"append_repository_name_to_write_cache", "append_repository_name_to_write_cache",
mkt_internal, stringify(params.append_repository_name_to_write_cache()))),
- ignore_deprecated_profiles(new LiteralMetadataValueKey<std::string> (
+ ignore_deprecated_profiles(std::make_shared<LiteralMetadataValueKey<std::string> >(
"ignore_deprecated_profiles", "ignore_deprecated_profiles",
mkt_internal, stringify(params.ignore_deprecated_profiles()))),
- names_cache_key(new LiteralMetadataValueKey<FSEntry> (
+ names_cache_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >(
"names_cache", "names_cache", mkt_normal, params.names_cache())),
- distdir_key(new LiteralMetadataValueKey<FSEntry> (
+ distdir_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >(
"distdir", "distdir", mkt_normal, params.distdir())),
- eclassdirs_key(new LiteralMetadataFSEntrySequenceKey(
+ eclassdirs_key(std::make_shared<LiteralMetadataFSEntrySequenceKey>(
"eclassdirs", "eclassdirs", mkt_normal, params.eclassdirs())),
- securitydir_key(new LiteralMetadataValueKey<FSEntry> (
+ securitydir_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >(
"securitydir", "securitydir", mkt_normal, params.securitydir())),
- setsdir_key(new LiteralMetadataValueKey<FSEntry> (
+ setsdir_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >(
"setsdir", "setsdir", mkt_normal, params.setsdir())),
- newsdir_key(new LiteralMetadataValueKey<FSEntry> (
+ newsdir_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >(
"newsdir", "newsdir", mkt_normal, params.newsdir())),
- sync_key(new LiteralMetadataValueKey<std::string> (
+ sync_key(std::make_shared<LiteralMetadataValueKey<std::string> >(
"sync", "sync", mkt_normal, params.sync())),
- sync_options_key(new LiteralMetadataValueKey<std::string> (
+ sync_options_key(std::make_shared<LiteralMetadataValueKey<std::string> >(
"sync_options", "sync_options", mkt_normal, params.sync_options())),
- builddir_key(new LiteralMetadataValueKey<FSEntry> (
+ builddir_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >(
"builddir", "builddir", mkt_normal, params.builddir())),
master_repositories_key(params.master_repositories() ?
- std::shared_ptr<MetadataCollectionKey<Sequence<std::string> > >(new LiteralMetadataStringSequenceKey(
+ std::shared_ptr<MetadataCollectionKey<Sequence<std::string> > >(std::make_shared<LiteralMetadataStringSequenceKey>(
"master_repository", "master_repository", mkt_normal, get_master_names(params.master_repositories()))) :
std::shared_ptr<MetadataCollectionKey<Sequence<std::string> > >()),
- eapi_when_unknown_key(new LiteralMetadataValueKey<std::string> (
+ eapi_when_unknown_key(std::make_shared<LiteralMetadataValueKey<std::string> >(
"eapi_when_unknown", "eapi_when_unknown", mkt_normal, params.eapi_when_unknown())),
- eapi_when_unspecified_key(new LiteralMetadataValueKey<std::string> (
+ eapi_when_unspecified_key(std::make_shared<LiteralMetadataValueKey<std::string> >(
"eapi_when_unspecified", "eapi_when_unspecified", mkt_normal, params.eapi_when_unspecified())),
- profile_eapi_when_unspecified_key(new LiteralMetadataValueKey<std::string> (
+ profile_eapi_when_unspecified_key(std::make_shared<LiteralMetadataValueKey<std::string> >(
"profile_eapi_when_unspecified", "profile_eapi_when_unspecified", mkt_normal, params.profile_eapi_when_unspecified())),
- use_manifest_key(new LiteralMetadataValueKey<std::string> (
+ use_manifest_key(std::make_shared<LiteralMetadataValueKey<std::string> >(
"use_manifest", "use_manifest", mkt_normal, stringify(params.use_manifest()))),
info_pkgs_key(layout->info_packages_files()->end() != std::find_if(layout->info_packages_files()->begin(),
layout->info_packages_files()->end(),
@@ -337,20 +337,20 @@ namespace paludis
std::shared_ptr<InfoVarsMetadataKey>()
),
#ifdef ENABLE_PBINS
- binary_destination_key(new LiteralMetadataValueKey<std::string> (
+ binary_destination_key(std::make_shared<LiteralMetadataValueKey<std::string> >(
"binary_destination", "binary_destination", params.binary_destination() ? mkt_normal : mkt_internal,
stringify(params.binary_destination()))),
- binary_src_uri_prefix_key(new LiteralMetadataValueKey<std::string> (
+ binary_src_uri_prefix_key(std::make_shared<LiteralMetadataValueKey<std::string> >(
"binary_uri_prefix", "binary_uri_prefix", params.binary_destination() ? mkt_normal : mkt_internal,
params.binary_uri_prefix())),
- binary_keywords(new LiteralMetadataValueKey<std::string> (
+ binary_keywords(std::make_shared<LiteralMetadataValueKey<std::string> >(
"binary_keywords", "binary_keywords", params.binary_destination() ? mkt_normal : mkt_internal,
params.binary_keywords())),
#endif
accounts_repository_data_location_key(layout->accounts_repository_data_location_key()),
e_updates_location_key(layout->e_updates_location_key()),
- sync_host_key(new LiteralMetadataValueKey<std::string> ("sync_host", "sync_host", mkt_internal, extract_host_from_url(params.sync()))),
- eclass_mtimes(new EclassMtimes(r, params.eclassdirs())),
+ sync_host_key(std::make_shared<LiteralMetadataValueKey<std::string> >("sync_host", "sync_host", mkt_internal, extract_host_from_url(params.sync()))),
+ eclass_mtimes(std::make_shared<EclassMtimes>(r, params.eclassdirs())),
master_mtime(0)
{
@@ -404,7 +404,7 @@ namespace paludis
if (f->is_regular_file_or_symlink_to_regular_file())
profiles_desc = *f;
- std::shared_ptr<FSEntrySequence> auto_profiles(new FSEntrySequence);
+ std::shared_ptr<FSEntrySequence> auto_profiles(std::make_shared<FSEntrySequence>());
if (profiles_desc == FSEntry("/dev/null"))
{
@@ -616,7 +616,7 @@ ERepository::repository_masked(const PackageID & id) const
{
try
{
- std::shared_ptr<const PackageDepSpec> a(new PackageDepSpec(parse_elike_package_dep_spec(
+ std::shared_ptr<const PackageDepSpec> a(std::make_shared<PackageDepSpec>(parse_elike_package_dep_spec(
line->second.first, line->first->supported()->package_dep_spec_parse_options(),
line->first->supported()->version_spec_options(),
std::shared_ptr<const PackageID>())));
@@ -714,7 +714,7 @@ ERepository::need_mirrors() const
if (ee.size() > 6)
ee.resize(6);
- std::shared_ptr<MirrorsSequence> ms(new MirrorsSequence);
+ std::shared_ptr<MirrorsSequence> ms(std::make_shared<MirrorsSequence>());
for (std::vector<std::string>::const_iterator e(next(ee.begin())),
e_end(ee.end()) ; e != e_end ; ++e)
ms->push_back(*e);
@@ -806,7 +806,7 @@ ERepository::purge_invalid_cache() const
const std::shared_ptr<const EAPI> eapi(EAPIData::get_instance()->eapi_from_string(
_imp->params.eapi_when_unknown()));
- std::shared_ptr<EclassMtimes> eclass_mtimes(new EclassMtimes(this, _imp->params.eclassdirs()));
+ std::shared_ptr<EclassMtimes> eclass_mtimes(std::make_shared<EclassMtimes>(this, _imp->params.eclassdirs()));
time_t master_mtime(0);
FSEntry master_mtime_file(_imp->params.location() / "metadata" / "timestamp");
if (master_mtime_file.exists())
@@ -925,7 +925,7 @@ ERepository::virtual_packages() const
_imp->need_profiles();
- std::shared_ptr<VirtualsSequence> result(new VirtualsSequence);
+ std::shared_ptr<VirtualsSequence> result(std::make_shared<VirtualsSequence>());
for (Map<QualifiedPackageName, PackageDepSpec>::ConstIterator i(_imp->profile_ptr->virtuals()->begin()),
i_end(_imp->profile_ptr->virtuals()->end()) ; i != i_end ; ++i)
@@ -1297,7 +1297,7 @@ ERepository::repository_factory_create(
}
}
- std::shared_ptr<FSEntrySequence> profiles(new FSEntrySequence);
+ std::shared_ptr<FSEntrySequence> profiles(std::make_shared<FSEntrySequence>());
bool profiles_explicitly_set(false), auto_profiles(false);
tokenise_whitespace(f("profiles"), create_inserter<FSEntry>(std::back_inserter(*profiles)));
if (profiles->empty())
@@ -1318,7 +1318,7 @@ ERepository::repository_factory_create(
else
profiles_explicitly_set = true;
- std::shared_ptr<FSEntrySequence> eclassdirs(new FSEntrySequence);
+ std::shared_ptr<FSEntrySequence> eclassdirs(std::make_shared<FSEntrySequence>());
tokenise_whitespace(f("eclassdirs"), create_inserter<FSEntry>(std::back_inserter(*eclassdirs)));
if (eclassdirs->empty())
{
@@ -1501,7 +1501,7 @@ ERepository::repository_factory_create(
throw ERepositoryConfigurationError("binary_destination = true, but binary_keywords is unset or empty");
}
- return std::shared_ptr<ERepository>(new ERepository(make_named_values<ERepositoryParams>(
+ return std::shared_ptr<ERepository>(std::make_shared<ERepository>(make_named_values<ERepositoryParams>(
n::append_repository_name_to_write_cache() = append_repository_name_to_write_cache,
n::auto_profiles() = auto_profiles,
n::binary_destination() = binary_destination,
@@ -1541,7 +1541,7 @@ ERepository::repository_factory_dependencies(
const Environment * const,
const std::function<std::string (const std::string &)> & f)
{
- std::shared_ptr<RepositoryNameSet> result(new RepositoryNameSet);
+ std::shared_ptr<RepositoryNameSet> result(std::make_shared<RepositoryNameSet>());
if (! f("master_repository").empty())
result->insert(RepositoryName(f("master_repository")));
else
@@ -1714,7 +1714,7 @@ ERepository::make_id(const QualifiedPackageName & q, const FSEntry & f) const
{
Context context("When creating ID for '" + stringify(q) + "' from '" + stringify(f) + "':");
- std::shared_ptr<EbuildID> result(new EbuildID(q, extract_package_file_version(q, f),
+ std::shared_ptr<EbuildID> result(std::make_shared<EbuildID>(q, extract_package_file_version(q, f),
_imp->params.environment(),
shared_from_this(), f, _guess_eapi(q, f),
_imp->master_mtime, _imp->eclass_mtimes));
@@ -1824,8 +1824,7 @@ namespace
const ERepositoryID & e,
std::shared_ptr<const Profile> profile)
{
- std::shared_ptr<Map<std::string, std::string> > expand_vars(
- new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > expand_vars(std::make_shared<Map<std::string, std::string> >());
if (! e.eapi()->supported())
{
@@ -2335,7 +2334,7 @@ ERepository::install(const std::shared_ptr<const ERepositoryID> & id,
stringify(id->name().package()) + "-" + stringify(id->version())));
std::string used_config_protect;
- std::shared_ptr<FSEntrySet> merged_entries(new FSEntrySet);
+ std::shared_ptr<FSEntrySet> merged_entries(std::make_shared<FSEntrySet>());
std::shared_ptr<const ChoiceValue> preserve_work_choice(
id->choices_key()->value()->find_by_name_with_prefix(
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index fe5dc0d..6ef25fc 100644
--- a/paludis/repositories/e/e_repository_TEST.cc
+++ b/paludis/repositories/e/e_repository_TEST.cc
@@ -98,7 +98,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo1"));
@@ -118,7 +118,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo2"));
@@ -138,7 +138,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo3"));
@@ -158,7 +158,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo1"));
@@ -187,7 +187,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo1"));
@@ -218,7 +218,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo4"));
@@ -255,7 +255,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo4"));
@@ -296,7 +296,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo4"));
@@ -346,7 +346,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo5"));
@@ -379,8 +379,7 @@ namespace test_cases
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(
- new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo4"));
@@ -425,7 +424,7 @@ namespace test_cases
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo8"));
@@ -477,8 +476,7 @@ namespace test_cases
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(
- new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("write_cache", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo7/metadata/cache"));
@@ -560,8 +558,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(
- new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo7"));
@@ -605,8 +602,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(
- new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo9"));
@@ -687,8 +683,7 @@ namespace test_cases
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys18(
- new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys18(std::make_shared<Map<std::string, std::string>>());
keys18->insert("format", "e");
keys18->insert("names_cache", "/var/empty");
keys18->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo18"));
@@ -698,8 +693,7 @@ namespace test_cases
std::bind(from_keys, keys18, std::placeholders::_1)));
env.package_database()->add_repository(1, repo18);
- std::shared_ptr<Map<std::string, std::string> > keys19(
- new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys19(std::make_shared<Map<std::string, std::string>>());
keys19->insert("format", "e");
keys19->insert("names_cache", "/var/empty");
keys19->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo19"));
@@ -745,8 +739,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(
- new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo10"));
@@ -781,8 +774,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(
- new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo15"));
@@ -824,8 +816,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(
- new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo15"));
@@ -873,8 +864,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(
- new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo11"));
@@ -919,7 +909,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "exheres");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo12"));
@@ -1032,8 +1022,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(
- new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo11"));
diff --git a/paludis/repositories/e/e_repository_TEST_0.cc b/paludis/repositories/e/e_repository_TEST_0.cc
index 7d4c73a..fa3b7bf 100644
--- a/paludis/repositories/e/e_repository_TEST_0.cc
+++ b/paludis/repositories/e/e_repository_TEST_0.cc
@@ -111,7 +111,7 @@ namespace test_cases
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_0_dir" / "repo"));
@@ -126,7 +126,7 @@ namespace test_cases
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
- std::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(
+ std::shared_ptr<FakeInstalledRepository> installed_repo(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("installed"),
@@ -138,12 +138,12 @@ namespace test_cases
env.package_database()->add_repository(2, installed_repo);
#ifdef ENABLE_VIRTUALS_REPOSITORY
- std::shared_ptr<Map<std::string, std::string> > iv_keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > iv_keys(std::make_shared<Map<std::string, std::string>>());
iv_keys->insert("root", "/");
iv_keys->insert("format", "installed_virtuals");
env.package_database()->add_repository(-2, RepositoryFactory::get_instance()->create(&env,
std::bind(from_keys, iv_keys, std::placeholders::_1)));
- std::shared_ptr<Map<std::string, std::string> > v_keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > v_keys(std::make_shared<Map<std::string, std::string>>());
v_keys->insert("format", "virtuals");
env.package_database()->add_repository(-2, RepositoryFactory::get_instance()->create(&env,
std::bind(from_keys, v_keys, std::placeholders::_1)));
diff --git a/paludis/repositories/e/e_repository_TEST_1.cc b/paludis/repositories/e/e_repository_TEST_1.cc
index 291a366..b2bf570 100644
--- a/paludis/repositories/e/e_repository_TEST_1.cc
+++ b/paludis/repositories/e/e_repository_TEST_1.cc
@@ -104,7 +104,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_1_dir" / "repo"));
@@ -119,7 +119,7 @@ namespace test_cases
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
- std::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(
+ std::shared_ptr<FakeInstalledRepository> installed_repo(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("installed"),
diff --git a/paludis/repositories/e/e_repository_TEST_2.cc b/paludis/repositories/e/e_repository_TEST_2.cc
index a1b5cdb..ef6abb3 100644
--- a/paludis/repositories/e/e_repository_TEST_2.cc
+++ b/paludis/repositories/e/e_repository_TEST_2.cc
@@ -104,7 +104,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_2_dir" / "repo"));
@@ -119,7 +119,7 @@ namespace test_cases
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
- std::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(
+ std::shared_ptr<FakeInstalledRepository> installed_repo(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("installed"),
diff --git a/paludis/repositories/e/e_repository_TEST_3.cc b/paludis/repositories/e/e_repository_TEST_3.cc
index a7aa0fb..9ddd481 100644
--- a/paludis/repositories/e/e_repository_TEST_3.cc
+++ b/paludis/repositories/e/e_repository_TEST_3.cc
@@ -104,7 +104,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_3_dir" / "repo"));
@@ -119,7 +119,7 @@ namespace test_cases
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
- std::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(
+ std::shared_ptr<FakeInstalledRepository> installed_repo(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("installed"),
diff --git a/paludis/repositories/e/e_repository_TEST_4.cc b/paludis/repositories/e/e_repository_TEST_4.cc
index dc597c9..6b1d966 100644
--- a/paludis/repositories/e/e_repository_TEST_4.cc
+++ b/paludis/repositories/e/e_repository_TEST_4.cc
@@ -104,7 +104,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_4_dir" / "repo"));
@@ -119,7 +119,7 @@ namespace test_cases
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
- std::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(
+ std::shared_ptr<FakeInstalledRepository> installed_repo(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("installed"),
diff --git a/paludis/repositories/e/e_repository_TEST_dependencies_rewriter.cc b/paludis/repositories/e/e_repository_TEST_dependencies_rewriter.cc
index 338f4a4..42b4471 100644
--- a/paludis/repositories/e/e_repository_TEST_dependencies_rewriter.cc
+++ b/paludis/repositories/e/e_repository_TEST_dependencies_rewriter.cc
@@ -94,8 +94,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(
- new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_dependencies_rewriter_dir" / "repo"));
diff --git a/paludis/repositories/e/e_repository_TEST_ever.cc b/paludis/repositories/e/e_repository_TEST_ever.cc
index a3a573e..94c33e2 100644
--- a/paludis/repositories/e/e_repository_TEST_ever.cc
+++ b/paludis/repositories/e/e_repository_TEST_ever.cc
@@ -112,7 +112,7 @@ namespace
#endif
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_ever_dir" / "repo1"));
@@ -127,7 +127,7 @@ namespace
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
- std::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(
+ std::shared_ptr<FakeInstalledRepository> installed_repo(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("installed"),
@@ -139,12 +139,12 @@ namespace
env.package_database()->add_repository(2, installed_repo);
#ifdef ENABLE_VIRTUALS_REPOSITORY
- std::shared_ptr<Map<std::string, std::string> > iv_keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > iv_keys(std::make_shared<Map<std::string, std::string>>());
iv_keys->insert("root", "/");
iv_keys->insert("format", "installed_virtuals");
env.package_database()->add_repository(-2, RepositoryFactory::get_instance()->create(&env,
std::bind(from_keys, iv_keys, std::placeholders::_1)));
- std::shared_ptr<Map<std::string, std::string> > v_keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > v_keys(std::make_shared<Map<std::string, std::string>>());
v_keys->insert("format", "virtuals");
env.package_database()->add_repository(-2, RepositoryFactory::get_instance()->create(&env,
std::bind(from_keys, v_keys, std::placeholders::_1)));
diff --git a/paludis/repositories/e/e_repository_TEST_exheres_0.cc b/paludis/repositories/e/e_repository_TEST_exheres_0.cc
index 55f4f5b..773fe6e 100644
--- a/paludis/repositories/e/e_repository_TEST_exheres_0.cc
+++ b/paludis/repositories/e/e_repository_TEST_exheres_0.cc
@@ -109,7 +109,7 @@ namespace test_cases
#endif
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_exheres_0_dir" / "repo"));
@@ -124,7 +124,7 @@ namespace test_cases
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
- std::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(
+ std::shared_ptr<FakeInstalledRepository> installed_repo(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("installed"),
@@ -136,12 +136,12 @@ namespace test_cases
env.package_database()->add_repository(2, installed_repo);
#ifdef ENABLE_VIRTUALS_REPOSITORY
- std::shared_ptr<Map<std::string, std::string> > iv_keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > iv_keys(std::make_shared<Map<std::string, std::string>>());
iv_keys->insert("root", "/");
iv_keys->insert("format", "installed_virtuals");
env.package_database()->add_repository(-2, RepositoryFactory::get_instance()->create(&env,
std::bind(from_keys, iv_keys, std::placeholders::_1)));
- std::shared_ptr<Map<std::string, std::string> > v_keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > v_keys(std::make_shared<Map<std::string, std::string>>());
v_keys->insert("format", "virtuals");
env.package_database()->add_repository(-2, RepositoryFactory::get_instance()->create(&env,
std::bind(from_keys, v_keys, std::placeholders::_1)));
diff --git a/paludis/repositories/e/e_repository_TEST_exlibs.cc b/paludis/repositories/e/e_repository_TEST_exlibs.cc
index 4d79a9f..518f376 100644
--- a/paludis/repositories/e/e_repository_TEST_exlibs.cc
+++ b/paludis/repositories/e/e_repository_TEST_exlibs.cc
@@ -120,7 +120,7 @@ namespace
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_exlibs_dir" / "repo1"));
@@ -135,7 +135,7 @@ namespace
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
- std::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(
+ std::shared_ptr<FakeInstalledRepository> installed_repo(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("installed"),
diff --git a/paludis/repositories/e/e_repository_TEST_pbin.cc b/paludis/repositories/e/e_repository_TEST_pbin.cc
index ecc4200..3914834 100644
--- a/paludis/repositories/e/e_repository_TEST_pbin.cc
+++ b/paludis/repositories/e/e_repository_TEST_pbin.cc
@@ -112,7 +112,7 @@ namespace test_cases
env.set_paludis_command("/bin/false");
FSEntry root(FSEntry::cwd() / "e_repository_TEST_pbin_dir" / "root");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_pbin_dir" / ("repo" + base_eapi)));
@@ -128,7 +128,7 @@ namespace test_cases
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
- std::shared_ptr<Map<std::string, std::string> > b_keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > b_keys(std::make_shared<Map<std::string, std::string>>());
b_keys->insert("format", "e");
b_keys->insert("names_cache", "/var/empty");
b_keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_pbin_dir" / ("binrepo" + base_eapi)));
@@ -148,7 +148,7 @@ namespace test_cases
std::bind(from_keys, b_keys, std::placeholders::_1)));
env.package_database()->add_repository(2, b_repo);
- std::shared_ptr<Map<std::string, std::string> > v_keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > v_keys(std::make_shared<Map<std::string, std::string>>());
v_keys->insert("format", "vdb");
v_keys->insert("names_cache", "/var/empty");
v_keys->insert("provides_cache", "/var/empty");
diff --git a/paludis/repositories/e/e_repository_TEST_phases.cc b/paludis/repositories/e/e_repository_TEST_phases.cc
index e0aaaeb..f090ce4 100644
--- a/paludis/repositories/e/e_repository_TEST_phases.cc
+++ b/paludis/repositories/e/e_repository_TEST_phases.cc
@@ -120,7 +120,7 @@ namespace
#endif
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_phases_dir" / "repo1"));
@@ -135,7 +135,7 @@ namespace
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
- std::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(
+ std::shared_ptr<FakeInstalledRepository> installed_repo(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("installed"),
@@ -147,12 +147,12 @@ namespace
env.package_database()->add_repository(2, installed_repo);
#ifdef ENABLE_VIRTUALS_REPOSITORY
- std::shared_ptr<Map<std::string, std::string> > iv_keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > iv_keys(std::make_shared<Map<std::string, std::string>>());
iv_keys->insert("root", "/");
iv_keys->insert("format", "installed_virtuals");
env.package_database()->add_repository(-2, RepositoryFactory::get_instance()->create(&env,
std::bind(from_keys, iv_keys, std::placeholders::_1)));
- std::shared_ptr<Map<std::string, std::string> > v_keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > v_keys(std::make_shared<Map<std::string, std::string>>());
v_keys->insert("format", "virtuals");
env.package_database()->add_repository(-2, RepositoryFactory::get_instance()->create(&env,
std::bind(from_keys, v_keys, std::placeholders::_1)));
diff --git a/paludis/repositories/e/e_repository_TEST_replacing.cc b/paludis/repositories/e/e_repository_TEST_replacing.cc
index 3cf2076..f9a8f2f 100644
--- a/paludis/repositories/e/e_repository_TEST_replacing.cc
+++ b/paludis/repositories/e/e_repository_TEST_replacing.cc
@@ -113,7 +113,7 @@ namespace
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_replacing_dir" / repo_path));
@@ -129,7 +129,7 @@ namespace
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
- std::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(
+ std::shared_ptr<FakeInstalledRepository> installed_repo(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("installed"),
diff --git a/paludis/repositories/e/e_repository_TEST_symlink_rewriting.cc b/paludis/repositories/e/e_repository_TEST_symlink_rewriting.cc
index 4d232ad..6ad4bb4 100644
--- a/paludis/repositories/e/e_repository_TEST_symlink_rewriting.cc
+++ b/paludis/repositories/e/e_repository_TEST_symlink_rewriting.cc
@@ -105,7 +105,7 @@ namespace test_cases
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_symlink_rewriting_dir" / "repo"));
diff --git a/paludis/repositories/e/e_repository_id.cc b/paludis/repositories/e/e_repository_id.cc
index 5f9ef18..8f208bc 100644
--- a/paludis/repositories/e/e_repository_id.cc
+++ b/paludis/repositories/e/e_repository_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
@@ -28,7 +28,7 @@ using namespace paludis::erepository;
std::shared_ptr<const Set<std::string> >
ERepositoryID::breaks_portage() const
{
- std::shared_ptr<Set<std::string> > why(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > why(std::make_shared<Set<std::string>>());
if (version().has_try_part() || version().has_scm_part() || version().has_local_revision())
why->insert("version");
if ((! eapi()->supported()) || eapi()->supported()->breaks_portage())
diff --git a/paludis/repositories/e/e_repository_mask_file.cc b/paludis/repositories/e/e_repository_mask_file.cc
index e46400a..c8201c3 100644
--- a/paludis/repositories/e/e_repository_mask_file.cc
+++ b/paludis/repositories/e/e_repository_mask_file.cc
@@ -59,7 +59,7 @@ MaskFile::MaskFile(const FSEntry & f, const LineConfigFileOptions & opts) :
myopts += lcfo_no_skip_blank_lines;
LineConfigFile file(f, myopts);
- std::shared_ptr<Sequence<std::string> > comment(new Sequence<std::string>);
+ std::shared_ptr<Sequence<std::string> > comment(std::make_shared<Sequence<std::string>>());
bool comment_used(false);
for (LineConfigFile::ConstIterator it(file.begin()), it_end(file.end()); it_end != it; ++it)
{
@@ -74,7 +74,7 @@ MaskFile::MaskFile(const FSEntry & f, const LineConfigFileOptions & opts) :
{
if (comment_used)
{
- std::shared_ptr<Sequence<std::string> > cpy(new Sequence<std::string>);
+ std::shared_ptr<Sequence<std::string> > cpy(std::make_shared<Sequence<std::string>>());
std::copy(comment->begin(), comment->end(), cpy->back_inserter());
comment = cpy;
comment_used = false;
@@ -83,7 +83,7 @@ MaskFile::MaskFile(const FSEntry & f, const LineConfigFileOptions & opts) :
continue;
}
- _imp->lines.push_back(std::make_pair(*it, std::shared_ptr<RepositoryMaskInfo>(new RepositoryMaskInfo(
+ _imp->lines.push_back(std::make_pair(*it, std::shared_ptr<RepositoryMaskInfo>(std::make_shared<RepositoryMaskInfo>(
make_named_values<RepositoryMaskInfo>(n::comment() = comment, n::mask_file() = f)))));
comment_used = true;
}
diff --git a/paludis/repositories/e/e_repository_sets.cc b/paludis/repositories/e/e_repository_sets.cc
index 0b3ba46..0bf7847 100644
--- a/paludis/repositories/e/e_repository_sets.cc
+++ b/paludis/repositories/e/e_repository_sets.cc
@@ -113,7 +113,7 @@ ERepositorySets::package_set(const SetName & ss) const
if ((_imp->params.setsdir() / (stringify(s.first) + ".conf")).exists())
{
- std::shared_ptr<GeneralSetDepTag> tag(new GeneralSetDepTag(ss, stringify(_imp->e_repository->name())));
+ std::shared_ptr<GeneralSetDepTag> tag(std::make_shared<GeneralSetDepTag>(ss, stringify(_imp->e_repository->name())));
FSEntry ff(_imp->params.setsdir() / (stringify(s.first) + ".conf"));
Context context("When loading package set '" + stringify(s.first) + "' from '" + stringify(ff) + "':");
@@ -138,7 +138,7 @@ ERepositorySets::sets_list() const
{
Context context("While generating the list of sets:");
- std::shared_ptr<SetNameSet> result(new SetNameSet);
+ std::shared_ptr<SetNameSet> result(std::make_shared<SetNameSet>());
result->insert(SetName("insecurity"));
result->insert(SetName("security"));
result->insert(SetName("system"));
@@ -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(std::make_shared<AllDepSpec>()));
+ std::shared_ptr<SetSpecTree> security_packages(std::make_shared<SetSpecTree>(std::make_shared<AllDepSpec>()));
if (!_imp->params.securitydir().is_directory_or_symlink_to_directory())
return security_packages;
@@ -303,11 +303,11 @@ ERepositorySets::security_set(bool insecurity) const
if (glsa_tags.end() == glsa_tags.find(glsa->id()))
glsa_tags.insert(std::make_pair(glsa->id(), std::shared_ptr<GLSADepTag>(
- new GLSADepTag(glsa->id(), glsa->title(), *f))));
+ std::make_shared<GLSADepTag>(glsa->id(), glsa->title(), *f))));
if (insecurity)
{
- std::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(
+ std::shared_ptr<PackageDepSpec> spec(std::make_shared<PackageDepSpec>(
make_package_dep_spec(PartiallyMadePackageDepSpecOptions())
.package((*c)->name())
.version_requirement(make_named_values<VersionRequirement>(
@@ -341,7 +341,7 @@ ERepositorySets::security_set(bool insecurity) const
continue;
}
- std::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(make_package_dep_spec(PartiallyMadePackageDepSpecOptions())
+ std::shared_ptr<PackageDepSpec> spec(std::make_shared<PackageDepSpec>(make_package_dep_spec(PartiallyMadePackageDepSpecOptions())
.package((*r)->name())
.version_requirement(make_named_values<VersionRequirement>(
n::version_operator() = vo_equal,
diff --git a/paludis/repositories/e/e_repository_sets_TEST.cc b/paludis/repositories/e/e_repository_sets_TEST.cc
index 40d58df..308214c 100644
--- a/paludis/repositories/e/e_repository_sets_TEST.cc
+++ b/paludis/repositories/e/e_repository_sets_TEST.cc
@@ -56,7 +56,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "e_repository_sets_TEST_dir/repo1"));
@@ -83,14 +83,14 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "e_repository_sets_TEST_dir/repo1"));
keys->insert("profiles", "e_repository_sets_TEST_dir/repo1/profiles/profile");
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
- std::shared_ptr<FakeInstalledRepository> installed(new FakeInstalledRepository(
+ std::shared_ptr<FakeInstalledRepository> installed(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("installed"),
@@ -123,7 +123,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "e_repository_sets_TEST_dir/repo1"));
@@ -154,8 +154,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::shared_ptr<Map<std::string, std::string> > keys(
- new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string> >());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "e_repository_sets_TEST_dir/repo1"));
@@ -163,7 +162,7 @@ namespace test_cases
std::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
- std::shared_ptr<FakeInstalledRepository> installed(new FakeInstalledRepository(
+ std::shared_ptr<FakeInstalledRepository> installed(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("installed"),
diff --git a/paludis/repositories/e/eapi.cc b/paludis/repositories/e/eapi.cc
index c4993cb..ce9d36c 100644
--- a/paludis/repositories/e/eapi.cc
+++ b/paludis/repositories/e/eapi.cc
@@ -149,7 +149,7 @@ namespace
std::shared_ptr<Set<std::string> > make_set(const std::string & s)
{
- std::shared_ptr<Set<std::string> > result(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > result(std::make_shared<Set<std::string>>());
tokenise_whitespace(s, result->inserter());
return result;
}
@@ -357,7 +357,7 @@ namespace paludis
std::bind(&predefined, stringify(d->dirname()), std::placeholders::_1, std::placeholders::_2),
&KeyValueConfigFile::no_transformation);
- std::shared_ptr<EAPI> eapi(new EAPI(make_named_values<EAPI>(
+ std::shared_ptr<EAPI> eapi(std::make_shared<EAPI>(make_named_values<EAPI>(
n::exported_name() = check_get(k, "exported_name"),
n::name() = strip_trailing_string(d->basename(), ".conf"),
n::supported() = make_supported_eapi(k)
diff --git a/paludis/repositories/e/ebuild_flat_metadata_cache_TEST.cc b/paludis/repositories/e/ebuild_flat_metadata_cache_TEST.cc
index 0c98360..27c1eed 100644
--- a/paludis/repositories/e/ebuild_flat_metadata_cache_TEST.cc
+++ b/paludis/repositories/e/ebuild_flat_metadata_cache_TEST.cc
@@ -64,7 +64,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
@@ -92,7 +92,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
@@ -120,7 +120,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
@@ -149,7 +149,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
@@ -180,7 +180,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
@@ -208,7 +208,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
@@ -236,7 +236,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
@@ -264,7 +264,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
@@ -292,7 +292,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
@@ -320,7 +320,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
@@ -349,7 +349,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
@@ -377,7 +377,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
@@ -405,7 +405,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
@@ -434,7 +434,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
@@ -462,7 +462,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
@@ -490,7 +490,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
@@ -518,7 +518,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
@@ -546,7 +546,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
@@ -574,7 +574,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
@@ -602,7 +602,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
@@ -633,7 +633,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
@@ -661,7 +661,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
@@ -689,7 +689,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
@@ -716,7 +716,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
@@ -747,7 +747,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
@@ -778,7 +778,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
@@ -806,7 +806,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
@@ -834,7 +834,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
@@ -862,7 +862,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
@@ -897,7 +897,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
@@ -925,7 +925,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
@@ -953,7 +953,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
@@ -985,7 +985,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
@@ -1017,7 +1017,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
@@ -1046,7 +1046,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
@@ -1075,7 +1075,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
@@ -1104,7 +1104,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
@@ -1140,7 +1140,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
@@ -1169,7 +1169,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
@@ -1204,7 +1204,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
@@ -1240,7 +1240,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
@@ -1276,7 +1276,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
@@ -1314,7 +1314,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "ebuild_flat_metadata_cache_TEST_dir/repo"));
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index 03e55c5..a35c128 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -133,10 +133,10 @@ namespace paludis
eclass_mtimes(m),
has_keys(false),
has_masks(false),
- raw_dependencies_labels(new DependenciesLabelSequence),
- build_dependencies_labels(new DependenciesLabelSequence),
- run_dependencies_labels(new DependenciesLabelSequence),
- post_dependencies_labels(new DependenciesLabelSequence)
+ raw_dependencies_labels(std::make_shared<DependenciesLabelSequence>()),
+ build_dependencies_labels(std::make_shared<DependenciesLabelSequence>()),
+ run_dependencies_labels(std::make_shared<DependenciesLabelSequence>()),
+ post_dependencies_labels(std::make_shared<DependenciesLabelSequence>())
{
raw_dependencies_labels->push_back(std::make_shared<DependenciesBuildLabel>("build",
return_literal_function(true)));
@@ -335,7 +335,7 @@ EbuildID::need_keys_added() const
if (_imp->eapi->supported()->choices_options()->profile_iuse_injection())
{
- std::shared_ptr<Set<std::string> > iuse_effective(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > iuse_effective(std::make_shared<Set<std::string>>());
if (! _imp->raw_iuse)
throw InternalError(PALUDIS_HERE, "no raw_iuse?");
@@ -1382,7 +1382,7 @@ EbuildID::add_build_options(const std::shared_ptr<Choices> & choices) const
{
if (eapi()->supported())
{
- std::shared_ptr<Choice> build_options(new Choice(make_named_values<ChoiceParams>(
+ std::shared_ptr<Choice> build_options(std::make_shared<Choice>(make_named_values<ChoiceParams>(
n::consider_added_or_changed() = false,
n::contains_every_value() = false,
n::hidden() = false,
diff --git a/paludis/repositories/e/exheres_layout.cc b/paludis/repositories/e/exheres_layout.cc
index b97918e..c323f28 100644
--- a/paludis/repositories/e/exheres_layout.cc
+++ b/paludis/repositories/e/exheres_layout.cc
@@ -82,13 +82,13 @@ namespace paludis
repository(n),
tree_root(t),
has_category_names(false),
- arch_list_files(new FSEntrySequence),
- repository_mask_files(new FSEntrySequence),
- profiles_desc_files(new FSEntrySequence),
- mirror_files(new FSEntrySequence),
- info_variables_files(new FSEntrySequence),
- info_packages_files(new FSEntrySequence),
- use_desc_files(new UseDescFileInfoSequence)
+ arch_list_files(std::make_shared<FSEntrySequence>()),
+ repository_mask_files(std::make_shared<FSEntrySequence>()),
+ profiles_desc_files(std::make_shared<FSEntrySequence>()),
+ mirror_files(std::make_shared<FSEntrySequence>()),
+ info_variables_files(std::make_shared<FSEntrySequence>()),
+ info_packages_files(std::make_shared<FSEntrySequence>()),
+ use_desc_files(std::make_shared<UseDescFileInfoSequence>())
{
}
};
@@ -231,7 +231,7 @@ ExheresLayout::need_package_ids(const QualifiedPackageName & n) const
Context context("When loading versions for '" + stringify(n) + "' in "
+ stringify(_imp->repository->name()) + ":");
- std::shared_ptr<PackageIDSequence> v(new PackageIDSequence);
+ std::shared_ptr<PackageIDSequence> v(std::make_shared<PackageIDSequence>());
FSEntry path(_imp->tree_root / "packages" / stringify(n.category()) / stringify(n.package()));
@@ -359,7 +359,7 @@ ExheresLayout::package_names(const CategoryNamePart & c) const
need_category_names();
if (_imp->category_names.end() == _imp->category_names.find(c))
- return std::shared_ptr<QualifiedPackageNameSet>(new QualifiedPackageNameSet);
+ return std::shared_ptr<QualifiedPackageNameSet>(std::make_shared<QualifiedPackageNameSet>());
if ((_imp->tree_root / "packages" / stringify(c)).is_directory_or_symlink_to_directory())
for (DirIterator d(_imp->tree_root / "packages" / stringify(c)), d_end ; d != d_end ; ++d)
@@ -384,7 +384,7 @@ ExheresLayout::package_names(const CategoryNamePart & c) const
_imp->category_names[c] = true;
- std::shared_ptr<QualifiedPackageNameSet> result(new QualifiedPackageNameSet);
+ std::shared_ptr<QualifiedPackageNameSet> result(std::make_shared<QualifiedPackageNameSet>());
for (PackagesMap::const_iterator p(_imp->package_names.begin()), p_end(_imp->package_names.end()) ;
p != p_end ; ++p)
@@ -407,7 +407,7 @@ ExheresLayout::package_ids(const QualifiedPackageName & n) const
return _imp->ids.find(n)->second;
}
else
- return std::shared_ptr<PackageIDSequence>(new PackageIDSequence);
+ return std::shared_ptr<PackageIDSequence>(std::make_shared<PackageIDSequence>());
}
const std::shared_ptr<const FSEntrySequence>
@@ -476,7 +476,7 @@ ExheresLayout::profiles_base_dir() const
std::shared_ptr<const FSEntrySequence>
ExheresLayout::exlibsdirs(const QualifiedPackageName & q) const
{
- std::shared_ptr<FSEntrySequence> result(new FSEntrySequence);
+ std::shared_ptr<FSEntrySequence> result(std::make_shared<FSEntrySequence>());
std::shared_ptr<const FSEntrySequence> global(exlibsdirs_global());
std::copy(global->begin(), global->end(), result->back_inserter());
@@ -493,7 +493,7 @@ ExheresLayout::exlibsdirs(const QualifiedPackageName & q) const
std::shared_ptr<const FSEntrySequence>
ExheresLayout::exlibsdirs_global() const
{
- std::shared_ptr<FSEntrySequence> result(new FSEntrySequence);
+ std::shared_ptr<FSEntrySequence> result(std::make_shared<FSEntrySequence>());
if (_imp->repository->params().master_repositories())
{
@@ -512,7 +512,7 @@ ExheresLayout::exlibsdirs_global() const
std::shared_ptr<const FSEntrySequence>
ExheresLayout::exlibsdirs_category(const CategoryNamePart & c) const
{
- std::shared_ptr<FSEntrySequence> result(new FSEntrySequence);
+ std::shared_ptr<FSEntrySequence> result(std::make_shared<FSEntrySequence>());
if (_imp->repository->params().master_repositories())
{
@@ -531,7 +531,7 @@ ExheresLayout::exlibsdirs_category(const CategoryNamePart & c) const
std::shared_ptr<const FSEntrySequence>
ExheresLayout::exlibsdirs_package(const QualifiedPackageName & q) const
{
- std::shared_ptr<FSEntrySequence> result(new FSEntrySequence);
+ std::shared_ptr<FSEntrySequence> result(std::make_shared<FSEntrySequence>());
if (_imp->repository->params().master_repositories())
{
@@ -550,7 +550,7 @@ ExheresLayout::exlibsdirs_package(const QualifiedPackageName & q) const
std::shared_ptr<const FSEntrySequence>
ExheresLayout::licenses_dirs() const
{
- std::shared_ptr<FSEntrySequence> result(new FSEntrySequence);
+ std::shared_ptr<FSEntrySequence> result(std::make_shared<FSEntrySequence>());
if (_imp->repository->params().master_repositories())
{
@@ -602,7 +602,7 @@ namespace
std::shared_ptr<Map<FSEntry, std::string> >
ExheresLayout::manifest_files(const QualifiedPackageName & qpn) const
{
- std::shared_ptr<Map<FSEntry, std::string> > result(new Map<FSEntry, std::string>);
+ std::shared_ptr<Map<FSEntry, std::string> > result(std::make_shared<Map<FSEntry, std::string>>());
FSEntry package_dir = _imp->repository->layout()->package_directory(qpn);
std::list<FSEntry> package_files((DirIterator(package_dir)),
diff --git a/paludis/repositories/e/exheres_profile.cc b/paludis/repositories/e/exheres_profile.cc
index 3550a61..7796de6 100644
--- a/paludis/repositories/e/exheres_profile.cc
+++ b/paludis/repositories/e/exheres_profile.cc
@@ -98,7 +98,7 @@ namespace paludis
const std::string &, const bool) :
env(e),
repository(p),
- profiles_with_parents(new FSEntrySequence),
+ profiles_with_parents(std::make_shared<FSEntrySequence>()),
options_conf(make_named_values<PaludisLikeOptionsConfParams>(
n::allow_locking() = true,
n::environment() = e,
@@ -106,14 +106,14 @@ namespace paludis
)),
package_mask_file(p),
packages_file(p),
- use_expand(new Set<std::string>),
- use_expand_hidden(new Set<std::string>),
- use_expand_unprefixed(new Set<std::string>),
- use_expand_implicit(new Set<std::string>),
- iuse_implicit(new Set<std::string>),
- use_expand_values(new Set<std::string>),
- system_packages(new SetSpecTree(std::make_shared<AllDepSpec>())),
- system_tag(new GeneralSetDepTag(SetName("system"), stringify(name)))
+ use_expand(std::make_shared<Set<std::string>>()),
+ use_expand_hidden(std::make_shared<Set<std::string>>()),
+ use_expand_unprefixed(std::make_shared<Set<std::string>>()),
+ use_expand_implicit(std::make_shared<Set<std::string>>()),
+ iuse_implicit(std::make_shared<Set<std::string>>()),
+ use_expand_values(std::make_shared<Set<std::string>>()),
+ system_packages(std::make_shared<SetSpecTree>(std::make_shared<AllDepSpec>())),
+ system_tag(std::make_shared<GeneralSetDepTag>(SetName("system"), stringify(name)))
{
environment_variables["CONFIG_PROTECT"] = getenv_with_default("CONFIG_PROTECT", "/etc");
environment_variables["CONFIG_PROTECT_MASK"] = getenv_with_default("CONFIG_PROTECT_MASK", "");
@@ -155,7 +155,7 @@ ExheresProfile::ExheresProfile(
continue;
Context context_spec("When parsing '" + i->second + "':");
- std::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(
+ std::shared_ptr<PackageDepSpec> spec(std::make_shared<PackageDepSpec>(
parse_elike_package_dep_spec(i->second.substr(1),
i->first->supported()->package_dep_spec_parse_options(),
i->first->supported()->version_spec_options(),
@@ -173,7 +173,7 @@ ExheresProfile::ExheresProfile(
try
{
- std::shared_ptr<const PackageDepSpec> a(new PackageDepSpec(
+ std::shared_ptr<const PackageDepSpec> a(std::make_shared<PackageDepSpec>(
parse_elike_package_dep_spec(line->second.first,
line->first->supported()->package_dep_spec_parse_options(),
line->first->supported()->version_spec_options(),
diff --git a/paludis/repositories/e/exndbam_repository.cc b/paludis/repositories/e/exndbam_repository.cc
index 300d368..68aaa9c 100644
--- a/paludis/repositories/e/exndbam_repository.cc
+++ b/paludis/repositories/e/exndbam_repository.cc
@@ -78,15 +78,15 @@ namespace paludis
ndbam(params.location(), &supported_exndbam, "exndbam-1",
EAPIData::get_instance()->eapi_from_string(
params.eapi_when_unknown())->supported()->version_spec_options()),
- location_key(new LiteralMetadataValueKey<FSEntry> ("location", "location",
+ location_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("location", "location",
mkt_significant, params.location())),
- root_key(new LiteralMetadataValueKey<FSEntry> ("root", "root",
+ root_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("root", "root",
mkt_normal, params.root())),
- format_key(new LiteralMetadataValueKey<std::string> ("format", "format",
+ format_key(std::make_shared<LiteralMetadataValueKey<std::string> >("format", "format",
mkt_significant, "vdb")),
- builddir_key(new LiteralMetadataValueKey<FSEntry> ("builddir", "builddir",
+ builddir_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("builddir", "builddir",
mkt_normal, params.builddir())),
- eapi_when_unknown_key(new LiteralMetadataValueKey<std::string> (
+ eapi_when_unknown_key(std::make_shared<LiteralMetadataValueKey<std::string> >(
"eapi_when_unknown", "eapi_when_unknown", mkt_normal, params.eapi_when_unknown()))
{
}
@@ -160,7 +160,7 @@ ExndbamRepository::repository_factory_create(
*DistributionData::get_instance()->distribution_from_string(
env->distribution()))->default_eapi_when_unknown();
- return std::shared_ptr<Repository>(new ExndbamRepository(
+ return std::shared_ptr<Repository>(std::make_shared<ExndbamRepository>(
RepositoryName(name),
make_named_values<ExndbamRepositoryParams>(
n::builddir() = builddir,
@@ -208,7 +208,7 @@ std::shared_ptr<const PackageIDSequence>
ExndbamRepository::package_ids(const QualifiedPackageName & q) const
{
std::shared_ptr<NDBAMEntrySequence> entries(_imp->ndbam.entries(q));
- std::shared_ptr<PackageIDSequence> result(new PackageIDSequence);
+ std::shared_ptr<PackageIDSequence> result(std::make_shared<PackageIDSequence>());
for (IndirectIterator<NDBAMEntrySequence::ConstIterator> e(entries->begin()), e_end(entries->end()) ;
e != e_end ; ++e)
@@ -496,9 +496,9 @@ ExndbamRepository::perform_uninstall(
std::shared_ptr<OutputManager> output_manager(a.options.make_output_manager()(a));
FSEntry ver_dir(id->fs_location_key()->value().realpath());
- std::shared_ptr<FSEntry> load_env(new FSEntry(ver_dir / "environment.bz2"));
+ std::shared_ptr<FSEntry> load_env(std::make_shared<FSEntry>(ver_dir / "environment.bz2"));
- std::shared_ptr<FSEntrySequence> eclassdirs(new FSEntrySequence);
+ std::shared_ptr<FSEntrySequence> eclassdirs(std::make_shared<FSEntrySequence>());
eclassdirs->push_back(ver_dir);
EAPIPhases phases(id->eapi()->supported()->ebuild_phases()->ebuild_uninstall());
diff --git a/paludis/repositories/e/exndbam_repository_TEST.cc b/paludis/repositories/e/exndbam_repository_TEST.cc
index 614d4bb..660a51f 100644
--- a/paludis/repositories/e/exndbam_repository_TEST.cc
+++ b/paludis/repositories/e/exndbam_repository_TEST.cc
@@ -75,7 +75,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "exndbam");
keys->insert("location", stringify(FSEntry::cwd() / "exndbam_repository_TEST_dir" / "repo1"));
keys->insert("builddir", stringify(FSEntry::cwd() / "exndbam_repository_TEST_dir" / "build"));
@@ -104,7 +104,7 @@ namespace test_cases
const std::string & chosen_one,
const std::string & victim) const
{
- std::shared_ptr<PackageIDSequence> replacing(new PackageIDSequence);
+ std::shared_ptr<PackageIDSequence> replacing(std::make_shared<PackageIDSequence>());
if (! victim.empty())
replacing->push_back(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec(victim,
@@ -125,7 +125,7 @@ namespace test_cases
{
TestEnvironment env(FSEntry("exndbam_repository_TEST_dir/root").realpath());
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "exndbam_repository_TEST_dir" / "postinsttest_src1"));
diff --git a/paludis/repositories/e/extra_distribution_data.cc b/paludis/repositories/e/extra_distribution_data.cc
index 45c7df1..4cfd6ec 100644
--- a/paludis/repositories/e/extra_distribution_data.cc
+++ b/paludis/repositories/e/extra_distribution_data.cc
@@ -31,7 +31,7 @@ namespace
{
std::shared_ptr<const Set<std::string> > make_set(const std::string & s)
{
- std::shared_ptr<Set<std::string> > result(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > result(std::make_shared<Set<std::string>>());
tokenise_whitespace(s, result->inserter());
return result;
}
diff --git a/paludis/repositories/e/fetch_visitor_TEST.cc b/paludis/repositories/e/fetch_visitor_TEST.cc
index 92f3e2c..273a745 100644
--- a/paludis/repositories/e/fetch_visitor_TEST.cc
+++ b/paludis/repositories/e/fetch_visitor_TEST.cc
@@ -46,7 +46,7 @@ namespace
const std::shared_ptr<const MirrorsSequence>
get_mirrors_fn(const std::string & m)
{
- const std::shared_ptr<MirrorsSequence> result(new MirrorsSequence);
+ const std::shared_ptr<MirrorsSequence> result(std::make_shared<MirrorsSequence>());
if (m == "repo")
result->push_back("http://fake-repo/fake-repo/");
if (m == "example")
@@ -64,7 +64,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- const std::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
diff --git a/paludis/repositories/e/fix_locked_dependencies.cc b/paludis/repositories/e/fix_locked_dependencies.cc
index d38f35e..570b5fe 100644
--- a/paludis/repositories/e/fix_locked_dependencies.cc
+++ b/paludis/repositories/e/fix_locked_dependencies.cc
@@ -61,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(std::make_shared<AllDepSpec>())),
+ result(std::make_shared<DependencySpecTree>(std::make_shared<AllDepSpec>())),
env(e),
eapi(a),
id(i)
diff --git a/paludis/repositories/e/fix_locked_dependencies_TEST.cc b/paludis/repositories/e/fix_locked_dependencies_TEST.cc
index 54f5ce0..56f8709 100644
--- a/paludis/repositories/e/fix_locked_dependencies_TEST.cc
+++ b/paludis/repositories/e/fix_locked_dependencies_TEST.cc
@@ -44,14 +44,14 @@ namespace test_cases
void run()
{
TestEnvironment env;
- const std::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
env.package_database()->add_repository(1, repo);
std::shared_ptr<const PackageID> id(repo->add_version("cat", "pkg", "1"));
- std::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(
+ std::shared_ptr<FakeInstalledRepository> installed_repo(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("installed"),
diff --git a/paludis/repositories/e/info_metadata_key.cc b/paludis/repositories/e/info_metadata_key.cc
index 7beddfa..b8eee1a 100644
--- a/paludis/repositories/e/info_metadata_key.cc
+++ b/paludis/repositories/e/info_metadata_key.cc
@@ -193,7 +193,7 @@ InfoPkgsMetadataKey::need_keys_added() const
else
{
using namespace std::placeholders;
- std::shared_ptr<Set<std::string> > s(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > s(std::make_shared<Set<std::string>>());
std::transform(indirect_iterator(q->begin()), indirect_iterator(q->end()), s->inserter(),
std::bind(std::mem_fn(&PackageID::canonical_form), _1, idcf_version));
key = std::make_shared<LiteralMetadataStringSetKey>(i->first, i->first, mkt_normal, s);
diff --git a/paludis/repositories/e/layout.cc b/paludis/repositories/e/layout.cc
index c7f8cdc..3de52c5 100644
--- a/paludis/repositories/e/layout.cc
+++ b/paludis/repositories/e/layout.cc
@@ -59,7 +59,7 @@ namespace
make_layout(const ERepository * const n, const FSEntry & b,
std::shared_ptr<const FSEntrySequence> f)
{
- return std::shared_ptr<Layout>(new T_(n, b, f));
+ return std::shared_ptr<Layout>(std::make_shared<T_>(n, b, f));
}
}
diff --git a/paludis/repositories/e/myoptions_requirements_verifier.cc b/paludis/repositories/e/myoptions_requirements_verifier.cc
index 75801a6..b40473c 100644
--- a/paludis/repositories/e/myoptions_requirements_verifier.cc
+++ b/paludis/repositories/e/myoptions_requirements_verifier.cc
@@ -53,7 +53,7 @@ namespace paludis
Imp(const std::shared_ptr<const ERepositoryID> & i) :
id(i),
- unmet_requirements(new Sequence<std::string>)
+ unmet_requirements(std::make_shared<Sequence<std::string>>())
{
current_prefix_stack.push_front(ChoicePrefixName(""));
current_children_stack.push_front(ChildrenList());
diff --git a/paludis/repositories/e/pipe_command_handler.cc b/paludis/repositories/e/pipe_command_handler.cc
index deea6cb..4ca05b0 100644
--- a/paludis/repositories/e/pipe_command_handler.cc
+++ b/paludis/repositories/e/pipe_command_handler.cc
@@ -272,7 +272,7 @@ paludis::erepository::pipe_command_handler(const Environment * const environment
"' resolves to '" << **entries->last() << "', which is a virtual for '"
<< *(*entries->last())->virtual_for_key()->value() << "'. This will break with "
"new style virtuals.";
- std::shared_ptr<PackageIDSequence> new_entries(new PackageIDSequence);
+ std::shared_ptr<PackageIDSequence> new_entries(std::make_shared<PackageIDSequence>());
new_entries->push_back((*entries->last())->virtual_for_key()->value());
entries = new_entries;
}
@@ -332,7 +332,7 @@ paludis::erepository::pipe_command_handler(const Environment * const environment
generator::Matches(spec, MatchPackageOptions()) | filter::InstalledAtRoot(environment->root()))]);
if (eapi->supported()->pipe_commands()->rewrite_virtuals() && (! entries->empty()))
{
- std::shared_ptr<PackageIDSequence> new_entries(new PackageIDSequence);
+ std::shared_ptr<PackageIDSequence> new_entries(std::make_shared<PackageIDSequence>());
for (PackageIDSequence::ConstIterator i(entries->begin()), i_end(entries->end()) ;
i != i_end ; ++i)
{
diff --git a/paludis/repositories/e/profile.cc b/paludis/repositories/e/profile.cc
index 3f1c2d1..b46fbd8 100644
--- a/paludis/repositories/e/profile.cc
+++ b/paludis/repositories/e/profile.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
@@ -45,7 +45,7 @@ namespace
const std::string & a,
const bool x)
{
- return std::shared_ptr<Profile>(new T_(env, repo, name, locations, a, x));
+ return std::shared_ptr<Profile>(std::make_shared<T_>(env, repo, name, locations, a, x));
}
}
diff --git a/paludis/repositories/e/registration.cc b/paludis/repositories/e/registration.cc
index 2513f51..166c21d 100644
--- a/paludis/repositories/e/registration.cc
+++ b/paludis/repositories/e/registration.cc
@@ -53,7 +53,7 @@ namespace paludis
void register_repositories<repository_groups::e>(const repository_groups::e * const,
RepositoryFactory * const factory)
{
- std::shared_ptr<Set<std::string> > ebuild_formats(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > ebuild_formats(std::make_shared<Set<std::string>>());
ebuild_formats->insert("e");
ebuild_formats->insert("ebuild");
ebuild_formats->insert("exheres");
@@ -66,7 +66,7 @@ namespace paludis
&ERepository::repository_factory_dependencies
);
- std::shared_ptr<Set<std::string> > vdb_formats(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > vdb_formats(std::make_shared<Set<std::string>>());
vdb_formats->insert("vdb");
factory->add_repository_format(
@@ -77,7 +77,7 @@ namespace paludis
&VDBRepository::repository_factory_dependencies
);
- std::shared_ptr<Set<std::string> > exndbam_formats(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > exndbam_formats(std::make_shared<Set<std::string>>());
exndbam_formats->insert("exndbam");
factory->add_repository_format(
diff --git a/paludis/repositories/e/source_uri_finder_TEST.cc b/paludis/repositories/e/source_uri_finder_TEST.cc
index f4a25f3..9332681 100644
--- a/paludis/repositories/e/source_uri_finder_TEST.cc
+++ b/paludis/repositories/e/source_uri_finder_TEST.cc
@@ -36,7 +36,7 @@ namespace
const std::shared_ptr<MirrorsSequence>
get_mirrors_fn(const std::string & m)
{
- const std::shared_ptr<MirrorsSequence> result(new MirrorsSequence);
+ const std::shared_ptr<MirrorsSequence> result(std::make_shared<MirrorsSequence>());
if (m == "example")
result->push_back("http://fake-example/fake-example/");
if (m == "repo")
@@ -54,7 +54,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- const std::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
@@ -84,7 +84,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- const std::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
diff --git a/paludis/repositories/e/traditional_layout.cc b/paludis/repositories/e/traditional_layout.cc
index b0c114c..b2d9ce5 100644
--- a/paludis/repositories/e/traditional_layout.cc
+++ b/paludis/repositories/e/traditional_layout.cc
@@ -82,13 +82,13 @@ namespace paludis
repository(r),
tree_root(t),
has_category_names(false),
- arch_list_files(new FSEntrySequence),
- repository_mask_files(new FSEntrySequence),
- profiles_desc_files(new FSEntrySequence),
- mirror_files(new FSEntrySequence),
- info_packages_files(new FSEntrySequence),
- info_variables_files(new FSEntrySequence),
- use_desc_files(new UseDescFileInfoSequence)
+ arch_list_files(std::make_shared<FSEntrySequence>()),
+ repository_mask_files(std::make_shared<FSEntrySequence>()),
+ profiles_desc_files(std::make_shared<FSEntrySequence>()),
+ mirror_files(std::make_shared<FSEntrySequence>()),
+ info_packages_files(std::make_shared<FSEntrySequence>()),
+ info_variables_files(std::make_shared<FSEntrySequence>()),
+ use_desc_files(std::make_shared<UseDescFileInfoSequence>())
{
}
};
@@ -243,7 +243,7 @@ TraditionalLayout::need_package_ids(const QualifiedPackageName & n) const
Context context("When loading versions for '" + stringify(n) + "' in "
+ stringify(_imp->repository->name()) + ":");
- std::shared_ptr<PackageIDSequence> v(new PackageIDSequence);
+ std::shared_ptr<PackageIDSequence> v(std::make_shared<PackageIDSequence>());
FSEntry path(_imp->tree_root / stringify(n.category()) / stringify(n.package()));
@@ -370,7 +370,7 @@ TraditionalLayout::package_names(const CategoryNamePart & c) const
need_category_names();
if (_imp->category_names.end() == _imp->category_names.find(c))
- return std::shared_ptr<QualifiedPackageNameSet>(new QualifiedPackageNameSet);
+ return std::shared_ptr<QualifiedPackageNameSet>(std::make_shared<QualifiedPackageNameSet>());
if ((_imp->tree_root / stringify(c)).is_directory_or_symlink_to_directory())
for (DirIterator d(_imp->tree_root / stringify(c), DirIteratorOptions() + dio_inode_sort), d_end ; d != d_end ; ++d)
@@ -395,7 +395,7 @@ TraditionalLayout::package_names(const CategoryNamePart & c) const
_imp->category_names[c] = true;
- std::shared_ptr<QualifiedPackageNameSet> result(new QualifiedPackageNameSet);
+ std::shared_ptr<QualifiedPackageNameSet> result(std::make_shared<QualifiedPackageNameSet>());
for (PackagesMap::const_iterator p(_imp->package_names.begin()), p_end(_imp->package_names.end()) ;
p != p_end ; ++p)
@@ -418,7 +418,7 @@ TraditionalLayout::package_ids(const QualifiedPackageName & n) const
return _imp->ids.find(n)->second;
}
else
- return std::shared_ptr<PackageIDSequence>(new PackageIDSequence);
+ return std::shared_ptr<PackageIDSequence>(std::make_shared<PackageIDSequence>());
}
const std::shared_ptr<const FSEntrySequence>
@@ -487,7 +487,7 @@ TraditionalLayout::profiles_base_dir() const
std::shared_ptr<const FSEntrySequence>
TraditionalLayout::exlibsdirs(const QualifiedPackageName & q) const
{
- std::shared_ptr<FSEntrySequence> result(new FSEntrySequence);
+ std::shared_ptr<FSEntrySequence> result(std::make_shared<FSEntrySequence>());
std::shared_ptr<const FSEntrySequence> global(exlibsdirs_global());
std::copy(global->begin(), global->end(), result->back_inserter());
@@ -504,7 +504,7 @@ TraditionalLayout::exlibsdirs(const QualifiedPackageName & q) const
std::shared_ptr<const FSEntrySequence>
TraditionalLayout::exlibsdirs_global() const
{
- std::shared_ptr<FSEntrySequence> result(new FSEntrySequence);
+ std::shared_ptr<FSEntrySequence> result(std::make_shared<FSEntrySequence>());
if (_imp->repository->params().master_repositories())
{
@@ -523,7 +523,7 @@ TraditionalLayout::exlibsdirs_global() const
std::shared_ptr<const FSEntrySequence>
TraditionalLayout::exlibsdirs_category(const CategoryNamePart & c) const
{
- std::shared_ptr<FSEntrySequence> result(new FSEntrySequence);
+ std::shared_ptr<FSEntrySequence> result(std::make_shared<FSEntrySequence>());
if (_imp->repository->params().master_repositories())
{
@@ -542,7 +542,7 @@ TraditionalLayout::exlibsdirs_category(const CategoryNamePart & c) const
std::shared_ptr<const FSEntrySequence>
TraditionalLayout::exlibsdirs_package(const QualifiedPackageName & q) const
{
- std::shared_ptr<FSEntrySequence> result(new FSEntrySequence);
+ std::shared_ptr<FSEntrySequence> result(std::make_shared<FSEntrySequence>());
if (_imp->repository->params().master_repositories())
{
@@ -561,7 +561,7 @@ TraditionalLayout::exlibsdirs_package(const QualifiedPackageName & q) const
std::shared_ptr<const FSEntrySequence>
TraditionalLayout::licenses_dirs() const
{
- std::shared_ptr<FSEntrySequence> result(new FSEntrySequence);
+ std::shared_ptr<FSEntrySequence> result(std::make_shared<FSEntrySequence>());
if (_imp->repository->params().master_repositories())
{
@@ -613,7 +613,7 @@ namespace
std::shared_ptr<Map<FSEntry, std::string> >
TraditionalLayout::manifest_files(const QualifiedPackageName & qpn) const
{
- std::shared_ptr<Map<FSEntry, std::string> > result(new Map<FSEntry, std::string>);
+ std::shared_ptr<Map<FSEntry, std::string> > result(std::make_shared<Map<FSEntry, std::string>>());
FSEntry package_dir = _imp->repository->layout()->package_directory(qpn);
std::list<FSEntry> package_files((DirIterator(package_dir, DirIteratorOptions() + dio_inode_sort)),
diff --git a/paludis/repositories/e/traditional_profile.cc b/paludis/repositories/e/traditional_profile.cc
index 1e33aa3..a92a0d3 100644
--- a/paludis/repositories/e/traditional_profile.cc
+++ b/paludis/repositories/e/traditional_profile.cc
@@ -193,15 +193,15 @@ namespace paludis
package_mask_file(p),
env(e),
repository(p),
- profiles_with_parents(new FSEntrySequence),
- 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>),
- use_expand_hidden(new Set<std::string>),
- use_expand_unprefixed(new Set<std::string>),
- use_expand_implicit(new Set<std::string>),
- iuse_implicit(new Set<std::string>)
+ profiles_with_parents(std::make_shared<FSEntrySequence>()),
+ system_packages(std::make_shared<SetSpecTree>(std::make_shared<AllDepSpec>())),
+ system_tag(std::make_shared<GeneralSetDepTag>(SetName("system"), stringify(name))),
+ virtuals(std::make_shared<Map<QualifiedPackageName, PackageDepSpec>>()),
+ use_expand(std::make_shared<Set<std::string>>()),
+ use_expand_hidden(std::make_shared<Set<std::string>>()),
+ use_expand_unprefixed(std::make_shared<Set<std::string>>()),
+ use_expand_implicit(std::make_shared<Set<std::string>>()),
+ iuse_implicit(std::make_shared<Set<std::string>>())
{
Context context("When loading profiles '" + join(dirs.begin(), dirs.end(), "' '") + "' for repository '" + stringify(name) + "':");
@@ -454,7 +454,7 @@ Imp<TraditionalProfile>::load_profile_make_defaults(const FSEntry & dir)
for (Set<std::string>::ConstIterator x(use_expand->begin()), x_end(use_expand->end()) ;
x != x_end ; ++x)
{
- std::shared_ptr<Set<std::string> > v(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > v(std::make_shared<Set<std::string>>());
tokenise_whitespace(environment_variables[use_expand_values_part_var + *x], v->inserter());
use_expand_values.insert(std::make_pair(*x, v));
}
@@ -462,7 +462,7 @@ Imp<TraditionalProfile>::load_profile_make_defaults(const FSEntry & dir)
for (Set<std::string>::ConstIterator x(use_expand_unprefixed->begin()), x_end(use_expand_unprefixed->end()) ;
x != x_end ; ++x)
{
- std::shared_ptr<Set<std::string> > v(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > v(std::make_shared<Set<std::string>>());
tokenise_whitespace(environment_variables[use_expand_values_part_var + *x], v->inserter());
use_expand_values.insert(std::make_pair(*x, v));
}
@@ -576,7 +576,7 @@ Imp<TraditionalProfile>::make_vars_from_file_vars()
continue;
Context context_spec("When parsing '" + i->second + "':");
- std::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(
+ std::shared_ptr<PackageDepSpec> spec(std::make_shared<PackageDepSpec>(
parse_elike_package_dep_spec(i->second.substr(1),
i->first->supported()->package_dep_spec_parse_options(),
i->first->supported()->version_spec_options(),
@@ -634,7 +634,7 @@ Imp<TraditionalProfile>::make_vars_from_file_vars()
try
{
- std::shared_ptr<const PackageDepSpec> a(new PackageDepSpec(
+ std::shared_ptr<const PackageDepSpec> a(std::make_shared<PackageDepSpec>(
parse_elike_package_dep_spec(line->second.first,
line->first->supported()->package_dep_spec_parse_options(),
line->first->supported()->version_spec_options(),
@@ -718,7 +718,7 @@ Imp<TraditionalProfile>::load_spec_use_file(const EAPI & eapi, const FSEntry & f
try
{
- std::shared_ptr<const PackageDepSpec> spec(new PackageDepSpec(
+ std::shared_ptr<const PackageDepSpec> spec(std::make_shared<PackageDepSpec>(
parse_elike_package_dep_spec(*tokens.begin(), eapi.supported()->package_dep_spec_parse_options(),
eapi.supported()->version_spec_options(),
std::shared_ptr<const PackageID>())));
@@ -988,7 +988,7 @@ TraditionalProfile::known_choice_value_names(
KnownMap::const_iterator it2(it->second.find(lower_x));
if (it->second.end() == it2)
{
- std::shared_ptr<Set<UnprefixedChoiceName> > result(new Set<UnprefixedChoiceName>);
+ std::shared_ptr<Set<UnprefixedChoiceName> > result(std::make_shared<Set<UnprefixedChoiceName>>());
it2 = it->second.insert(std::make_pair(lower_x, result)).first;
KnownMap::const_iterator i(_imp->known_choice_value_names.find(lower_x));
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index c4be416..8baf491 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_repository.cc
@@ -137,20 +137,20 @@ namespace paludis
has_category_names(false),
tried_provides_cache(false),
used_provides_cache(false),
- names_cache(new RepositoryNameCache(p.names_cache(), r)),
- location_key(new LiteralMetadataValueKey<FSEntry> ("location", "location",
+ names_cache(std::make_shared<RepositoryNameCache>(p.names_cache(), r)),
+ location_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("location", "location",
mkt_significant, params.location())),
- root_key(new LiteralMetadataValueKey<FSEntry> ("root", "root",
+ root_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("root", "root",
mkt_normal, params.root())),
- format_key(new LiteralMetadataValueKey<std::string> ("format", "format",
+ format_key(std::make_shared<LiteralMetadataValueKey<std::string> >("format", "format",
mkt_significant, "vdb")),
- provides_cache_key(new LiteralMetadataValueKey<FSEntry> ("provides_cache", "provides_cache",
+ provides_cache_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("provides_cache", "provides_cache",
mkt_normal, params.provides_cache())),
- names_cache_key(new LiteralMetadataValueKey<FSEntry> ("names_cache", "names_cache",
+ names_cache_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("names_cache", "names_cache",
mkt_normal, params.names_cache())),
- builddir_key(new LiteralMetadataValueKey<FSEntry> ("builddir", "builddir",
+ builddir_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("builddir", "builddir",
mkt_normal, params.builddir())),
- eapi_when_unknown_key(new LiteralMetadataValueKey<std::string> (
+ eapi_when_unknown_key(std::make_shared<LiteralMetadataValueKey<std::string> >(
"eapi_when_unknown", "eapi_when_unknown", mkt_normal, params.eapi_when_unknown()))
{
}
@@ -245,7 +245,7 @@ VDBRepository::category_names() const
need_category_names();
- std::shared_ptr<CategoryNamePartSet> result(new CategoryNamePartSet);
+ std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
std::transform(_imp->categories.begin(), _imp->categories.end(), result->inserter(),
std::mem_fn(&std::pair<const CategoryNamePart, std::shared_ptr<QualifiedPackageNameSet> >::first));
@@ -261,7 +261,7 @@ VDBRepository::package_names(const CategoryNamePart & c) const
Context context("When fetching package names in category '" + stringify(c)
+ "' in " + stringify(name()) + ":");
- std::shared_ptr<QualifiedPackageNameSet> result(new QualifiedPackageNameSet);
+ std::shared_ptr<QualifiedPackageNameSet> result(std::make_shared<QualifiedPackageNameSet>());
need_category_names();
if (! has_category_named(c))
@@ -350,7 +350,7 @@ VDBRepository::repository_factory_create(
*DistributionData::get_instance()->distribution_from_string(
env->distribution()))->default_eapi_when_unknown();
- return std::shared_ptr<Repository>(new VDBRepository(make_named_values<VDBRepositoryParams>(
+ return std::shared_ptr<Repository>(std::make_shared<VDBRepository>(make_named_values<VDBRepositoryParams>(
n::builddir() = builddir,
n::eapi_when_unknown() = eapi_when_unknown,
n::environment() = env,
@@ -418,14 +418,14 @@ VDBRepository::perform_uninstall(
std::string reinstalling_str(a.options.is_overwrite() ? "-reinstalling-" : "");
- std::shared_ptr<FSEntrySequence> eclassdirs(new FSEntrySequence);
+ std::shared_ptr<FSEntrySequence> eclassdirs(std::make_shared<FSEntrySequence>());
eclassdirs->push_back(FSEntry(_imp->params.location() / stringify(id->name().category()) /
(reinstalling_str + stringify(id->name().package()) + "-" + stringify(id->version()))));
FSEntry pkg_dir(_imp->params.location() / stringify(id->name().category()) / (reinstalling_str +
stringify(id->name().package()) + "-" + stringify(id->version())));
- std::shared_ptr<FSEntry> load_env(new FSEntry(pkg_dir / "environment.bz2"));
+ std::shared_ptr<FSEntry> load_env(std::make_shared<FSEntry>(pkg_dir / "environment.bz2"));
EAPIPhases phases(id->eapi()->supported()->ebuild_phases()->ebuild_uninstall());
for (EAPIPhases::ConstIterator phase(phases.begin_phases()), phase_end(phases.end_phases()) ;
@@ -531,7 +531,7 @@ VDBRepository::perform_uninstall(
IDMap::iterator it2(_imp->ids.find(id->name()));
if (_imp->ids.end() != it2)
{
- std::shared_ptr<PackageIDSequence> ids(new PackageIDSequence);
+ std::shared_ptr<PackageIDSequence> ids(std::make_shared<PackageIDSequence>());
std::remove_copy(it2->second->begin(), it2->second->end(), ids->back_inserter(), id);
it2->second = ids;
}
@@ -675,7 +675,7 @@ VDBRepository::load_provided_using_cache() const
VersionSpec v(tokens.at(1), EAPIData::get_instance()->eapi_from_string(
_imp->params.eapi_when_unknown())->supported()->version_spec_options());
- std::shared_ptr<std::list<QualifiedPackageName> > qpns(new std::list<QualifiedPackageName>);
+ std::shared_ptr<std::list<QualifiedPackageName> > qpns(std::make_shared<std::list<QualifiedPackageName>>());
std::copy(tokens.begin() + 2, tokens.end(), create_inserter<QualifiedPackageName>(
std::back_inserter(*qpns)));
@@ -714,7 +714,7 @@ VDBRepository::provides_from_package_id(const PackageID & id) const
DepSpecFlattener<ProvideSpecTree, PackageDepSpec> f(_imp->params.environment());
provide->root()->accept(f);
- std::shared_ptr<std::list<QualifiedPackageName> > qpns(new std::list<QualifiedPackageName>);
+ std::shared_ptr<std::list<QualifiedPackageName> > qpns(std::make_shared<std::list<QualifiedPackageName>>());
for (DepSpecFlattener<ProvideSpecTree, PackageDepSpec>::ConstIterator
p(f.begin()), p_end(f.end()) ; p != p_end ; ++p)
@@ -992,7 +992,7 @@ VDBRepository::merge(const MergeParams & m)
IDMap::iterator it2(_imp->ids.find(m.package_id()->name()));
if (_imp->ids.end() == it2)
{
- std::shared_ptr<PackageIDSequence> ids(new PackageIDSequence);
+ std::shared_ptr<PackageIDSequence> ids(std::make_shared<PackageIDSequence>());
it2 = _imp->ids.insert(std::make_pair(m.package_id()->name(), ids)).first;
}
it2->second->push_back(new_id = make_id(m.package_id()->name(), m.package_id()->version(), vdb_dir));
@@ -1094,7 +1094,7 @@ VDBRepository::need_package_ids(const CategoryNamePart & c) const
Context context("When loading package names from '" + stringify(_imp->params.location()) +
"' in category '" + stringify(c) + "':");
- std::shared_ptr<QualifiedPackageNameSet> q(new QualifiedPackageNameSet);
+ std::shared_ptr<QualifiedPackageNameSet> q(std::make_shared<QualifiedPackageNameSet>());
for (DirIterator d(_imp->params.location() / stringify(c), DirIteratorOptions() + dio_inode_sort), d_end ; d != d_end ; ++d)
try
@@ -1134,7 +1134,7 @@ VDBRepository::make_id(const QualifiedPackageName & q, const VersionSpec & v, co
Context context("When creating ID for '" + stringify(q) + "-" + stringify(v) + "' from '" + stringify(f) + "':");
- std::shared_ptr<VDBID> result(new VDBID(q, v, _imp->params.environment(), shared_from_this(), f));
+ std::shared_ptr<VDBID> result(std::make_shared<VDBID>(q, v, _imp->params.environment(), shared_from_this(), f));
return result;
}
diff --git a/paludis/repositories/e/vdb_repository_TEST.cc b/paludis/repositories/e/vdb_repository_TEST.cc
index ab36900..ca0b2f9 100644
--- a/paludis/repositories/e/vdb_repository_TEST.cc
+++ b/paludis/repositories/e/vdb_repository_TEST.cc
@@ -96,7 +96,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "vdb");
keys->insert("names_cache", "/var/empty");
keys->insert("provides_cache", "/var/empty");
@@ -116,8 +116,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(
- new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "vdb");
keys->insert("names_cache", "/var/empty");
keys->insert("provides_cache", "/var/empty");
@@ -140,8 +139,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(
- new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "vdb");
keys->insert("names_cache", "/var/empty");
keys->insert("provides_cache", "/var/empty");
@@ -211,7 +209,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "vdb");
keys->insert("names_cache", "/var/empty");
keys->insert("provides_cache", "/var/empty");
@@ -266,8 +264,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(
- new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "vdb");
keys->insert("names_cache", "/var/empty");
keys->insert("provides_cache", "/var/empty");
@@ -324,7 +321,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "srcrepo"));
@@ -454,7 +451,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "srcrepo"));
@@ -585,7 +582,7 @@ namespace test_cases
const std::string & chosen_one,
const std::string & victim) const
{
- std::shared_ptr<PackageIDSequence> replacing(new PackageIDSequence);
+ std::shared_ptr<PackageIDSequence> replacing(std::make_shared<PackageIDSequence>());
if (! victim.empty())
replacing->push_back(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec(victim,
@@ -606,7 +603,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "namesincrtest_src"));
@@ -855,7 +852,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys = std::make_shared<Map<std::string, std::string>>();
keys->insert("format", "vdb");
keys->insert("names_cache", "/var/empty");
@@ -948,7 +945,7 @@ namespace test_cases
const std::string & chosen_one,
const std::string & victim) const
{
- std::shared_ptr<PackageIDSequence> replacing(new PackageIDSequence);
+ std::shared_ptr<PackageIDSequence> replacing(std::make_shared<PackageIDSequence>());
if (! victim.empty())
replacing->push_back(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec(victim,
@@ -969,7 +966,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "providesincrtest_src1"));
@@ -1164,7 +1161,7 @@ namespace test_cases
{
TestEnvironment env;
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "reinstalltest_src1"));
@@ -1274,7 +1271,7 @@ namespace test_cases
const std::string & chosen_one,
const std::string & victim) const
{
- std::shared_ptr<PackageIDSequence> replacing(new PackageIDSequence);
+ std::shared_ptr<PackageIDSequence> replacing(std::make_shared<PackageIDSequence>());
if (! victim.empty())
replacing->push_back(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec(victim,
@@ -1295,7 +1292,7 @@ namespace test_cases
{
TestEnvironment env(FSEntry(stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "root")).realpath());
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "postinsttest_src1"));
diff --git a/paludis/repositories/e/vdb_unmerger_TEST.cc b/paludis/repositories/e/vdb_unmerger_TEST.cc
index b02c711..d365b6b 100644
--- a/paludis/repositories/e/vdb_unmerger_TEST.cc
+++ b/paludis/repositories/e/vdb_unmerger_TEST.cc
@@ -112,7 +112,7 @@ namespace
void run()
{
env.set_paludis_command("/bin/false");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "vdb");
keys->insert("names_cache", "/var/empty");
keys->insert("provides_cache", "/var/empty");
diff --git a/paludis/repositories/e/xml_things.cc b/paludis/repositories/e/xml_things.cc
index c8520be..fc44082 100644
--- a/paludis/repositories/e/xml_things.cc
+++ b/paludis/repositories/e/xml_things.cc
@@ -125,7 +125,7 @@ namespace
public:
GLSAHandler() :
- _glsa(new GLSA)
+ _glsa(std::make_shared<GLSA>())
{
}
@@ -238,7 +238,7 @@ namespace
{
std::string m;
handle_package_name(doc, n->properties, m);
- std::shared_ptr<GLSAPackage> pkg(new GLSAPackage(QualifiedPackageName(m)));
+ std::shared_ptr<GLSAPackage> pkg(std::make_shared<GLSAPackage>(QualifiedPackageName(m)));
handle_package_archs(doc, n->properties, pkg);
handle_package_children(doc, n->children, pkg);
_glsa->add_package(pkg);
@@ -283,7 +283,7 @@ paludis_xml_things_create_glsa_from_xml_file(const std::string & filename)
std::shared_ptr<erepository::MetadataXML>
paludis_xml_things_create_metadata_xml_from_xml_file(const FSEntry & filename)
{
- std::shared_ptr<erepository::MetadataXML> result(new erepository::MetadataXML(
+ std::shared_ptr<erepository::MetadataXML> result(std::make_shared<erepository::MetadataXML>(
make_named_values<erepository::MetadataXML>(
n::herds() = std::make_shared<Sequence<std::string>>(),
n::long_description() = "",
diff --git a/paludis/repositories/fake/fake_installed_repository.cc b/paludis/repositories/fake/fake_installed_repository.cc
index 2d84b83..4ab7d34 100644
--- a/paludis/repositories/fake/fake_installed_repository.cc
+++ b/paludis/repositories/fake/fake_installed_repository.cc
@@ -47,9 +47,9 @@ namespace paludis
const bool is_suitable_destination;
Imp(const bool s, const bool b) :
- format_key(new LiteralMetadataValueKey<std::string> (
+ format_key(std::make_shared<LiteralMetadataValueKey<std::string> >(
"format", "format", mkt_significant, "installed_fake")),
- installed_root_key(new LiteralMetadataValueKey<FSEntry> (
+ installed_root_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >(
"installed_root", "installed_root", mkt_normal, FSEntry("/"))),
supports_uninstall(s),
is_suitable_destination(b)
@@ -87,7 +87,7 @@ FakeInstalledRepository::is_suitable_destination_for(const PackageID &) const
std::shared_ptr<const FakeInstalledRepository::ProvidesSequence>
FakeInstalledRepository::provided_packages() const
{
- std::shared_ptr<ProvidesSequence> result(new ProvidesSequence);
+ std::shared_ptr<ProvidesSequence> result(std::make_shared<ProvidesSequence>());
std::shared_ptr<const CategoryNamePartSet> cats(category_names());
for (CategoryNamePartSet::ConstIterator c(cats->begin()), c_end(cats->end()) ;
diff --git a/paludis/repositories/fake/fake_installed_repository_TEST.cc b/paludis/repositories/fake/fake_installed_repository_TEST.cc
index 163a6fa..fc3d6bf 100644
--- a/paludis/repositories/fake/fake_installed_repository_TEST.cc
+++ b/paludis/repositories/fake/fake_installed_repository_TEST.cc
@@ -35,7 +35,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::shared_ptr<const FakeInstalledRepository> r(new FakeInstalledRepository(
+ std::shared_ptr<const FakeInstalledRepository> r(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("fake"),
diff --git a/paludis/repositories/fake/fake_package_id.cc b/paludis/repositories/fake/fake_package_id.cc
index 57e71c2..a470d23 100644
--- a/paludis/repositories/fake/fake_package_id.cc
+++ b/paludis/repositories/fake/fake_package_id.cc
@@ -245,7 +245,7 @@ namespace paludis
Imp(const std::function<const std::shared_ptr<const FetchableURISpecTree> (const std::string &)> & f,
const std::string & r, const std::string & h, const MetadataKeyType t) :
func(f),
- initial_label(new URIListedThenMirrorsLabel("listed-then-mirrors")),
+ initial_label(std::make_shared<URIListedThenMirrorsLabel>("listed-then-mirrors")),
raw_name(r),
human_name(h),
type(t)
@@ -478,7 +478,7 @@ namespace paludis
Imp(const Environment * const e, const std::shared_ptr<const PackageID> & i) :
env(e),
id(i),
- value(new Choices)
+ value(std::make_shared<Choices>())
{
}
};
@@ -564,7 +564,7 @@ FakeMetadataChoicesKey::add(const std::string & n, const std::string & v)
{
if (_imp->choices.end() == _imp->choices.find(n))
{
- std::shared_ptr<Choice> c(new Choice(make_named_values<ChoiceParams>(
+ std::shared_ptr<Choice> c(std::make_shared<Choice>(make_named_values<ChoiceParams>(
n::consider_added_or_changed() = false,
n::contains_every_value() = false,
n::hidden() = false,
@@ -723,13 +723,13 @@ namespace paludis
repository(r),
name(q),
version(v),
- build_dependencies_labels(new DependenciesLabelSequence),
- run_dependencies_labels(new DependenciesLabelSequence),
- post_dependencies_labels(new DependenciesLabelSequence),
- suggested_dependencies_labels(new DependenciesLabelSequence),
- slot(new LiteralMetadataValueKey<SlotName>("SLOT", "Slot", mkt_internal, SlotName("0"))),
- keywords(new FakeMetadataKeywordSetKey("KEYWORDS", "Keywords", "test", mkt_normal, id, env)),
- behaviours_set(new Set<std::string>),
+ build_dependencies_labels(std::make_shared<DependenciesLabelSequence>()),
+ run_dependencies_labels(std::make_shared<DependenciesLabelSequence>()),
+ post_dependencies_labels(std::make_shared<DependenciesLabelSequence>()),
+ suggested_dependencies_labels(std::make_shared<DependenciesLabelSequence>()),
+ slot(std::make_shared<LiteralMetadataValueKey<SlotName>>("SLOT", "Slot", mkt_internal, SlotName("0"))),
+ keywords(std::make_shared<FakeMetadataKeywordSetKey>("KEYWORDS", "Keywords", "test", mkt_normal, id, env)),
+ behaviours_set(std::make_shared<Set<std::string>>()),
has_masks(false)
{
build_dependencies_labels->push_back(std::make_shared<DependenciesBuildLabel>("DEPEND",
@@ -1321,7 +1321,7 @@ FakeMetadataKeywordSetKey::pretty_print_flat(const Formatter<KeywordName> & f) c
if (! result.empty())
result.append(" ");
- std::shared_ptr<KeywordNameSet> k(new KeywordNameSet);
+ std::shared_ptr<KeywordNameSet> k(std::make_shared<KeywordNameSet>());
k->insert(*i);
if (_imp->env->accept_keywords(k, *_imp->id))
result.append(f.format(*i, format::Accepted()));
diff --git a/paludis/repositories/fake/fake_repository.cc b/paludis/repositories/fake/fake_repository.cc
index fa61e29..6201af3 100644
--- a/paludis/repositories/fake/fake_repository.cc
+++ b/paludis/repositories/fake/fake_repository.cc
@@ -44,8 +44,8 @@ namespace paludis
std::shared_ptr<const MetadataValueKey<std::string> > format_key;
Imp() :
- virtual_packages(new FakeRepository::VirtualsSequence),
- format_key(new LiteralMetadataValueKey<std::string> (
+ virtual_packages(std::make_shared<FakeRepository::VirtualsSequence>()),
+ format_key(std::make_shared<LiteralMetadataValueKey<std::string> >(
"format", "format", mkt_significant, "fake"))
{
}
diff --git a/paludis/repositories/fake/fake_repository_TEST.cc b/paludis/repositories/fake/fake_repository_TEST.cc
index 4418545..007b977 100644
--- a/paludis/repositories/fake/fake_repository_TEST.cc
+++ b/paludis/repositories/fake/fake_repository_TEST.cc
@@ -35,7 +35,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- const std::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
diff --git a/paludis/repositories/fake/fake_repository_base.cc b/paludis/repositories/fake/fake_repository_base.cc
index 8f9a97e..06554be 100644
--- a/paludis/repositories/fake/fake_repository_base.cc
+++ b/paludis/repositories/fake/fake_repository_base.cc
@@ -55,7 +55,7 @@ namespace paludis
};
Imp<FakeRepositoryBase>::Imp(const Environment * const e) :
- category_names(new CategoryNamePartSet),
+ category_names(std::make_shared<CategoryNamePartSet>()),
env(e)
{
}
@@ -96,7 +96,7 @@ FakeRepositoryBase::category_names() const
std::shared_ptr<const QualifiedPackageNameSet>
FakeRepositoryBase::package_names(const CategoryNamePart & c) const
{
- std::shared_ptr<QualifiedPackageNameSet> result(new QualifiedPackageNameSet);
+ std::shared_ptr<QualifiedPackageNameSet> result(std::make_shared<QualifiedPackageNameSet>());
if (! has_category_named(c))
return result;
@@ -111,9 +111,9 @@ std::shared_ptr<const PackageIDSequence>
FakeRepositoryBase::package_ids(const QualifiedPackageName & n) const
{
if (! has_category_named(n.category()))
- return std::shared_ptr<PackageIDSequence>(new PackageIDSequence);
+ return std::shared_ptr<PackageIDSequence>(std::make_shared<PackageIDSequence>());
if (! has_package_named(n))
- return std::shared_ptr<PackageIDSequence>(new PackageIDSequence);
+ return std::shared_ptr<PackageIDSequence>(std::make_shared<PackageIDSequence>());
return _imp->ids.find(n)->second;
}
@@ -121,7 +121,7 @@ void
FakeRepositoryBase::add_category(const CategoryNamePart & c)
{
_imp->category_names->insert(c);
- _imp->package_names.insert(std::make_pair(c, new PackageNamePartSet));
+ _imp->package_names.insert(std::make_pair(c, std::make_shared<PackageNamePartSet>()));
}
void
@@ -129,7 +129,7 @@ FakeRepositoryBase::add_package(const QualifiedPackageName & q)
{
add_category(q.category());
_imp->package_names.find(q.category())->second->insert(q.package());
- _imp->ids.insert(std::make_pair(q, new PackageIDSequence));
+ _imp->ids.insert(std::make_pair(q, std::make_shared<PackageIDSequence>()));
}
namespace
@@ -159,7 +159,7 @@ FakeRepositoryBase::add_version(const QualifiedPackageName & q, const VersionSpe
_imp->ids.find(q)->second->end(), VersionIs(v)))
throw InternalError(PALUDIS_HERE, "duplicate id added");
- std::shared_ptr<FakePackageID> id(new FakePackageID(_imp->env, shared_from_this(), q, v));
+ std::shared_ptr<FakePackageID> id(std::make_shared<FakePackageID>(_imp->env, shared_from_this(), q, v));
_imp->ids.find(q)->second->push_back(id);
return id;
}
diff --git a/paludis/repositories/fake/registration.cc b/paludis/repositories/fake/registration.cc
index afe87e9..55f7e75 100644
--- a/paludis/repositories/fake/registration.cc
+++ b/paludis/repositories/fake/registration.cc
@@ -48,7 +48,7 @@ namespace paludis
void register_repositories<repository_groups::fake>(const repository_groups::fake * const,
RepositoryFactory * const factory)
{
- std::shared_ptr<Set<std::string> > fake_formats(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > fake_formats(std::make_shared<Set<std::string>>());
fake_formats->insert("fake_installed");
factory->add_repository_format(
diff --git a/paludis/repositories/gems/gem_specification.cc b/paludis/repositories/gems/gem_specification.cc
index f57d40c..e4f8171 100644
--- a/paludis/repositories/gems/gem_specification.cc
+++ b/paludis/repositories/gems/gem_specification.cc
@@ -485,7 +485,7 @@ InstalledGemsRepository::need_version_metadata(const QualifiedPackageName & q, c
Context c("When loading version metadata for '" + stringify(PackageDatabaseEntry(q, v, name())) + "':");
- std::shared_ptr<gems::InstalledGemMetadata> m(new gems::InstalledGemMetadata(v));
+ std::shared_ptr<gems::InstalledGemMetadata> m(std::make_shared<gems::InstalledGemMetadata>(v));
_imp->metadata.insert(std::make_pair(std::make_pair(q, v), m));
Command cmd(getenv_with_default("PALUDIS_GEMS_DIR", LIBEXECDIR "/paludis") +
@@ -636,7 +636,7 @@ GemSpecification::invalidate_masks() const
std::shared_ptr<const Set<std::string> >
GemSpecification::breaks_portage() const
{
- std::shared_ptr<Set<std::string> > why(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > why(std::make_shared<Set<std::string>>());
why->insert("format");
return why;
}
diff --git a/paludis/repositories/gems/gem_specifications.cc b/paludis/repositories/gems/gem_specifications.cc
index 9516275..f1b22ea 100644
--- a/paludis/repositories/gems/gem_specifications.cc
+++ b/paludis/repositories/gems/gem_specifications.cc
@@ -124,7 +124,7 @@ namespace
try
{
- std::shared_ptr<GemSpecification> spec(new GemSpecification(environment, repository, *i->second));
+ std::shared_ptr<GemSpecification> spec(std::make_shared<GemSpecification>(environment, repository, *i->second));
_imp->specs.insert(std::make_pair(std::make_pair(spec->name(), spec->version()), spec));
}
catch (const InternalError &)
diff --git a/paludis/repositories/gems/gems_repository.cc b/paludis/repositories/gems/gems_repository.cc
index 48163ed..86e3fdc 100644
--- a/paludis/repositories/gems/gems_repository.cc
+++ b/paludis/repositories/gems/gems_repository.cc
@@ -72,17 +72,17 @@ namespace paludis
big_nasty_mutex(m),
has_category_names(false),
has_ids(false),
- location_key(new LiteralMetadataValueKey<FSEntry> ("location", "location",
+ location_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("location", "location",
mkt_significant, params.location())),
- install_dir_key(new LiteralMetadataValueKey<FSEntry> ("install_dir", "install_dir",
+ install_dir_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("install_dir", "install_dir",
mkt_normal, params.install_dir())),
- builddir_key(new LiteralMetadataValueKey<FSEntry> ("builddir", "builddir",
+ builddir_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("builddir", "builddir",
mkt_normal, params.builddir())),
- sync_key(new LiteralMetadataValueKey<std::string> ("sync", "sync",
+ sync_key(std::make_shared<LiteralMetadataValueKey<std::string> >("sync", "sync",
mkt_normal, params.sync())),
- sync_options_key(new LiteralMetadataValueKey<std::string> (
+ sync_options_key(std::make_shared<LiteralMetadataValueKey<std::string> >(
"sync_options", "sync_options", mkt_normal, params.sync_options())),
- format_key(new LiteralMetadataValueKey<std::string> ("format", "format",
+ format_key(std::make_shared<LiteralMetadataValueKey<std::string> >("format", "format",
mkt_significant, "gems"))
{
}
@@ -216,7 +216,7 @@ GemsRepository::need_category_names() const
if (_imp->has_category_names)
return;
- std::shared_ptr<CategoryNamePartSet> cat(new CategoryNamePartSet);
+ std::shared_ptr<CategoryNamePartSet> cat(std::make_shared<CategoryNamePartSet>());
_imp->category_names = cat;
cat->insert(CategoryNamePart("gems"));
@@ -233,7 +233,7 @@ GemsRepository::need_ids() const
need_category_names();
- std::shared_ptr<QualifiedPackageNameSet> pkgs(new QualifiedPackageNameSet);
+ std::shared_ptr<QualifiedPackageNameSet> pkgs(std::make_shared<QualifiedPackageNameSet>());
_imp->package_names.insert(std::make_pair(CategoryNamePart("gems"), pkgs));
Context context("When loading gems yaml file:");
diff --git a/paludis/repositories/gems/installed_gems_repository.cc b/paludis/repositories/gems/installed_gems_repository.cc
index 27deb5b..c977d80 100644
--- a/paludis/repositories/gems/installed_gems_repository.cc
+++ b/paludis/repositories/gems/installed_gems_repository.cc
@@ -80,13 +80,13 @@ namespace paludis
params(p),
has_category_names(false),
has_ids(false),
- install_dir_key(new LiteralMetadataValueKey<FSEntry> ("install_dir", "install_dir",
+ install_dir_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("install_dir", "install_dir",
mkt_normal, params.install_dir())),
- builddir_key(new LiteralMetadataValueKey<FSEntry> ("builddir", "builddir",
+ builddir_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("builddir", "builddir",
mkt_normal, params.builddir())),
- root_key(new LiteralMetadataValueKey<FSEntry> (
+ root_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >(
"root", "root", mkt_normal, params.root())),
- format_key(new LiteralMetadataValueKey<std::string> ("format", "format",
+ format_key(std::make_shared<LiteralMetadataValueKey<std::string> >("format", "format",
mkt_significant, "gems"))
{
}
@@ -209,7 +209,7 @@ InstalledGemsRepository::need_category_names() const
if (_imp->has_category_names)
return;
- std::shared_ptr<CategoryNamePartSet> cat(new CategoryNamePartSet);
+ std::shared_ptr<CategoryNamePartSet> cat(std::make_shared<CategoryNamePartSet>());
_imp->category_names = cat;
cat->insert(CategoryNamePart("gems"));
@@ -230,7 +230,7 @@ InstalledGemsRepository::need_ids() const
need_category_names();
- std::shared_ptr<QualifiedPackageNameSet> pkgs(new QualifiedPackageNameSet);
+ std::shared_ptr<QualifiedPackageNameSet> pkgs(std::make_shared<QualifiedPackageNameSet>());
_imp->package_names.insert(std::make_pair(gems, pkgs));
for (DirIterator d(_imp->params.install_dir() / "specifications"), d_end ; d != d_end ; ++d)
diff --git a/paludis/repositories/gems/installed_gems_repository_TEST.cc b/paludis/repositories/gems/installed_gems_repository_TEST.cc
index 6269ac1..0e81a21 100644
--- a/paludis/repositories/gems/installed_gems_repository_TEST.cc
+++ b/paludis/repositories/gems/installed_gems_repository_TEST.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 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 @@ namespace test_cases
void run()
{
TestEnvironment env;
- env.package_database()->add_repository(1, make_shared_ptr(new InstalledGemsRepository(
+ env.package_database()->add_repository(1, make_shared_ptr(std::make_shared<InstalledGemsRepository>(
gems::InstalledRepositoryParams::create()
.location(FSEntry("gems_repository_TEST_dir/installed-repo"))
.environment(&env)
diff --git a/paludis/repositories/gems/registration.cc b/paludis/repositories/gems/registration.cc
index d069836..d502d46 100644
--- a/paludis/repositories/gems/registration.cc
+++ b/paludis/repositories/gems/registration.cc
@@ -53,7 +53,7 @@ namespace paludis
void register_repositories<repository_groups::gems>(const repository_groups::gems * const,
RepositoryFactory * const factory)
{
- std::shared_ptr<Set<std::string> > gems_formats(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > gems_formats(std::make_shared<Set<std::string>>());
gems_formats->insert("gems");
factory->add_repository_format(
@@ -64,7 +64,7 @@ namespace paludis
GemsRepository::repository_factory_dependencies
);
- std::shared_ptr<Set<std::string> > installed_gems_formats(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > installed_gems_formats(std::make_shared<Set<std::string>>());
installed_gems_formats->insert("installed_gems");
installed_gems_formats->insert("installed-gems");
diff --git a/paludis/repositories/repository/registration.cc b/paludis/repositories/repository/registration.cc
index 23bc4a8..a1cdf62 100644
--- a/paludis/repositories/repository/registration.cc
+++ b/paludis/repositories/repository/registration.cc
@@ -48,7 +48,7 @@ namespace paludis
void register_repositories<repository_groups::repository>(const repository_groups::repository * const,
RepositoryFactory * const factory)
{
- std::shared_ptr<Set<std::string> > repository_formats(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > repository_formats(std::make_shared<Set<std::string>>());
repository_formats->insert("repository");
factory->add_repository_format(repository_formats,
diff --git a/paludis/repositories/repository/repository_id.cc b/paludis/repositories/repository/repository_id.cc
index 40cd0ed..962e53a 100644
--- a/paludis/repositories/repository/repository_id.cc
+++ b/paludis/repositories/repository/repository_id.cc
@@ -55,7 +55,7 @@ namespace paludis
name(e.name()),
version("0", VersionSpecOptions()),
repo(e.repository()),
- behaviours_key(new LiteralMetadataStringSetKey("behaviours", "behaviours", mkt_internal, behaviours_set))
+ behaviours_key(std::make_shared<LiteralMetadataStringSetKey>("behaviours", "behaviours", mkt_internal, behaviours_set))
{
}
};
@@ -65,7 +65,7 @@ namespace
{
std::shared_ptr<Set<std::string> > make_behaviours()
{
- std::shared_ptr<Set<std::string> > result(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > result(std::make_shared<Set<std::string>>());
result->insert("transient");
result->insert("used");
return result;
diff --git a/paludis/repositories/repository/repository_repository.cc b/paludis/repositories/repository/repository_repository.cc
index 052f93b..64b6d56 100644
--- a/paludis/repositories/repository/repository_repository.cc
+++ b/paludis/repositories/repository/repository_repository.cc
@@ -68,13 +68,13 @@ namespace paludis
Imp(const RepositoryRepository * const repo, const RepositoryRepositoryParams & p) :
params(p),
- format_key(new LiteralMetadataValueKey<std::string> ("format", "format",
+ format_key(std::make_shared<LiteralMetadataValueKey<std::string> >("format", "format",
mkt_significant, "repository")),
- config_filename_key(new LiteralMetadataValueKey<std::string> (
+ config_filename_key(std::make_shared<LiteralMetadataValueKey<std::string> >(
"config_filename", "config_filename", mkt_normal, params.config_filename())),
- config_template_key(new LiteralMetadataValueKey<std::string> (
+ config_template_key(std::make_shared<LiteralMetadataValueKey<std::string> >(
"config_template", "config_template", mkt_normal, params.config_template())),
- installed_root_key(new LiteralMetadataValueKey<FSEntry>("root", "root", mkt_normal, p.root())),
+ installed_root_key(std::make_shared<LiteralMetadataValueKey<FSEntry>>("root", "root", mkt_normal, p.root())),
store(DeferredConstructionPtr<std::shared_ptr<RepositoryRepositoryStore> > (
std::bind(&make_store, repo, std::cref(params))))
{
@@ -291,7 +291,7 @@ RepositoryRepository::repository_factory_create(
if (root_str.empty())
root_str = "/";
- return std::shared_ptr<RepositoryRepository>(new RepositoryRepository(
+ return std::shared_ptr<RepositoryRepository>(std::make_shared<RepositoryRepository>(
make_named_values<RepositoryRepositoryParams>(
n::config_filename() = config_filename,
n::config_template() = config_template,
diff --git a/paludis/repositories/repository/repository_repository_store.cc b/paludis/repositories/repository/repository_repository_store.cc
index 6a53271..ab8202b 100644
--- a/paludis/repositories/repository/repository_repository_store.cc
+++ b/paludis/repositories/repository/repository_repository_store.cc
@@ -63,7 +63,7 @@ namespace paludis
Imp(const Environment * const e, const RepositoryRepository * const r) :
env(e),
repo(r),
- categories(new CategoryNamePartSet)
+ categories(std::make_shared<CategoryNamePartSet>())
{
}
};
@@ -92,7 +92,7 @@ RepositoryRepositoryStore::_populate()
void
RepositoryRepositoryStore::_populate_one(const RepositoryName & repo_name)
{
- const std::shared_ptr<RepositoryID> id(new RepositoryID(make_named_values<RepositoryIDParams>(
+ const std::shared_ptr<RepositoryID> id(std::make_shared<RepositoryID>(make_named_values<RepositoryIDParams>(
n::environment() = _imp->env,
n::name() = CategoryNamePart("repository") + PackageNamePart(stringify(repo_name)),
n::repository() = _imp->repo
diff --git a/paludis/repositories/unavailable/registration.cc b/paludis/repositories/unavailable/registration.cc
index 592e343..208e9d8 100644
--- a/paludis/repositories/unavailable/registration.cc
+++ b/paludis/repositories/unavailable/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
@@ -48,7 +48,7 @@ namespace paludis
void register_repositories<repository_groups::unavailable>(const repository_groups::unavailable * const,
RepositoryFactory * const factory)
{
- std::shared_ptr<Set<std::string> > unavailable_formats(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > unavailable_formats(std::make_shared<Set<std::string>>());
unavailable_formats->insert("unavailable");
factory->add_repository_format(unavailable_formats,
diff --git a/paludis/repositories/unavailable/unavailable_package_id.cc b/paludis/repositories/unavailable/unavailable_package_id.cc
index 3fb8625..11768ec 100644
--- a/paludis/repositories/unavailable/unavailable_package_id.cc
+++ b/paludis/repositories/unavailable/unavailable_package_id.cc
@@ -60,7 +60,7 @@ namespace paludis
name(e.name()),
version(e.version()),
repo(e.repository()),
- slot_key(new LiteralMetadataValueKey<SlotName>("SLOT", "Slot", mkt_internal, e.slot())),
+ slot_key(std::make_shared<LiteralMetadataValueKey<SlotName>>("SLOT", "Slot", mkt_internal, e.slot())),
description_key(e.description()),
repository_homepage_key(e.repository_homepage()),
repository_description_key(e.repository_description()),
diff --git a/paludis/repositories/unavailable/unavailable_repository.cc b/paludis/repositories/unavailable/unavailable_repository.cc
index b86468a..61fe9d3 100644
--- a/paludis/repositories/unavailable/unavailable_repository.cc
+++ b/paludis/repositories/unavailable/unavailable_repository.cc
@@ -63,15 +63,15 @@ namespace paludis
Imp(const UnavailableRepository * const repo, const UnavailableRepositoryParams & p) :
params(p),
- format_key(new LiteralMetadataValueKey<std::string> ("format", "format",
+ format_key(std::make_shared<LiteralMetadataValueKey<std::string> >("format", "format",
mkt_significant, "unavailable")),
- location_key(new LiteralMetadataValueKey<FSEntry> ("location", "location",
+ location_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("location", "location",
mkt_significant, params.location())),
- sync_key(new LiteralMetadataValueKey<std::string> (
+ sync_key(std::make_shared<LiteralMetadataValueKey<std::string> >(
"sync", "sync", mkt_normal, params.sync())),
- sync_options_key(new LiteralMetadataValueKey<std::string> (
+ sync_options_key(std::make_shared<LiteralMetadataValueKey<std::string> >(
"sync_options", "sync_options", mkt_normal, params.sync_options())),
- sync_host_key(new LiteralMetadataValueKey<std::string> ("sync_host", "sync_host", mkt_internal, extract_host_from_url(params.sync()))),
+ sync_host_key(std::make_shared<LiteralMetadataValueKey<std::string> >("sync_host", "sync_host", mkt_internal, extract_host_from_url(params.sync()))),
store(DeferredConstructionPtr<std::shared_ptr<UnavailableRepositoryStore> > (
std::bind(&make_store, repo, std::cref(params))))
{
@@ -323,7 +323,7 @@ UnavailableRepository::repository_factory_create(
std::string sync_options(f("sync_options"));
- return std::shared_ptr<UnavailableRepository>(new UnavailableRepository(
+ return std::shared_ptr<UnavailableRepository>(std::make_shared<UnavailableRepository>(
make_named_values<UnavailableRepositoryParams>(
n::environment() = env,
n::location() = location,
diff --git a/paludis/repositories/unavailable/unavailable_repository_TEST.cc b/paludis/repositories/unavailable/unavailable_repository_TEST.cc
index 7b19f34..4dc1347 100644
--- a/paludis/repositories/unavailable/unavailable_repository_TEST.cc
+++ b/paludis/repositories/unavailable/unavailable_repository_TEST.cc
@@ -48,7 +48,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::shared_ptr<UnavailableRepository> repo(new UnavailableRepository(
+ std::shared_ptr<UnavailableRepository> repo(std::make_shared<UnavailableRepository>(
make_named_values<UnavailableRepositoryParams>(
n::environment() = &env,
n::location() = FSEntry::cwd() / "unavailable_repository_TEST_dir" / "repo1",
@@ -68,7 +68,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::shared_ptr<UnavailableRepository> repo(new UnavailableRepository(
+ std::shared_ptr<UnavailableRepository> repo(std::make_shared<UnavailableRepository>(
make_named_values<UnavailableRepositoryParams>(
n::environment() = &env,
n::location() = FSEntry::cwd() / "unavailable_repository_TEST_dir" / "repo2",
@@ -98,7 +98,7 @@ namespace test_cases
"repository/foo-0::unavailable"
);
- const std::shared_ptr<FakeRepository> hide_bar(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> hide_bar(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("bar")
)));
diff --git a/paludis/repositories/unavailable/unavailable_repository_dependencies_key.cc b/paludis/repositories/unavailable/unavailable_repository_dependencies_key.cc
index d70b6a7..5914e85 100644
--- a/paludis/repositories/unavailable/unavailable_repository_dependencies_key.cc
+++ b/paludis/repositories/unavailable/unavailable_repository_dependencies_key.cc
@@ -49,7 +49,7 @@ namespace paludis
const std::string & v) :
env(e),
value(CommaSeparatedDepParser::parse(e, v)),
- labels(new DependenciesLabelSequence),
+ labels(std::make_shared<DependenciesLabelSequence>()),
raw_name(r),
human_name(h),
type(t)
diff --git a/paludis/repositories/unavailable/unavailable_repository_file.cc b/paludis/repositories/unavailable/unavailable_repository_file.cc
index ff624a3..359c943 100644
--- a/paludis/repositories/unavailable/unavailable_repository_file.cc
+++ b/paludis/repositories/unavailable/unavailable_repository_file.cc
@@ -210,7 +210,7 @@ UnavailableRepositoryFile::_load(const FSEntry & f)
"Cannot parse body description line '" + line + "' in '" + stringify(f) + "'");
std::shared_ptr<LiteralMetadataValueKey<std::string> > desc(
- new LiteralMetadataValueKey<std::string>("DESCRIPTION", "Description", mkt_significant,
+ std::make_shared<LiteralMetadataValueKey<std::string>>("DESCRIPTION", "Description", mkt_significant,
token));
for (std::list<VersionSpec>::const_iterator v(versions.begin()), v_end(versions.end()) ;
v != v_end ; ++v)
diff --git a/paludis/repositories/unavailable/unavailable_repository_store.cc b/paludis/repositories/unavailable/unavailable_repository_store.cc
index 1ef7804..95b077e 100644
--- a/paludis/repositories/unavailable/unavailable_repository_store.cc
+++ b/paludis/repositories/unavailable/unavailable_repository_store.cc
@@ -69,7 +69,7 @@ namespace paludis
Imp(const UnavailableRepository * const r) :
repo(r),
- categories(new CategoryNamePartSet)
+ categories(std::make_shared<CategoryNamePartSet>())
{
}
};
@@ -138,11 +138,11 @@ UnavailableRepositoryStore::_populate_one(const Environment * const env, const F
"REPOSITORY_SYNC", "Repository sync", mkt_normal, file.sync());
{
- std::shared_ptr<Mask> mask(new UnavailableMask);
- std::shared_ptr<Set<std::string> > from_repositories_set(new Set<std::string>);
+ std::shared_ptr<Mask> mask(std::make_shared<UnavailableMask>());
+ std::shared_ptr<Set<std::string> > from_repositories_set(std::make_shared<Set<std::string>>());
from_repositories_set->insert(file.repo_name());
std::shared_ptr<MetadataCollectionKey<Set<std::string> > > from_repositories(
- new LiteralMetadataStringSetKey("OWNING_REPOSITORY", "Owning repository",
+ std::make_shared<LiteralMetadataStringSetKey>("OWNING_REPOSITORY", "Owning repository",
mkt_significant, from_repositories_set));
QualifiedPackageName old_name("x/x");
@@ -191,13 +191,13 @@ UnavailableRepositoryStore::_populate_one(const Environment * const env, const F
if (file.autoconfigurable())
{
- const std::shared_ptr<NoConfigurationInformationMask> no_configuration_mask(new NoConfigurationInformationMask);
+ const std::shared_ptr<NoConfigurationInformationMask> no_configuration_mask(std::make_shared<NoConfigurationInformationMask>());
std::shared_ptr<UnavailableRepositoryDependenciesKey> deps;
if (! file.dependencies().empty())
deps = std::make_shared<UnavailableRepositoryDependenciesKey>(env, "dependencies", "Dependencies", mkt_dependencies,
file.dependencies());
- const std::shared_ptr<UnavailableRepositoryID> id(new UnavailableRepositoryID(
+ const std::shared_ptr<UnavailableRepositoryID> id(std::make_shared<UnavailableRepositoryID>(
make_named_values<UnavailableRepositoryIDParams>(
n::dependencies() = deps,
n::description() = repository_description,
diff --git a/paludis/repositories/unpackaged/installed_id.cc b/paludis/repositories/unpackaged/installed_id.cc
index c3dd4e4..732216b 100644
--- a/paludis/repositories/unpackaged/installed_id.cc
+++ b/paludis/repositories/unpackaged/installed_id.cc
@@ -424,11 +424,11 @@ namespace paludis
repository_name(r),
root(ro),
ndbam(d),
- build_dependencies_labels(new DependenciesLabelSequence),
- run_dependencies_labels(new DependenciesLabelSequence),
- slot_key(new LiteralMetadataValueKey<SlotName> ("slot", "Slot", mkt_internal, s)),
- fs_location_key(new InstalledUnpackagedFSEntryKey(l)),
- behaviours_key(new LiteralMetadataStringSetKey("behaviours", "behaviours", mkt_internal, behaviours_set))
+ build_dependencies_labels(std::make_shared<DependenciesLabelSequence>()),
+ run_dependencies_labels(std::make_shared<DependenciesLabelSequence>()),
+ slot_key(std::make_shared<LiteralMetadataValueKey<SlotName> >("slot", "Slot", mkt_internal, s)),
+ fs_location_key(std::make_shared<InstalledUnpackagedFSEntryKey>(l)),
+ behaviours_key(std::make_shared<LiteralMetadataStringSetKey>("behaviours", "behaviours", mkt_internal, behaviours_set))
{
build_dependencies_labels->push_back(std::make_shared<DependenciesBuildLabel>("build_dependencies",
return_literal_function(true)));
@@ -468,7 +468,7 @@ namespace
{
std::shared_ptr<Set<std::string> > make_behaviours()
{
- std::shared_ptr<Set<std::string> > result(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > result(std::make_shared<Set<std::string>>());
result->insert("transient");
return result;
}
@@ -824,7 +824,7 @@ InstalledUnpackagedID::invalidate_masks() const
std::shared_ptr<const Set<std::string> >
InstalledUnpackagedID::breaks_portage() const
{
- std::shared_ptr<Set<std::string> > why(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > why(std::make_shared<Set<std::string>>());
why->insert("format");
return why;
}
diff --git a/paludis/repositories/unpackaged/installed_repository.cc b/paludis/repositories/unpackaged/installed_repository.cc
index 7568cbd..1ca3795 100644
--- a/paludis/repositories/unpackaged/installed_repository.cc
+++ b/paludis/repositories/unpackaged/installed_repository.cc
@@ -77,11 +77,11 @@ namespace paludis
Imp(const InstalledUnpackagedRepositoryParams & p) :
params(p),
ndbam(p.location(), &supported_installed_unpackaged, "installed_unpackaged-1", user_version_spec_options()),
- location_key(new LiteralMetadataValueKey<FSEntry> ("location", "location",
+ location_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("location", "location",
mkt_significant, params.location())),
- root_key(new LiteralMetadataValueKey<FSEntry> ("root", "root",
+ root_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("root", "root",
mkt_normal, params.root())),
- format_key(new LiteralMetadataValueKey<std::string> (
+ format_key(std::make_shared<LiteralMetadataValueKey<std::string> >(
"format", "format", mkt_significant, "installed_unpackaged"))
{
}
@@ -121,7 +121,7 @@ std::shared_ptr<const PackageIDSequence>
InstalledUnpackagedRepository::package_ids(const QualifiedPackageName & q) const
{
std::shared_ptr<NDBAMEntrySequence> entries(_imp->ndbam.entries(q));
- std::shared_ptr<PackageIDSequence> result(new PackageIDSequence);
+ std::shared_ptr<PackageIDSequence> result(std::make_shared<PackageIDSequence>());
for (IndirectIterator<NDBAMEntrySequence::ConstIterator> e(entries->begin()), e_end(entries->end()) ;
e != e_end ; ++e)
diff --git a/paludis/repositories/unpackaged/installed_repository_TEST.cc b/paludis/repositories/unpackaged/installed_repository_TEST.cc
index 8c42442..7fe9800 100644
--- a/paludis/repositories/unpackaged/installed_repository_TEST.cc
+++ b/paludis/repositories/unpackaged/installed_repository_TEST.cc
@@ -102,7 +102,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::shared_ptr<Repository> repo(new InstalledUnpackagedRepository(
+ std::shared_ptr<Repository> repo(std::make_shared<InstalledUnpackagedRepository>(
RepositoryName("installed-unpackaged"),
make_named_values<unpackaged_repositories::InstalledUnpackagedRepositoryParams>(
n::environment() = &env,
@@ -125,7 +125,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::shared_ptr<Repository> repo(new InstalledUnpackagedRepository(
+ std::shared_ptr<Repository> repo(std::make_shared<InstalledUnpackagedRepository>(
RepositoryName("installed-unpackaged"),
make_named_values<unpackaged_repositories::InstalledUnpackagedRepositoryParams>(
n::environment() = &env,
@@ -179,7 +179,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::shared_ptr<Repository> repo(new InstalledUnpackagedRepository(
+ std::shared_ptr<Repository> repo(std::make_shared<InstalledUnpackagedRepository>(
RepositoryName("installed-unpackaged"),
make_named_values<unpackaged_repositories::InstalledUnpackagedRepositoryParams>(
n::environment() = &env,
@@ -209,7 +209,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::shared_ptr<Repository> repo(new InstalledUnpackagedRepository(
+ std::shared_ptr<Repository> repo(std::make_shared<InstalledUnpackagedRepository>(
RepositoryName("installed-unpackaged"),
make_named_values<unpackaged_repositories::InstalledUnpackagedRepositoryParams>(
n::environment() = &env,
@@ -244,7 +244,7 @@ namespace test_cases
{
TestEnvironment env;
- std::shared_ptr<Repository> repo(new InstalledUnpackagedRepository(
+ std::shared_ptr<Repository> repo(std::make_shared<InstalledUnpackagedRepository>(
RepositoryName("installed-unpackaged"),
make_named_values<unpackaged_repositories::InstalledUnpackagedRepositoryParams>(
n::environment() = &env,
@@ -300,7 +300,7 @@ namespace test_cases
{
TestEnvironment env;
- std::shared_ptr<Repository> repo(new InstalledUnpackagedRepository(
+ std::shared_ptr<Repository> repo(std::make_shared<InstalledUnpackagedRepository>(
RepositoryName("installed-unpackaged"),
make_named_values<unpackaged_repositories::InstalledUnpackagedRepositoryParams>(
n::environment() = &env,
@@ -355,7 +355,7 @@ namespace test_cases
TestMessageSuffix suffix("initial", true);
TestEnvironment env;
- std::shared_ptr<Repository> repo(new InstalledUnpackagedRepository(
+ std::shared_ptr<Repository> repo(std::make_shared<InstalledUnpackagedRepository>(
RepositoryName("installed-unpackaged"),
make_named_values<unpackaged_repositories::InstalledUnpackagedRepositoryParams>(
n::environment() = &env,
@@ -374,7 +374,7 @@ namespace test_cases
TestMessageSuffix suffix("install 4a", true);
TestEnvironment env;
- std::shared_ptr<Repository> repo(new InstalledUnpackagedRepository(
+ std::shared_ptr<Repository> repo(std::make_shared<InstalledUnpackagedRepository>(
RepositoryName("installed-unpackaged"),
make_named_values<unpackaged_repositories::InstalledUnpackagedRepositoryParams>(
n::environment() = &env,
@@ -383,7 +383,7 @@ namespace test_cases
)));
env.package_database()->add_repository(0, repo);
- std::shared_ptr<Repository> source_repo(new UnpackagedRepository(
+ std::shared_ptr<Repository> source_repo(std::make_shared<UnpackagedRepository>(
RepositoryName("unpackaged"),
make_named_values<unpackaged_repositories::UnpackagedRepositoryParams>(
n::build_dependencies() = "",
@@ -432,7 +432,7 @@ namespace test_cases
TestMessageSuffix suffix("install 4b1", true);
TestEnvironment env;
- std::shared_ptr<Repository> repo(new InstalledUnpackagedRepository(
+ std::shared_ptr<Repository> repo(std::make_shared<InstalledUnpackagedRepository>(
RepositoryName("installed-unpackaged"),
make_named_values<unpackaged_repositories::InstalledUnpackagedRepositoryParams>(
n::environment() = &env,
@@ -441,7 +441,7 @@ namespace test_cases
)));
env.package_database()->add_repository(0, repo);
- std::shared_ptr<Repository> source_repo(new UnpackagedRepository(
+ std::shared_ptr<Repository> source_repo(std::make_shared<UnpackagedRepository>(
RepositoryName("unpackaged"),
make_named_values<unpackaged_repositories::UnpackagedRepositoryParams>(
n::build_dependencies() = "",
@@ -492,7 +492,7 @@ namespace test_cases
TestMessageSuffix suffix("install 4b2", true);
TestEnvironment env;
- std::shared_ptr<Repository> repo(new InstalledUnpackagedRepository(
+ std::shared_ptr<Repository> repo(std::make_shared<InstalledUnpackagedRepository>(
RepositoryName("installed-unpackaged"),
make_named_values<unpackaged_repositories::InstalledUnpackagedRepositoryParams>(
n::environment() = &env,
@@ -501,7 +501,7 @@ namespace test_cases
)));
env.package_database()->add_repository(0, repo);
- std::shared_ptr<Repository> source_repo(new UnpackagedRepository(
+ std::shared_ptr<Repository> source_repo(std::make_shared<UnpackagedRepository>(
RepositoryName("unpackaged"),
make_named_values<unpackaged_repositories::UnpackagedRepositoryParams>(
n::build_dependencies() = "",
@@ -552,7 +552,7 @@ namespace test_cases
TestMessageSuffix suffix("uninstall 4a", true);
TestEnvironment env;
- std::shared_ptr<Repository> repo(new InstalledUnpackagedRepository(
+ std::shared_ptr<Repository> repo(std::make_shared<InstalledUnpackagedRepository>(
RepositoryName("installed-unpackaged"),
make_named_values<unpackaged_repositories::InstalledUnpackagedRepositoryParams>(
n::environment() = &env,
@@ -598,7 +598,7 @@ namespace test_cases
TestMessageSuffix suffix("uninstall 4b", true);
TestEnvironment env;
- std::shared_ptr<Repository> repo(new InstalledUnpackagedRepository(
+ std::shared_ptr<Repository> repo(std::make_shared<InstalledUnpackagedRepository>(
RepositoryName("installed-unpackaged"),
make_named_values<unpackaged_repositories::InstalledUnpackagedRepositoryParams>(
n::environment() = &env,
diff --git a/paludis/repositories/unpackaged/registration.cc b/paludis/repositories/unpackaged/registration.cc
index b1a1672..af581d8 100644
--- a/paludis/repositories/unpackaged/registration.cc
+++ b/paludis/repositories/unpackaged/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
@@ -49,7 +49,7 @@ namespace paludis
void register_repositories<repository_groups::unpackaged>(const repository_groups::unpackaged * const,
RepositoryFactory * const factory)
{
- std::shared_ptr<Set<std::string> > unpackaged_formats(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > unpackaged_formats(std::make_shared<Set<std::string>>());
unpackaged_formats->insert("unpackaged");
factory->add_repository_format(
@@ -60,7 +60,7 @@ namespace paludis
&UnpackagedRepository::repository_factory_dependencies
);
- std::shared_ptr<Set<std::string> > installed_unpackaged_formats(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > installed_unpackaged_formats(std::make_shared<Set<std::string>>());
installed_unpackaged_formats->insert("installed_unpackaged");
installed_unpackaged_formats->insert("installed-unpackaged");
diff --git a/paludis/repositories/unpackaged/unpackaged_id.cc b/paludis/repositories/unpackaged/unpackaged_id.cc
index 6e7506a..3e4a75c 100644
--- a/paludis/repositories/unpackaged/unpackaged_id.cc
+++ b/paludis/repositories/unpackaged/unpackaged_id.cc
@@ -78,16 +78,16 @@ namespace paludis
name(q),
version(v),
repository_name(n),
- build_dependencies_labels(new DependenciesLabelSequence),
- run_dependencies_labels(new DependenciesLabelSequence),
- slot_key(new LiteralMetadataValueKey<SlotName> ("slot", "Slot", mkt_internal, s)),
- fs_location_key(new LiteralMetadataValueKey<FSEntry> ("location", "Location", mkt_normal, l)),
- build_dependencies_key(new UnpackagedDependencyKey(env, "build_dependencies", "Build dependencies", mkt_dependencies,
+ build_dependencies_labels(std::make_shared<DependenciesLabelSequence>()),
+ run_dependencies_labels(std::make_shared<DependenciesLabelSequence>()),
+ slot_key(std::make_shared<LiteralMetadataValueKey<SlotName> >("slot", "Slot", mkt_internal, s)),
+ fs_location_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("location", "Location", mkt_normal, l)),
+ build_dependencies_key(std::make_shared<UnpackagedDependencyKey>(env, "build_dependencies", "Build dependencies", mkt_dependencies,
build_dependencies_labels, b)),
- run_dependencies_key(new UnpackagedDependencyKey(env, "run_dependencies", "Run dependencies", mkt_dependencies,
+ run_dependencies_key(std::make_shared<UnpackagedDependencyKey>(env, "run_dependencies", "Run dependencies", mkt_dependencies,
run_dependencies_labels, r)),
- description_key(new LiteralMetadataValueKey<std::string> ("description", "Description", mkt_significant, d)),
- choices_key(new UnpackagedChoicesKey(env, "choices", "Choices", mkt_normal, id))
+ description_key(std::make_shared<LiteralMetadataValueKey<std::string> >("description", "Description", mkt_significant, d)),
+ choices_key(std::make_shared<UnpackagedChoicesKey>(env, "choices", "Choices", mkt_normal, id))
{
build_dependencies_labels->push_back(std::make_shared<DependenciesBuildLabel>("build_dependencies",
return_literal_function(true)));
@@ -461,7 +461,7 @@ UnpackagedID::invalidate_masks() const
std::shared_ptr<const Set<std::string> >
UnpackagedID::breaks_portage() const
{
- std::shared_ptr<Set<std::string> > why(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > why(std::make_shared<Set<std::string>>());
why->insert("format");
return why;
}
diff --git a/paludis/repositories/unpackaged/unpackaged_key.cc b/paludis/repositories/unpackaged/unpackaged_key.cc
index bd107fb..6e1db61 100644
--- a/paludis/repositories/unpackaged/unpackaged_key.cc
+++ b/paludis/repositories/unpackaged/unpackaged_key.cc
@@ -162,7 +162,7 @@ UnpackagedChoicesKey::value() const
if (! _imp->value)
{
_imp->value = std::make_shared<Choices>();
- std::shared_ptr<Choice> build_options(new Choice(make_named_values<ChoiceParams>(
+ std::shared_ptr<Choice> build_options(std::make_shared<Choice>(make_named_values<ChoiceParams>(
n::consider_added_or_changed() = false,
n::contains_every_value() = false,
n::hidden() = false,
diff --git a/paludis/repositories/unpackaged/unpackaged_repository.cc b/paludis/repositories/unpackaged/unpackaged_repository.cc
index 06fa3e6..27098c6 100644
--- a/paludis/repositories/unpackaged/unpackaged_repository.cc
+++ b/paludis/repositories/unpackaged/unpackaged_repository.cc
@@ -61,28 +61,28 @@ namespace paludis
Imp(const RepositoryName & n,
const UnpackagedRepositoryParams & p) :
params(p),
- id(new UnpackagedID(params.environment(), params.name(), params.version(), params.slot(), n, params.location(),
+ id(std::make_shared<UnpackagedID>(params.environment(), params.name(), params.version(), params.slot(), n, params.location(),
params.build_dependencies(), params.run_dependencies(), params.description())),
- ids(new PackageIDSequence),
- package_names(new QualifiedPackageNameSet),
- category_names(new CategoryNamePartSet),
- location_key(new LiteralMetadataValueKey<FSEntry> ("location", "location",
+ ids(std::make_shared<PackageIDSequence>()),
+ package_names(std::make_shared<QualifiedPackageNameSet>()),
+ category_names(std::make_shared<CategoryNamePartSet>()),
+ location_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("location", "location",
mkt_significant, params.location())),
- install_under_key(new LiteralMetadataValueKey<FSEntry> ("install_under", "install_under",
+ install_under_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("install_under", "install_under",
mkt_significant, params.install_under())),
- rewrite_ids_over_to_root_key(new LiteralMetadataValueKey<long> ("rewrite_ids_over_to_root", "rewrite_ids_over_to_root",
+ rewrite_ids_over_to_root_key(std::make_shared<LiteralMetadataValueKey<long> >("rewrite_ids_over_to_root", "rewrite_ids_over_to_root",
mkt_normal, params.rewrite_ids_over_to_root())),
- name_key(new LiteralMetadataValueKey<std::string> ("name", "name",
+ name_key(std::make_shared<LiteralMetadataValueKey<std::string> >("name", "name",
mkt_normal, stringify(params.name()))),
- slot_key(new LiteralMetadataValueKey<std::string> ("slot", "slot",
+ slot_key(std::make_shared<LiteralMetadataValueKey<std::string> >("slot", "slot",
mkt_normal, stringify(params.slot()))),
- format_key(new LiteralMetadataValueKey<std::string> (
+ format_key(std::make_shared<LiteralMetadataValueKey<std::string> >(
"format", "format", mkt_significant, "unpackaged")),
- build_dependencies_key(new LiteralMetadataValueKey<std::string> (
+ build_dependencies_key(std::make_shared<LiteralMetadataValueKey<std::string> >(
"build_dependencies", "build_dependencies", mkt_normal, params.build_dependencies())),
- run_dependencies_key(new LiteralMetadataValueKey<std::string> (
+ run_dependencies_key(std::make_shared<LiteralMetadataValueKey<std::string> >(
"run_dependencies", "run_dependencies", mkt_normal, params.run_dependencies())),
- description_key(new LiteralMetadataValueKey<std::string> (
+ description_key(std::make_shared<LiteralMetadataValueKey<std::string> >(
"description", "description", mkt_normal, params.description()))
{
ids->push_back(id);
diff --git a/paludis/repositories/unpackaged/unpackaged_repository_TEST.cc b/paludis/repositories/unpackaged/unpackaged_repository_TEST.cc
index e817412..14f1ddc 100644
--- a/paludis/repositories/unpackaged/unpackaged_repository_TEST.cc
+++ b/paludis/repositories/unpackaged/unpackaged_repository_TEST.cc
@@ -72,7 +72,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::shared_ptr<Repository> repo(new UnpackagedRepository(
+ std::shared_ptr<Repository> repo(std::make_shared<UnpackagedRepository>(
RepositoryName("unpackaged"),
make_named_values<unpackaged_repositories::UnpackagedRepositoryParams>(
n::build_dependencies() = "",
@@ -102,7 +102,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::shared_ptr<Repository> repo(new UnpackagedRepository(
+ std::shared_ptr<Repository> repo(std::make_shared<UnpackagedRepository>(
RepositoryName("unpackaged"),
make_named_values<unpackaged_repositories::UnpackagedRepositoryParams>(
n::build_dependencies() = "",
@@ -137,7 +137,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::shared_ptr<Repository> repo(new UnpackagedRepository(
+ std::shared_ptr<Repository> repo(std::make_shared<UnpackagedRepository>(
RepositoryName("unpackaged"),
make_named_values<unpackaged_repositories::UnpackagedRepositoryParams>(
n::build_dependencies() = "",
@@ -167,7 +167,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::shared_ptr<Repository> repo(new UnpackagedRepository(
+ std::shared_ptr<Repository> repo(std::make_shared<UnpackagedRepository>(
RepositoryName("unpackaged"),
make_named_values<unpackaged_repositories::UnpackagedRepositoryParams>(
n::build_dependencies() = "",
@@ -208,7 +208,7 @@ namespace test_cases
{
TestEnvironment env;
- std::shared_ptr<Repository> repo(new UnpackagedRepository(
+ std::shared_ptr<Repository> repo(std::make_shared<UnpackagedRepository>(
RepositoryName("unpackaged"),
make_named_values<unpackaged_repositories::UnpackagedRepositoryParams>(
n::build_dependencies() = "",
@@ -224,7 +224,7 @@ namespace test_cases
)));
env.package_database()->add_repository(1, repo);
- std::shared_ptr<Repository> installed_repo(new InstalledUnpackagedRepository(
+ std::shared_ptr<Repository> installed_repo(std::make_shared<InstalledUnpackagedRepository>(
RepositoryName("installed-unpackaged"),
make_named_values<unpackaged_repositories::InstalledUnpackagedRepositoryParams>(
n::environment() = &env,
@@ -264,7 +264,7 @@ namespace test_cases
{
TestEnvironment env;
- std::shared_ptr<Repository> repo(new UnpackagedRepository(
+ std::shared_ptr<Repository> repo(std::make_shared<UnpackagedRepository>(
RepositoryName("unpackaged"),
make_named_values<unpackaged_repositories::UnpackagedRepositoryParams>(
n::build_dependencies() = "",
@@ -280,7 +280,7 @@ namespace test_cases
)));
env.package_database()->add_repository(1, repo);
- std::shared_ptr<Repository> installed_repo(new InstalledUnpackagedRepository(
+ std::shared_ptr<Repository> installed_repo(std::make_shared<InstalledUnpackagedRepository>(
RepositoryName("installed-unpackaged"),
make_named_values<unpackaged_repositories::InstalledUnpackagedRepositoryParams>(
n::environment() = &env,
diff --git a/paludis/repositories/unwritten/registration.cc b/paludis/repositories/unwritten/registration.cc
index d2c8d44..bf6b570 100644
--- a/paludis/repositories/unwritten/registration.cc
+++ b/paludis/repositories/unwritten/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
@@ -48,7 +48,7 @@ namespace paludis
void register_repositories<repository_groups::unwritten>(const repository_groups::unwritten * const,
RepositoryFactory * const factory)
{
- std::shared_ptr<Set<std::string> > unwritten_formats(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > unwritten_formats(std::make_shared<Set<std::string>>());
unwritten_formats->insert("unwritten");
factory->add_repository_format(unwritten_formats,
diff --git a/paludis/repositories/unwritten/unwritten_repository.cc b/paludis/repositories/unwritten/unwritten_repository.cc
index 46a2ed5..f715a61 100644
--- a/paludis/repositories/unwritten/unwritten_repository.cc
+++ b/paludis/repositories/unwritten/unwritten_repository.cc
@@ -63,15 +63,15 @@ namespace paludis
Imp(const UnwrittenRepository * const repo, const UnwrittenRepositoryParams & p) :
params(p),
- format_key(new LiteralMetadataValueKey<std::string> ("format", "format",
+ format_key(std::make_shared<LiteralMetadataValueKey<std::string> >("format", "format",
mkt_significant, "unwritten")),
- location_key(new LiteralMetadataValueKey<FSEntry> ("location", "location",
+ location_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >("location", "location",
mkt_significant, params.location())),
- sync_key(new LiteralMetadataValueKey<std::string> (
+ sync_key(std::make_shared<LiteralMetadataValueKey<std::string> >(
"sync", "sync", mkt_normal, params.sync())),
- sync_options_key(new LiteralMetadataValueKey<std::string> (
+ sync_options_key(std::make_shared<LiteralMetadataValueKey<std::string> >(
"sync_options", "sync_options", mkt_normal, params.sync_options())),
- sync_host_key(new LiteralMetadataValueKey<std::string> ("sync_host", "sync_host", mkt_internal, extract_host_from_url(params.sync()))),
+ sync_host_key(std::make_shared<LiteralMetadataValueKey<std::string> >("sync_host", "sync_host", mkt_internal, extract_host_from_url(params.sync()))),
store(DeferredConstructionPtr<std::shared_ptr<UnwrittenRepositoryStore> > (
std::bind(&make_store, repo, std::cref(params))))
{
@@ -323,7 +323,7 @@ UnwrittenRepository::repository_factory_create(
std::string sync_options(f("sync_options"));
- return std::shared_ptr<UnwrittenRepository>(new UnwrittenRepository(
+ return std::shared_ptr<UnwrittenRepository>(std::make_shared<UnwrittenRepository>(
make_named_values<UnwrittenRepositoryParams>(
n::environment() = env,
n::location() = location,
diff --git a/paludis/repositories/unwritten/unwritten_repository_TEST.cc b/paludis/repositories/unwritten/unwritten_repository_TEST.cc
index 3e118e2..7facff4 100644
--- a/paludis/repositories/unwritten/unwritten_repository_TEST.cc
+++ b/paludis/repositories/unwritten/unwritten_repository_TEST.cc
@@ -47,7 +47,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::shared_ptr<UnwrittenRepository> repo(new UnwrittenRepository(
+ std::shared_ptr<UnwrittenRepository> repo(std::make_shared<UnwrittenRepository>(
make_named_values<UnwrittenRepositoryParams>(
n::environment() = &env,
n::location() = FSEntry::cwd() / "unwritten_repository_TEST_dir" / "repo1",
@@ -67,7 +67,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::shared_ptr<UnwrittenRepository> repo(new UnwrittenRepository(
+ std::shared_ptr<UnwrittenRepository> repo(std::make_shared<UnwrittenRepository>(
make_named_values<UnwrittenRepositoryParams>(
n::environment() = &env,
n::location() = FSEntry::cwd() / "unwritten_repository_TEST_dir" / "repo2",
diff --git a/paludis/repositories/unwritten/unwritten_repository_file.cc b/paludis/repositories/unwritten/unwritten_repository_file.cc
index 16bca88..487fc47 100644
--- a/paludis/repositories/unwritten/unwritten_repository_file.cc
+++ b/paludis/repositories/unwritten/unwritten_repository_file.cc
@@ -303,8 +303,8 @@ UnwrittenRepositoryFile::_load(const FSEntry & f)
entry->description() = std::make_shared<LiteralMetadataValueKey<std::string>>("description", "Description", mkt_significant, token2);
else if (token == "homepage")
{
- std::shared_ptr<AllDepSpec> all_spec(new AllDepSpec);
- std::shared_ptr<SimpleURISpecTree> tree(new SimpleURISpecTree(all_spec));
+ std::shared_ptr<AllDepSpec> all_spec(std::make_shared<AllDepSpec>());
+ std::shared_ptr<SimpleURISpecTree> tree(std::make_shared<SimpleURISpecTree>(all_spec));
std::list<std::string> tokens;
tokenise_whitespace(token2, std::back_inserter(tokens));
for (std::list<std::string>::const_iterator t(tokens.begin()), t_end(tokens.end()) ;
@@ -318,7 +318,7 @@ UnwrittenRepositoryFile::_load(const FSEntry & f)
entry->added_by() = std::make_shared<LiteralMetadataValueKey<std::string>>("added-by", "Added by", mkt_author, token2);
else if (token == "bug-ids")
{
- std::shared_ptr<Sequence<std::string> > seq(new Sequence<std::string>);
+ std::shared_ptr<Sequence<std::string> > seq(std::make_shared<Sequence<std::string>>());
std::list<std::string> tokens;
tokenise_whitespace(token2, std::back_inserter(tokens));
for (std::list<std::string>::const_iterator t(tokens.begin()), t_end(tokens.end()) ;
@@ -328,7 +328,7 @@ UnwrittenRepositoryFile::_load(const FSEntry & f)
}
else if (token == "remote-ids")
{
- std::shared_ptr<Sequence<std::string> > seq(new Sequence<std::string>);
+ std::shared_ptr<Sequence<std::string> > seq(std::make_shared<Sequence<std::string>>());
std::list<std::string> tokens;
tokenise_whitespace(token2, std::back_inserter(tokens));
for (std::list<std::string>::const_iterator t(tokens.begin()), t_end(tokens.end()) ;
diff --git a/paludis/repositories/unwritten/unwritten_repository_store.cc b/paludis/repositories/unwritten/unwritten_repository_store.cc
index a7dc6ca..d440b0a 100644
--- a/paludis/repositories/unwritten/unwritten_repository_store.cc
+++ b/paludis/repositories/unwritten/unwritten_repository_store.cc
@@ -64,7 +64,7 @@ namespace paludis
Imp(const UnwrittenRepository * const r) :
repo(r),
- categories(new CategoryNamePartSet)
+ categories(std::make_shared<CategoryNamePartSet>())
{
}
};
@@ -103,7 +103,7 @@ UnwrittenRepositoryStore::_populate_one(const Environment * const env, const FSE
UnwrittenRepositoryFile file(f);
- std::shared_ptr<Mask> mask(new UnwrittenMask);
+ std::shared_ptr<Mask> mask(std::make_shared<UnwrittenMask>());
QualifiedPackageName old_name("x/x");
std::shared_ptr<QualifiedPackageNameSet> pkgs;
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository.cc b/paludis/repositories/virtuals/installed_virtuals_repository.cc
index cf6afff..d49a36c 100644
--- a/paludis/repositories/virtuals/installed_virtuals_repository.cc
+++ b/paludis/repositories/virtuals/installed_virtuals_repository.cc
@@ -66,9 +66,9 @@ namespace paludis
root(r),
ids_mutex(m),
has_ids(false),
- root_key(new LiteralMetadataValueKey<FSEntry> (
+ root_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >(
"root", "root", mkt_normal, root)),
- format_key(new LiteralMetadataValueKey<std::string> (
+ format_key(std::make_shared<LiteralMetadataValueKey<std::string> >(
"format", "format", mkt_significant, "installed_virtuals"))
{
}
@@ -155,7 +155,7 @@ InstalledVirtualsRepository::need_ids() const
if (i == _imp->ids.end())
i = _imp->ids.insert(std::make_pair((*p).virtual_name(), std::make_shared<PackageIDSequence>())).first;
- std::shared_ptr<const PackageID> id(new virtuals::VirtualsPackageID(
+ std::shared_ptr<const PackageID> id(std::make_shared<virtuals::VirtualsPackageID>(
_imp->env, shared_from_this(), (*p).virtual_name(), (*p).provided_by(), false));
i->second->push_back(id);
}
@@ -168,13 +168,13 @@ std::shared_ptr<const PackageIDSequence>
InstalledVirtualsRepository::package_ids(const QualifiedPackageName & q) const
{
if (q.category().value() != "virtual")
- return std::shared_ptr<PackageIDSequence>(new PackageIDSequence);
+ return std::shared_ptr<PackageIDSequence>(std::make_shared<PackageIDSequence>());
need_ids();
IDMap::const_iterator i(_imp->ids.find(q));
if (i == _imp->ids.end())
- return std::shared_ptr<PackageIDSequence>(new PackageIDSequence);
+ return std::shared_ptr<PackageIDSequence>(std::make_shared<PackageIDSequence>());
return i->second;
}
@@ -183,11 +183,11 @@ std::shared_ptr<const QualifiedPackageNameSet>
InstalledVirtualsRepository::package_names(const CategoryNamePart & c) const
{
if (c.value() != "virtual")
- return std::shared_ptr<QualifiedPackageNameSet>(new QualifiedPackageNameSet);
+ return std::shared_ptr<QualifiedPackageNameSet>(std::make_shared<QualifiedPackageNameSet>());
need_ids();
- std::shared_ptr<QualifiedPackageNameSet> result(new QualifiedPackageNameSet);
+ std::shared_ptr<QualifiedPackageNameSet> result(std::make_shared<QualifiedPackageNameSet>());
std::transform(_imp->ids.begin(), _imp->ids.end(), result->inserter(),
std::mem_fn(&std::pair<const QualifiedPackageName, std::shared_ptr<PackageIDSequence> >::first));
@@ -197,7 +197,7 @@ InstalledVirtualsRepository::package_names(const CategoryNamePart & c) const
std::shared_ptr<const CategoryNamePartSet>
InstalledVirtualsRepository::category_names() const
{
- std::shared_ptr<CategoryNamePartSet> result(new CategoryNamePartSet);
+ std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
result->insert(CategoryNamePart("virtual"));
return result;
}
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository_TEST.cc b/paludis/repositories/virtuals/installed_virtuals_repository_TEST.cc
index 497819f..136472f 100644
--- a/paludis/repositories/virtuals/installed_virtuals_repository_TEST.cc
+++ b/paludis/repositories/virtuals/installed_virtuals_repository_TEST.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
@@ -34,7 +34,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::shared_ptr<const InstalledVirtualsRepository> r(new InstalledVirtualsRepository(&env, FSEntry("/")));
+ std::shared_ptr<const InstalledVirtualsRepository> r(std::make_shared<InstalledVirtualsRepository>(&env, FSEntry("/")));
}
} test_installed_virtuals_repository;
}
diff --git a/paludis/repositories/virtuals/package_id.cc b/paludis/repositories/virtuals/package_id.cc
index b6f617f..1e02917 100644
--- a/paludis/repositories/virtuals/package_id.cc
+++ b/paludis/repositories/virtuals/package_id.cc
@@ -64,7 +64,7 @@ namespace paludis
const std::shared_ptr<const DependenciesLabelSequence> & l,
bool exact, const std::string & h, const std::string & r) :
env(e),
- value(new DependencySpecTree(std::make_shared<AllDepSpec>())),
+ value(std::make_shared<DependencySpecTree>(std::make_shared<AllDepSpec>())),
labels(l),
spec(exact ?
std::make_shared<PackageDepSpec>(
@@ -184,11 +184,11 @@ namespace paludis
repository(o),
name(n),
version(p->version()),
- bdep_labels(new DependenciesLabelSequence),
- rdep_labels(new DependenciesLabelSequence),
- virtual_for(new LiteralMetadataValueKey<std::shared_ptr<const PackageID> > ("VIRTUAL_FOR", "Virtual for", mkt_normal, p)),
- bdep(new virtuals::VirtualsDepKey(e, "DEPEND", "Build dependencies", p, bdep_labels, b)),
- rdep(new virtuals::VirtualsDepKey(e, "RDEPEND", "Run dependencies", p, rdep_labels, b)),
+ bdep_labels(std::make_shared<DependenciesLabelSequence>()),
+ rdep_labels(std::make_shared<DependenciesLabelSequence>()),
+ virtual_for(std::make_shared<LiteralMetadataValueKey<std::shared_ptr<const PackageID> > >("VIRTUAL_FOR", "Virtual for", mkt_normal, p)),
+ bdep(std::make_shared<virtuals::VirtualsDepKey>(e, "DEPEND", "Build dependencies", p, bdep_labels, b)),
+ rdep(std::make_shared<virtuals::VirtualsDepKey>(e, "RDEPEND", "Run dependencies", p, rdep_labels, b)),
has_masks(false)
{
bdep_labels->push_back(std::make_shared<DependenciesBuildLabel>("DEPEND",
diff --git a/paludis/repositories/virtuals/registration.cc b/paludis/repositories/virtuals/registration.cc
index ad2feae..f9abb56 100644
--- a/paludis/repositories/virtuals/registration.cc
+++ b/paludis/repositories/virtuals/registration.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
*
* 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
void register_repositories<repository_groups::virtuals>(const repository_groups::virtuals * const,
RepositoryFactory * const factory)
{
- std::shared_ptr<Set<std::string> > virtuals_formats(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > virtuals_formats(std::make_shared<Set<std::string>>());
virtuals_formats->insert("virtuals");
factory->add_repository_format(
@@ -59,7 +59,7 @@ namespace paludis
&VirtualsRepository::repository_factory_dependencies
);
- std::shared_ptr<Set<std::string> > installed_virtuals_formats(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > installed_virtuals_formats(std::make_shared<Set<std::string>>());
installed_virtuals_formats->insert("installed_virtuals");
installed_virtuals_formats->insert("installed-virtuals");
diff --git a/paludis/repositories/virtuals/virtuals_repository.cc b/paludis/repositories/virtuals/virtuals_repository.cc
index 0f50960..f55b003 100644
--- a/paludis/repositories/virtuals/virtuals_repository.cc
+++ b/paludis/repositories/virtuals/virtuals_repository.cc
@@ -76,8 +76,7 @@ namespace paludis
big_nasty_mutex(m),
has_names(false),
has_ids(false),
- format_key(new LiteralMetadataValueKey<std::string> (
- "format", "format", mkt_significant, "virtuals"))
+ format_key(std::make_shared<LiteralMetadataValueKey<std::string> >("format", "format", mkt_significant, "virtuals"))
{
}
};
@@ -163,7 +162,7 @@ VirtualsRepository::need_names() const
for (RepositoryProvidesInterface::ProvidesSequence::ConstIterator p(provides->begin()),
p_end(provides->end()) ; p != p_end ; ++p)
_imp->names.push_back(std::make_pair((*p).virtual_name(), std::shared_ptr<const PackageDepSpec>(
- new PackageDepSpec(make_package_dep_spec(PartiallyMadePackageDepSpecOptions()).package((*p).provided_by()->name())))));
+ std::make_shared<PackageDepSpec>(make_package_dep_spec(PartiallyMadePackageDepSpecOptions()).package((*p).provided_by()->name())))));
}
std::sort(_imp->names.begin(), _imp->names.end(), NamesSortComparator());
@@ -252,13 +251,13 @@ std::shared_ptr<const PackageIDSequence>
VirtualsRepository::package_ids(const QualifiedPackageName & q) const
{
if (q.category().value() != "virtual")
- return std::shared_ptr<PackageIDSequence>(new PackageIDSequence);
+ return std::shared_ptr<PackageIDSequence>(std::make_shared<PackageIDSequence>());
need_ids();
IDMap::const_iterator i(_imp->ids.find(q));
if (i == _imp->ids.end())
- return std::shared_ptr<PackageIDSequence>(new PackageIDSequence);
+ return std::shared_ptr<PackageIDSequence>(std::make_shared<PackageIDSequence>());
return i->second;
}
@@ -267,11 +266,11 @@ std::shared_ptr<const QualifiedPackageNameSet>
VirtualsRepository::package_names(const CategoryNamePart & c) const
{
if (c.value() != "virtual")
- return std::shared_ptr<QualifiedPackageNameSet>(new QualifiedPackageNameSet);
+ return std::shared_ptr<QualifiedPackageNameSet>(std::make_shared<QualifiedPackageNameSet>());
need_ids();
- std::shared_ptr<QualifiedPackageNameSet> result(new QualifiedPackageNameSet);
+ std::shared_ptr<QualifiedPackageNameSet> result(std::make_shared<QualifiedPackageNameSet>());
std::transform(_imp->ids.begin(), _imp->ids.end(), result->inserter(),
std::mem_fn(&std::pair<const QualifiedPackageName, std::shared_ptr<PackageIDSequence> >::first));
@@ -281,7 +280,7 @@ VirtualsRepository::package_names(const CategoryNamePart & c) const
std::shared_ptr<const CategoryNamePartSet>
VirtualsRepository::category_names() const
{
- std::shared_ptr<CategoryNamePartSet> result(new CategoryNamePartSet);
+ std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
result->insert(CategoryNamePart("virtual"));
return result;
}
diff --git a/paludis/repositories/virtuals/virtuals_repository_TEST.cc b/paludis/repositories/virtuals/virtuals_repository_TEST.cc
index c2ba62b..5d5525a 100644
--- a/paludis/repositories/virtuals/virtuals_repository_TEST.cc
+++ b/paludis/repositories/virtuals/virtuals_repository_TEST.cc
@@ -49,12 +49,12 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::shared_ptr<VirtualsRepository> virtuals(new VirtualsRepository(&env));
- const std::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ std::shared_ptr<VirtualsRepository> virtuals(std::make_shared<VirtualsRepository>(&env));
+ const std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
- std::shared_ptr<FakeInstalledRepository> installed(new FakeInstalledRepository(
+ std::shared_ptr<FakeInstalledRepository> installed(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("installed"),
@@ -92,16 +92,16 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::shared_ptr<VirtualsRepository> virtuals(new VirtualsRepository(&env));
- const std::shared_ptr<FakeRepository> repo1(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ std::shared_ptr<VirtualsRepository> virtuals(std::make_shared<VirtualsRepository>(&env));
+ const std::shared_ptr<FakeRepository> repo1(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo1")
)));
- const std::shared_ptr<FakeRepository> repo2(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> repo2(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo2")
)));
- std::shared_ptr<FakeInstalledRepository> installed(new FakeInstalledRepository(
+ std::shared_ptr<FakeInstalledRepository> installed(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("installed"),
@@ -145,12 +145,12 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::shared_ptr<VirtualsRepository> virtuals(new VirtualsRepository(&env));
- const std::shared_ptr<FakeRepository> repo1(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ std::shared_ptr<VirtualsRepository> virtuals(std::make_shared<VirtualsRepository>(&env));
+ const std::shared_ptr<FakeRepository> repo1(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo1")
)));
- const std::shared_ptr<FakeRepository> repo2(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> repo2(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo2")
)));
diff --git a/paludis/repository.cc b/paludis/repository.cc
index 5c0a507..91ee1af 100644
--- a/paludis/repository.cc
+++ b/paludis/repository.cc
@@ -160,7 +160,7 @@ Repository::category_names_containing_package(const PackageNamePart & p) const
{
Context context("When finding category names containing package '" + stringify(p) + "':");
- std::shared_ptr<CategoryNamePartSet> result(new CategoryNamePartSet);
+ std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
std::shared_ptr<const CategoryNamePartSet> cats(category_names());
for (CategoryNamePartSet::ConstIterator c(cats->begin()), c_end(cats->end()) ;
c != c_end ; ++c)
diff --git a/paludis/repository_name_cache.cc b/paludis/repository_name_cache.cc
index 1161c3b..f9be87e 100644
--- a/paludis/repository_name_cache.cc
+++ b/paludis/repository_name_cache.cc
@@ -198,7 +198,7 @@ RepositoryNameCache::category_names_containing_package(const PackageNamePart & p
Context context("When using name cache at '" + stringify(_imp->location) + "':");
- std::shared_ptr<CategoryNamePartSet> result(new CategoryNamePartSet);
+ std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
NameCacheMap::iterator r(_imp->find(p));
if (_imp->name_cache_map.end() == r)
return std::shared_ptr<const CategoryNamePartSet>();
@@ -282,7 +282,7 @@ RepositoryNameCache::add(const QualifiedPackageName & q)
Context context("When adding '" + stringify(q) + "' to name cache at '" + stringify(_imp->location) + "':");
- std::shared_ptr<CategoryNamePartSet> result(new CategoryNamePartSet);
+ std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
NameCacheMap::iterator r(_imp->find(q.package()));
if (_imp->name_cache_map.end() == r)
return;
@@ -301,7 +301,7 @@ RepositoryNameCache::remove(const QualifiedPackageName & q)
Context context("When removing '" + stringify(q) + "' from name cache at '" + stringify(_imp->location) + "':");
- std::shared_ptr<CategoryNamePartSet> result(new CategoryNamePartSet);
+ std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
NameCacheMap::iterator r(_imp->find(q.package()));
if (_imp->name_cache_map.end() == r)
return;
diff --git a/paludis/repository_name_cache_TEST.cc b/paludis/repository_name_cache_TEST.cc
index 5bc095f..b36c0fa 100644
--- a/paludis/repository_name_cache_TEST.cc
+++ b/paludis/repository_name_cache_TEST.cc
@@ -41,7 +41,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- const std::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
@@ -59,7 +59,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- const std::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
@@ -79,7 +79,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- const std::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
@@ -99,7 +99,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- const std::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
@@ -119,7 +119,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- const std::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
@@ -139,7 +139,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- const std::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
@@ -167,7 +167,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- const std::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
diff --git a/paludis/resolver/constraint.cc b/paludis/resolver/constraint.cc
index a82b447..c9a35e9 100644
--- a/paludis/resolver/constraint.cc
+++ b/paludis/resolver/constraint.cc
@@ -126,7 +126,7 @@ Constraints::deserialise(Deserialisation & d)
{
Deserialisator v(d, "Constraints");
Deserialisator vv(*v.find_remove_member("items"), "c");
- std::shared_ptr<Constraints> result(new Constraints);
+ std::shared_ptr<Constraints> result(std::make_shared<Constraints>());
for (int n(1), n_end(vv.member<int>("count") + 1) ; n != n_end ; ++n)
result->add(vv.member<std::shared_ptr<Constraint> >(stringify(n)));
return result;
diff --git a/paludis/resolver/decider.cc b/paludis/resolver/decider.cc
index 208024d..a3cb52a 100644
--- a/paludis/resolver/decider.cc
+++ b/paludis/resolver/decider.cc
@@ -298,7 +298,7 @@ namespace
env(e),
going_away(g),
newly_available(n),
- result(new C_)
+ result(std::make_shared<C_>())
{
}
@@ -400,8 +400,8 @@ namespace
std::shared_ptr<ChangeByResolventSequence> newly_available;
ChangingCollector() :
- going_away(new ChangeByResolventSequence),
- newly_available(new ChangeByResolventSequence)
+ going_away(std::make_shared<ChangeByResolventSequence>()),
+ newly_available(std::make_shared<ChangeByResolventSequence>())
{
}
@@ -491,7 +491,7 @@ Decider::_collect_staying(const std::shared_ptr<const ChangeByResolventSequence>
const std::shared_ptr<const PackageIDSequence> existing((*_imp->env)[selection::AllVersionsUnsorted(
generator::All() | filter::InstalledAtRoot(FSEntry("/")))]);
- const std::shared_ptr<PackageIDSequence> result(new PackageIDSequence);
+ const std::shared_ptr<PackageIDSequence> result(std::make_shared<PackageIDSequence>());
for (PackageIDSequence::ConstIterator x(existing->begin()), x_end(existing->end()) ;
x != x_end ; ++x)
if (going_away->end() == std::find_if(going_away->begin(), going_away->end(), ChangeByResolventPackageIDIs(*x)))
@@ -618,7 +618,7 @@ Decider::_find_replacing(
else
repos.insert(repo->name());
- std::shared_ptr<PackageIDSequence> result(new PackageIDSequence);
+ std::shared_ptr<PackageIDSequence> result(std::make_shared<PackageIDSequence>());
for (std::set<RepositoryName>::const_iterator r(repos.begin()),
r_end(repos.end()) ;
r != r_end ; ++r)
@@ -685,7 +685,7 @@ Decider::_make_constraints_from_target(
{
if (spec.if_package())
{
- const std::shared_ptr<ConstraintSequence> result(new ConstraintSequence);
+ const std::shared_ptr<ConstraintSequence> result(std::make_shared<ConstraintSequence>());
result->push_back(std::make_shared<Constraint>(make_named_values<Constraint>(
n::destination_type() = resolution->resolvent().destination_type(),
n::nothing_is_fine_too() = false,
@@ -711,7 +711,7 @@ Decider::_make_constraints_from_dependency(
{
if (dep.spec().if_package())
{
- const std::shared_ptr<ConstraintSequence> result(new ConstraintSequence);
+ const std::shared_ptr<ConstraintSequence> result(std::make_shared<ConstraintSequence>());
result->push_back(std::make_shared<Constraint>(make_named_values<Constraint>(
n::destination_type() = resolution->resolvent().destination_type(),
n::nothing_is_fine_too() = false,
@@ -734,7 +734,7 @@ Decider::_make_constraints_from_blocker(
const BlockDepSpec & spec,
const std::shared_ptr<const Reason> & reason) const
{
- const std::shared_ptr<ConstraintSequence> result(new ConstraintSequence);
+ const std::shared_ptr<ConstraintSequence> result(std::make_shared<ConstraintSequence>());
DestinationTypes destination_types(_get_destination_types_for_blocker(spec));
for (EnumIterator<DestinationType> t, t_end(last_dt) ; t != t_end ; ++t)
@@ -996,9 +996,9 @@ Decider::_make_constraint_for_preloading(
const std::shared_ptr<const Decision> &,
const std::shared_ptr<const Constraint> & c) const
{
- const std::shared_ptr<Constraint> result(new Constraint(*c));
+ const std::shared_ptr<Constraint> result(std::make_shared<Constraint>(*c));
- const std::shared_ptr<PresetReason> reason(new PresetReason("restarted because of", c->reason()));
+ const std::shared_ptr<PresetReason> reason(std::make_shared<PresetReason>("restarted because of", c->reason()));
result->reason() = reason;
if (result->spec().if_package())
@@ -1128,7 +1128,7 @@ Decider::_add_dependencies_if_necessary(
Context context("When adding dependencies for '" + stringify(our_resolution->resolvent()) + "' with '"
+ stringify(*package_id) + "':");
- const std::shared_ptr<SanitisedDependencies> deps(new SanitisedDependencies);
+ const std::shared_ptr<SanitisedDependencies> deps(std::make_shared<SanitisedDependencies>());
deps->populate(_imp->env, *this, our_resolution, package_id);
for (SanitisedDependencies::ConstIterator s(deps->begin()), s_end(deps->end()) ;
@@ -1149,7 +1149,7 @@ Decider::_add_dependencies_if_necessary(
break;
}
- const std::shared_ptr<DependencyReason> reason(new DependencyReason(
+ const std::shared_ptr<DependencyReason> reason(std::make_shared<DependencyReason>(
package_id, our_resolution->resolvent(), *s, _already_met(*s)));
std::shared_ptr<const Resolvents> resolvents;
@@ -1310,7 +1310,7 @@ Decider::find_any_score(
return std::make_pair(acs_wrong_options_installed, operator_bias);
}
- const std::shared_ptr<DependencyReason> reason(new DependencyReason(
+ const std::shared_ptr<DependencyReason> reason(std::make_shared<DependencyReason>(
our_id, our_resolution->resolvent(), dep, _already_met(dep)));
const std::shared_ptr<const Resolvents> resolvents(_get_resolvents_for(spec, reason));
@@ -1402,7 +1402,7 @@ Decider::_get_resolvents_for_blocker(const BlockDepSpec & spec) const
}
DestinationTypes destination_types(_get_destination_types_for_blocker(spec));
- std::shared_ptr<Resolvents> result(new Resolvents);
+ std::shared_ptr<Resolvents> result(std::make_shared<Resolvents>());
if (exact_slot)
{
for (EnumIterator<DestinationType> t, t_end(last_dt) ; t != t_end ; ++t)
@@ -1464,7 +1464,7 @@ Decider::_get_error_resolvents_for(
{
Context context("When finding slots for '" + stringify(spec) + "', which can't be found the normal way:");
- std::shared_ptr<Resolvents> result(new Resolvents);
+ std::shared_ptr<Resolvents> result(std::make_shared<Resolvents>());
DestinationTypes destination_types(_get_destination_types_for(spec, make_null_shared_ptr(), reason));
for (EnumIterator<DestinationType> t, t_end(last_dt) ; t != t_end ; ++t)
if (destination_types[*t])
@@ -1614,7 +1614,7 @@ Decider::_try_to_find_decision_for(
existing_id->behaviours_key()->value()->find("transient"));
/* we've got existing and installable. do we have any reason not to pick the existing id? */
- const std::shared_ptr<Decision> existing(new ExistingNoChangeDecision(
+ const std::shared_ptr<Decision> existing(std::make_shared<ExistingNoChangeDecision>(
resolution->resolvent(),
existing_id,
is_same,
@@ -1622,7 +1622,7 @@ Decider::_try_to_find_decision_for(
is_transient,
! resolution->constraints()->all_untaken()
));
- const std::shared_ptr<Decision> changes_to_make(new ChangesToMakeDecision(
+ const std::shared_ptr<Decision> changes_to_make(std::make_shared<ChangesToMakeDecision>(
resolution->resolvent(),
installable_id,
best,
@@ -1665,7 +1665,7 @@ const std::shared_ptr<Decision>
Decider::_cannot_decide_for(
const std::shared_ptr<const Resolution> & resolution) const
{
- const std::shared_ptr<UnsuitableCandidates> unsuitable_candidates(new UnsuitableCandidates);
+ const std::shared_ptr<UnsuitableCandidates> unsuitable_candidates(std::make_shared<UnsuitableCandidates>());
const std::shared_ptr<const PackageID> existing_id(_find_existing_id_for(resolution));
if (existing_id)
@@ -1795,7 +1795,7 @@ Decider::_get_unmatching_constraints(
const std::shared_ptr<const PackageID> & id,
const bool existing) const
{
- const std::shared_ptr<Constraints> result(new Constraints);
+ const std::shared_ptr<Constraints> result(std::make_shared<Constraints>());
for (Constraints::ConstIterator c(resolution->constraints()->begin()),
c_end(resolution->constraints()->end()) ;
@@ -1898,7 +1898,7 @@ Decider::purge()
_imp->env->trigger_notifier_callback(NotifierCallbackResolverStageEvent("Collecting"));
const std::shared_ptr<const PackageIDSet> have_now(_collect_installed());
- const std::shared_ptr<PackageIDSequence> have_now_seq(new PackageIDSequence);
+ const std::shared_ptr<PackageIDSequence> have_now_seq(std::make_shared<PackageIDSequence>());
std::copy(have_now->begin(), have_now->end(), have_now_seq->back_inserter());
const std::shared_ptr<const PackageIDSet> world(_collect_world(have_now));
@@ -1906,7 +1906,7 @@ Decider::purge()
_imp->env->trigger_notifier_callback(NotifierCallbackResolverStageEvent("Calculating Unused"));
- const std::shared_ptr<PackageIDSet> unused(new PackageIDSet);
+ const std::shared_ptr<PackageIDSet> unused(std::make_shared<PackageIDSet>());
std::set_difference(have_now->begin(), have_now->end(),
world_plus_deps->begin(), world_plus_deps->end(), unused->inserter(), PackageIDSetComparator());
@@ -1952,7 +1952,7 @@ const std::shared_ptr<const PackageIDSet>
Decider::_collect_world(
const std::shared_ptr<const PackageIDSet> & from) const
{
- const std::shared_ptr<PackageIDSet> result(new PackageIDSet);
+ const std::shared_ptr<PackageIDSet> result(std::make_shared<PackageIDSet>());
const std::shared_ptr<const SetSpecTree> set(_imp->env->set(SetName("world")));
for (PackageIDSet::ConstIterator i(from->begin()), i_end(from->end()) ;
@@ -2043,14 +2043,14 @@ namespace
{
if (! changes_to_make_decision.best())
{
- const std::shared_ptr<RequiredConfirmation> c(new NotBestConfirmation);
+ const std::shared_ptr<RequiredConfirmation> c(std::make_shared<NotBestConfirmation>());
if (! fns.confirm_fn()(resolution, c))
changes_to_make_decision.add_required_confirmation(c);
}
if (ct_downgrade == changes_to_make_decision.change_type())
{
- const std::shared_ptr<DowngradeConfirmation> c(new DowngradeConfirmation);
+ const std::shared_ptr<DowngradeConfirmation> c(std::make_shared<DowngradeConfirmation>());
if (! fns.confirm_fn()(resolution, c))
changes_to_make_decision.add_required_confirmation(c);
}
@@ -2058,7 +2058,7 @@ namespace
void visit(BreakDecision & break_decision) const
{
- const std::shared_ptr<BreakConfirmation> c(new BreakConfirmation);
+ const std::shared_ptr<BreakConfirmation> c(std::make_shared<BreakConfirmation>());
if (! fns.confirm_fn()(resolution, c))
break_decision.add_required_confirmation(c);
}
@@ -2086,7 +2086,7 @@ namespace
if (is_system)
{
- const std::shared_ptr<RemoveSystemPackageConfirmation> c(new RemoveSystemPackageConfirmation);
+ const std::shared_ptr<RemoveSystemPackageConfirmation> c(std::make_shared<RemoveSystemPackageConfirmation>());
if (! fns.confirm_fn()(resolution, c))
remove_decision.add_required_confirmation(c);
}
@@ -2110,45 +2110,45 @@ Decider::_resolve_purges()
std::shared_ptr<const ChangeByResolventSequence>,
std::shared_ptr<const ChangeByResolventSequence> > going_away_newly_available(_collect_changing());
- const std::shared_ptr<PackageIDSet> going_away(new PackageIDSet);
+ const std::shared_ptr<PackageIDSet> going_away(std::make_shared<PackageIDSet>());
std::transform(going_away_newly_available.first->begin(), going_away_newly_available.first->end(),
going_away->inserter(), get_change_by_resolvent_id);
- const std::shared_ptr<PackageIDSet> newly_available(new PackageIDSet);
+ const std::shared_ptr<PackageIDSet> newly_available(std::make_shared<PackageIDSet>());
std::transform(going_away_newly_available.second->begin(), going_away_newly_available.second->end(),
newly_available->inserter(), get_change_by_resolvent_id);
const std::shared_ptr<const PackageIDSet> have_now(_collect_installed());
- const std::shared_ptr<PackageIDSet> have_now_minus_going_away(new PackageIDSet);
+ const std::shared_ptr<PackageIDSet> have_now_minus_going_away(std::make_shared<PackageIDSet>());
std::set_difference(have_now->begin(), have_now->end(),
going_away->begin(), going_away->end(), have_now_minus_going_away->inserter(), PackageIDSetComparator());
- const std::shared_ptr<PackageIDSet> will_eventually_have_set(new PackageIDSet);
+ const std::shared_ptr<PackageIDSet> will_eventually_have_set(std::make_shared<PackageIDSet>());
std::copy(have_now_minus_going_away->begin(), have_now_minus_going_away->end(), will_eventually_have_set->inserter());
std::copy(newly_available->begin(), newly_available->end(), will_eventually_have_set->inserter());
- const std::shared_ptr<PackageIDSequence> will_eventually_have(new PackageIDSequence);
+ const std::shared_ptr<PackageIDSequence> will_eventually_have(std::make_shared<PackageIDSequence>());
std::copy(will_eventually_have_set->begin(), will_eventually_have_set->end(), will_eventually_have->back_inserter());
const std::shared_ptr<const PackageIDSet> used_originally(_accumulate_deps_and_provides(going_away, will_eventually_have, false));
const std::shared_ptr<const PackageIDSet> used_afterwards(_accumulate_deps_and_provides(newly_available, will_eventually_have, false));
- const std::shared_ptr<PackageIDSet> used_originally_and_not_going_away(new PackageIDSet);
+ const std::shared_ptr<PackageIDSet> used_originally_and_not_going_away(std::make_shared<PackageIDSet>());
std::set_difference(used_originally->begin(), used_originally->end(),
going_away->begin(), going_away->end(), used_originally_and_not_going_away->inserter(), PackageIDSetComparator());
- const std::shared_ptr<PackageIDSet> newly_unused(new PackageIDSet);
+ const std::shared_ptr<PackageIDSet> newly_unused(std::make_shared<PackageIDSet>());
std::set_difference(used_originally_and_not_going_away->begin(), used_originally_and_not_going_away->end(),
used_afterwards->begin(), used_afterwards->end(), newly_unused->inserter(), PackageIDSetComparator());
if (newly_unused->empty())
return false;
- const std::shared_ptr<PackageIDSequence> newly_unused_seq(new PackageIDSequence);
+ const std::shared_ptr<PackageIDSequence> newly_unused_seq(std::make_shared<PackageIDSequence>());
std::copy(newly_unused->begin(), newly_unused->end(), newly_unused_seq->back_inserter());
- const std::shared_ptr<PackageIDSet> used_by_unchanging(new PackageIDSet);
+ const std::shared_ptr<PackageIDSet> used_by_unchanging(std::make_shared<PackageIDSet>());
for (PackageIDSet::ConstIterator u(have_now_minus_going_away->begin()), u_end(have_now_minus_going_away->end()) ;
u != u_end ; ++u)
{
@@ -2158,7 +2158,7 @@ Decider::_resolve_purges()
std::copy(used->begin(), used->end(), used_by_unchanging->inserter());
}
- const std::shared_ptr<PackageIDSet> newly_really_unused(new PackageIDSet);
+ const std::shared_ptr<PackageIDSet> newly_really_unused(std::make_shared<PackageIDSet>());
std::set_difference(newly_unused->begin(), newly_unused->end(),
used_by_unchanging->begin(), used_by_unchanging->end(), newly_really_unused->inserter(), PackageIDSetComparator());
@@ -2180,8 +2180,8 @@ Decider::_resolve_purges()
if (match_package_in_set(*_imp->env, *world, **i, MatchPackageOptions()))
continue;
- const std::shared_ptr<ChangeByResolventSequence> used_to_use(new ChangeByResolventSequence);
- const std::shared_ptr<PackageIDSequence> star_i_set(new PackageIDSequence);
+ const std::shared_ptr<ChangeByResolventSequence> used_to_use(std::make_shared<ChangeByResolventSequence>());
+ const std::shared_ptr<PackageIDSequence> star_i_set(std::make_shared<PackageIDSequence>());
star_i_set->push_back(*i);
for (ChangeByResolventSequence::ConstIterator g(going_away_newly_available.first->begin()), g_end(going_away_newly_available.first->end()) ;
g != g_end ; ++g)
@@ -2213,7 +2213,7 @@ Decider::_collect_installed() const
{
const std::shared_ptr<const PackageIDSequence> q((*_imp->env)[selection::AllVersionsUnsorted(
generator::All() | filter::InstalledAtRoot(FSEntry("/")))]);
- const std::shared_ptr<PackageIDSet> result(new PackageIDSet);
+ const std::shared_ptr<PackageIDSet> result(std::make_shared<PackageIDSet>());
std::copy(q->begin(), q->end(), result->inserter());
return result;
@@ -2225,12 +2225,12 @@ Decider::_accumulate_deps_and_provides(
const std::shared_ptr<const PackageIDSequence> & will_eventually_have,
const bool recurse) const
{
- const std::shared_ptr<PackageIDSet> result(new PackageIDSet), done(new PackageIDSet);
+ const std::shared_ptr<PackageIDSet> result(std::make_shared<PackageIDSet>()), done(std::make_shared<PackageIDSet>());
std::copy(start->begin(), start->end(), result->inserter());
while (result->size() > done->size())
{
- const std::shared_ptr<PackageIDSet> more(new PackageIDSet);
+ const std::shared_ptr<PackageIDSet> more(std::make_shared<PackageIDSet>());
std::set_difference(result->begin(), result->end(), done->begin(), done->end(), more->inserter(), PackageIDSetComparator());
for (PackageIDSet::ConstIterator i(more->begin()), i_end(more->end()) ;
@@ -2274,7 +2274,7 @@ Decider::_collect_depped_upon(
id->suggested_dependencies_key()->value()->root()->accept(c);
}
- const std::shared_ptr<PackageIDSet> result(new PackageIDSet);
+ const std::shared_ptr<PackageIDSet> result(std::make_shared<PackageIDSet>());
std::copy(c.result->begin(), c.result->end(), result->inserter());
return result;
}
@@ -2283,7 +2283,7 @@ const std::shared_ptr<const PackageIDSet>
Decider::_collect_provided(
const std::shared_ptr<const PackageID> & id) const
{
- const std::shared_ptr<PackageIDSet> result(new PackageIDSet);
+ const std::shared_ptr<PackageIDSet> result(std::make_shared<PackageIDSet>());
if (id->provide_key())
{
@@ -2331,13 +2331,13 @@ namespace
const std::shared_ptr<ConstraintSequence> visit(const LikeOtherDestinationTypeReason &) const
{
- std::shared_ptr<ConstraintSequence> result(new ConstraintSequence);
+ std::shared_ptr<ConstraintSequence> result(std::make_shared<ConstraintSequence>());
return result;
}
const std::shared_ptr<ConstraintSequence> visit(const Reason &) const
{
- std::shared_ptr<ConstraintSequence> result(new ConstraintSequence);
+ std::shared_ptr<ConstraintSequence> result(std::make_shared<ConstraintSequence>());
result->push_back(make_shared_copy(make_named_values<Constraint>(
n::destination_type() = destination_type,
n::nothing_is_fine_too() = true,
diff --git a/paludis/resolver/decision.cc b/paludis/resolver/decision.cc
index 23d0495..118c381 100644
--- a/paludis/resolver/decision.cc
+++ b/paludis/resolver/decision.cc
@@ -118,7 +118,7 @@ const std::shared_ptr<ChangesToMakeDecision>
ChangesToMakeDecision::deserialise(Deserialisation & d)
{
Deserialisator v(d, "ChangesToMakeDecision");
- std::shared_ptr<ChangesToMakeDecision> result(new ChangesToMakeDecision(
+ std::shared_ptr<ChangesToMakeDecision> result(std::make_shared<ChangesToMakeDecision>(
v.member<Resolvent>("resolvent"),
v.member<std::shared_ptr<const PackageID> >("origin_id"),
v.member<bool>("best"),
@@ -152,7 +152,7 @@ UnableToMakeDecision::deserialise(Deserialisation & d)
{
Deserialisator v(d, "UnableToMakeDecision");
- std::shared_ptr<UnsuitableCandidates> unsuitable_candidates(new UnsuitableCandidates);
+ std::shared_ptr<UnsuitableCandidates> unsuitable_candidates(std::make_shared<UnsuitableCandidates>());
Deserialisator vv(*v.find_remove_member("unsuitable_candidates"), "c");
for (int n(1), n_end(vv.member<int>("count") + 1) ; n != n_end ; ++n)
unsuitable_candidates->push_back(vv.member<UnsuitableCandidate>(stringify(n)));
@@ -169,14 +169,14 @@ RemoveDecision::deserialise(Deserialisation & d)
{
Deserialisator v(d, "RemoveDecision");
- std::shared_ptr<PackageIDSequence> ids(new PackageIDSequence);
+ std::shared_ptr<PackageIDSequence> ids(std::make_shared<PackageIDSequence>());
{
Deserialisator vv(*v.find_remove_member("ids"), "c");
for (int n(1), n_end(vv.member<int>("count") + 1) ; n != n_end ; ++n)
ids->push_back(vv.member<std::shared_ptr<const PackageID> >(stringify(n)));
}
- const std::shared_ptr<RemoveDecision> result(new RemoveDecision(
+ const std::shared_ptr<RemoveDecision> result(std::make_shared<RemoveDecision>(
v.member<Resolvent>("resolvent"),
ids,
v.member<bool>("taken")
@@ -660,7 +660,7 @@ const std::shared_ptr<BreakDecision>
BreakDecision::deserialise(Deserialisation & d)
{
Deserialisator v(d, "BreakDecision");
- std::shared_ptr<BreakDecision> result(new BreakDecision(
+ std::shared_ptr<BreakDecision> result(std::make_shared<BreakDecision>(
v.member<Resolvent>("resolvent"),
v.member<std::shared_ptr<const PackageID> >("existing_id"),
v.member<bool>("taken")
diff --git a/paludis/resolver/decisions.cc b/paludis/resolver/decisions.cc
index a7a22f1..fb0ec78 100644
--- a/paludis/resolver/decisions.cc
+++ b/paludis/resolver/decisions.cc
@@ -170,7 +170,7 @@ const std::shared_ptr<Decisions<Decision_, Notes_> >
Decisions<Decision_, Notes_>::deserialise(Deserialisation & d)
{
Deserialisator v(d, "Decisions");
- std::shared_ptr<Decisions<Decision_, Notes_> > result(new Decisions<Decision_, Notes_>);
+ std::shared_ptr<Decisions<Decision_, Notes_> > result(std::make_shared<Decisions<Decision_, Notes_>>());
for (int n(1), n_end(v.member<int>("count") + 1) ; n != n_end ; ++n)
ContainerTraits<Decision_, Notes_>::do_extract(result, v, n);
return result;
diff --git a/paludis/resolver/destination.cc b/paludis/resolver/destination.cc
index 78a86b1..576b0e8 100644
--- a/paludis/resolver/destination.cc
+++ b/paludis/resolver/destination.cc
@@ -33,7 +33,7 @@ Destination::deserialise(Deserialisation & d)
{
Deserialisator v(d, "Destination");
- std::shared_ptr<PackageIDSequence> replacing(new PackageIDSequence);
+ std::shared_ptr<PackageIDSequence> replacing(std::make_shared<PackageIDSequence>());
Deserialisator vv(*v.find_remove_member("replacing"), "c");
for (int n(1), n_end(vv.member<int>("count") + 1) ; n != n_end ; ++n)
replacing->push_back(vv.member<std::shared_ptr<const PackageID> >(stringify(n)));
diff --git a/paludis/resolver/job.cc b/paludis/resolver/job.cc
index d394524..82ed868 100644
--- a/paludis/resolver/job.cc
+++ b/paludis/resolver/job.cc
@@ -155,14 +155,14 @@ FetchJob::deserialise(Deserialisation & d)
{
Deserialisator v(d, "FetchJob");
- std::shared_ptr<JobRequirements> requirements(new JobRequirements);
+ std::shared_ptr<JobRequirements> requirements(std::make_shared<JobRequirements>());
{
Deserialisator vv(*v.find_remove_member("requirements"), "c");
for (int n(1), n_end(vv.member<int>("count") + 1) ; n != n_end ; ++n)
requirements->push_back(vv.member<JobRequirement>(stringify(n)));
}
- std::shared_ptr<FetchJob> result(new FetchJob(
+ std::shared_ptr<FetchJob> result(std::make_shared<FetchJob>(
requirements,
parse_user_package_dep_spec(v.member<std::string>("origin_id_spec"),
d.deserialiser().environment(), UserPackageDepSpecOptions() + updso_no_disambiguation)
@@ -273,7 +273,7 @@ InstallJob::deserialise(Deserialisation & d)
{
Deserialisator v(d, "InstallJob");
- std::shared_ptr<Sequence<PackageDepSpec> > replacing_specs(new Sequence<PackageDepSpec>);
+ std::shared_ptr<Sequence<PackageDepSpec> > replacing_specs(std::make_shared<Sequence<PackageDepSpec>>());
{
Deserialisator vv(*v.find_remove_member("replacing_specs"), "c");
for (int n(1), n_end(vv.member<int>("count") + 1) ; n != n_end ; ++n)
@@ -281,14 +281,14 @@ InstallJob::deserialise(Deserialisation & d)
d.deserialiser().environment(), UserPackageDepSpecOptions() + updso_no_disambiguation));
}
- std::shared_ptr<JobRequirements> requirements(new JobRequirements);
+ std::shared_ptr<JobRequirements> requirements(std::make_shared<JobRequirements>());
{
Deserialisator vv(*v.find_remove_member("requirements"), "c");
for (int n(1), n_end(vv.member<int>("count") + 1) ; n != n_end ; ++n)
requirements->push_back(vv.member<JobRequirement>(stringify(n)));
}
- std::shared_ptr<InstallJob> result(new InstallJob(
+ std::shared_ptr<InstallJob> result(std::make_shared<InstallJob>(
requirements,
parse_user_package_dep_spec(v.member<std::string>("origin_id_spec"),
d.deserialiser().environment(), UserPackageDepSpecOptions() + updso_no_disambiguation),
@@ -304,7 +304,7 @@ InstallJob::deserialise(Deserialisation & d)
void
InstallJob::serialise(Serialiser & s) const
{
- std::shared_ptr<Sequence<std::string> > replacing_specs_s(new Sequence<std::string>);
+ std::shared_ptr<Sequence<std::string> > replacing_specs_s(std::make_shared<Sequence<std::string>>());
for (Sequence<PackageDepSpec>::ConstIterator r(replacing_specs()->begin()),
r_end(replacing_specs()->end()) ;
r != r_end ; ++r)
@@ -382,7 +382,7 @@ UninstallJob::deserialise(Deserialisation & d)
{
Deserialisator v(d, "UninstallJob");
- std::shared_ptr<Sequence<PackageDepSpec> > ids_to_remove_specs(new Sequence<PackageDepSpec> );
+ std::shared_ptr<Sequence<PackageDepSpec> > ids_to_remove_specs(std::make_shared<Sequence<PackageDepSpec> >());
{
Deserialisator vv(*v.find_remove_member("ids_to_remove_specs"), "c");
for (int n(1), n_end(vv.member<int>("count") + 1) ; n != n_end ; ++n)
@@ -390,14 +390,14 @@ UninstallJob::deserialise(Deserialisation & d)
d.deserialiser().environment(), UserPackageDepSpecOptions() + updso_no_disambiguation));
}
- std::shared_ptr<JobRequirements> requirements(new JobRequirements);
+ std::shared_ptr<JobRequirements> requirements(std::make_shared<JobRequirements>());
{
Deserialisator vv(*v.find_remove_member("requirements"), "c");
for (int n(1), n_end(vv.member<int>("count") + 1) ; n != n_end ; ++n)
requirements->push_back(vv.member<JobRequirement>(stringify(n)));
}
- std::shared_ptr<UninstallJob> result(new UninstallJob(
+ std::shared_ptr<UninstallJob> result(std::make_shared<UninstallJob>(
requirements,
ids_to_remove_specs
));
@@ -409,7 +409,7 @@ UninstallJob::deserialise(Deserialisation & d)
void
UninstallJob::serialise(Serialiser & s) const
{
- std::shared_ptr<Sequence<std::string> > ids_to_remove_specs_s(new Sequence<std::string>);
+ std::shared_ptr<Sequence<std::string> > ids_to_remove_specs_s(std::make_shared<Sequence<std::string>>());
for (Sequence<PackageDepSpec>::ConstIterator r(ids_to_remove_specs()->begin()),
r_end(ids_to_remove_specs()->end()) ;
r != r_end ; ++r)
diff --git a/paludis/resolver/job_list.cc b/paludis/resolver/job_list.cc
index ac8cef9..bcaff0a 100644
--- a/paludis/resolver/job_list.cc
+++ b/paludis/resolver/job_list.cc
@@ -95,7 +95,7 @@ JobList<Job_>::deserialise(Deserialisation & d)
{
Deserialisator v(d, "JobList");
Deserialisator vv(*v.find_remove_member("items"), "c");
- std::shared_ptr<JobList> result(new JobList);
+ std::shared_ptr<JobList> result(std::make_shared<JobList>());
for (int n(1), n_end(vv.member<int>("count") + 1) ; n != n_end ; ++n)
result->append(vv.member<std::shared_ptr<Job_> >(stringify(n)));
return result;
diff --git a/paludis/resolver/nag.cc b/paludis/resolver/nag.cc
index 91a0607..26d4791 100644
--- a/paludis/resolver/nag.cc
+++ b/paludis/resolver/nag.cc
@@ -320,7 +320,7 @@ NAG::sorted_strongly_connected_components(
/* topological sort with consistent ordering (mostly to make test cases
* easier). we know there're no cycles. */
- std::shared_ptr<SortedStronglyConnectedComponents> result(new SortedStronglyConnectedComponents);
+ std::shared_ptr<SortedStronglyConnectedComponents> result(std::make_shared<SortedStronglyConnectedComponents>());
typedef std::set<std::pair<int, NAGIndex> > OrderableNow;
OrderableNow orderable_now;
@@ -446,7 +446,7 @@ NAG::deserialise(Deserialisation & d)
Context context("When deserialising NAG:");
Deserialisator v(d, "NAG");
- std::shared_ptr<NAG> result(new NAG);
+ std::shared_ptr<NAG> result(std::make_shared<NAG>());
{
Deserialisator vv(*v.find_remove_member("nodes"), "c");
diff --git a/paludis/resolver/orderer.cc b/paludis/resolver/orderer.cc
index caf3b6b..9e891e3 100644
--- a/paludis/resolver/orderer.cc
+++ b/paludis/resolver/orderer.cc
@@ -798,7 +798,7 @@ namespace
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);
+ const std::shared_ptr<JobRequirements> requirements(std::make_shared<JobRequirements>());
requirements->push_back(make_named_values<JobRequirement>(
n::job_number() = fetch_job_n->second,
n::required_if() = JobRequirementIfs() + jri_require_for_satisfied + jri_require_for_independent
@@ -817,7 +817,7 @@ namespace
recursed
);
- const std::shared_ptr<Sequence<PackageDepSpec> > replacing(new Sequence<PackageDepSpec>);
+ const std::shared_ptr<Sequence<PackageDepSpec> > replacing(std::make_shared<Sequence<PackageDepSpec>>());
for (PackageIDSequence::ConstIterator i(changes_to_make_decision.destination()->replacing()->begin()),
i_end(changes_to_make_decision.destination()->replacing()->end()) ;
i != i_end ; ++i)
@@ -837,7 +837,7 @@ namespace
case nir_fetched:
{
- const std::shared_ptr<JobRequirements> requirements(new JobRequirements);
+ const std::shared_ptr<JobRequirements> requirements(std::make_shared<JobRequirements>());
RecursedRequirements recursed;
populate_requirements(
@@ -867,13 +867,13 @@ namespace
void visit(const RemoveDecision & remove_decision) const
{
- const std::shared_ptr<Sequence<PackageDepSpec> > removing(new Sequence<PackageDepSpec>);
+ const std::shared_ptr<Sequence<PackageDepSpec> > removing(std::make_shared<Sequence<PackageDepSpec>>());
for (PackageIDSequence::ConstIterator i(remove_decision.ids()->begin()),
i_end(remove_decision.ids()->end()) ;
i != i_end ; ++i)
removing->push_back((*i)->uniquely_identifying_spec());
- const std::shared_ptr<JobRequirements> requirements(new JobRequirements);
+ const std::shared_ptr<JobRequirements> requirements(std::make_shared<JobRequirements>());
RecursedRequirements recursed;
populate_requirements(
resolved->nag(),
diff --git a/paludis/resolver/package_or_block_dep_spec.cc b/paludis/resolver/package_or_block_dep_spec.cc
index f8b40b2..81abba3 100644
--- a/paludis/resolver/package_or_block_dep_spec.cc
+++ b/paludis/resolver/package_or_block_dep_spec.cc
@@ -126,7 +126,7 @@ PackageOrBlockDepSpec::deserialise(Deserialisation & d, const std::shared_ptr<co
std::shared_ptr<MetadataSectionKey> annotations;
- std::shared_ptr<Map<std::string, std::string> > m(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > m(std::make_shared<Map<std::string, std::string>>());
for (int a(0), a_end(v.member<int>("annotations_count")) ;
a != a_end ; ++a)
{
diff --git a/paludis/resolver/reason.cc b/paludis/resolver/reason.cc
index ead47f5..bf999b2 100644
--- a/paludis/resolver/reason.cc
+++ b/paludis/resolver/reason.cc
@@ -432,7 +432,7 @@ Reason::deserialise(Deserialisation & d)
{
Deserialisator v(d, "WasUsedByReason");
Deserialisator vv(*v.find_remove_member("ids_and_resolvents_being_removed"), "c");
- std::shared_ptr<ChangeByResolventSequence> ids_and_resolvents_being_removed(new ChangeByResolventSequence);
+ std::shared_ptr<ChangeByResolventSequence> ids_and_resolvents_being_removed(std::make_shared<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 std::make_shared<WasUsedByReason>(ids_and_resolvents_being_removed);
diff --git a/paludis/resolver/resolutions_by_resolvent.cc b/paludis/resolver/resolutions_by_resolvent.cc
index dfd112c..7ab0398 100644
--- a/paludis/resolver/resolutions_by_resolvent.cc
+++ b/paludis/resolver/resolutions_by_resolvent.cc
@@ -109,7 +109,7 @@ ResolutionsByResolvent::deserialise(Deserialisation & d)
{
Deserialisator v(d, "ResolutionsByResolvent");
Deserialisator vv(*v.find_remove_member("items"), "c");
- std::shared_ptr<ResolutionsByResolvent> result(new ResolutionsByResolvent);
+ std::shared_ptr<ResolutionsByResolvent> result(std::make_shared<ResolutionsByResolvent>());
for (int n(1), n_end(vv.member<int>("count") + 1) ; n != n_end ; ++n)
result->insert_new(vv.member<std::shared_ptr<Resolution> >(stringify(n)));
return result;
diff --git a/paludis/resolver/resolver.cc b/paludis/resolver/resolver.cc
index 1a752d6..59a83b3 100644
--- a/paludis/resolver/resolver.cc
+++ b/paludis/resolver/resolver.cc
@@ -62,7 +62,7 @@ namespace paludis
Imp(const Environment * const e, const ResolverFunctions & f) :
env(e),
fns(f),
- resolved(new Resolved(make_named_values<Resolved>(
+ resolved(std::make_shared<Resolved>(make_named_values<Resolved>(
n::job_lists() = make_shared_copy(make_named_values<JobLists>(
n::execute_job_list() = std::make_shared<JobList<ExecuteJob>>(),
n::pretend_job_list() = std::make_shared<JobList<PretendJob>>()
@@ -76,8 +76,8 @@ namespace paludis
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))
+ decider(std::make_shared<Decider>(e, f, resolved->resolutions_by_resolvent())),
+ orderer(std::make_shared<Orderer>(e, f, resolved))
{
}
};
diff --git a/paludis/resolver/resolver_test.cc b/paludis/resolver/resolver_test.cc
index b86e2ca..318308b 100644
--- a/paludis/resolver/resolver_test.cc
+++ b/paludis/resolver/resolver_test.cc
@@ -89,7 +89,7 @@ paludis::resolver::resolver_test::get_resolvents_for_fn(const PackageDepSpec & s
const std::shared_ptr<const SlotName> & slot,
const std::shared_ptr<const Reason> &)
{
- std::shared_ptr<Resolvents> result(new Resolvents);
+ std::shared_ptr<Resolvents> result(std::make_shared<Resolvents>());
result->push_back(Resolvent(spec, slot ? *slot : SlotName("0"), dt_install_to_slash));
return result;
}
@@ -231,7 +231,7 @@ paludis::resolver::resolver_test::get_constraints_for_dependent_fn(
const std::shared_ptr<const PackageID> & id,
const std::shared_ptr<const ChangeByResolventSequence> & ids)
{
- const std::shared_ptr<ConstraintSequence> result(new ConstraintSequence);
+ const std::shared_ptr<ConstraintSequence> result(std::make_shared<ConstraintSequence>());
PartiallyMadePackageDepSpec partial_spec((PartiallyMadePackageDepSpecOptions()));
partial_spec.package(id->name());
@@ -243,7 +243,7 @@ paludis::resolver::resolver_test::get_constraints_for_dependent_fn(
for (ChangeByResolventSequence::ConstIterator i(ids->begin()), i_end(ids->end()) ;
i != i_end ; ++i)
{
- const std::shared_ptr<DependentReason> reason(new DependentReason(*i));
+ const std::shared_ptr<DependentReason> reason(std::make_shared<DependentReason>(*i));
result->push_back(std::make_shared<Constraint>(make_named_values<Constraint>(
n::destination_type() = dt_install_to_slash,
@@ -264,7 +264,7 @@ paludis::resolver::resolver_test::get_constraints_for_purge_fn(
const std::shared_ptr<const PackageID> & id,
const std::shared_ptr<const ChangeByResolventSequence> & ids)
{
- const std::shared_ptr<ConstraintSequence> result(new ConstraintSequence);
+ const std::shared_ptr<ConstraintSequence> result(std::make_shared<ConstraintSequence>());
PartiallyMadePackageDepSpec partial_spec((PartiallyMadePackageDepSpecOptions()));
partial_spec.package(id->name());
@@ -273,7 +273,7 @@ paludis::resolver::resolver_test::get_constraints_for_purge_fn(
id->slot_key()->value(), false));
PackageDepSpec spec(partial_spec);
- const std::shared_ptr<WasUsedByReason> reason(new WasUsedByReason(ids));
+ const std::shared_ptr<WasUsedByReason> reason(std::make_shared<WasUsedByReason>(ids));
result->push_back(std::make_shared<Constraint>(make_named_values<Constraint>(
n::destination_type() = dt_install_to_slash,
@@ -296,7 +296,7 @@ paludis::resolver::resolver_test::get_constraints_for_via_binary_fn(
partial_spec.package(resolution->resolvent().package());
PackageDepSpec spec(partial_spec);
- std::shared_ptr<ConstraintSequence> result(new ConstraintSequence);
+ std::shared_ptr<ConstraintSequence> result(std::make_shared<ConstraintSequence>());
result->push_back(std::make_shared<Constraint>(make_named_values<Constraint>(
n::destination_type() = resolution->resolvent().destination_type(),
n::nothing_is_fine_too() = false,
@@ -326,11 +326,11 @@ paludis::resolver::resolver_test::always_via_binary_fn(
ResolverTestCase::ResolverTestCase(const std::string & t, const std::string & s, const std::string & e,
const std::string & l) :
TestCase(s),
- allowed_to_remove_names(new QualifiedPackageNameSet),
- remove_if_dependent_names(new QualifiedPackageNameSet),
- prefer_or_avoid_names(new Map<QualifiedPackageName, bool>)
+ allowed_to_remove_names(std::make_shared<QualifiedPackageNameSet>()),
+ remove_if_dependent_names(std::make_shared<QualifiedPackageNameSet>()),
+ prefer_or_avoid_names(std::make_shared<Map<QualifiedPackageName, bool>>())
{
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / ("resolver_TEST_" + t + "_dir") / "repo"));
diff --git a/paludis/resolver/sanitised_dependencies.cc b/paludis/resolver/sanitised_dependencies.cc
index 94d8e8d..7cd60af 100644
--- a/paludis/resolver/sanitised_dependencies.cc
+++ b/paludis/resolver/sanitised_dependencies.cc
@@ -416,7 +416,7 @@ namespace
void visit(const DependencySpecTree::NodeType<DependenciesLabelsDepSpec>::Type & node)
{
- std::shared_ptr<DependenciesLabelSequence> labels(new DependenciesLabelSequence);
+ std::shared_ptr<DependenciesLabelSequence> labels(std::make_shared<DependenciesLabelSequence>());
std::copy(node.spec()->begin(), node.spec()->end(), labels->back_inserter());
*labels_stack.begin() = labels;
}
diff --git a/paludis/resolver/spec_rewriter.cc b/paludis/resolver/spec_rewriter.cc
index 3c0bded..3496243 100644
--- a/paludis/resolver/spec_rewriter.cc
+++ b/paludis/resolver/spec_rewriter.cc
@@ -49,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(std::make_shared<AllDepSpec>()));
+ const std::shared_ptr<DependencySpecTree> result(std::make_shared<DependencySpecTree>(std::make_shared<AllDepSpec>()));
for (Sequence<PackageOrBlockDepSpec>::ConstIterator i(specs()->begin()), i_end(specs()->end()) ;
i != i_end ; ++i)
@@ -100,7 +100,7 @@ SpecRewriter::rewrite_if_special(const PackageOrBlockDepSpec & s, const std::sha
if (r == _imp->rewrites.end())
return make_null_shared_ptr();
- const std::shared_ptr<RewrittenSpec> result(new RewrittenSpec(make_named_values<RewrittenSpec>(
+ const std::shared_ptr<RewrittenSpec> result(std::make_shared<RewrittenSpec>(make_named_values<RewrittenSpec>(
n::specs() = std::make_shared<Sequence<PackageOrBlockDepSpec>>()
)));
@@ -120,7 +120,7 @@ SpecRewriter::rewrite_if_special(const PackageOrBlockDepSpec & s, const std::sha
if (r == _imp->rewrites.end())
return make_null_shared_ptr();
- const std::shared_ptr<RewrittenSpec> result(new RewrittenSpec(make_named_values<RewrittenSpec>(
+ const std::shared_ptr<RewrittenSpec> result(std::make_shared<RewrittenSpec>(make_named_values<RewrittenSpec>(
n::specs() = std::make_shared<Sequence<PackageOrBlockDepSpec>>()
)));
diff --git a/paludis/selection.cc b/paludis/selection.cc
index 0a50daf..a57ff9a 100644
--- a/paludis/selection.cc
+++ b/paludis/selection.cc
@@ -118,7 +118,7 @@ namespace
virtual std::shared_ptr<PackageIDSequence> perform_select(const Environment * const env) const
{
- std::shared_ptr<PackageIDSequence> result(new PackageIDSequence);
+ std::shared_ptr<PackageIDSequence> result(std::make_shared<PackageIDSequence>());
std::shared_ptr<const RepositoryNameSet> r(_fg.filter().repositories(env, _fg.generator().repositories(env)));
if (r->empty())
@@ -134,7 +134,7 @@ namespace
for (QualifiedPackageNameSet::ConstIterator q(p->begin()), q_end(p->end()) ; q != q_end ; ++q)
{
- std::shared_ptr<QualifiedPackageNameSet> s(new QualifiedPackageNameSet);
+ std::shared_ptr<QualifiedPackageNameSet> s(std::make_shared<QualifiedPackageNameSet>());
s->insert(*q);
std::shared_ptr<const PackageIDSet> i(_fg.filter().ids(env, _fg.generator().ids(env, r, s)));
if (! i->empty())
@@ -166,7 +166,7 @@ namespace
{
using namespace std::placeholders;
- std::shared_ptr<PackageIDSequence> result(new PackageIDSequence);
+ std::shared_ptr<PackageIDSequence> result(std::make_shared<PackageIDSequence>());
std::shared_ptr<const RepositoryNameSet> r(_fg.filter().repositories(env, _fg.generator().repositories(env)));
if (r->empty())
@@ -182,7 +182,7 @@ namespace
for (QualifiedPackageNameSet::ConstIterator q(p->begin()), q_end(p->end()) ; q != q_end ; ++q)
{
- std::shared_ptr<QualifiedPackageNameSet> s(new QualifiedPackageNameSet);
+ std::shared_ptr<QualifiedPackageNameSet> s(std::make_shared<QualifiedPackageNameSet>());
s->insert(*q);
std::shared_ptr<const PackageIDSet> i(_fg.filter().ids(env, _fg.generator().ids(env, r, s)));
if (! i->empty())
@@ -211,7 +211,7 @@ namespace
{
using namespace std::placeholders;
- std::shared_ptr<PackageIDSequence> result(new PackageIDSequence);
+ std::shared_ptr<PackageIDSequence> result(std::make_shared<PackageIDSequence>());
std::shared_ptr<const RepositoryNameSet> r(_fg.filter().repositories(env, _fg.generator().repositories(env)));
if (r->empty())
@@ -251,7 +251,7 @@ namespace
{
using namespace std::placeholders;
- std::shared_ptr<PackageIDSequence> result(new PackageIDSequence);
+ std::shared_ptr<PackageIDSequence> result(std::make_shared<PackageIDSequence>());
std::shared_ptr<const RepositoryNameSet> r(_fg.filter().repositories(env, _fg.generator().repositories(env)));
if (r->empty())
@@ -290,7 +290,7 @@ namespace
{
using namespace std::placeholders;
- std::shared_ptr<PackageIDSequence> result(new PackageIDSequence);
+ std::shared_ptr<PackageIDSequence> result(std::make_shared<PackageIDSequence>());
std::shared_ptr<const RepositoryNameSet> r(_fg.filter().repositories(env, _fg.generator().repositories(env)));
if (r->empty())
@@ -356,7 +356,7 @@ namespace
{
using namespace std::placeholders;
- std::shared_ptr<PackageIDSequence> result(new PackageIDSequence);
+ std::shared_ptr<PackageIDSequence> result(std::make_shared<PackageIDSequence>());
std::shared_ptr<const RepositoryNameSet> r(_fg.filter().repositories(env, _fg.generator().repositories(env)));
if (r->empty())
@@ -422,7 +422,7 @@ namespace
{
using namespace std::placeholders;
- std::shared_ptr<PackageIDSequence> result(new PackageIDSequence);
+ std::shared_ptr<PackageIDSequence> result(std::make_shared<PackageIDSequence>());
std::shared_ptr<const RepositoryNameSet> r(_fg.filter().repositories(env, _fg.generator().repositories(env)));
if (r->empty())
diff --git a/paludis/selection_TEST.cc b/paludis/selection_TEST.cc
index 09fdf73..997792a 100644
--- a/paludis/selection_TEST.cc
+++ b/paludis/selection_TEST.cc
@@ -49,7 +49,7 @@ namespace test_cases
{
TestEnvironment env;
- std::shared_ptr<FakeRepository> r1(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ std::shared_ptr<FakeRepository> r1(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo1"))));
r1->add_version("r1c1", "r1c1p1", "1");
@@ -60,7 +60,7 @@ namespace test_cases
env.package_database()->add_repository(11, r1);
TEST_CHECK(true);
- std::shared_ptr<FakeRepository> r2(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ std::shared_ptr<FakeRepository> r2(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo2"))));
r2->add_version("rac1", "rac1pa", "1");
@@ -117,7 +117,7 @@ namespace test_cases
{
TestEnvironment env;
- std::shared_ptr<FakeRepository> r1(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ std::shared_ptr<FakeRepository> r1(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo1"))));
r1->add_version("cat", "pkg", "1")->set_slot(SlotName("a"));
@@ -127,7 +127,7 @@ namespace test_cases
env.package_database()->add_repository(10, r1);
TEST_CHECK(true);
- std::shared_ptr<FakeRepository> r2(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ std::shared_ptr<FakeRepository> r2(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo2"))));
r2->add_version("cat", "pkg", "1")->set_slot(SlotName("a"));
@@ -153,7 +153,7 @@ namespace test_cases
TEST_CHECK_EQUAL(join(indirect_iterator(q4->begin()), indirect_iterator(q4->end()), " "),
"cat/pkg-3:b::repo2 cat/pkg-3:c::repo1 cat/pkg-4:a::repo1");
- std::shared_ptr<FakeRepository> r3(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ std::shared_ptr<FakeRepository> r3(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo3"))));
r3->add_version("cat", "other", "1")->set_slot(SlotName("a"));
diff --git a/paludis/selection_cache.cc b/paludis/selection_cache.cc
index cef26a2..dddb55d 100644
--- a/paludis/selection_cache.cc
+++ b/paludis/selection_cache.cc
@@ -49,7 +49,7 @@ namespace paludis
Imp(Environment * const e) :
environment(e),
- selection_cache(new SelectionCache)
+ selection_cache(std::make_shared<SelectionCache>())
{
}
};
@@ -78,7 +78,7 @@ SelectionCache::perform_select(const Environment * const env, const Selection &
i = _imp->cache.insert(std::make_pair(ss, s.perform_select(env))).first;
}
- std::shared_ptr<PackageIDSequence> result(new PackageIDSequence);
+ std::shared_ptr<PackageIDSequence> result(std::make_shared<PackageIDSequence>());
std::copy(i->second->begin(), i->second->end(), result->back_inserter());
return result;
}
diff --git a/paludis/selinux/security_context.cc b/paludis/selinux/security_context.cc
index 9a3046b..dcec327 100644
--- a/paludis/selinux/security_context.cc
+++ b/paludis/selinux/security_context.cc
@@ -182,7 +182,7 @@ SecurityContext::~SecurityContext()
std::shared_ptr<const SecurityContext> SecurityContext::current_context()
{
- std::shared_ptr<SecurityContext> p(new SecurityContext);
+ std::shared_ptr<SecurityContext> p(std::make_shared<SecurityContext>());
security_context_t con;
if (0 != libselinux.getcon(&con))
throw SELinuxException("Couldn't get current security context.");
@@ -192,7 +192,7 @@ std::shared_ptr<const SecurityContext> SecurityContext::current_context()
std::shared_ptr<const SecurityContext> SecurityContext::fs_create_context()
{
- std::shared_ptr<SecurityContext> p(new SecurityContext);
+ std::shared_ptr<SecurityContext> p(std::make_shared<SecurityContext>());
security_context_t con;
if (0 != libselinux.getfscreatecon(&con))
throw SELinuxException("Couldn't get current filesystem creation context.");
@@ -241,7 +241,7 @@ bool MatchPathCon::good() const
std::shared_ptr<const SecurityContext> MatchPathCon::match(const std::string & path, mode_t mode) const
{
- std::shared_ptr<SecurityContext> p(new SecurityContext);
+ std::shared_ptr<SecurityContext> p(std::make_shared<SecurityContext>());
security_context_t context;
if (0 != libselinux.matchpathcon(path.c_str(), mode, &context))
{
diff --git a/paludis/serialise.cc b/paludis/serialise.cc
index 9b12a55..5a26ccb 100644
--- a/paludis/serialise.cc
+++ b/paludis/serialise.cc
@@ -273,7 +273,7 @@ Deserialisation::Deserialisation(const std::string & i, Deserialiser & d) :
k.append(1, c);
}
- std::shared_ptr<Deserialisation> de(new Deserialisation(k, d));
+ std::shared_ptr<Deserialisation> de(std::make_shared<Deserialisation>(k, d));
_imp->children.push_back(de);
}
}
diff --git a/paludis/set_file.cc b/paludis/set_file.cc
index 3a5e8a8..30a6aa3 100644
--- a/paludis/set_file.cc
+++ b/paludis/set_file.cc
@@ -129,13 +129,13 @@ namespace
switch (p.type())
{
case sft_simple:
- return std::shared_ptr<SetFileHandler>(new SimpleHandler(p));
+ return std::shared_ptr<SetFileHandler>(std::make_shared<SimpleHandler>(p));
case sft_paludis_conf:
- return std::shared_ptr<SetFileHandler>(new PaludisConfHandler(p));
+ return std::shared_ptr<SetFileHandler>(std::make_shared<PaludisConfHandler>(p));
case sft_paludis_bash:
- return std::shared_ptr<SetFileHandler>(new PaludisBashHandler(p));
+ return std::shared_ptr<SetFileHandler>(std::make_shared<PaludisBashHandler>(p));
case last_sft:
break;
@@ -218,7 +218,7 @@ namespace
}
else
{
- std::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(params.parser()(tokens.at(1))));
+ std::shared_ptr<PackageDepSpec> spec(std::make_shared<PackageDepSpec>(params.parser()(tokens.at(1))));
if (params.tag())
spec->set_tag(params.tag());
result->root()->append(spec);
@@ -233,7 +233,7 @@ namespace
return;
}
- std::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(params.parser()(tokens.at(1))));
+ std::shared_ptr<PackageDepSpec> spec(std::make_shared<PackageDepSpec>(params.parser()(tokens.at(1))));
if (params.tag())
spec->set_tag(params.tag());
@@ -260,7 +260,7 @@ namespace
return;
}
- std::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(params.parser()(tokens.at(1))));
+ std::shared_ptr<PackageDepSpec> spec(std::make_shared<PackageDepSpec>(params.parser()(tokens.at(1))));
if (params.tag())
spec->set_tag(params.tag());
@@ -338,12 +338,12 @@ SimpleHandler::_create_contents() const
{
if (std::string::npos == i->find('/'))
{
- std::shared_ptr<NamedSetDepSpec> p(new NamedSetDepSpec(SetName(*i)));
+ std::shared_ptr<NamedSetDepSpec> p(std::make_shared<NamedSetDepSpec>(SetName(*i)));
_contents->root()->append(p);
}
else
{
- std::shared_ptr<PackageDepSpec> p(new PackageDepSpec(_p.parser()(stringify(*i))));
+ std::shared_ptr<PackageDepSpec> p(std::make_shared<PackageDepSpec>(_p.parser()(stringify(*i))));
if (_p.tag())
p->set_tag(_p.tag());
_contents->root()->append(p);
diff --git a/paludis/show_suggest_visitor.cc b/paludis/show_suggest_visitor.cc
index 210c659..c8155d3 100644
--- a/paludis/show_suggest_visitor.cc
+++ b/paludis/show_suggest_visitor.cc
@@ -226,7 +226,7 @@ ShowSuggestVisitor::visit(const DependencySpecTree::NodeType<PackageDepSpec>::Ty
void
ShowSuggestVisitor::visit(const DependencySpecTree::NodeType<DependenciesLabelsDepSpec>::Type & node)
{
- std::shared_ptr<DependenciesLabelSequence> labels(new DependenciesLabelSequence);
+ std::shared_ptr<DependenciesLabelSequence> labels(std::make_shared<DependenciesLabelSequence>());
std::copy(node.spec()->begin(), node.spec()->end(), labels->back_inserter());
*_imp->labels.begin() = labels;
}
diff --git a/paludis/spec_tree.cc b/paludis/spec_tree.cc
index 0b2e76a..6fb47ad 100644
--- a/paludis/spec_tree.cc
+++ b/paludis/spec_tree.cc
@@ -47,7 +47,7 @@ LeafNode<Tree_, Item_>::spec() const
template <typename Tree_>
BasicInnerNode<Tree_>::BasicInnerNode() :
- _child_list(new ChildList)
+ _child_list(std::make_shared<ChildList>())
{
}
diff --git a/paludis/standard_output_manager.cc b/paludis/standard_output_manager.cc
index c92cfdd..021473b 100644
--- a/paludis/standard_output_manager.cc
+++ b/paludis/standard_output_manager.cc
@@ -72,7 +72,7 @@ StandardOutputManager::message(const MessageType, const std::string &)
const std::shared_ptr<const Set<std::string> >
StandardOutputManager::factory_managers()
{
- std::shared_ptr<Set<std::string> > result(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > result(std::make_shared<Set<std::string>>());
result->insert("standard");
return result;
}
diff --git a/paludis/tee_output_manager.cc b/paludis/tee_output_manager.cc
index 33175c1..fa46dda 100644
--- a/paludis/tee_output_manager.cc
+++ b/paludis/tee_output_manager.cc
@@ -138,7 +138,7 @@ TeeOutputManager::nothing_more_to_come()
const std::shared_ptr<const Set<std::string> >
TeeOutputManager::factory_managers()
{
- std::shared_ptr<Set<std::string> > result(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > result(std::make_shared<Set<std::string>>());
result->insert("tee");
return result;
}
@@ -149,8 +149,8 @@ TeeOutputManager::factory_create(
const OutputManagerFactory::CreateChildFunction & create_child,
const OutputManagerFactory::ReplaceVarsFunc &)
{
- std::shared_ptr<OutputManagerSequence> children(new OutputManagerSequence);
- std::shared_ptr<OutputManagerSequence> messages_children(new OutputManagerSequence);
+ std::shared_ptr<OutputManagerSequence> children(std::make_shared<OutputManagerSequence>());
+ std::shared_ptr<OutputManagerSequence> messages_children(std::make_shared<OutputManagerSequence>());
std::vector<std::string> children_keys;
tokenise_whitespace(key_func("children"), std::back_inserter(children_keys));
diff --git a/paludis/unchoices_key.cc b/paludis/unchoices_key.cc
index 1e461ac..61d6e8d 100644
--- a/paludis/unchoices_key.cc
+++ b/paludis/unchoices_key.cc
@@ -36,7 +36,7 @@ namespace
public:
UnChoicesKey() :
- _value(new Choices)
+ _value(std::make_shared<Choices>())
{
_value->add(std::make_shared<Choice>(make_named_values<ChoiceParams>(
n::consider_added_or_changed() = false,
@@ -78,7 +78,7 @@ namespace
std::shared_ptr<const MetadataValueKey<std::shared_ptr<const Choices> > >
paludis::unchoices_key()
{
- static std::shared_ptr<const UnChoicesKey> result(new UnChoicesKey);
+ static std::shared_ptr<const UnChoicesKey> result(std::make_shared<UnChoicesKey>());
return result;
}
diff --git a/paludis/uninstall_list.cc b/paludis/uninstall_list.cc
index 73d5973..d267d3c 100644
--- a/paludis/uninstall_list.cc
+++ b/paludis/uninstall_list.cc
@@ -162,7 +162,7 @@ UninstallList::add_errors_for_system()
if (! system)
return;
- std::shared_ptr<Set<std::shared_ptr<DepTag> > > tags(new Set<std::shared_ptr<DepTag> >);
+ std::shared_ptr<Set<std::shared_ptr<DepTag> > > tags(std::make_shared<Set<std::shared_ptr<DepTag> >>());
tags->insert(std::make_shared<GeneralSetDepTag>(SetName("system"), ""));
for (std::list<UninstallListEntry>::iterator l(_imp->uninstall_list.begin()), l_end(_imp->uninstall_list.end()) ;
@@ -209,8 +209,8 @@ UninstallList::add_unused()
everything(collect_all_installed()), used(collect_used());
std::shared_ptr<PackageIDSet>
- world_plus_deps(new PackageIDSet),
- unused(new PackageIDSet);
+ world_plus_deps(std::make_shared<PackageIDSet>()),
+ unused(std::make_shared<PackageIDSet>());
std::copy(world->begin(), world->end(), world_plus_deps->inserter());
std::copy(used->begin(), used->end(), world_plus_deps->inserter());
@@ -276,7 +276,7 @@ UninstallList::collect_all_installed() const
{
Context context("When collecting all installed packages:");
- std::shared_ptr<PackageIDSet> result(new PackageIDSet);
+ std::shared_ptr<PackageIDSet> result(std::make_shared<PackageIDSet>());
for (PackageDatabase::RepositoryConstIterator i(_imp->env->package_database()->begin_repositories()),
i_end(_imp->env->package_database()->end_repositories()) ; i != i_end ; ++i)
{
@@ -312,7 +312,7 @@ namespace
DepCollector(const Environment * const ee, const std::shared_ptr<const PackageID> & e) :
env(ee),
pkg(e),
- matches(new DepListEntryTags)
+ matches(std::make_shared<DepListEntryTags>())
{
}
@@ -336,7 +336,7 @@ namespace
it_end != it; ++it)
matches->insert(make_named_values<DepTagEntry>(
n::generation() = 0,
- n::tag() = std::shared_ptr<const DepTag>(new DependencyDepTag(*it, *node.spec()))
+ n::tag() = std::shared_ptr<const DepTag>(std::make_shared<DependencyDepTag>(*it, *node.spec()))
));
}
@@ -392,7 +392,7 @@ UninstallList::collect_depped_upon(std::shared_ptr<const PackageIDSet> targets)
{
Context context("When collecting depended upon packages:");
- std::shared_ptr<PackageIDSet> result(new PackageIDSet);
+ std::shared_ptr<PackageIDSet> result(std::make_shared<PackageIDSet>());
Lock l(_imp->dep_collector_cache_mutex);
for (PackageIDSet::ConstIterator i(targets->begin()), i_end(targets->end()) ;
@@ -439,7 +439,7 @@ UninstallList::add_unused_dependencies()
/* find packages that're depped upon by anything in our uninstall list, excluding error
* packages */
- std::shared_ptr<PackageIDSet> uninstall_list_targets(new PackageIDSet);
+ std::shared_ptr<PackageIDSet> uninstall_list_targets(std::make_shared<PackageIDSet>());
for (std::list<UninstallListEntry>::const_iterator i(_imp->uninstall_list.begin()),
i_end(_imp->uninstall_list.end()) ; i != i_end ; ++i)
if (i->kind() == ulk_package || i->kind() == ulk_virtual)
@@ -448,8 +448,7 @@ UninstallList::add_unused_dependencies()
std::shared_ptr<const PackageIDSet> depped_upon_list(collect_depped_upon(uninstall_list_targets));
/* find packages that're depped upon by anything not in our uninstall list */
- std::shared_ptr<PackageIDSet> everything_except_uninstall_list_targets(
- new PackageIDSet);
+ std::shared_ptr<PackageIDSet> everything_except_uninstall_list_targets(std::make_shared<PackageIDSet>());
std::set_difference(everything->begin(), everything->end(),
uninstall_list_targets->begin(), uninstall_list_targets->end(),
everything_except_uninstall_list_targets->inserter(),
@@ -464,7 +463,7 @@ UninstallList::add_unused_dependencies()
collect_depped_upon(everything_except_uninstall_list_targets));
/* find unused dependencies */
- std::shared_ptr<PackageIDSet> unused_dependencies(new PackageIDSet);
+ std::shared_ptr<PackageIDSet> unused_dependencies(std::make_shared<PackageIDSet>());
std::set_difference(depped_upon_list->begin(), depped_upon_list->end(),
depped_upon_not_list->begin(), depped_upon_not_list->end(), unused_dependencies->inserter(),
PackageIDSetComparator());
@@ -532,7 +531,7 @@ UninstallList::add_dependencies(const PackageID & e, const bool error)
logged = true;
}
real_add(*i, std::shared_ptr<DependencyDepTag>(
- new DependencyDepTag(tag->package_id(), *tag->dependency())), error);
+ std::make_shared<DependencyDepTag>(tag->package_id(), *tag->dependency())), error);
}
}
@@ -544,7 +543,7 @@ UninstallList::collect_world() const
{
Context local_context("When collecting world packages:");
- std::shared_ptr<PackageIDSet> result(new PackageIDSet);
+ std::shared_ptr<PackageIDSet> result(std::make_shared<PackageIDSet>());
std::shared_ptr<const PackageIDSet> everything(collect_all_installed());
std::shared_ptr<const SetSpecTree> world(_imp->env->set(SetName("world")));
@@ -563,7 +562,7 @@ UninstallList::collect_used() const
{
Context local_context("When collecting used packages:");
- std::shared_ptr<PackageIDSet> result(new PackageIDSet);
+ std::shared_ptr<PackageIDSet> result(std::make_shared<PackageIDSet>());
std::shared_ptr<const PackageIDSet> everything(collect_all_installed());
for (PackageIDSet::ConstIterator i(everything->begin()),
diff --git a/paludis/uninstall_list_TEST.cc b/paludis/uninstall_list_TEST.cc
index dd038d7..c3cdc0d 100644
--- a/paludis/uninstall_list_TEST.cc
+++ b/paludis/uninstall_list_TEST.cc
@@ -99,7 +99,7 @@ namespace test_cases
UninstallListTestCaseBase(const std::string & s) :
TestCase("uninstall list " + s),
env(),
- installed_repo(new FakeInstalledRepository(
+ installed_repo(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("installed"),
@@ -109,7 +109,7 @@ namespace test_cases
#ifdef ENABLE_VIRTUALS_REPOSITORY
virtuals_repo(RepositoryFactory::get_instance()->create(&env, virtuals_repo_keys)),
#endif
- targets(new PackageIDSequence),
+ targets(std::make_shared<PackageIDSequence>()),
done_populate(false),
unused_target(false)
{
@@ -389,7 +389,7 @@ namespace test_cases
UninstallListWithUnusedDepsWorldTest() :
UninstallListTestCaseBase("with unused deps world")
{
- std::shared_ptr<SetSpecTree> world(new SetSpecTree(std::make_shared<AllDepSpec>()));
+ std::shared_ptr<SetSpecTree> world(std::make_shared<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,7 +428,7 @@ namespace test_cases
UninstallListWithUnusedDepsWorldTargetTest() :
UninstallListTestCaseBase("with unused deps world target")
{
- std::shared_ptr<SetSpecTree> world(new SetSpecTree(std::make_shared<AllDepSpec>()));
+ std::shared_ptr<SetSpecTree> world(std::make_shared<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,7 +468,7 @@ namespace test_cases
UninstallListWithSlotsTest() :
UninstallListTestCaseBase("with slots")
{
- std::shared_ptr<SetSpecTree> world(new SetSpecTree(std::make_shared<AllDepSpec>()));
+ std::shared_ptr<SetSpecTree> world(std::make_shared<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())));
diff --git a/paludis/uninstall_task.cc b/paludis/uninstall_task.cc
index 1dea7eb..7d72ccb 100644
--- a/paludis/uninstall_task.cc
+++ b/paludis/uninstall_task.cc
@@ -158,7 +158,7 @@ UninstallTask::add_target(const std::string & target)
try
{
- std::shared_ptr<PackageDepSpec> pds(new PackageDepSpec(parse_user_package_dep_spec(
+ std::shared_ptr<PackageDepSpec> pds(std::make_shared<PackageDepSpec>(parse_user_package_dep_spec(
target, _imp->env, UserPackageDepSpecOptions() + updso_throw_if_set + updso_allow_wildcards,
filter::SupportsAction<UninstallAction>())));
@@ -169,7 +169,7 @@ UninstallTask::add_target(const std::string & target)
if (pds->package_ptr())
{
/* don't need to dewildcard */
- pds->set_tag(std::shared_ptr<const DepTag>(new TargetDepTag));
+ pds->set_tag(std::shared_ptr<const DepTag>(std::make_shared<TargetDepTag>()));
_imp->targets.push_back(pds);
}
else
@@ -180,7 +180,7 @@ UninstallTask::add_target(const std::string & target)
if (names->empty())
{
/* no match. we'll get an error from this later anyway. */
- pds->set_tag(std::shared_ptr<const DepTag>(new TargetDepTag));
+ pds->set_tag(std::shared_ptr<const DepTag>(std::make_shared<TargetDepTag>()));
_imp->targets.push_back(pds);
}
else
@@ -190,8 +190,8 @@ UninstallTask::add_target(const std::string & target)
{
PartiallyMadePackageDepSpec p(*pds);
p.package((*i)->name());
- std::shared_ptr<PackageDepSpec> pdsn(new PackageDepSpec(p));
- pdsn->set_tag(std::shared_ptr<const DepTag>(new TargetDepTag));
+ std::shared_ptr<PackageDepSpec> pdsn(std::make_shared<PackageDepSpec>(p));
+ pdsn->set_tag(std::shared_ptr<const DepTag>(std::make_shared<TargetDepTag>()));
_imp->targets.push_back(pdsn);
}
}
@@ -316,7 +316,7 @@ UninstallTask::execute()
{
on_update_world_pre();
- std::shared_ptr<SetSpecTree> all(new SetSpecTree(std::make_shared<AllDepSpec>()));
+ std::shared_ptr<SetSpecTree> all(std::make_shared<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)
diff --git a/paludis/user_dep_spec.cc b/paludis/user_dep_spec.cc
index caa7153..c4bf96a 100644
--- a/paludis/user_dep_spec.cc
+++ b/paludis/user_dep_spec.cc
@@ -186,7 +186,7 @@ namespace
case '.':
{
- std::shared_ptr<const AdditionalPackageDepSpecRequirement> req(new UserKeyRequirement(flag.substr(1)));
+ std::shared_ptr<const AdditionalPackageDepSpecRequirement> req(std::make_shared<UserKeyRequirement>(flag.substr(1)));
result.additional_requirement(req);
}
break;
diff --git a/paludis/user_dep_spec_TEST.cc b/paludis/user_dep_spec_TEST.cc
index 91e0acd..cf41623 100644
--- a/paludis/user_dep_spec_TEST.cc
+++ b/paludis/user_dep_spec_TEST.cc
@@ -313,10 +313,10 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::shared_ptr<FakeRepository> fake(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ std::shared_ptr<FakeRepository> fake(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("fake"))));
- std::shared_ptr<FakeInstalledRepository> fake_inst(new FakeInstalledRepository(
+ std::shared_ptr<FakeInstalledRepository> fake_inst(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("fake_inst"),
@@ -376,7 +376,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::shared_ptr<FakeRepository> fake(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ std::shared_ptr<FakeRepository> fake(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("fake"))));
env.package_database()->add_repository(1, fake);
@@ -409,7 +409,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::shared_ptr<FakeRepository> fake(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ std::shared_ptr<FakeRepository> fake(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("fake"))));
env.package_database()->add_repository(1, fake);
diff --git a/paludis/util/active_object_ptr.hh b/paludis/util/active_object_ptr.hh
index 8d86daf..8059f3b 100644
--- a/paludis/util/active_object_ptr.hh
+++ b/paludis/util/active_object_ptr.hh
@@ -57,7 +57,7 @@ namespace paludis
public:
ActiveObjectPtr(const T_ & t) :
_ptr(t),
- _mutex(new Mutex)
+ _mutex(std::make_shared<Mutex>())
{
}
diff --git a/paludis/util/clone-impl.hh b/paludis/util/clone-impl.hh
index 8bd59af..a877da6 100644
--- a/paludis/util/clone-impl.hh
+++ b/paludis/util/clone-impl.hh
@@ -39,7 +39,7 @@ namespace paludis
std::shared_ptr<Base_>
CloneUsingThis<Base_, Child_>::clone() const
{
- return std::shared_ptr<Base_>(new Child_(*static_cast<const Child_ *>(this)));
+ return std::shared_ptr<Base_>(std::make_shared<Child_>(*static_cast<const Child_ *>(this)));
}
template<typename Base_, typename Child_>
diff --git a/paludis/util/config_file.cc b/paludis/util/config_file.cc
index 1333f20..1bfc6e9 100644
--- a/paludis/util/config_file.cc
+++ b/paludis/util/config_file.cc
@@ -79,7 +79,7 @@ namespace paludis
try
{
SafeIFStream ff(f);
- std::shared_ptr<std::string> t(new std::string);
+ std::shared_ptr<std::string> t(std::make_shared<std::string>());
std::copy((std::istreambuf_iterator<char>(ff)), std::istreambuf_iterator<char>(), std::back_inserter(*t));
text = t;
}
@@ -90,13 +90,13 @@ namespace paludis
}
Imp(const std::string & s) :
- text(new std::string(s))
+ text(std::make_shared<std::string>(s))
{
}
Imp(std::istream & ff)
{
- std::shared_ptr<std::string> t(new std::string);
+ std::shared_ptr<std::string> t(std::make_shared<std::string>());
std::copy((std::istreambuf_iterator<char>(ff)), std::istreambuf_iterator<char>(), std::back_inserter(*t));
text = t;
}
diff --git a/paludis/util/config_file_TEST.cc b/paludis/util/config_file_TEST.cc
index fea690e..f0f500e 100644
--- a/paludis/util/config_file_TEST.cc
+++ b/paludis/util/config_file_TEST.cc
@@ -227,7 +227,7 @@ namespace test_cases
TEST_CHECK_EQUAL(ff.get("z"), "foofoo\\$");
std::stringstream t;
- std::shared_ptr<Map<std::string, std::string> > t_defs(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > t_defs(std::make_shared<Map<std::string, std::string>>());
t_defs->insert("a", "moo");
t_defs->insert("d", "bar");
t_defs->insert("e", "baz");
@@ -262,7 +262,7 @@ namespace test_cases
std::stringstream d_s;
d_s << "foo=oink" << std::endl;
- std::shared_ptr<KeyValueConfigFile> d_ff(new KeyValueConfigFile(d_s, KeyValueConfigFileOptions(),
+ std::shared_ptr<KeyValueConfigFile> d_ff(std::make_shared<KeyValueConfigFile>(d_s, KeyValueConfigFileOptions(),
&predefined_from_env,
&KeyValueConfigFile::no_transformation));
diff --git a/paludis/util/dir_iterator.cc b/paludis/util/dir_iterator.cc
index 732eaad..4021082 100644
--- a/paludis/util/dir_iterator.cc
+++ b/paludis/util/dir_iterator.cc
@@ -128,7 +128,7 @@ DirIterator::DirIterator(const DirIterator & other) :
}
DirIterator::DirIterator() :
- Pimp<DirIterator>(std::shared_ptr<EntrySet>(new EntrySet(&compare_name)))
+ Pimp<DirIterator>(std::shared_ptr<EntrySet>(std::make_shared<EntrySet>(&compare_name)))
{
_imp->iter = _imp->items->end();
}
diff --git a/paludis/util/exception.cc b/paludis/util/exception.cc
index 0924210..7ae5468 100644
--- a/paludis/util/exception.cc
+++ b/paludis/util/exception.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2005, 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
diff --git a/paludis/util/graph-impl.hh b/paludis/util/graph-impl.hh
index 20d4f3c..6c4769d 100644
--- a/paludis/util/graph-impl.hh
+++ b/paludis/util/graph-impl.hh
@@ -381,7 +381,7 @@ namespace paludis
if (done.size() < c)
{
std::shared_ptr<NoGraphTopologicalOrderExistsError::RemainingNodes> r(
- new NoGraphTopologicalOrderExistsError::RemainingNodes);
+ std::make_shared<NoGraphTopologicalOrderExistsError::RemainingNodes>());
for (typename DirectedGraph<Node_, Edge_, Comparator_>::NodeConstIterator n(g.begin_nodes()), n_end(g.end_nodes()) ; n != n_end ; ++n)
if (done.end() == done.find(*n))
r->add(stringify(depointer(*n)));
diff --git a/paludis/util/indirect_iterator_TEST.cc b/paludis/util/indirect_iterator_TEST.cc
index 173ec40..d76fbdd 100644
--- a/paludis/util/indirect_iterator_TEST.cc
+++ b/paludis/util/indirect_iterator_TEST.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2010 Ciaran McCreesh
* Copyright (c) 2007 David Leverton
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -51,8 +51,8 @@ namespace test_cases
void run()
{
std::vector<std::shared_ptr<int> > v;
- v.push_back(std::shared_ptr<int>(new int(5)));
- v.push_back(std::shared_ptr<int>(new int(10)));
+ v.push_back(std::shared_ptr<int>(std::make_shared<int>(5)));
+ v.push_back(std::shared_ptr<int>(std::make_shared<int>(10)));
IndirectIterator<std::vector<std::shared_ptr<int> >::iterator, int> vi(v.begin()), vi_end(v.end());
TEST_CHECK(vi != vi_end);
TEST_CHECK(vi < vi_end);
@@ -77,8 +77,8 @@ namespace test_cases
void run()
{
std::list<std::shared_ptr<int> > v;
- v.push_back(std::shared_ptr<int>(new int(5)));
- v.push_back(std::shared_ptr<int>(new int(10)));
+ v.push_back(std::shared_ptr<int>(std::make_shared<int>(5)));
+ v.push_back(std::shared_ptr<int>(std::make_shared<int>(10)));
IndirectIterator<std::list<std::shared_ptr<int> >::iterator> vi(v.begin()), vi_end(v.end());
TEST_CHECK(vi != vi_end);
TEST_CHECK_EQUAL(*vi, 5);
diff --git a/paludis/util/system.cc b/paludis/util/system.cc
index 17c7e11..04abfc1 100644
--- a/paludis/util/system.cc
+++ b/paludis/util/system.cc
@@ -562,7 +562,7 @@ paludis::run_command(const Command & cmd)
Log::get_instance()->message("util.system.execl", ll_debug, lc_no_context) << "execl /bin/sh -c " << command
<< " " << extras;
- std::shared_ptr<Pipe> internal_command_reader(new Pipe), pipe_command_reader,
+ std::shared_ptr<Pipe> internal_command_reader(std::make_shared<Pipe>()), pipe_command_reader,
pipe_command_response, input_stream, output_stream;
std::shared_ptr<Channel> captured_stdout, captured_stderr;
if (cmd.pipe_command_handler())
diff --git a/paludis/util/tail_output_stream.cc b/paludis/util/tail_output_stream.cc
index 5219a33..14af0b9 100644
--- a/paludis/util/tail_output_stream.cc
+++ b/paludis/util/tail_output_stream.cc
@@ -94,7 +94,7 @@ TailOutputStreamBuf::_append(const std::string & s)
const std::shared_ptr<const Sequence<std::string> >
TailOutputStreamBuf::tail(const bool clear)
{
- std::shared_ptr<Sequence<std::string> > result(new Sequence<std::string>);
+ std::shared_ptr<Sequence<std::string> > result(std::make_shared<Sequence<std::string>>());
Lock lock(_imp->mutex);
for (std::list<std::string>::const_iterator i(_imp->tail.begin()), i_end(_imp->tail.end()), i_last(previous(_imp->tail.end())) ;
i != i_end ; ++i)
diff --git a/paludis/util/wildcard_expander.cc b/paludis/util/wildcard_expander.cc
index 234984e..bc5741c 100644
--- a/paludis/util/wildcard_expander.cc
+++ b/paludis/util/wildcard_expander.cc
@@ -41,7 +41,7 @@ namespace paludis
std::vector<FSEntry>::const_iterator it;
Imp() :
- files(new std::vector<FSEntry>)
+ files(std::make_shared<std::vector<FSEntry>>())
{
}
diff --git a/python/additional_tests.cc b/python/additional_tests.cc
index fc7e795..88c2f73 100644
--- a/python/additional_tests.cc
+++ b/python/additional_tests.cc
@@ -47,7 +47,7 @@ namespace environment
{
void test_env(Environment & e)
{
- std::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &e,
n::name() = RepositoryName("fakerepo"))));
std::shared_ptr<PackageID> pid(repo->add_version("cat", "pkg", "1.0"));
@@ -55,7 +55,7 @@ namespace environment
bool PALUDIS_ATTRIBUTE((unused)) b2(e.accept_license("l", *pid));
- std::shared_ptr<KeywordNameSet> kns(new KeywordNameSet);
+ std::shared_ptr<KeywordNameSet> kns(std::make_shared<KeywordNameSet>());
kns->insert(KeywordName("keyword"));
bool PALUDIS_ATTRIBUTE((unused)) b3(e.accept_keywords(kns, *pid));
diff --git a/python/dep_spec.cc b/python/dep_spec.cc
index 0861bac..c7a3493 100644
--- a/python/dep_spec.cc
+++ b/python/dep_spec.cc
@@ -207,7 +207,7 @@ std::shared_ptr<T_>
deep_copy(const std::shared_ptr<const T_> & x)
{
if (x)
- return std::shared_ptr<T_>(new T_(*x));
+ return std::shared_ptr<T_>(std::make_shared<T_>(*x));
else
return std::shared_ptr<T_>();
}
@@ -529,7 +529,7 @@ SpecTreeToPython::~SpecTreeToPython()
void
SpecTreeToPython::visit(const GenericSpecTree::NodeType<AllDepSpec>::Type & node)
{
- std::shared_ptr<PythonAllDepSpec> py_cds(new PythonAllDepSpec(*node.spec()));
+ std::shared_ptr<PythonAllDepSpec> py_cds(std::make_shared<PythonAllDepSpec>(*node.spec()));
_current_parent->add_child(py_cds);
Save<std::shared_ptr<PythonCompositeDepSpec> > old_parent(&_current_parent, py_cds);
std::for_each(indirect_iterator(node.begin()), indirect_iterator(node.end()), accept_visitor(*this));
@@ -538,7 +538,7 @@ SpecTreeToPython::visit(const GenericSpecTree::NodeType<AllDepSpec>::Type & node
void
SpecTreeToPython::visit(const GenericSpecTree::NodeType<AnyDepSpec>::Type & node)
{
- std::shared_ptr<PythonAnyDepSpec> py_cds(new PythonAnyDepSpec(*node.spec()));
+ std::shared_ptr<PythonAnyDepSpec> py_cds(std::make_shared<PythonAnyDepSpec>(*node.spec()));
_current_parent->add_child(py_cds);
Save<std::shared_ptr<PythonCompositeDepSpec> > old_parent(&_current_parent, py_cds);
std::for_each(indirect_iterator(node.begin()), indirect_iterator(node.end()), accept_visitor(*this));
@@ -547,7 +547,7 @@ SpecTreeToPython::visit(const GenericSpecTree::NodeType<AnyDepSpec>::Type & node
void
SpecTreeToPython::visit(const GenericSpecTree::NodeType<ConditionalDepSpec>::Type & node)
{
- std::shared_ptr<PythonConditionalDepSpec> py_cds(new PythonConditionalDepSpec(*node.spec()));
+ std::shared_ptr<PythonConditionalDepSpec> py_cds(std::make_shared<PythonConditionalDepSpec>(*node.spec()));
_current_parent->add_child(py_cds);
Save<std::shared_ptr<PythonCompositeDepSpec> > old_parent(&_current_parent, py_cds);
std::for_each(indirect_iterator(node.begin()), indirect_iterator(node.end()), accept_visitor(*this));
@@ -729,7 +729,7 @@ void dispatch(SpecTreeFromPython<H_> * const v, const PyD_ & d)
template <typename H_>
SpecTreeFromPython<H_>::SpecTreeFromPython() :
- _result(new H_(std::make_shared<AllDepSpec>())),
+ _result(std::make_shared<H_>(std::make_shared<AllDepSpec>())),
_add_to(_result->root())
{
}
diff --git a/python/environment.cc b/python/environment.cc
index 8be1aef..b4d0913 100644
--- a/python/environment.cc
+++ b/python/environment.cc
@@ -50,7 +50,7 @@ class EnvironmentImplementationWrapper :
public:
EnvironmentImplementationWrapper() :
- _db(new PackageDatabase(this))
+ _db(std::make_shared<PackageDatabase>(this))
{
}
diff --git a/ruby/action.cc b/ruby/action.cc
index 824e4e7..b84327f 100644
--- a/ruby/action.cc
+++ b/ruby/action.cc
@@ -285,7 +285,7 @@ namespace
{
const FetchActionOptions opts_ptr(value_to_fetch_action_options(opts));
std::shared_ptr<Action> * a(
- new std::shared_ptr<Action>(new FetchAction(opts_ptr)));
+ new std::shared_ptr<Action>(std::make_shared<FetchAction>(opts_ptr)));
VALUE tdata(Data_Wrap_Struct(self, 0, &Common<std::shared_ptr<Action> >::free, a));
rb_obj_call_init(tdata, 1, &self);
return tdata;
@@ -476,7 +476,7 @@ namespace
n::make_output_manager() = &make_standard_output_manager
));
- std::shared_ptr<Action> * a(new std::shared_ptr<Action>(new A_(options)));
+ std::shared_ptr<Action> * a(new std::shared_ptr<Action>(std::make_shared<A_>(options)));
VALUE tdata(Data_Wrap_Struct(self, 0, &Common<std::shared_ptr<Action> >::free, a));
rb_obj_call_init(tdata, 1, &self);
return tdata;
@@ -573,7 +573,7 @@ namespace
{
const InstallActionOptions opts_ptr(value_to_install_action_options(opts));
std::shared_ptr<Action> * a(
- new std::shared_ptr<Action>(new InstallAction(opts_ptr)));
+ new std::shared_ptr<Action>(std::make_shared<InstallAction>(opts_ptr)));
VALUE tdata(Data_Wrap_Struct(self, 0, &Common<std::shared_ptr<Action> >::free, a));
rb_obj_call_init(tdata, 1, &self);
return tdata;
@@ -648,8 +648,7 @@ namespace
uninstall_action_new(VALUE self, VALUE opts)
{
const UninstallActionOptions opts_ptr(value_to_uninstall_action_options(opts));
- std::shared_ptr<Action> * a(
- new std::shared_ptr<Action>(new UninstallAction(opts_ptr)));
+ std::shared_ptr<Action> * a(new std::shared_ptr<Action>(std::make_shared<UninstallAction>(opts_ptr)));
VALUE tdata(Data_Wrap_Struct(self, 0, &Common<std::shared_ptr<Action> >::free, a));
rb_obj_call_init(tdata, 1, &self);
return tdata;
diff --git a/ruby/contents.cc b/ruby/contents.cc
index 2753aae..10caa1f 100644
--- a/ruby/contents.cc
+++ b/ruby/contents.cc
@@ -2,7 +2,7 @@
/*
* Copyright (c) 2006, 2007 Richard Brown
- * 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
@@ -173,7 +173,7 @@ namespace
{
if (1 == argc)
{
- ptr = new std::shared_ptr<const ContentsEntry>(new A_(
+ ptr = new std::shared_ptr<const ContentsEntry>(std::make_shared<A_>(
FSEntry(StringValuePtr(argv[0]))));
}
else
@@ -199,7 +199,7 @@ namespace
{
if (2 == argc)
{
- ptr = new std::shared_ptr<const ContentsEntry>(new ContentsSymEntry(
+ ptr = new std::shared_ptr<const ContentsEntry>(std::make_shared<ContentsSymEntry>(
FSEntry(StringValuePtr(argv[0])), StringValuePtr(argv[1])));
}
else
diff --git a/ruby/dep_list.cc b/ruby/dep_list.cc
index 60c2d73..b64d6fb 100644
--- a/ruby/dep_list.cc
+++ b/ruby/dep_list.cc
@@ -133,7 +133,7 @@ namespace
std::shared_ptr<DepListOverrideMasksFunctions> * ptr(0);
try
{
- ptr = new std::shared_ptr<DepListOverrideMasksFunctions>(new DepListOverrideMasksFunctions);
+ ptr = new std::shared_ptr<DepListOverrideMasksFunctions>(std::make_shared<DepListOverrideMasksFunctions>());
VALUE tdata(Data_Wrap_Struct(self, 0, &Common<std::shared_ptr<DepListOverrideMasksFunctions> >::free, ptr));
rb_obj_call_init(tdata, argc, argv);
return tdata;
@@ -194,7 +194,7 @@ namespace
{
try
{
- ptr = new std::shared_ptr<DepListOptions>(new DepListOptions);
+ ptr = new std::shared_ptr<DepListOptions>(std::make_shared<DepListOptions>());
VALUE tdata(Data_Wrap_Struct(self, 0, &Common<std::shared_ptr<DepListOptions> >::free, ptr));
rb_obj_call_init(tdata, argc, argv);
return tdata;
@@ -382,7 +382,7 @@ namespace
if (value_for_circular < 0 || value_for_blocks >= last_dl_blocks)
rb_raise(rb_eArgError, "blocks out of range");
- ptr = new std::shared_ptr<DepListOptions>(new DepListOptions);
+ ptr = new std::shared_ptr<DepListOptions>(std::make_shared<DepListOptions>());
(*ptr)->blocks() = static_cast<DepListBlocksOption>(value_for_blocks);
(*ptr)->circular() = static_cast<DepListCircularOption>(value_for_circular);
(*ptr)->dependency_tags() = value_for_dependency_tags;
@@ -915,7 +915,7 @@ namespace
Data_Get_Struct(self, DepList, p);
if (!rb_obj_is_kind_of(d, rb_cArray))
rb_raise(rb_eTypeError, "Can't convert %s into Array", rb_obj_classname(d));
- std::shared_ptr<DestinationsSet> destinations(new DestinationsSet);
+ std::shared_ptr<DestinationsSet> destinations(std::make_shared<DestinationsSet>());
for (long i = 0 ; i < RARRAY_LEN(d) ; ++i)
destinations->insert(value_to_repository(rb_ary_entry(d, i)));
@@ -975,7 +975,7 @@ namespace
Data_Get_Struct(self, DepList, p);
if (!rb_obj_is_kind_of(d, rb_cArray))
rb_raise(rb_eTypeError, "Can't convert %s into Array", rb_obj_classname(d));
- std::shared_ptr<DestinationsCollection> destinations(new DestinationsCollection::Concrete);
+ std::shared_ptr<DestinationsCollection> destinations(std::make_shared<DestinationsCollection::Concrete>());
for (long i = 0 ; i < RARRAY_LEN(d) ; ++i)
destinations->insert(value_to_repository(rb_ary_entry(d, i)));
diff --git a/ruby/dep_spec.cc b/ruby/dep_spec.cc
index 1f180e1..65daf6b 100644
--- a/ruby/dep_spec.cc
+++ b/ruby/dep_spec.cc
@@ -187,61 +187,61 @@ namespace
void visit(const GenericSpecTree::NodeType<PackageDepSpec>::Type & node)
{
- wrapped = std::make_shared<WrappedSpec<PackageDepSpec>>(std::static_pointer_cast<PackageDepSpec>(node.spec()->clone()));
+ wrapped.reset(new WrappedSpec<PackageDepSpec>(std::static_pointer_cast<PackageDepSpec>(node.spec()->clone())));
klass = c_package_dep_spec;
}
void visit(const GenericSpecTree::NodeType<BlockDepSpec>::Type & node)
{
- wrapped = std::make_shared<WrappedSpec<BlockDepSpec>>(std::static_pointer_cast<BlockDepSpec>(node.spec()->clone()));
+ wrapped.reset(new WrappedSpec<BlockDepSpec>(std::static_pointer_cast<BlockDepSpec>(node.spec()->clone())));
klass = c_block_dep_spec;
}
void visit(const GenericSpecTree::NodeType<PlainTextDepSpec>::Type & node)
{
- wrapped = std::make_shared<WrappedSpec<PlainTextDepSpec>>(std::static_pointer_cast<PlainTextDepSpec>(node.spec()->clone()));
+ wrapped.reset(new WrappedSpec<PlainTextDepSpec>(std::static_pointer_cast<PlainTextDepSpec>(node.spec()->clone())));
klass = c_plain_text_dep_spec;
}
void visit(const GenericSpecTree::NodeType<SimpleURIDepSpec>::Type & node)
{
- wrapped = std::make_shared<WrappedSpec<SimpleURIDepSpec>>(std::static_pointer_cast<SimpleURIDepSpec>(node.spec()->clone()));
+ wrapped.reset(new WrappedSpec<SimpleURIDepSpec>(std::static_pointer_cast<SimpleURIDepSpec>(node.spec()->clone())));
klass = c_simple_uri_dep_spec;
}
void visit(const GenericSpecTree::NodeType<FetchableURIDepSpec>::Type & node)
{
- wrapped = std::make_shared<WrappedSpec<FetchableURIDepSpec>>(std::static_pointer_cast<FetchableURIDepSpec>(node.spec()->clone()));
+ wrapped.reset(new WrappedSpec<FetchableURIDepSpec>(std::static_pointer_cast<FetchableURIDepSpec>(node.spec()->clone())));
klass = c_fetchable_uri_dep_spec;
}
void visit(const GenericSpecTree::NodeType<URILabelsDepSpec>::Type & node)
{
- wrapped = std::make_shared<WrappedSpec<URILabelsDepSpec>>(std::static_pointer_cast<URILabelsDepSpec>(node.spec()->clone()));
+ wrapped.reset(new WrappedSpec<URILabelsDepSpec>(std::static_pointer_cast<URILabelsDepSpec>(node.spec()->clone())));
klass = c_uri_labels_dep_spec;
}
void visit(const GenericSpecTree::NodeType<PlainTextLabelDepSpec>::Type & node)
{
- wrapped = std::make_shared<WrappedSpec<PlainTextLabelDepSpec>>(std::static_pointer_cast<PlainTextLabelDepSpec>(node.spec()->clone()));
+ wrapped.reset(new WrappedSpec<PlainTextLabelDepSpec>(std::static_pointer_cast<PlainTextLabelDepSpec>(node.spec()->clone())));
klass = c_plain_text_label_dep_spec;
}
void visit(const GenericSpecTree::NodeType<DependenciesLabelsDepSpec>::Type & node)
{
- wrapped = std::make_shared<WrappedSpec<DependenciesLabelsDepSpec>>(std::static_pointer_cast<DependenciesLabelsDepSpec>(node.spec()->clone()));
+ wrapped.reset(new WrappedSpec<DependenciesLabelsDepSpec>(std::static_pointer_cast<DependenciesLabelsDepSpec>(node.spec()->clone())));
klass = c_dependencies_labels_dep_spec;
}
void visit(const GenericSpecTree::NodeType<NamedSetDepSpec>::Type & node)
{
- wrapped = std::make_shared<WrappedSpec<NamedSetDepSpec>>(std::static_pointer_cast<NamedSetDepSpec>(node.spec()->clone()));
+ wrapped.reset(new WrappedSpec<NamedSetDepSpec>(std::static_pointer_cast<NamedSetDepSpec>(node.spec()->clone())));
klass = c_named_set_dep_spec;
}
void visit(const GenericSpecTree::NodeType<LicenseDepSpec>::Type & node)
{
- wrapped = std::make_shared<WrappedSpec<LicenseDepSpec>>(std::static_pointer_cast<LicenseDepSpec>(node.spec()->clone()));
+ wrapped.reset(new WrappedSpec<LicenseDepSpec>(std::static_pointer_cast<LicenseDepSpec>(node.spec()->clone())));
klass = c_license_dep_spec;
}
@@ -354,7 +354,7 @@ namespace
{
static void handle(ValueToTree<H_> * const t, const WrappedSpec<AllDepSpec> & spec)
{
- t->result = std::make_shared<H_>(spec.spec());
+ t->result.reset(new H_(spec.spec()));
t->add_to = t->result->root();
}
};
@@ -469,7 +469,7 @@ namespace
try
{
std::shared_ptr<const PackageDepSpec> pkg(value_to_package_dep_spec(spec));
- ptr = new std::shared_ptr<const WrappedSpecBase>(new WrappedSpec<BlockDepSpec>(
+ ptr = new std::shared_ptr<const WrappedSpecBase>(std::make_shared<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);
@@ -506,7 +506,7 @@ namespace
std::shared_ptr<const WrappedSpecBase> * ptr(0);
try
{
- ptr = new std::shared_ptr<const WrappedSpecBase>(new WrappedSpec<A_>(std::make_shared<A_>()));
+ ptr = new std::shared_ptr<const WrappedSpecBase>(std::make_shared<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_>(std::make_shared<A_>(StringValuePtr(s))));
+ ptr = new std::shared_ptr<const WrappedSpecBase>(std::make_shared<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;
@@ -1058,7 +1058,7 @@ namespace
filter::All()
);
- ptr = new std::shared_ptr<const WrappedSpecBase>(new WrappedSpec<PackageDepSpec>(
+ ptr = new std::shared_ptr<const WrappedSpecBase>(std::make_shared<WrappedSpec<PackageDepSpec>>(
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);
@@ -1402,7 +1402,7 @@ VALUE
paludis::ruby::package_dep_spec_to_value(const std::shared_ptr<const PackageDepSpec> & p)
{
std::shared_ptr<const WrappedSpecBase> * v_ptr(new std::shared_ptr<const WrappedSpecBase>(
- new WrappedSpec<PackageDepSpec>(std::static_pointer_cast<PackageDepSpec>(p->clone()))));
+ std::make_shared<WrappedSpec<PackageDepSpec>>(std::static_pointer_cast<PackageDepSpec>(p->clone()))));
return Data_Wrap_Struct(c_package_dep_spec, 0, &Common<std::shared_ptr<const WrappedSpecBase> >::free, v_ptr);
}
diff --git a/ruby/dep_tag.cc b/ruby/dep_tag.cc
index d662e69..e0d9716 100644
--- a/ruby/dep_tag.cc
+++ b/ruby/dep_tag.cc
@@ -85,7 +85,7 @@ namespace
try
{
ptr = new std::shared_ptr<const DepTag>(
- new DependencyDepTag(value_to_package_id(argv[0]),
+ std::make_shared<DependencyDepTag>(value_to_package_id(argv[0]),
*value_to_package_dep_spec(argv[1])));
VALUE tdata(Data_Wrap_Struct(self, 0, &Common<std::shared_ptr<const DepTag> >::free, ptr));
rb_obj_call_init(tdata, argc, argv);
@@ -135,7 +135,7 @@ namespace
std::shared_ptr<const DepTag> * ptr(0);
try
{
- ptr = new std::shared_ptr<const DepTag>(new GLSADepTag(StringValuePtr(argv[0]), StringValuePtr(argv[1]),
+ ptr = new std::shared_ptr<const DepTag>(std::make_shared<GLSADepTag>(StringValuePtr(argv[0]), StringValuePtr(argv[1]),
FSEntry(StringValuePtr(argv[2]))));
VALUE tdata(Data_Wrap_Struct(self, 0, &Common<std::shared_ptr<const DepTag> >::free, ptr));
rb_obj_call_init(tdata, argc, argv);
@@ -157,7 +157,7 @@ namespace
std::shared_ptr<const DepTag> * ptr(0);
try
{
- ptr = new std::shared_ptr<const DepTag>(new GeneralSetDepTag(SetName(StringValuePtr(argv[0])), StringValuePtr(argv[1])));
+ ptr = new std::shared_ptr<const DepTag>(std::make_shared<GeneralSetDepTag>(SetName(StringValuePtr(argv[0])), StringValuePtr(argv[1])));
VALUE tdata(Data_Wrap_Struct(self, 0, &Common<std::shared_ptr<const DepTag> >::free, ptr));
rb_obj_call_init(tdata, argc, argv);
return tdata;
@@ -175,7 +175,7 @@ namespace
std::shared_ptr<const DepTag> * ptr(0);
try
{
- ptr = new std::shared_ptr<const DepTag>(new TargetDepTag);
+ ptr = new std::shared_ptr<const DepTag>(std::make_shared<TargetDepTag>());
VALUE tdata(Data_Wrap_Struct(self, 0, &Common<std::shared_ptr<const DepTag> >::free, ptr));
rb_obj_call_init(tdata, 0, 0);
return tdata;
diff --git a/ruby/environment.cc b/ruby/environment.cc
index c519d95..75c92ee 100644
--- a/ruby/environment.cc
+++ b/ruby/environment.cc
@@ -143,7 +143,7 @@ namespace
{
try
{
- std::shared_ptr<KeywordNameSet> knc (new KeywordNameSet);
+ std::shared_ptr<KeywordNameSet> knc (std::make_shared<KeywordNameSet>());
long len = NUM2LONG(rb_funcall(keywords,rb_intern("length"),0));
for (long i = 0; i < len; i++)
{
@@ -276,7 +276,7 @@ namespace
else if (0 != argc)
rb_raise(rb_eArgError, "PaludisEnvironment.new expects one or zero arguments, but got %d", argc);
- std::shared_ptr<Environment> * e = new std::shared_ptr<Environment>(new PaludisEnvironment(config_suffix));
+ std::shared_ptr<Environment> * e = new std::shared_ptr<Environment>(std::make_shared<PaludisEnvironment>(config_suffix));
VALUE tdata(Data_Wrap_Struct(self, 0, &Common<std::shared_ptr<Environment> >::free, e));
rb_obj_call_init(tdata, argc, argv);
return tdata;
@@ -298,7 +298,7 @@ namespace
{
try
{
- std::shared_ptr<Environment> * e = new std::shared_ptr<Environment>(new TestEnvironment);
+ std::shared_ptr<Environment> * e = new std::shared_ptr<Environment>(std::make_shared<TestEnvironment>());
VALUE tdata(Data_Wrap_Struct(self, 0, &Common<std::shared_ptr<Environment> >::free, e));
rb_obj_call_init(tdata, 0, &self);
return tdata;
@@ -343,7 +343,7 @@ namespace
try
{
std::string write_cache, master_repository_name;
- std::shared_ptr<FSEntrySequence> extra_repository_dirs(new FSEntrySequence);
+ std::shared_ptr<FSEntrySequence> extra_repository_dirs(std::make_shared<FSEntrySequence>());
if (1 == argc)
{
write_cache = "/var/empty/";
diff --git a/ruby/repository.cc b/ruby/repository.cc
index ff5d090..ef58486 100644
--- a/ruby/repository.cc
+++ b/ruby/repository.cc
@@ -497,7 +497,7 @@ namespace
if (2 != argc)
rb_raise(rb_eArgError, "FakeRepository.new expects two arguments, but got %d", argc);
- std::shared_ptr<Repository> * r = new std::shared_ptr<Repository>(new FakeRepository(
+ std::shared_ptr<Repository> * r = new std::shared_ptr<Repository>(std::make_shared<FakeRepository>(
make_named_values<FakeRepositoryParams>(
n::environment() = value_to_environment(argv[0]).get(),
n::name() = RepositoryName(StringValuePtr(argv[1])))));
diff --git a/src/clients/accerso/accerso.cc b/src/clients/accerso/accerso.cc
index 69d4894..32587a9 100644
--- a/src/clients/accerso/accerso.cc
+++ b/src/clients/accerso/accerso.cc
@@ -106,13 +106,13 @@ main(int argc, char *argv[])
}
else
{
- std::shared_ptr<FSEntrySequence> extra_repository_dirs(new FSEntrySequence);
+ std::shared_ptr<FSEntrySequence> extra_repository_dirs(std::make_shared<FSEntrySequence>());
for (args::StringSequenceArg::ConstIterator d(CommandLine::get_instance()->a_extra_repository_dir.begin_args()),
d_end(CommandLine::get_instance()->a_extra_repository_dir.end_args()) ;
d != d_end ; ++d)
extra_repository_dirs->push_back(*d);
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("distdir", CommandLine::get_instance()->a_download_directory.argument());
NoConfigEnvironment env(make_named_values<no_config_environment::Params>(
n::accept_unstable() = true,
diff --git a/src/clients/adjutrix/adjutrix.cc b/src/clients/adjutrix/adjutrix.cc
index 4bab55f..05c1b5d 100644
--- a/src/clients/adjutrix/adjutrix.cc
+++ b/src/clients/adjutrix/adjutrix.cc
@@ -130,7 +130,7 @@ main(int argc, char *argv[])
if (! CommandLine::get_instance()->a_write_cache_dir.specified())
CommandLine::get_instance()->a_write_cache_dir.set_argument("/var/empty");
- std::shared_ptr<FSEntrySequence> extra_repository_dirs(new FSEntrySequence);
+ std::shared_ptr<FSEntrySequence> extra_repository_dirs(std::make_shared<FSEntrySequence>());
for (args::StringSequenceArg::ConstIterator d(CommandLine::get_instance()->a_extra_repository_dir.begin_args()),
d_end(CommandLine::get_instance()->a_extra_repository_dir.end_args()) ;
d != d_end ; ++d)
diff --git a/src/clients/adjutrix/display_default_system_resolution.cc b/src/clients/adjutrix/display_default_system_resolution.cc
index d0031a4..7d61991 100644
--- a/src/clients/adjutrix/display_default_system_resolution.cc
+++ b/src/clients/adjutrix/display_default_system_resolution.cc
@@ -100,7 +100,7 @@ int do_display_default_system_resolution(NoConfigEnvironment & env)
if (env.default_destinations()->empty())
{
- std::shared_ptr<Repository> fake_destination(new FakeInstalledRepository(
+ std::shared_ptr<Repository> fake_destination(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("fake_destination"),
diff --git a/src/clients/adjutrix/find_reverse_deps.cc b/src/clients/adjutrix/find_reverse_deps.cc
index bd267fd..c898535 100644
--- a/src/clients/adjutrix/find_reverse_deps.cc
+++ b/src/clients/adjutrix/find_reverse_deps.cc
@@ -162,7 +162,7 @@ namespace
{
std::shared_ptr<const PackageIDSequence> dep_entries((*_env)[selection::AllVersionsSorted(
generator::Matches(*node.spec(), MatchPackageOptions() + mpo_ignore_additional_requirements))]);
- std::shared_ptr<PackageIDSequence> matches(new PackageIDSequence);
+ std::shared_ptr<PackageIDSequence> matches(std::make_shared<PackageIDSequence>());
bool header_written = false;
diff --git a/src/clients/adjutrix/find_stable_candidates.cc b/src/clients/adjutrix/find_stable_candidates.cc
index 85d52ce..82e958f 100644
--- a/src/clients/adjutrix/find_stable_candidates.cc
+++ b/src/clients/adjutrix/find_stable_candidates.cc
@@ -143,7 +143,7 @@ namespace
SlotsToVersions slots_to_versions;
std::shared_ptr<const PackageIDSequence> versions(repo.package_ids(package));
- std::shared_ptr<PackageIDSet> versions_sorted(new PackageIDSet);
+ std::shared_ptr<PackageIDSet> versions_sorted(std::make_shared<PackageIDSet>());
std::copy(versions->begin(), versions->end(), versions_sorted->inserter());
for (PackageIDSet::ConstIterator v(versions_sorted->begin()), v_end(versions_sorted->end()) ;
v != v_end ; ++v)
diff --git a/src/clients/adjutrix/what_needs_keywording.cc b/src/clients/adjutrix/what_needs_keywording.cc
index c387745..8ba1777 100644
--- a/src/clients/adjutrix/what_needs_keywording.cc
+++ b/src/clients/adjutrix/what_needs_keywording.cc
@@ -60,7 +60,7 @@ int do_what_needs_keywording(NoConfigEnvironment & env)
if (env.default_destinations()->empty())
{
- std::shared_ptr<Repository> fake_destination(new FakeInstalledRepository(
+ std::shared_ptr<Repository> fake_destination(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("fake_destination"),
diff --git a/src/clients/appareo/appareo.cc b/src/clients/appareo/appareo.cc
index e3b6b0a..9113c5a 100644
--- a/src/clients/appareo/appareo.cc
+++ b/src/clients/appareo/appareo.cc
@@ -99,7 +99,7 @@ namespace
cout << "Processing " << colour(cl_package_name, stringify(**i)) << "..." << endl;
++total;
- const std::shared_ptr<Sequence<FetchActionFailure> > failures(new Sequence<FetchActionFailure>);
+ const std::shared_ptr<Sequence<FetchActionFailure> > failures(std::make_shared<Sequence<FetchActionFailure>>());
try
{
if ((*i)->supports_action(SupportsActionTest<FetchAction>()))
@@ -223,13 +223,13 @@ main(int argc, char *argv[])
}
else
{
- std::shared_ptr<FSEntrySequence> extra_repository_dirs(new FSEntrySequence);
+ std::shared_ptr<FSEntrySequence> extra_repository_dirs(std::make_shared<FSEntrySequence>());
for (args::StringSequenceArg::ConstIterator d(CommandLine::get_instance()->a_extra_repository_dir.begin_args()),
d_end(CommandLine::get_instance()->a_extra_repository_dir.end_args()) ;
d != d_end ; ++d)
extra_repository_dirs->push_back(*d);
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("distdir", CommandLine::get_instance()->a_download_directory.argument());
NoConfigEnvironment env(make_named_values<no_config_environment::Params>(
diff --git a/src/clients/cave/cave.cc b/src/clients/cave/cave.cc
index 110d026..13ff28c 100644
--- a/src/clients/cave/cave.cc
+++ b/src/clients/cave/cave.cc
@@ -95,7 +95,7 @@ int main(int argc, char * argv[])
+ " --" + cmdline.a_log_level.long_name() + " " + cmdline.a_log_level.argument()
+ " --" + cmdline.a_environment.long_name() + " " + (cmdline.a_environment.argument().empty() ? ":" : cmdline.a_environment.argument()));
- std::shared_ptr<Sequence<std::string> > seq(new Sequence<std::string>);
+ std::shared_ptr<Sequence<std::string> > seq(std::make_shared<Sequence<std::string>>());
std::copy(next(cmdline.begin_parameters()), cmdline.end_parameters(), seq->back_inserter());
return cave::CommandFactory::get_instance()->create(*cmdline.begin_parameters())->run(env, seq);
diff --git a/src/clients/cave/cmd_execute_resolution.cc b/src/clients/cave/cmd_execute_resolution.cc
index 641fd9d..06f85f3 100644
--- a/src/clients/cave/cmd_execute_resolution.cc
+++ b/src/clients/cave/cmd_execute_resolution.cc
@@ -153,7 +153,7 @@ namespace
cout << std::string(stringify(prev_x).length() + stringify(y).length() + 4, '\010');
cout << x << " of " << y << std::flush;
- std::shared_ptr<Sequence<std::string> > args(new Sequence<std::string>);
+ std::shared_ptr<Sequence<std::string> > args(std::make_shared<Sequence<std::string>>());
args->push_back("pretend");
args->push_back("--hooks");
@@ -746,7 +746,7 @@ namespace
case x1_main:
{
- const std::shared_ptr<JobActiveState> active_state(new JobActiveState);
+ const std::shared_ptr<JobActiveState> active_state(std::make_shared<JobActiveState>());
{
Lock lock(job_mutex);
install_item.set_state(active_state);
@@ -784,7 +784,7 @@ namespace
int visit(UninstallJob & uninstall_item)
{
- const std::shared_ptr<PackageIDSequence> ids(new PackageIDSequence);
+ const std::shared_ptr<PackageIDSequence> ids(std::make_shared<PackageIDSequence>());
for (Sequence<PackageDepSpec>::ConstIterator i(uninstall_item.ids_to_remove_specs()->begin()),
i_end(uninstall_item.ids_to_remove_specs()->end()) ;
i != i_end ; ++i)
@@ -805,7 +805,7 @@ namespace
case x1_main:
{
- const std::shared_ptr<JobActiveState> active_state(new JobActiveState);
+ const std::shared_ptr<JobActiveState> active_state(std::make_shared<JobActiveState>());
{
Lock lock(job_mutex);
uninstall_item.set_state(active_state);
@@ -850,7 +850,7 @@ namespace
case x1_main:
{
- const std::shared_ptr<JobActiveState> active_state(new JobActiveState);
+ const std::shared_ptr<JobActiveState> active_state(std::make_shared<JobActiveState>());
{
Lock lock(job_mutex);
fetch_item.set_state(active_state);
@@ -1564,10 +1564,10 @@ namespace
}
else
{
- std::shared_ptr<Sequence<std::string> > targets(new Sequence<std::string>);
+ std::shared_ptr<Sequence<std::string> > targets(std::make_shared<Sequence<std::string>>());
std::copy(cmdline.begin_parameters(), cmdline.end_parameters(), targets->back_inserter());
- std::shared_ptr<Sequence<std::string> > world_specs(new Sequence<std::string>);
+ std::shared_ptr<Sequence<std::string> > world_specs(std::make_shared<Sequence<std::string>>());
std::copy(cmdline.a_world_specs.begin_args(), cmdline.a_world_specs.end_args(), world_specs->back_inserter());
ResumeData resume_data(make_named_values<ResumeData>(
diff --git a/src/clients/cave/cmd_find_candidates.cc b/src/clients/cave/cmd_find_candidates.cc
index 8f9af29..3550872 100644
--- a/src/clients/cave/cmd_find_candidates.cc
+++ b/src/clients/cave/cmd_find_candidates.cc
@@ -123,7 +123,7 @@ FindCandidatesCommand::run(
if (cmdline.begin_parameters() == cmdline.end_parameters())
throw args::DoHelp("find-candidates requires at least one parameter");
- const std::shared_ptr<Set<std::string> > patterns(new Set<std::string>);
+ const std::shared_ptr<Set<std::string> > patterns(std::make_shared<Set<std::string>>());
std::copy(cmdline.begin_parameters(), cmdline.end_parameters(), patterns->inserter());
run_hosted(env, cmdline.search_options, cmdline.match_options, patterns, &print_spec, &no_step);
diff --git a/src/clients/cave/cmd_fix_linkage.cc b/src/clients/cave/cmd_fix_linkage.cc
index bcd33c5..df8a474 100644
--- a/src/clients/cave/cmd_fix_linkage.cc
+++ b/src/clients/cave/cmd_fix_linkage.cc
@@ -184,7 +184,7 @@ FixLinkageCommand::run(
return EXIT_SUCCESS;
}
- std::shared_ptr<Sequence<std::pair<std::string, std::string> > > targets(new Sequence<std::pair<std::string, std::string> >);
+ std::shared_ptr<Sequence<std::pair<std::string, std::string> > > targets(std::make_shared<Sequence<std::pair<std::string, std::string> >>());
for (BrokenLinkageFinder::BrokenPackageConstIterator pkg_it(finder->begin_broken_packages()),
pkg_it_end(finder->end_broken_packages()); pkg_it_end != pkg_it; ++pkg_it)
diff --git a/src/clients/cave/cmd_import.cc b/src/clients/cave/cmd_import.cc
index e8df8ef..9cee9ae 100644
--- a/src/clients/cave/cmd_import.cc
+++ b/src/clients/cave/cmd_import.cc
@@ -238,7 +238,7 @@ ImportCommand::run(
cmdline.a_run_dependency.begin_args(),
cmdline.a_run_dependency.end_args(), ", ");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("location", stringify(
cmdline.a_location.specified() ?
FSEntry(cmdline.a_location.argument()) :
@@ -271,10 +271,10 @@ ImportCommand::run(
if (cmdline.a_execute.specified())
resolve_cmdline.resolution_options.a_execute.set_specified(true);
- std::shared_ptr<Sequence<std::pair<std::string, std::string> > > targets(new Sequence<std::pair<std::string, std::string> >);
+ std::shared_ptr<Sequence<std::pair<std::string, std::string> > > targets(std::make_shared<Sequence<std::pair<std::string, std::string> >>());
targets->push_back(std::make_pair(stringify((*ids->begin())->name()), ""));
- std::shared_ptr<Sequence<std::string> > world_specs(new Sequence<std::string>);
+ std::shared_ptr<Sequence<std::string> > world_specs(std::make_shared<Sequence<std::string>>());
world_specs->push_back(stringify((*ids->begin())->name()));
return resolve_common(env,
diff --git a/src/clients/cave/cmd_info.cc b/src/clients/cave/cmd_info.cc
index cabbca2..3de4ad5 100644
--- a/src/clients/cave/cmd_info.cc
+++ b/src/clients/cave/cmd_info.cc
@@ -343,7 +343,7 @@ namespace
cout << format_general_s(f::info_id_heading(), stringify(*id));
- std::shared_ptr<Sequence<std::string> > args(new Sequence<std::string>);
+ std::shared_ptr<Sequence<std::string> > args(std::make_shared<Sequence<std::string>>());
args->push_back("info");
args->push_back("--if-supported");
args->push_back("--hooks");
diff --git a/src/clients/cave/cmd_match.cc b/src/clients/cave/cmd_match.cc
index 0153374..115d8e9 100644
--- a/src/clients/cave/cmd_match.cc
+++ b/src/clients/cave/cmd_match.cc
@@ -362,7 +362,7 @@ MatchCommand::run(
PackageDepSpec spec(parse_user_package_dep_spec(*cmdline.begin_parameters(), env.get(), UserPackageDepSpecOptions()));
- const std::shared_ptr<Set<std::string> > patterns(new Set<std::string>);
+ const std::shared_ptr<Set<std::string> > patterns(std::make_shared<Set<std::string>>());
std::copy(next(cmdline.begin_parameters()), cmdline.end_parameters(), patterns->inserter());
return run_hosted(env, cmdline.match_options, patterns, spec) ? EXIT_SUCCESS : EXIT_FAILURE;
diff --git a/src/clients/cave/cmd_perform.cc b/src/clients/cave/cmd_perform.cc
index b93611b..f5ea726 100644
--- a/src/clients/cave/cmd_perform.cc
+++ b/src/clients/cave/cmd_perform.cc
@@ -422,7 +422,7 @@ PerformCommand::run(
OutputManagerFromIPCOrEnvironment output_manager_holder(env.get(), cmdline, id);
WantInstallPhase want_phase(cmdline, output_manager_holder);
- std::shared_ptr<Sequence<FetchActionFailure> > failures(new Sequence<FetchActionFailure>);
+ std::shared_ptr<Sequence<FetchActionFailure> > failures(std::make_shared<Sequence<FetchActionFailure>>());
FetchActionOptions options(make_named_values<FetchActionOptions>(
n::errors() = failures,
n::exclude_unmirrorable() = cmdline.a_exclude_unmirrorable.specified(),
@@ -505,7 +505,7 @@ PerformCommand::run(
const std::shared_ptr<Repository> destination(env->package_database()->fetch_repository(
RepositoryName(cmdline.a_destination.argument())));
- const std::shared_ptr<PackageIDSequence> replacing(new PackageIDSequence);
+ const std::shared_ptr<PackageIDSequence> replacing(std::make_shared<PackageIDSequence>());
for (args::StringSetArg::ConstIterator p(cmdline.a_replacing.begin_args()),
p_end(cmdline.a_replacing.end_args()) ;
p != p_end ; ++p)
diff --git a/src/clients/cave/cmd_print_id_masks.cc b/src/clients/cave/cmd_print_id_masks.cc
index 8123f21..5ccd1b4 100644
--- a/src/clients/cave/cmd_print_id_masks.cc
+++ b/src/clients/cave/cmd_print_id_masks.cc
@@ -133,7 +133,7 @@ namespace
const PrintIDMasksCommandLine & cmdline
)
{
- std::shared_ptr<Map<char, std::string> > m(new Map<char, std::string>);
+ std::shared_ptr<Map<char, std::string> > m(std::make_shared<Map<char, std::string>>());
m->insert('k', std::string(1, mask->key()));
m->insert('d', mask->description());
diff --git a/src/clients/cave/cmd_print_ids.cc b/src/clients/cave/cmd_print_ids.cc
index 45be918..3b3b764 100644
--- a/src/clients/cave/cmd_print_ids.cc
+++ b/src/clients/cave/cmd_print_ids.cc
@@ -162,7 +162,7 @@ namespace
const Environment * const,
const std::shared_ptr<const PackageIDSet> & c) const
{
- std::shared_ptr<PackageIDSet> result(new PackageIDSet);
+ std::shared_ptr<PackageIDSet> result(std::make_shared<PackageIDSet>());
for (PackageIDSet::ConstIterator i(c->begin()), i_end(c->end()) ;
i != i_end ; ++i)
@@ -248,7 +248,7 @@ namespace
const PrintIDsCommandLine & c,
const std::shared_ptr<const PackageID> & i)
{
- std::shared_ptr<Map<char, std::string> > m(new Map<char, std::string>);
+ std::shared_ptr<Map<char, std::string> > m(std::make_shared<Map<char, std::string>>());
m->insert('c', stringify(i->name().category()));
m->insert('p', stringify(i->name().package()));
m->insert('v', stringify(i->version()));
diff --git a/src/clients/cave/cmd_resolve.cc b/src/clients/cave/cmd_resolve.cc
index 1b7a82b..b3dab40 100644
--- a/src/clients/cave/cmd_resolve.cc
+++ b/src/clients/cave/cmd_resolve.cc
@@ -96,7 +96,7 @@ ResolveCommand::run(
cmdline.resolution_options.apply_shortcuts();
cmdline.resolution_options.verify(env);
- std::shared_ptr<Sequence<std::pair<std::string, std::string> > > targets(new Sequence<std::pair<std::string, std::string> >);
+ std::shared_ptr<Sequence<std::pair<std::string, std::string> > > targets(std::make_shared<Sequence<std::pair<std::string, std::string> >>());
for (ResolveCommandLine::ParametersConstIterator p(cmdline.begin_parameters()), p_end(cmdline.end_parameters()) ;
p != p_end ; ++p)
targets->push_back(std::make_pair(*p, ""));
diff --git a/src/clients/cave/cmd_resolve_cmdline.cc b/src/clients/cave/cmd_resolve_cmdline.cc
index 7d7f6b2..4d9734a 100644
--- a/src/clients/cave/cmd_resolve_cmdline.cc
+++ b/src/clients/cave/cmd_resolve_cmdline.cc
@@ -362,7 +362,7 @@ ResolveCommandLineImportOptions::apply(const std::shared_ptr<Environment> & env)
if (! a_unpackaged_repository_params.specified())
return;
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
for (args::StringSetArg::ConstIterator a(a_unpackaged_repository_params.begin_args()),
a_end(a_unpackaged_repository_params.end_args()) ;
a != a_end ; ++a)
diff --git a/src/clients/cave/cmd_resume.cc b/src/clients/cave/cmd_resume.cc
index 44b8ece..e963e51 100644
--- a/src/clients/cave/cmd_resume.cc
+++ b/src/clients/cave/cmd_resume.cc
@@ -110,7 +110,7 @@ namespace
{
Context context("When performing chosen resolution:");
- std::shared_ptr<Sequence<std::string> > args(new Sequence<std::string>);
+ std::shared_ptr<Sequence<std::string> > args(std::make_shared<Sequence<std::string>>());
for (args::ArgsSection::GroupsConstIterator g(program_options.begin()), g_end(program_options.end()) ;
g != g_end ; ++g)
diff --git a/src/clients/cave/cmd_search.cc b/src/clients/cave/cmd_search.cc
index 6d6e08e..ee7323d 100644
--- a/src/clients/cave/cmd_search.cc
+++ b/src/clients/cave/cmd_search.cc
@@ -270,20 +270,20 @@ SearchCommand::run(
if (cmdline.begin_parameters() == cmdline.end_parameters())
throw args::DoHelp("search requires at least one parameter");
- const std::shared_ptr<Sequence<std::string> > show_args(new Sequence<std::string>);
+ const std::shared_ptr<Sequence<std::string> > show_args(std::make_shared<Sequence<std::string>>());
{
DisplayCallback display_callback;
ScopedNotifierCallback display_callback_holder(env.get(),
NotifierCallbackFunction(std::cref(display_callback)));
- const std::shared_ptr<Set<std::string> > patterns(new Set<std::string>);
+ const std::shared_ptr<Set<std::string> > patterns(std::make_shared<Set<std::string>>());
std::copy(cmdline.begin_parameters(), cmdline.end_parameters(), patterns->inserter());
FindCandidatesCommand find_candidates_command;
MatchCommand match_command;
- std::shared_ptr<Set<QualifiedPackageName> > matches(new Set<QualifiedPackageName>);
+ std::shared_ptr<Set<QualifiedPackageName> > matches(std::make_shared<Set<QualifiedPackageName>>());
find_candidates_command.run_hosted(env, cmdline.search_options, cmdline.match_options,
patterns, std::bind(
&found_candidate, env, std::ref(match_command), std::cref(cmdline.match_options),
diff --git a/src/clients/cave/cmd_show.cc b/src/clients/cave/cmd_show.cc
index 09a4563..59680da 100644
--- a/src/clients/cave/cmd_show.cc
+++ b/src/clients/cave/cmd_show.cc
@@ -904,7 +904,7 @@ namespace
throw NothingMatching(s);
std::shared_ptr<const PackageID> best_installable, best_weak_masked_installable, best_masked_installable, best_not_installed;
- std::shared_ptr<PackageIDSequence> all_installed(new PackageIDSequence);
+ std::shared_ptr<PackageIDSequence> all_installed(std::make_shared<PackageIDSequence>());
std::set<RepositoryName> repos;
for (PackageIDSequence::ConstIterator i(ids->begin()), i_end(ids->end()) ;
i != i_end ; ++i)
diff --git a/src/clients/cave/cmd_sync.cc b/src/clients/cave/cmd_sync.cc
index e50ee48..2653a67 100644
--- a/src/clients/cave/cmd_sync.cc
+++ b/src/clients/cave/cmd_sync.cc
@@ -303,7 +303,7 @@ namespace
for (Repos::const_iterator r(repos.begin()), r_end(repos.end()) ;
r != r_end ; ++r)
{
- const std::shared_ptr<SyncExecutive> x(new SyncExecutive(env, cmdline, &executor, *r));
+ const std::shared_ptr<SyncExecutive> x(std::make_shared<SyncExecutive>(env, cmdline, &executor, *r));
executor.add(x);
executives.push_back(x);
}
diff --git a/src/clients/cave/cmd_uninstall.cc b/src/clients/cave/cmd_uninstall.cc
index 9075509..c32fbe4 100644
--- a/src/clients/cave/cmd_uninstall.cc
+++ b/src/clients/cave/cmd_uninstall.cc
@@ -128,11 +128,11 @@ UninstallCommand::run(
cmdline.resolution_options->apply_shortcuts();
cmdline.resolution_options->verify(env);
- std::shared_ptr<Sequence<std::pair<std::string, std::string> > > targets(new Sequence<std::pair<std::string, std::string> >);
- std::shared_ptr<Sequence<std::string> > targets_cleaned_up(new Sequence<std::string>);
+ std::shared_ptr<Sequence<std::pair<std::string, std::string> > > targets(std::make_shared<Sequence<std::pair<std::string, std::string> >>());
+ std::shared_ptr<Sequence<std::string> > targets_cleaned_up(std::make_shared<Sequence<std::string>>());
std::set<QualifiedPackageName> qpns_being_changed;
- std::shared_ptr<PackageIDSequence> ids_going_away(new PackageIDSequence);
+ std::shared_ptr<PackageIDSequence> ids_going_away(std::make_shared<PackageIDSequence>());
for (UninstallCommandLine::ParametersConstIterator p(cmdline.begin_parameters()), p_end(cmdline.end_parameters()) ;
p != p_end ; ++p)
diff --git a/src/clients/cave/format_general.cc b/src/clients/cave/format_general.cc
index faf977a..0722bfa 100644
--- a/src/clients/cave/format_general.cc
+++ b/src/clients/cave/format_general.cc
@@ -28,7 +28,7 @@ using namespace cave;
std::string
paludis::cave::format_general_s(const std::string & f, const std::string & s)
{
- std::shared_ptr<Map<char, std::string> > m(new Map<char, std::string>);
+ std::shared_ptr<Map<char, std::string> > m(std::make_shared<Map<char, std::string>>());
m->insert('s', s);
return format_string(f, m);
}
@@ -36,7 +36,7 @@ paludis::cave::format_general_s(const std::string & f, const std::string & s)
std::string
paludis::cave::format_general_si(const std::string & f, const std::string & s, const int i)
{
- std::shared_ptr<Map<char, std::string> > m(new Map<char, std::string>);
+ std::shared_ptr<Map<char, std::string> > m(std::make_shared<Map<char, std::string>>());
m->insert('s', s);
m->insert('i', std::string(i, ' '));
return format_string(f, m);
@@ -45,7 +45,7 @@ paludis::cave::format_general_si(const std::string & f, const std::string & s, c
std::string
paludis::cave::format_general_kv(const std::string & f, const std::string & k, const std::string & v)
{
- std::shared_ptr<Map<char, std::string> > m(new Map<char, std::string>);
+ std::shared_ptr<Map<char, std::string> > m(std::make_shared<Map<char, std::string>>());
m->insert('k', k);
m->insert('v', v);
return format_string(f, m);
@@ -54,7 +54,7 @@ paludis::cave::format_general_kv(const std::string & f, const std::string & k, c
std::string
paludis::cave::format_general_sr(const std::string & f, const std::string & s, const std::string & r)
{
- std::shared_ptr<Map<char, std::string> > m(new Map<char, std::string>);
+ std::shared_ptr<Map<char, std::string> > m(std::make_shared<Map<char, std::string>>());
m->insert('s', s);
m->insert('r', r);
return format_string(f, m);
@@ -63,7 +63,7 @@ paludis::cave::format_general_sr(const std::string & f, const std::string & s, c
std::string
paludis::cave::format_general_spad(const std::string & f, const std::string & s, const int p, const int a, const int d)
{
- std::shared_ptr<Map<char, std::string> > m(new Map<char, std::string>);
+ std::shared_ptr<Map<char, std::string> > m(std::make_shared<Map<char, std::string>>());
m->insert('s', s);
m->insert('p', stringify(p));
m->insert('a', stringify(a));
@@ -75,7 +75,7 @@ std::string
paludis::cave::format_general_rhvib(const std::string & f, const std::string & r, const std::string & h,
const std::string & v, const int i, const bool b)
{
- std::shared_ptr<Map<char, std::string> > m(new Map<char, std::string>);
+ std::shared_ptr<Map<char, std::string> > m(std::make_shared<Map<char, std::string>>());
m->insert('r', r);
m->insert('h', h);
m->insert('v', v);
@@ -87,7 +87,7 @@ paludis::cave::format_general_rhvib(const std::string & f, const std::string & r
std::string
paludis::cave::format_general_i(const std::string & f, const int i)
{
- std::shared_ptr<Map<char, std::string> > m(new Map<char, std::string>);
+ std::shared_ptr<Map<char, std::string> > m(std::make_shared<Map<char, std::string>>());
m->insert('i', std::string(i, ' '));
return format_string(f, m);
}
@@ -95,7 +95,7 @@ paludis::cave::format_general_i(const std::string & f, const int i)
std::string
paludis::cave::format_general_his(const std::string & f, const std::string & h, const int i, const std::string & s)
{
- std::shared_ptr<Map<char, std::string> > m(new Map<char, std::string>);
+ std::shared_ptr<Map<char, std::string> > m(std::make_shared<Map<char, std::string>>());
m->insert('h', h);
m->insert('i', std::string(i, ' '));
m->insert('s', s);
diff --git a/src/clients/cave/format_plain_contents_entry.cc b/src/clients/cave/format_plain_contents_entry.cc
index c9ba47a..338986a 100644
--- a/src/clients/cave/format_plain_contents_entry.cc
+++ b/src/clients/cave/format_plain_contents_entry.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
@@ -74,7 +74,7 @@ paludis::cave::format_plain_contents_entry(
ValueGetter v;
c->accept(v);
- std::shared_ptr<Map<char, std::string> > m(new Map<char, std::string>);
+ std::shared_ptr<Map<char, std::string> > m(std::make_shared<Map<char, std::string>>());
m->insert('n', stringify(c->location_key()->value()));
m->insert('d', stringify(c->location_key()->value().dirname()));
m->insert('b', stringify(c->location_key()->value().basename()));
diff --git a/src/clients/cave/format_plain_metadata_key.cc b/src/clients/cave/format_plain_metadata_key.cc
index e5ecbd4..3b9a45f 100644
--- a/src/clients/cave/format_plain_metadata_key.cc
+++ b/src/clients/cave/format_plain_metadata_key.cc
@@ -172,7 +172,7 @@ paludis::cave::format_plain_metadata_key(
const std::string & i,
const std::string & f)
{
- std::shared_ptr<Map<char, std::string> > m(new Map<char, std::string>);
+ std::shared_ptr<Map<char, std::string> > m(std::make_shared<Map<char, std::string>>());
m->insert('r', k->raw_name());
m->insert('h', k->human_name());
m->insert('v', format_plain_metadata_key_value(k));
diff --git a/src/clients/cave/resolve_common.cc b/src/clients/cave/resolve_common.cc
index cb1fdc1..e704ab4 100644
--- a/src/clients/cave/resolve_common.cc
+++ b/src/clients/cave/resolve_common.cc
@@ -260,7 +260,7 @@ namespace
if (targets->empty())
throw args::DoHelp("Must specify at least one target");
- const std::shared_ptr<Sequence<std::string> > result(new Sequence<std::string>);
+ const std::shared_ptr<Sequence<std::string> > result(std::make_shared<Sequence<std::string>>());
bool seen_sets(false), seen_packages(false);
for (Sequence<std::pair<std::string, std::string> >::ConstIterator p(targets->begin()), p_end(targets->end()) ;
p != p_end ; ++p)
@@ -521,7 +521,7 @@ namespace
const PackageDepSpecList & without,
const Resolvent & resolvent)
{
- const std::shared_ptr<Constraints> result(new Constraints);
+ const std::shared_ptr<Constraints> result(std::make_shared<Constraints>());
int n(reinstall_scm_days(resolution_options));
if ((-1 != n) && installed_is_scm_older_than(env, resolution_options, all_binary_repos_generator, resolvent, n)
@@ -612,7 +612,7 @@ namespace
const std::shared_ptr<const Reason> & reason,
const DestinationTypes & extra_dts)
{
- std::shared_ptr<PackageIDSequence> result_ids(new PackageIDSequence);
+ std::shared_ptr<PackageIDSequence> result_ids(std::make_shared<PackageIDSequence>());
std::shared_ptr<const PackageID> best;
const std::shared_ptr<const PackageIDSequence> ids((*env)[selection::BestVersionOnly(
@@ -660,7 +660,7 @@ namespace
throw args::DoHelp("Don't understand argument '" + arg.argument() + "' to '--"
+ arg.long_name() + "'");
- std::shared_ptr<Resolvents> result(new Resolvents);
+ std::shared_ptr<Resolvents> result(std::make_shared<Resolvents>());
for (PackageIDSequence::ConstIterator i(result_ids->begin()), i_end(result_ids->end()) ;
i != i_end ; ++i)
{
@@ -1192,7 +1192,7 @@ namespace
const std::shared_ptr<const PackageID> & id,
const std::shared_ptr<const ChangeByResolventSequence> & ids)
{
- const std::shared_ptr<ConstraintSequence> result(new ConstraintSequence);
+ const std::shared_ptr<ConstraintSequence> result(std::make_shared<ConstraintSequence>());
std::shared_ptr<PackageDepSpec> spec;
if (match_any(env, list, id))
@@ -1210,7 +1210,7 @@ namespace
for (ChangeByResolventSequence::ConstIterator i(ids->begin()), i_end(ids->end()) ;
i != i_end ; ++i)
{
- const std::shared_ptr<DependentReason> reason(new DependentReason(*i));
+ const std::shared_ptr<DependentReason> reason(std::make_shared<DependentReason>(*i));
result->push_back(std::make_shared<Constraint>(make_named_values<Constraint>(
n::destination_type() = dt_install_to_slash,
@@ -1232,7 +1232,7 @@ namespace
const std::shared_ptr<const PackageID> & id,
const std::shared_ptr<const ChangeByResolventSequence> & ids)
{
- const std::shared_ptr<ConstraintSequence> result(new ConstraintSequence);
+ const std::shared_ptr<ConstraintSequence> result(std::make_shared<ConstraintSequence>());
PartiallyMadePackageDepSpec partial_spec((PartiallyMadePackageDepSpecOptions()));
partial_spec.package(id->name());
@@ -1241,7 +1241,7 @@ namespace
id->slot_key()->value(), false));
PackageDepSpec spec(partial_spec);
- const std::shared_ptr<WasUsedByReason> reason(new WasUsedByReason(ids));
+ const std::shared_ptr<WasUsedByReason> reason(std::make_shared<WasUsedByReason>(ids));
result->push_back(std::make_shared<Constraint>(make_named_values<Constraint>(
n::destination_type() = dt_install_to_slash,
@@ -1260,13 +1260,13 @@ namespace
const std::shared_ptr<const Resolution> & resolution,
const std::shared_ptr<const Resolution> & other_resolution)
{
- const std::shared_ptr<ConstraintSequence> result(new ConstraintSequence);
+ const std::shared_ptr<ConstraintSequence> result(std::make_shared<ConstraintSequence>());
PartiallyMadePackageDepSpec partial_spec((PartiallyMadePackageDepSpecOptions()));
partial_spec.package(resolution->resolvent().package());
PackageDepSpec spec(partial_spec);
- const std::shared_ptr<ViaBinaryReason> reason(new ViaBinaryReason(other_resolution->resolvent()));
+ const std::shared_ptr<ViaBinaryReason> reason(std::make_shared<ViaBinaryReason>(other_resolution->resolvent()));
result->push_back(std::make_shared<Constraint>(make_named_values<Constraint>(
n::destination_type() = resolution->resolvent().destination_type(),
@@ -1323,7 +1323,7 @@ namespace
std::ref(ser_stream),
std::cref(*resolved)));
- std::shared_ptr<Sequence<std::string> > args(new Sequence<std::string>);
+ std::shared_ptr<Sequence<std::string> > args(std::make_shared<Sequence<std::string>>());
for (args::ArgsSection::GroupsConstIterator g(display_options.begin()), g_end(display_options.end()) ;
g != g_end ; ++g)
@@ -1388,7 +1388,7 @@ namespace
{
Context context("When performing chosen resolution:");
- std::shared_ptr<Sequence<std::string> > args(new Sequence<std::string>);
+ std::shared_ptr<Sequence<std::string> > args(std::make_shared<Sequence<std::string>>());
if (is_set)
args->push_back("--set");
@@ -1778,7 +1778,7 @@ paludis::cave::resolve_common(
i_end(resolution_options.a_preset.end_args()) ;
i != i_end ; ++i)
{
- const std::shared_ptr<const Reason> reason(new PresetReason("preset", make_null_shared_ptr()));
+ const std::shared_ptr<const Reason> reason(std::make_shared<PresetReason>("preset", make_null_shared_ptr()));
PackageDepSpec spec(parse_user_package_dep_spec(*i, env.get(), UserPackageDepSpecOptions()));
DestinationTypes all_dts;
for (EnumIterator<DestinationType> t, t_end(last_dt) ; t != t_end ; ++t)
@@ -1793,7 +1793,7 @@ paludis::cave::resolve_common(
for (Resolvents::ConstIterator r(resolvents->begin()), r_end(resolvents->end()) ;
r != r_end ; ++r)
{
- const std::shared_ptr<Constraint> constraint(new Constraint(make_named_values<Constraint>(
+ const std::shared_ptr<Constraint> constraint(std::make_shared<Constraint>(make_named_values<Constraint>(
n::destination_type() = r->destination_type(),
n::nothing_is_fine_too() = true,
n::reason() = reason,
@@ -1857,7 +1857,7 @@ paludis::cave::resolve_common(
));
ScopedSelectionCache selection_cache(env.get());
- std::shared_ptr<Resolver> resolver(new Resolver(env.get(), resolver_functions));
+ std::shared_ptr<Resolver> resolver(std::make_shared<Resolver>(env.get(), resolver_functions));
bool is_set(false);
std::shared_ptr<const Sequence<std::string> > targets_cleaned_up;
std::list<SuggestRestart> restarts;
diff --git a/src/clients/cave/resume_data.cc b/src/clients/cave/resume_data.cc
index 836c7d2..cbbe630 100644
--- a/src/clients/cave/resume_data.cc
+++ b/src/clients/cave/resume_data.cc
@@ -40,14 +40,14 @@ ResumeData::deserialise(Deserialisation & d)
Deserialisator v(d, "ResumeData@" + stringify(PALUDIS_VERSION));
- std::shared_ptr<Sequence<std::string> > targets(new Sequence<std::string>);
+ std::shared_ptr<Sequence<std::string> > targets(std::make_shared<Sequence<std::string>>());
{
Deserialisator vv(*v.find_remove_member("targets"), "c");
for (int n(1), n_end(vv.member<int>("count") + 1) ; n != n_end ; ++n)
targets->push_back(vv.member<std::string>(stringify(n)));
}
- std::shared_ptr<Sequence<std::string> > world_specs(new Sequence<std::string>);
+ std::shared_ptr<Sequence<std::string> > world_specs(std::make_shared<Sequence<std::string>>());
{
Deserialisator vv(*v.find_remove_member("world_specs"), "c");
for (int n(1), n_end(vv.member<int>("count") + 1) ; n != n_end ; ++n)
diff --git a/src/clients/importare/importare.cc b/src/clients/importare/importare.cc
index 938c312..6cedb3f 100644
--- a/src/clients/importare/importare.cc
+++ b/src/clients/importare/importare.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
@@ -187,7 +187,7 @@ main(int argc, char *argv[])
CommandLine::get_instance()->a_run_dependency.begin_args(),
CommandLine::get_instance()->a_run_dependency.end_args(), ", ");
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("location", stringify(
CommandLine::get_instance()->a_location.specified() ?
FSEntry(CommandLine::get_instance()->a_location.argument()) :
diff --git a/src/clients/importare/install.cc b/src/clients/importare/install.cc
index 4f5ec57..d2360c5 100644
--- a/src/clients/importare/install.cc
+++ b/src/clients/importare/install.cc
@@ -146,7 +146,7 @@ do_install(const std::shared_ptr<Environment> & env, const std::shared_ptr<const
CommandLine::get_instance()->install_args.populate_install_task(env.get(), task);
CommandLine::get_instance()->dl_args.populate_install_task(env.get(), task);
- std::shared_ptr<PackageIDSequence> targets(new PackageIDSequence);
+ std::shared_ptr<PackageIDSequence> targets(std::make_shared<PackageIDSequence>());
targets->push_back(target);
task.set_targets_from_exact_packages(targets);
task.execute();
diff --git a/src/clients/inquisitio/matcher.cc b/src/clients/inquisitio/matcher.cc
index a3e9f22..a85869c 100644
--- a/src/clients/inquisitio/matcher.cc
+++ b/src/clients/inquisitio/matcher.cc
@@ -48,7 +48,7 @@ namespace
static std::shared_ptr<Matcher>
make(const std::string & s)
{
- return std::shared_ptr<Matcher>(new M_(s));
+ return std::shared_ptr<Matcher>(std::make_shared<M_>(s));
}
}
diff --git a/src/clients/instruo/instruo.cc b/src/clients/instruo/instruo.cc
index 638e34a..285120b 100644
--- a/src/clients/instruo/instruo.cc
+++ b/src/clients/instruo/instruo.cc
@@ -320,13 +320,13 @@ main(int argc, char *argv[])
if (! CommandLine::get_instance()->a_output_directory.specified())
CommandLine::get_instance()->a_output_directory.set_argument(stringify(FSEntry::cwd()));
- std::shared_ptr<FSEntrySequence> extra_repository_dirs(new FSEntrySequence);
+ std::shared_ptr<FSEntrySequence> extra_repository_dirs(std::make_shared<FSEntrySequence>());
for (args::StringSequenceArg::ConstIterator d(CommandLine::get_instance()->a_extra_repository_dir.begin_args()),
d_end(CommandLine::get_instance()->a_extra_repository_dir.end_args()) ;
d != d_end ; ++d)
extra_repository_dirs->push_back(*d);
- std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
keys->insert("append_repository_name_to_write_cache", "false");
NoConfigEnvironment env(make_named_values<no_config_environment::Params>(
n::accept_unstable() = true,
diff --git a/src/clients/paludis/applets.cc b/src/clients/paludis/applets.cc
index 24b2ab6..4b623c9 100644
--- a/src/clients/paludis/applets.cc
+++ b/src/clients/paludis/applets.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
*
* 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
@@ -185,7 +185,7 @@ int do_has_version(const std::shared_ptr<Environment> & env)
Context context("When performing has-version action from command line:");
std::string query(*CommandLine::get_instance()->begin_parameters());
- std::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(
+ std::shared_ptr<PackageDepSpec> spec(std::make_shared<PackageDepSpec>(
parse_user_package_dep_spec(query, env.get(), UserPackageDepSpecOptions())));
std::shared_ptr<const PackageIDSequence> entries((*env)[selection::SomeArbitraryVersion(
generator::Matches(*spec, MatchPackageOptions()) | filter::InstalledAtRoot(env->root()))]);
@@ -203,7 +203,7 @@ int do_best_version(const std::shared_ptr<Environment> & env)
Context context("When performing best-version action from command line:");
std::string query(*CommandLine::get_instance()->begin_parameters());
- std::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(
+ std::shared_ptr<PackageDepSpec> spec(std::make_shared<PackageDepSpec>(
parse_user_package_dep_spec(query, env.get(), UserPackageDepSpecOptions())));
std::shared_ptr<const PackageIDSequence> entries((*env)[selection::AllVersionsSorted(
generator::Matches(*spec, MatchPackageOptions()) | filter::InstalledAtRoot(env->root()))]);
@@ -218,7 +218,7 @@ int do_best_version(const std::shared_ptr<Environment> & env)
"' resolves to '" << **entries->last() << "', which is a virtual for '"
<< *(*entries->last())->virtual_for_key()->value() << "'. This will break with "
"new style virtuals.";
- std::shared_ptr<PackageIDSequence> new_entries(new PackageIDSequence);
+ std::shared_ptr<PackageIDSequence> new_entries(std::make_shared<PackageIDSequence>());
new_entries->push_back((*entries->last())->virtual_for_key()->value());
entries = new_entries;
}
@@ -244,7 +244,7 @@ int do_match(const std::shared_ptr<Environment> & env)
Context context("When performing match action from command line:");
std::string query(*CommandLine::get_instance()->begin_parameters());
- std::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(
+ std::shared_ptr<PackageDepSpec> spec(std::make_shared<PackageDepSpec>(
parse_user_package_dep_spec(query, env.get(), UserPackageDepSpecOptions())));
std::shared_ptr<const PackageIDSequence> entries((*env)[selection::AllVersionsSorted(
generator::Matches(*spec, MatchPackageOptions()) | filter::InstalledAtRoot(env->root()))]);
@@ -258,7 +258,7 @@ int do_match(const std::shared_ptr<Environment> & env)
"' resolves to '" << **entries->last() << "', which is a virtual for '"
<< *(*entries->last())->virtual_for_key()->value() << "'. This will break with "
"new style virtuals.";
- std::shared_ptr<PackageIDSequence> new_entries(new PackageIDSequence);
+ std::shared_ptr<PackageIDSequence> new_entries(std::make_shared<PackageIDSequence>());
new_entries->push_back((*entries->last())->virtual_for_key()->value());
entries = new_entries;
}
@@ -288,7 +288,7 @@ int do_environment_variable(const std::shared_ptr<Environment> & env)
std::string spec_str(*CommandLine::get_instance()->begin_parameters());
std::string var_str(* next(CommandLine::get_instance()->begin_parameters()));
- std::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(
+ std::shared_ptr<PackageDepSpec> spec(std::make_shared<PackageDepSpec>(
parse_user_package_dep_spec(spec_str, env.get(), UserPackageDepSpecOptions())));
std::shared_ptr<const PackageIDSequence> entries((*env)[selection::AllVersionsSorted(
diff --git a/src/clients/paludis/do_config.cc b/src/clients/paludis/do_config.cc
index e969163..5639b2d 100644
--- a/src/clients/paludis/do_config.cc
+++ b/src/clients/paludis/do_config.cc
@@ -77,7 +77,7 @@ namespace
Context local_context("When handling query '" + target + "':");
std::shared_ptr<PackageDepSpec> spec(
- new PackageDepSpec(parse_user_package_dep_spec(target, env.get(), UserPackageDepSpecOptions(),
+ std::make_shared<PackageDepSpec>(parse_user_package_dep_spec(target, env.get(), UserPackageDepSpecOptions(),
filter::InstalledAtRoot(env->root()))));
std::shared_ptr<const PackageIDSequence> entries(
diff --git a/src/clients/paludis/do_contents.cc b/src/clients/paludis/do_contents.cc
index c67b5c5..13c3753 100644
--- a/src/clients/paludis/do_contents.cc
+++ b/src/clients/paludis/do_contents.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
*
* 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
@@ -82,7 +82,7 @@ do_one_contents(
{
Context local_context("When handling query '" + q + "':");
- std::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(
+ std::shared_ptr<PackageDepSpec> spec(std::make_shared<PackageDepSpec>(
parse_user_package_dep_spec(q, env.get(), UserPackageDepSpecOptions() + updso_allow_wildcards,
filter::InstalledAtRoot(env->root()))));
diff --git a/src/clients/paludis/do_executables.cc b/src/clients/paludis/do_executables.cc
index 93e0f4d..51bcb08 100644
--- a/src/clients/paludis/do_executables.cc
+++ b/src/clients/paludis/do_executables.cc
@@ -134,7 +134,7 @@ do_one_executables(
{
Context local_context("When handling query '" + q + "':");
- std::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(
+ std::shared_ptr<PackageDepSpec> spec(std::make_shared<PackageDepSpec>(
parse_user_package_dep_spec(q, env.get(), UserPackageDepSpecOptions() + updso_allow_wildcards,
filter::InstalledAtRoot(env->root()))));
diff --git a/src/clients/paludis/info.cc b/src/clients/paludis/info.cc
index c06a37e..f5c18c5 100644
--- a/src/clients/paludis/info.cc
+++ b/src/clients/paludis/info.cc
@@ -219,7 +219,7 @@ int do_one_info(
Context local_context("When handling query '" + q + "':");
std::shared_ptr<PackageDepSpec> spec(
- new PackageDepSpec(parse_user_package_dep_spec(q, env.get(), UserPackageDepSpecOptions())));
+ std::make_shared<PackageDepSpec>(parse_user_package_dep_spec(q, env.get(), UserPackageDepSpecOptions())));
std::shared_ptr<const PackageIDSequence>
entries((*env)[selection::AllVersionsSorted(generator::Matches(*spec, MatchPackageOptions()))]),
@@ -228,7 +228,7 @@ int do_one_info(
installable_entries((*env)[selection::AllVersionsSorted(
generator::Matches(*spec, MatchPackageOptions()) | filter::SupportsAction<InstallAction>() | filter::NotMasked())]);
- std::shared_ptr<PackageIDSequence> to_show_entries(new PackageIDSequence);
+ std::shared_ptr<PackageIDSequence> to_show_entries(std::make_shared<PackageIDSequence>());
if (entries->empty())
throw NoSuchPackageError(q);
diff --git a/src/clients/paludis/install.cc b/src/clients/paludis/install.cc
index f7890d5..71e35d2 100644
--- a/src/clients/paludis/install.cc
+++ b/src/clients/paludis/install.cc
@@ -166,7 +166,7 @@ do_install(const std::shared_ptr<Environment> & env)
CommandLine::get_instance()->dl_args.populate_install_task(env.get(), task);
cout << "Building target list... " << std::flush;
- std::shared_ptr<Sequence<std::string> > specs(new Sequence<std::string>);
+ std::shared_ptr<Sequence<std::string> > specs(std::make_shared<Sequence<std::string>>());
std::copy(CommandLine::get_instance()->begin_parameters(), CommandLine::get_instance()->end_parameters(),
specs->back_inserter());
if (CommandLine::get_instance()->a_serialised.specified())
diff --git a/src/clients/paludis/query.cc b/src/clients/paludis/query.cc
index aa0a9e7..ba2ca1e 100644
--- a/src/clients/paludis/query.cc
+++ b/src/clients/paludis/query.cc
@@ -141,7 +141,7 @@ int do_query(const std::shared_ptr<Environment> & env)
Context context("When performing query action from command line:");
- std::shared_ptr<Map<char, std::string> > masks_to_explain(new Map<char, std::string>());
+ std::shared_ptr<Map<char, std::string> > masks_to_explain(std::make_shared<Map<char, std::string>>());
CommandLine::ParametersConstIterator q(CommandLine::get_instance()->begin_parameters()),
q_end(CommandLine::get_instance()->end_parameters());
diff --git a/src/clients/reconcilio/fix_linkage.cc b/src/clients/reconcilio/fix_linkage.cc
index afe4c6a..3327c57 100644
--- a/src/clients/reconcilio/fix_linkage.cc
+++ b/src/clients/reconcilio/fix_linkage.cc
@@ -71,7 +71,7 @@ do_fix_linkage(const std::shared_ptr<Environment> & env)
std::cout << std::endl << colour(cl_heading, "Packages that depend on " + library + ":") << std::endl;
}
- std::shared_ptr<Sequence<std::string> > targets(new Sequence<std::string>);
+ std::shared_ptr<Sequence<std::string> > targets(std::make_shared<Sequence<std::string>>());
for (BrokenLinkageFinder::BrokenPackageConstIterator pkg_it(finder.begin_broken_packages()),
pkg_it_end(finder.end_broken_packages()); pkg_it_end != pkg_it; ++pkg_it)
{
diff --git a/src/output/console_install_task.cc b/src/output/console_install_task.cc
index 1a809e9..55c5e97 100644
--- a/src/output/console_install_task.cc
+++ b/src/output/console_install_task.cc
@@ -109,8 +109,8 @@ ConsoleInstallTask::ConsoleInstallTask(Environment * const env,
InstallTask(env, options, d),
_download_size(0),
_download_size_overflow(false),
- _all_tags(new Set<DepTagEntry, DepTagEntryComparator>),
- _already_downloaded(new Set<FSEntry>),
+ _all_tags(std::make_shared<Set<DepTagEntry, DepTagEntryComparator>>()),
+ _already_downloaded(std::make_shared<Set<FSEntry>>()),
_resolution_finished(false)
{
std::fill_n(_counts, static_cast<int>(last_count), 0);
@@ -1516,7 +1516,7 @@ ConsoleInstallTask::display_merge_list_entry_end(const DepListEntry &, const Dis
std::shared_ptr<DepTagSummaryDisplayer>
ConsoleInstallTask::make_dep_tag_summary_displayer()
{
- return std::shared_ptr<DepTagSummaryDisplayer>(new DepTagSummaryDisplayer(this));
+ return std::shared_ptr<DepTagSummaryDisplayer>(std::make_shared<DepTagSummaryDisplayer>(this));
}
std::shared_ptr<EntryDepTagDisplayer>
diff --git a/src/output/console_query_task.cc b/src/output/console_query_task.cc
index ff9482f..fdecc5e 100644
--- a/src/output/console_query_task.cc
+++ b/src/output/console_query_task.cc
@@ -59,7 +59,7 @@ namespace paludis
Imp(const Environment * const e) :
env(e),
- masks_to_explain(new Map<char, std::string>)
+ masks_to_explain(std::make_shared<Map<char, std::string>>())
{
}
};