From 52de42e7fb64173edbae8bb39e648bf912a72b56 Mon Sep 17 00:00:00 2001 From: Scott Freeman Date: Tue, 14 Jan 2020 18:22:50 -0500 Subject: [PATCH] Removing Utils::Swap and using std::swap instead (#932) --- src/CalcViewModel/Common/Utils.h | 8 -------- src/CalcViewModel/UnitConverterViewModel.cpp | 4 ++-- src/GraphControl/Utils.h | 8 -------- 3 files changed, 2 insertions(+), 18 deletions(-) diff --git a/src/CalcViewModel/Common/Utils.h b/src/CalcViewModel/Common/Utils.h index 9e532870..7836b9bb 100644 --- a/src/CalcViewModel/Common/Utils.h +++ b/src/CalcViewModel/Common/Utils.h @@ -372,14 +372,6 @@ namespace Utils ref new Windows::UI::Xaml::PropertyChangedCallback(callback))); } - template - void Swap(T *ref1, T *ref2) - { - T temp = *ref1; - *ref1 = *ref2; - *ref2 = temp; - } - void IFTPlatformException(HRESULT hr); Platform::String ^ GetStringValue(Platform::String ^ input); bool IsLastCharacterTarget(std::wstring const& input, wchar_t target); diff --git a/src/CalcViewModel/UnitConverterViewModel.cpp b/src/CalcViewModel/UnitConverterViewModel.cpp index ecf4f80b..ff77cd77 100644 --- a/src/CalcViewModel/UnitConverterViewModel.cpp +++ b/src/CalcViewModel/UnitConverterViewModel.cpp @@ -264,9 +264,9 @@ void UnitConverterViewModel::OnSwitchActive(Platform::Object ^ unused) } m_valueFromUnlocalized.swap(m_valueToUnlocalized); - Utils::Swap(&m_localizedValueFromFormat, &m_localizedValueToFormat); + swap(m_localizedValueFromFormat, m_localizedValueToFormat); - Utils::Swap(&m_Unit1AutomationName, &m_Unit2AutomationName); + swap(m_Unit1AutomationName, m_Unit2AutomationName); RaisePropertyChanged(Unit1AutomationNamePropertyName); RaisePropertyChanged(Unit2AutomationNamePropertyName); diff --git a/src/GraphControl/Utils.h b/src/GraphControl/Utils.h index e29e4bde..f94b928b 100644 --- a/src/GraphControl/Utils.h +++ b/src/GraphControl/Utils.h @@ -349,14 +349,6 @@ namespace Utils defaultValue, ref new Windows::UI::Xaml::PropertyChangedCallback(callback))); } - - template - void Swap(T *ref1, T *ref2) - { - T temp = *ref1; - *ref1 = *ref2; - *ref2 = temp; - } } // This goes into the header to define the property, in the public: section of the class