Permalink
Browse files

Avoid unused warning on ignored return value. (#55)

* Avoid unused warning on ignored return value.

* Removed constexpr for backward compatibility. Although the perfect
solution would be with a macro that checks what version of C++ is being
used.
  • Loading branch information...
TheQuantumPhysicist authored and Cylix committed Sep 10, 2018
1 parent 5b60d9a commit 6e4c85bffadbd5306d1aa6aaf9259d2e002736a1
Showing with 6 additions and 2 deletions.
  1. +6 −2 sources/network/unix/unix_self_pipe.cpp
@@ -62,12 +62,16 @@ self_pipe::get_write_fd(void) const {
return m_fds[1];
}
template <typename T1>
void
___ignore_unused(T1 const&) {}
//!
//! notify
//!
void
self_pipe::notify(void) {
(void) write(m_fds[1], "a", 1);
___ignore_unused(write(m_fds[1], "a", 1));
}
//!
@@ -76,7 +80,7 @@ self_pipe::notify(void) {
void
self_pipe::clr_buffer(void) {
char buf[1024];
(void) read(m_fds[0], buf, 1024);
___ignore_unused(read(m_fds[0], buf, 1024));
}
} // namespace tacopie

0 comments on commit 6e4c85b

Please sign in to comment.