From b627e35758a8a13944424e811c5742a6d3dd526e Mon Sep 17 00:00:00 2001 From: Kenneth Heafield Date: Mon, 27 Jan 2014 22:06:31 -0800 Subject: Fix C++11 compiler error --- klm/util/joint_sort.hh | 11 +++++++---- 1 file 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 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 key_; @@ -84,10 +90,7 @@ template class JointProxy { } friend void swap(JointProxy first, JointProxy 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: -- cgit v1.2.3