From 843804d38ab68170c135816fbe5220347ef989b1 Mon Sep 17 00:00:00 2001 From: heck Date: Mon, 23 Jan 2023 19:03:41 +0530 Subject: [PATCH] standards: NEVER use namespace std --- src/Adapter.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Adapter.cc b/src/Adapter.cc index 8176002..23269c9 100644 --- a/src/Adapter.cc +++ b/src/Adapter.cc @@ -9,7 +9,6 @@ #include "callback_dispatcher.hh" #include "group_manager_api.h" -using namespace std; thread_local pEp::Adapter::Session pEp::Adapter::session{}; @@ -73,7 +72,7 @@ namespace pEp { void Session::_new() { - std::lock_guard lock(mut); + std::lock_guard lock(mut); if (_sync_mode == SyncModes::Sync) { _cb_handle_sync_event_from_engine = _cb_pass_sync_event_to_engine; @@ -173,7 +172,7 @@ namespace pEp { // public bool on_sync_thread() { - return _sync_thread.get_id() == this_thread::get_id(); + return _sync_thread.get_id() == std::this_thread::get_id(); } // public @@ -246,13 +245,13 @@ namespace pEp { return; } if (status == ::PEP_OUT_OF_MEMORY) { - throw bad_alloc(); + throw std::bad_alloc(); } if (status == ::PEP_ILLEGAL_VALUE) { - throw invalid_argument("illegal value"); + throw std::invalid_argument("illegal value"); } - string _status = status_to_string(status); + std::string _status = status_to_string(status); throw RuntimeError(_status, status); }