diff --git a/libcorpus2/tag.cpp b/libcorpus2/tag.cpp index 9cbdaf37259337c28361dba550aae63540427594..bb08d81f01e9269ae7714ccdb2885977d3ccf791 100644 --- a/libcorpus2/tag.cpp +++ b/libcorpus2/tag.cpp @@ -36,7 +36,7 @@ int Tag::pos_count() const int Tag::get_pos_index() const { - if (pos_ == 0) return -1; + if (pos_.none()) return -1; return PwrNlp::lowest_bit(pos_); } diff --git a/libcorpus2/tag.h b/libcorpus2/tag.h index 324c88ea16db0477076319d4da13d52405bb2a5f..41297e02ae72bf81c39355b00db9a6d8955f50e2 100644 --- a/libcorpus2/tag.h +++ b/libcorpus2/tag.h @@ -68,7 +68,7 @@ public: } bool is_null() const { - return pos_ == 0 && values_ == 0; + return pos_.none() && values_.none(); } int pos_count() const; diff --git a/libcorpus2/tagset.cpp b/libcorpus2/tagset.cpp index 475bf1034500b06808cc400aed9c57d341a4555a..00f31f4ed289bd5d9ee371563fc73c85cf7e3e15 100644 --- a/libcorpus2/tagset.cpp +++ b/libcorpus2/tagset.cpp @@ -252,9 +252,9 @@ Tag Tagset::parse_simple_tag(const string_range_vector &ts, for (size_t i = 1; i < ts.size(); ++i) { if (!ts[i].empty()) { mask_t val = get_value_mask(boost::copy_range<std::string>(ts[i])); - if (val == 0) { + if (val.none()) { mask_t a = get_attribute_mask(ts[i]); - if (a != 0) { + if (a.any()) { values &= (~a); } else { throw TagParseError("Unknown attribute value", @@ -335,7 +335,7 @@ bool Tagset::validate_tag(const Tag &t, bool allow_extra, for (idx_t i = 0; i < attribute_count(); ++i) { mask_t value = t.get_values_for(get_attribute_mask(i)); - if (value == 0) { + if (value.none()) { if (required[i]) { if (os) { (*os) << " red attribuite "