diff options
Diffstat (limited to 'butl/fdstream.ixx')
-rw-r--r-- | butl/fdstream.ixx | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/butl/fdstream.ixx b/butl/fdstream.ixx new file mode 100644 index 0000000..a3ea83c --- /dev/null +++ b/butl/fdstream.ixx @@ -0,0 +1,25 @@ +// file : butl/fdstream.ixx -*- C++ -*- +// copyright : Copyright (c) 2014-2016 Code Synthesis Ltd +// license : MIT; see accompanying LICENSE file + +namespace butl +{ + inline fdopen_mode operator& (fdopen_mode x, fdopen_mode y) {return x &= y;} + inline fdopen_mode operator| (fdopen_mode x, fdopen_mode y) {return x |= y;} + + inline fdopen_mode + operator&= (fdopen_mode& x, fdopen_mode y) + { + return x = static_cast<fdopen_mode> ( + static_cast<std::uint16_t> (x) & + static_cast<std::uint16_t> (y)); + } + + inline fdopen_mode + operator|= (fdopen_mode& x, fdopen_mode y) + { + return x = static_cast<fdopen_mode> ( + static_cast<std::uint16_t> (x) | + static_cast<std::uint16_t> (y)); + } +} |