Const-correctness for EpollInstance RAII wrapper
This commit is contained in:
@@ -46,7 +46,7 @@ namespace Bloom
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::optional<int> EpollInstance::waitForEvent(std::optional<std::chrono::milliseconds> timeout) {
|
std::optional<int> EpollInstance::waitForEvent(std::optional<std::chrono::milliseconds> timeout) const {
|
||||||
std::array<struct epoll_event, 1> events = {};
|
std::array<struct epoll_event, 1> events = {};
|
||||||
|
|
||||||
const auto eventCount = ::epoll_wait(
|
const auto eventCount = ::epoll_wait(
|
||||||
|
|||||||
@@ -48,7 +48,9 @@ namespace Bloom
|
|||||||
* @return
|
* @return
|
||||||
* The file descriptor of the file for which the event occurred, or std::nullopt if a timeout was reached.
|
* The file descriptor of the file for which the event occurred, or std::nullopt if a timeout was reached.
|
||||||
*/
|
*/
|
||||||
std::optional<int> waitForEvent(std::optional<std::chrono::milliseconds> timeout = std::nullopt);
|
[[nodiscard]] std::optional<int> waitForEvent(
|
||||||
|
std::optional<std::chrono::milliseconds> timeout = std::nullopt
|
||||||
|
) const;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* EpollInstance objects should not be copied.
|
* EpollInstance objects should not be copied.
|
||||||
|
|||||||
Reference in New Issue
Block a user