[paludis-commits] paludis.git (master) -- ba2963c by Ciaran McCreesh
git at git.pioto.org
git at git.pioto.org
Mon Sep 15 22:23:56 EDT 2008
Module: paludis.git
Branch: master
Commit: ba2963cf4666e66d92186a6962d1e4a794b4fedd
URL: http://git.pioto.org/?p=paludis.git;a=commit;h=ba2963cf4666e66d92186a6962d1e4a794b4fedd
Author: Ciaran McCreesh <ciaran.mccreesh at googlemail.com>
Committer: Ciaran McCreesh <ciaran.mccreesh at googlemail.com>
Date: Tue Sep 16 03:18:05 2008 +0100
----
add operator=
----
paludis/dep_label.cc | 20 ++++++++++++++++++++
paludis/dep_label.hh | 2 ++
2 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/paludis/dep_label.cc b/paludis/dep_label.cc
index f0f851b..3fca001 100644
--- a/paludis/dep_label.cc
+++ b/paludis/dep_label.cc
@@ -281,6 +281,26 @@ ActiveDependencyLabels::~ActiveDependencyLabels()
{
}
+ActiveDependencyLabels &
+ActiveDependencyLabels::operator= (const ActiveDependencyLabels & other)
+{
+ if (this != &other)
+ {
+ _imp->system_labels.reset(new DependencySystemLabelSequence);
+ std::copy(other._imp->system_labels->begin(), other._imp->system_labels->end(), _imp->system_labels->back_inserter());
+
+ _imp->type_labels.reset(new DependencyTypeLabelSequence);
+ std::copy(other._imp->type_labels->begin(), other._imp->type_labels->end(), _imp->type_labels->back_inserter());
+
+ _imp->suggest_labels.reset(new DependencySuggestLabelSequence);
+ std::copy(other._imp->suggest_labels->begin(), other._imp->suggest_labels->end(), _imp->suggest_labels->back_inserter());
+
+ _imp->abi_labels.reset(new DependencyABIsLabelSequence);
+ std::copy(other._imp->abi_labels->begin(), other._imp->abi_labels->end(), _imp->abi_labels->back_inserter());
+ }
+ return *this;
+}
+
const std::tr1::shared_ptr<const DependencySystemLabelSequence>
ActiveDependencyLabels::system_labels() const
{
diff --git a/paludis/dep_label.hh b/paludis/dep_label.hh
index 590774c..6b83d5f 100644
--- a/paludis/dep_label.hh
+++ b/paludis/dep_label.hh
@@ -359,6 +359,8 @@ namespace paludis
ActiveDependencyLabels(const ActiveDependencyLabels &, const DependencyLabelsDepSpec &);
~ActiveDependencyLabels();
+ ActiveDependencyLabels & operator= (const ActiveDependencyLabels &);
+
///\}
///\name Current label selections
---
More information about the paludis-commits
mailing list