Add noexcept annotation where applicable (#1244)
* NetworkDetector::RegisterAndListen does not throw exceptions, thus mark the method as noexcept. * RequestHandler::RequestHandler does not throw exceptions, thus mark the constructor as noexcept. * Constant intialization of member variables should be done using in-class initializers, not in the initializer-list.
This commit is contained in:
Родитель
8e3697de26
Коммит
a5bd5a6ee3
|
@ -330,7 +330,7 @@ namespace MAT_NS_BEGIN
|
|||
return true;
|
||||
}
|
||||
|
||||
bool NetworkDetector::RegisterAndListen()
|
||||
bool NetworkDetector::RegisterAndListen() noexcept
|
||||
{
|
||||
// ???
|
||||
HRESULT hr = pNlm->QueryInterface(IID_IUnknown, (void**)&pSink);
|
||||
|
|
|
@ -153,7 +153,7 @@ namespace MAT_NS_BEGIN
|
|||
/// Register and listen to network state notifications
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
bool RegisterAndListen();
|
||||
bool RegisterAndListen() noexcept;
|
||||
|
||||
/// <summary>
|
||||
/// Reset network state listener to uninitialized state
|
||||
|
|
|
@ -39,7 +39,7 @@ using namespace MAT;
|
|||
class RequestHandler : public HttpServer::Callback
|
||||
{
|
||||
public:
|
||||
RequestHandler(int id) : m_count(0), m_id(id){}
|
||||
RequestHandler(int id) noexcept : m_id(id){}
|
||||
|
||||
int onHttpRequest(HttpServer::Request const& request, HttpServer::Response& /*response*/) override
|
||||
{
|
||||
|
@ -54,7 +54,7 @@ class RequestHandler : public HttpServer::Callback
|
|||
}
|
||||
|
||||
private:
|
||||
size_t m_count;
|
||||
size_t m_count {};
|
||||
int m_id ;
|
||||
};
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче