diff --git a/coding/coding_tests/uri_test.cpp b/coding/coding_tests/uri_test.cpp index c6676ea112..a2aa541034 100644 --- a/coding/coding_tests/uri_test.cpp +++ b/coding/coding_tests/uri_test.cpp @@ -1,12 +1,18 @@ #include "testing/testing.hpp" + #include "coding/uri.hpp" + #include "base/macros.hpp" -#include "std/bind.hpp" -#include "std/queue.hpp" -#include "std/utility.hpp" + +#include +#include +#include +#include using url_scheme::Uri; +using namespace std; + namespace { @@ -28,7 +34,7 @@ public: TEST_EQUAL(uri.GetScheme(), m_scheme, ()); TEST_EQUAL(uri.GetPath(), m_path, ()); TEST(!m_scheme.empty() || !uri.IsValid(), ("Scheme is empty if and only if uri is invalid!")); - uri.ForEachKeyValue(bind(&TestUri::AddTestValue, this, _1, _2)); + uri.ForEachKeyValue(bind(&TestUri::AddTestValue, this, placeholders::_1, placeholders::_2)); } private: diff --git a/coding/file_sort.hpp b/coding/file_sort.hpp index fd7b8a17e8..ca8377a78e 100644 --- a/coding/file_sort.hpp +++ b/coding/file_sort.hpp @@ -1,17 +1,21 @@ #pragma once + #include "coding/file_reader.hpp" #include "coding/file_writer.hpp" + #include "base/base.hpp" #include "base/logging.hpp" #include "base/exception.hpp" -#include "std/algorithm.hpp" -#include "std/cstdlib.hpp" -#include "std/functional.hpp" -#include "std/queue.hpp" -#include "std/unique_ptr.hpp" -#include "std/string.hpp" -#include "std/utility.hpp" -#include "std/vector.hpp" + +#include +#include +#include +#include +#include +#include +#include +#include +#include template struct Sorter @@ -20,28 +24,25 @@ struct Sorter Sorter(LessT lessF) : m_Less(lessF) {} template void operator() (IterT beg, IterT end) const { - sort(beg, end, m_Less); + std::sort(beg, end, m_Less); } }; -template < - typename T, // Item type. - class OutputSinkT = FileWriter, // Sink to output into result file. - typename LessT = less, // Item comparator. - template class SorterT = Sorter // Item sorter. -> +template , // Item comparator. + template class SorterT = Sorter // Item sorter. + > class FileSorter { public: - FileSorter(size_t bufferBytes, - string const & tmpFileName, - OutputSinkT & outputSink, - LessT fLess = LessT()) : - m_TmpFileName(tmpFileName), - m_BufferCapacity(max(size_t(16), bufferBytes / sizeof(T))), - m_OutputSink(outputSink), - m_ItemCount(0), - m_Less(fLess) + FileSorter(size_t bufferBytes, std::string const & tmpFileName, OutputSinkT & outputSink, + LessT fLess = LessT()) + : m_TmpFileName(tmpFileName) + , m_BufferCapacity(std::max(size_t(16), bufferBytes / sizeof(T))) + , m_OutputSink(outputSink) + , m_ItemCount(0) + , m_Less(fLess) { m_Buffer.reserve(m_BufferCapacity); m_pTmpWriter.reset(new FileWriter(tmpFileName)); @@ -65,7 +66,7 @@ public: m_pTmpWriter.reset(); FileReader reader(m_TmpFileName); ItemIndexPairGreater fGreater(m_Less); - PriorityQueueType q(fGreater); + PriorityQueue q(fGreater); for (uint32_t i = 0; i < m_ItemCount; i += m_BufferCapacity) Push(q, i, reader); @@ -104,15 +105,16 @@ private: struct ItemIndexPairGreater { explicit ItemIndexPairGreater(LessT fLess) : m_Less(fLess) {} - inline bool operator() (pair const & a, pair const & b) const + inline bool operator()(std::pair const & a, std::pair const & b) const { return m_Less(b.first, a.first); } LessT m_Less; }; - typedef priority_queue, vector >, ItemIndexPairGreater> - PriorityQueueType; + using PriorityQueue = + std::priority_queue, std::vector>, + ItemIndexPairGreater>; void FlushToTmpFile() { @@ -124,18 +126,18 @@ private: m_Buffer.clear(); } - void Push(PriorityQueueType & q, uint32_t i, FileReader const & reader) + void Push(PriorityQueue & q, uint32_t i, FileReader const & reader) { T item; reader.Read(static_cast(i) * sizeof(T), &item, sizeof(T)); - q.push(pair(item, i)); + q.push(std::pair(item, i)); } - string const m_TmpFileName; + std::string const m_TmpFileName; size_t const m_BufferCapacity; OutputSinkT & m_OutputSink; - unique_ptr m_pTmpWriter; - vector m_Buffer; + std::unique_ptr m_pTmpWriter; + std::vector m_Buffer; uint32_t m_ItemCount; LessT m_Less; }; diff --git a/std/queue.hpp b/std/queue.hpp deleted file mode 100644 index 9b8db780e1..0000000000 --- a/std/queue.hpp +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -#ifdef new -#undef new -#endif - -#include -using std::queue; -using std::priority_queue; - -#ifdef DEBUG_NEW -#define new DEBUG_NEW -#endif diff --git a/storage/storage_tests/task_runner.hpp b/storage/storage_tests/task_runner.hpp index 4acd7a533c..ddd4352742 100644 --- a/storage/storage_tests/task_runner.hpp +++ b/storage/storage_tests/task_runner.hpp @@ -2,8 +2,8 @@ #include "base/thread_checker.hpp" -#include "std/function.hpp" -#include "std/queue.hpp" +#include +#include namespace storage { @@ -17,7 +17,7 @@ namespace storage class TaskRunner { public: - using TTask = function; + using TTask = std::function; ~TaskRunner(); @@ -25,7 +25,7 @@ public: void PostTask(TTask const & task); private: - queue m_tasks; + std::queue m_tasks; ThreadChecker m_checker; }; diff --git a/xcode/omim.xcworkspace/contents.xcworkspacedata b/xcode/omim.xcworkspace/contents.xcworkspacedata index d55f9bdd15..eb176f781b 100644 --- a/xcode/omim.xcworkspace/contents.xcworkspacedata +++ b/xcode/omim.xcworkspace/contents.xcworkspacedata @@ -118,9 +118,6 @@ - -