From 5b1c20f2315cd7fc624ffd31abdcc03b409bfcb2 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Sat, 2 Jul 2016 17:21:54 +0300 Subject: Add cpfile() --- butl/fdstream.ixx | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 butl/fdstream.ixx (limited to 'butl/fdstream.ixx') 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 ( + static_cast (x) & + static_cast (y)); + } + + inline fdopen_mode + operator|= (fdopen_mode& x, fdopen_mode y) + { + return x = static_cast ( + static_cast (x) | + static_cast (y)); + } +} -- cgit v1.1