summaryrefslogtreecommitdiff
path: root/klm
diff options
context:
space:
mode:
authorKenneth Heafield <github@kheafield.com>2014-01-27 22:06:31 -0800
committerKenneth Heafield <github@kheafield.com>2014-01-27 22:06:31 -0800
commitb627e35758a8a13944424e811c5742a6d3dd526e (patch)
treec1c76ddaca7981b3fef6417c2a428ad708b3437d /klm
parent0ee2b44c5c0981358ade9ddab1d083bbe1de5daf (diff)
Fix C++11 compiler error
Diffstat (limited to 'klm')
-rw-r--r--klm/util/joint_sort.hh11
1 files changed, 7 insertions, 4 deletions
diff --git a/klm/util/joint_sort.hh b/klm/util/joint_sort.hh
index 13a52b67..5589c558 100644
--- a/klm/util/joint_sort.hh
+++ b/klm/util/joint_sort.hh
@@ -40,6 +40,12 @@ template <class KeyIter, class ValueIter> class JointIter {
swap(first.value_, second.value_);
}
+ void DeepSwap(JointIter &other) {
+ using std::swap;
+ swap(*key_, *other.key_);
+ swap(*value_, *other.value_);
+ }
+
private:
friend class JointProxy<KeyIter, ValueIter>;
KeyIter key_;
@@ -84,10 +90,7 @@ template <class KeyIter, class ValueIter> class JointProxy {
}
friend void swap(JointProxy<KeyIter, ValueIter> first, JointProxy<KeyIter, ValueIter> second) {
- // Allow argument-dependent lookup.
- using std::swap;
- swap(*first.inner_.key_, *second.inner_.key_);
- swap(*first.inner_.value_, *second.inner_.value_);
+ first.DeepSwap(second);
}
private: