From a743381d8cbd3b1ac5bbf5feda8e3a690b2779b3 Mon Sep 17 00:00:00 2001 From: Nav Date: Mon, 28 Mar 2022 20:33:17 +0100 Subject: [PATCH] Const-correctness for EpollInstance RAII wrapper --- src/Helpers/EpollInstance.cpp | 2 +- src/Helpers/EpollInstance.hpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Helpers/EpollInstance.cpp b/src/Helpers/EpollInstance.cpp index d2adea14..6da8962b 100644 --- a/src/Helpers/EpollInstance.cpp +++ b/src/Helpers/EpollInstance.cpp @@ -46,7 +46,7 @@ namespace Bloom } } - std::optional EpollInstance::waitForEvent(std::optional timeout) { + std::optional EpollInstance::waitForEvent(std::optional timeout) const { std::array events = {}; const auto eventCount = ::epoll_wait( diff --git a/src/Helpers/EpollInstance.hpp b/src/Helpers/EpollInstance.hpp index 278a1678..1712ae93 100644 --- a/src/Helpers/EpollInstance.hpp +++ b/src/Helpers/EpollInstance.hpp @@ -48,7 +48,9 @@ namespace Bloom * @return * The file descriptor of the file for which the event occurred, or std::nullopt if a timeout was reached. */ - std::optional waitForEvent(std::optional timeout = std::nullopt); + [[nodiscard]] std::optional waitForEvent( + std::optional timeout = std::nullopt + ) const; /* * EpollInstance objects should not be copied.