aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdrian Kummerlaender2014-09-16 20:09:14 +0200
committerAdrian Kummerlaender2014-09-16 20:09:14 +0200
commit31f8cbdd0b038c7196f630febd2bbe2f9183cde0 (patch)
treecbcd7e8139b8c01b19f7ea2a56c716f9f7a513e8 /src
parentc87d8ec91f0e191dba6b744788167bb8d41d339e (diff)
downloadCodepointIterator-31f8cbdd0b038c7196f630febd2bbe2f9183cde0.tar
CodepointIterator-31f8cbdd0b038c7196f630febd2bbe2f9183cde0.tar.gz
CodepointIterator-31f8cbdd0b038c7196f630febd2bbe2f9183cde0.tar.bz2
CodepointIterator-31f8cbdd0b038c7196f630febd2bbe2f9183cde0.tar.lz
CodepointIterator-31f8cbdd0b038c7196f630febd2bbe2f9183cde0.tar.xz
CodepointIterator-31f8cbdd0b038c7196f630febd2bbe2f9183cde0.tar.zst
CodepointIterator-31f8cbdd0b038c7196f630febd2bbe2f9183cde0.zip
Redefined CodePoint utility masks as C++14 binary literalsHEADmaster
* they are more expressive as the shift-syntax in my opinion
Diffstat (limited to 'src')
-rw-r--r--src/utility.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/utility.h b/src/utility.h
index 75811f5..56bcfea 100644
--- a/src/utility.h
+++ b/src/utility.h
@@ -7,17 +7,17 @@ namespace UTF8 {
namespace dtl {
enum class CodeUnitType : std::uint8_t {
- CONTINUATION = (128 >> 0), // 10000000
- LEADING = (128 >> 1), // 01000000
- THREE = (128 >> 2), // 00100000
- FOUR = (128 >> 3), // 00010000
+ CONTINUATION = 0b10000000,
+ LEADING = 0b01000000,
+ THREE = 0b00100000,
+ FOUR = 0b00010000
};
enum class CodePoint : std::uint8_t {
- CONTINUATION = (UINT8_MAX >> 2), // 00111111
- TWO = (UINT8_MAX >> 3), // 00011111
- THREE = (UINT8_MAX >> 4), // 00001111
- FOUR = (UINT8_MAX >> 5), // 00000111
+ CONTINUATION = 0b00111111,
+ TWO = 0b00011111,
+ THREE = 0b00001111,
+ FOUR = 0b00000111
};
inline bool match(const std::uint8_t unit, const CodeUnitType type) {