aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Daniel Mierswa <impulze@impulze.org> 2012-02-27 12:59:48 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2012-03-03 14:46:28 +0000
commitc62993e9e188098013343109acf53d614a2b8402 (patch)
tree942ff67b060eeb2e668a92415cfa4998a01db67b
parenta5d3573915c63661f50fabc71af9a187b2bd0de6 (diff)
downloadpaludis-c62993e9e188098013343109acf53d614a2b8402.tar.gz
paludis-c62993e9e188098013343109acf53d614a2b8402.tar.xz
use std::make_shared where shared_ptr instances are required
removes compilation errors with 4.7 because construction of shared_ptr instances is explicit and matches the convention used in the rest of the code
-rw-r--r--paludis/ndbam.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/paludis/ndbam.cc b/paludis/ndbam.cc
index c684786..7003ce8 100644
--- a/paludis/ndbam.cc
+++ b/paludis/ndbam.cc
@@ -261,7 +261,7 @@ NDBAM::has_package_named(const QualifiedPackageName & q)
if (FSPath(_imp->location / "indices" / "categories" /
stringify(q.category()) / stringify(q.package())).stat().is_directory_or_symlink_to_directory())
{
- cc.package_contents_map.insert(std::make_pair(q, new PackageContents));
+ cc.package_contents_map.insert(std::make_pair(q, std::make_shared<PackageContents>()));
return true;
}
cc.package_contents_map.insert(std::make_pair(q, std::shared_ptr<PackageContents>()));
@@ -596,7 +596,7 @@ NDBAM::category_names_containing_package(const PackageNamePart & p) const
Lock l(_imp->category_names_containing_package_mutex);
CategoryNamesContainingPackage::iterator cncp_i(_imp->category_names_containing_package.find(p));
if (_imp->category_names_containing_package.end() == cncp_i)
- cncp_i = _imp->category_names_containing_package.insert(std::make_pair(p, new CategoryNamesContainingPackageEntry)).first;
+ cncp_i = _imp->category_names_containing_package.insert(std::make_pair(p, std::make_shared<CategoryNamesContainingPackageEntry>())).first;
CategoryNamesContainingPackageEntry & cncp(*cncp_i->second);
l.acquire_then_release_old(cncp.mutex);