diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2019-12-18 22:32:16 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2020-01-28 15:18:33 +0300 |
commit | acd7a29c02e222e27d474fe3b64b1ca11b3506c0 (patch) | |
tree | cf26139e835e7caad479cfb52e4e6c0fc2c887e2 /libbutl/utility.ixx | |
parent | 5cd9e0c25e39ff1449e38a9c74e131e7359e7183 (diff) |
Add utf8() predicate
Diffstat (limited to 'libbutl/utility.ixx')
-rw-r--r-- | libbutl/utility.ixx | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/libbutl/utility.ixx b/libbutl/utility.ixx index d8a5ee8..aabaef6 100644 --- a/libbutl/utility.ixx +++ b/libbutl/utility.ixx @@ -217,6 +217,34 @@ namespace butl return sanitize_identifier (std::string (s)); } + inline codepoint_types + operator&= (codepoint_types& x, codepoint_types y) + { + return x = static_cast<codepoint_types> ( + static_cast<std::uint16_t> (x) & + static_cast<std::uint16_t> (y)); + } + + inline codepoint_types + operator|= (codepoint_types& x, codepoint_types y) + { + return x = static_cast<codepoint_types> ( + static_cast<std::uint16_t> (x) | + static_cast<std::uint16_t> (y)); + } + + inline codepoint_types + operator& (codepoint_types x, codepoint_types y) + { + return x &= y; + } + + inline codepoint_types + operator| (codepoint_types x, codepoint_types y) + { + return x |= y; + } + inline bool eof (std::istream& is) { |