From 5d37517eac6abf960cf27aba0ee0bd01543e2b70 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 29 Sep 2016 17:04:43 +0300 Subject: [PATCH] Fixed build. --- Telegram/SourceFiles/core/stl_subset.h | 2 +- Telegram/SourceFiles/core/utils.h | 2 +- Telegram/SourceFiles/core/vector_of_moveable.h | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/core/stl_subset.h b/Telegram/SourceFiles/core/stl_subset.h index 10eeadbdf..f969ec927 100644 --- a/Telegram/SourceFiles/core/stl_subset.h +++ b/Telegram/SourceFiles/core/stl_subset.h @@ -90,7 +90,7 @@ inline constexpr typename remove_reference::type &&move(T &&value) noexcept { } template -void swap(T &a, T &b) { +void swap_moveable(T &a, T &b) { T tmp = move(a); a = move(b); b = move(tmp); diff --git a/Telegram/SourceFiles/core/utils.h b/Telegram/SourceFiles/core/utils.h index df4c23af3..c672c263b 100644 --- a/Telegram/SourceFiles/core/utils.h +++ b/Telegram/SourceFiles/core/utils.h @@ -90,7 +90,7 @@ inline void accumulate_min(T &a, const T &b) { if (a > b) a = b; } template T createAndSwap(T &value) { T result = T(); - std_::swap(result, value); + std_::swap_moveable(result, value); return std_::move(result); } diff --git a/Telegram/SourceFiles/core/vector_of_moveable.h b/Telegram/SourceFiles/core/vector_of_moveable.h index 6d34bdb83..e83005c07 100644 --- a/Telegram/SourceFiles/core/vector_of_moveable.h +++ b/Telegram/SourceFiles/core/vector_of_moveable.h @@ -20,6 +20,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once +#include "core/stl_subset.h" + // some minimal implementation of std::vector() for moveable (but not copiable) types. namespace std_ {