diff --git a/Global.h b/Global.h index a2fe92e6b..17f2a895a 100644 --- a/Global.h +++ b/Global.h @@ -217,8 +217,8 @@ typedef int16_t si16; //signed int 16 bits (2 bytes) typedef int8_t si8; //signed int 8 bits (1 byte) // Lock typedefs -typedef boost::lock_guard TLockGuard; -typedef boost::lock_guard TLockGuardRec; +using TLockGuard = std::lock_guard; +using TLockGuardRec = std::lock_guard; /* ---------------------------------------------------------------------------- */ /* Macros */ @@ -565,7 +565,7 @@ namespace vstd template OutputIterator copy_if(const InputRange &input, OutputIterator result, Predicate pred) { - return std::copy_if(boost::const_begin(input), std::end(input), result, pred); + return std::copy_if(std::cbegin(input), std::end(input), result, pred); } template @@ -693,7 +693,7 @@ namespace vstd template void removeDuplicates(std::vector &vec) { - boost::sort(vec); + std::sort(vec.begin(), vec.end()); vec.erase(std::unique(vec.begin(), vec.end()), vec.end()); } diff --git a/lib/CConsoleHandler.cpp b/lib/CConsoleHandler.cpp index fd7fe35bf..595de23b3 100644 --- a/lib/CConsoleHandler.cpp +++ b/lib/CConsoleHandler.cpp @@ -15,7 +15,7 @@ VCMI_LIB_NAMESPACE_BEGIN -boost::mutex CConsoleHandler::smx; +std::mutex CConsoleHandler::smx; DLL_LINKAGE CConsoleHandler * console = nullptr; diff --git a/lib/CConsoleHandler.h b/lib/CConsoleHandler.h index fd42ce648..28ee0ad0b 100644 --- a/lib/CConsoleHandler.h +++ b/lib/CConsoleHandler.h @@ -88,7 +88,7 @@ private: /// FIXME: Implement CConsoleHandler as singleton, move some logic into CLogConsoleTarget, etc... needs to be disussed:) /// Without static, application will crash complaining about mutex deleted. In short: CConsoleHandler gets deleted before /// the logging system. - static boost::mutex smx; + static std::mutex smx; boost::thread * thread; }; diff --git a/lib/logging/CLogger.cpp b/lib/logging/CLogger.cpp index 0e3c0c5ce..9e23d372e 100644 --- a/lib/logging/CLogger.cpp +++ b/lib/logging/CLogger.cpp @@ -85,8 +85,8 @@ bool CLoggerDomain::isGlobalDomain() const { return name == DOMAIN_GLOBAL; } const std::string& CLoggerDomain::getName() const { return name; } -boost::recursive_mutex CLogger::smx; -boost::recursive_mutex CLogManager::smx; +std::recursive_mutex CLogger::smx; +std::recursive_mutex CLogManager::smx; DLL_LINKAGE vstd::CLoggerBase * logGlobal = CLogger::getGlobalLogger(); diff --git a/lib/logging/CLogger.h b/lib/logging/CLogger.h index 71a817d81..064910383 100644 --- a/lib/logging/CLogger.h +++ b/lib/logging/CLogger.h @@ -78,8 +78,8 @@ private: CLogger * parent; ELogLevel::ELogLevel level; std::vector > targets; - mutable boost::mutex mx; - static boost::recursive_mutex smx; + mutable std::mutex mx; + static std::recursive_mutex smx; }; /* ---------------------------------------------------------------------------- */ @@ -101,8 +101,8 @@ private: virtual ~CLogManager(); std::map loggers; - mutable boost::mutex mx; - static boost::recursive_mutex smx; + mutable std::mutex mx; + static std::recursive_mutex smx; }; /// The struct LogRecord holds the log message and additional logging information. @@ -200,7 +200,7 @@ private: bool coloredOutputEnabled; CLogFormatter formatter; CColorMapping colorMapping; - mutable boost::mutex mx; + mutable std::mutex mx; }; /// This target is a logging target which writes messages to a log file. @@ -222,7 +222,7 @@ public: private: FileStream file; CLogFormatter formatter; - mutable boost::mutex mx; + mutable std::mutex mx; }; VCMI_LIB_NAMESPACE_END