aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-09-16 03:18:05 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-09-16 03:18:05 +0100
commitba2963cf4666e66d92186a6962d1e4a794b4fedd (patch)
tree5ec6d087a9c67f3bcede25a5035b5729bdd44c29
parentafa26e6cdadb402aee39213e4bbbc54b2c6b6e30 (diff)
downloadpaludis-ba2963cf4666e66d92186a6962d1e4a794b4fedd.tar.gz
paludis-ba2963cf4666e66d92186a6962d1e4a794b4fedd.tar.xz
add operator=
-rw-r--r--paludis/dep_label.cc20
-rw-r--r--paludis/dep_label.hh2
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