Skip to content

Commit 09c7fc4

Browse files
author
Hana Dusíková
committed
fix #238: missing property and binary property in populate(...) functions
1 parent ecd2e3a commit 09c7fc4

File tree

4 files changed

+32
-0
lines changed

4 files changed

+32
-0
lines changed

include/ctre/first.hpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,16 @@ template <size_t Capacity> class point_set {
499499
points[0].high = (std::numeric_limits<int64_t>::max)();
500500
used = 1;
501501
}
502+
template <auto Property> constexpr void populate(ctre::binary_property<Property>) {
503+
points[0].low = (std::numeric_limits<int64_t>::min)();
504+
points[0].high = (std::numeric_limits<int64_t>::max)();
505+
used = 1;
506+
}
507+
template <auto Property, auto Value> constexpr void populate(ctre::property<Property, Value>) {
508+
points[0].low = (std::numeric_limits<int64_t>::min)();
509+
points[0].high = (std::numeric_limits<int64_t>::max)();
510+
used = 1;
511+
}
502512
template <typename... Content> constexpr void populate(ctre::negative_set<Content...> nset) {
503513
negative_helper(nset, [&](int64_t low, int64_t high){
504514
this->insert(low, high);

single-header/ctre-unicode.hpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3946,6 +3946,16 @@ template <size_t Capacity> class point_set {
39463946
points[0].high = (std::numeric_limits<int64_t>::max)();
39473947
used = 1;
39483948
}
3949+
template <auto Property> constexpr void populate(ctre::binary_property<Property>) {
3950+
points[0].low = (std::numeric_limits<int64_t>::min)();
3951+
points[0].high = (std::numeric_limits<int64_t>::max)();
3952+
used = 1;
3953+
}
3954+
template <auto Property, auto Value> constexpr void populate(ctre::property<Property, Value>) {
3955+
points[0].low = (std::numeric_limits<int64_t>::min)();
3956+
points[0].high = (std::numeric_limits<int64_t>::max)();
3957+
used = 1;
3958+
}
39493959
template <typename... Content> constexpr void populate(ctre::negative_set<Content...> nset) {
39503960
negative_helper(nset, [&](int64_t low, int64_t high){
39513961
this->insert(low, high);

single-header/ctre.hpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3943,6 +3943,16 @@ template <size_t Capacity> class point_set {
39433943
points[0].high = (std::numeric_limits<int64_t>::max)();
39443944
used = 1;
39453945
}
3946+
template <auto Property> constexpr void populate(ctre::binary_property<Property>) {
3947+
points[0].low = (std::numeric_limits<int64_t>::min)();
3948+
points[0].high = (std::numeric_limits<int64_t>::max)();
3949+
used = 1;
3950+
}
3951+
template <auto Property, auto Value> constexpr void populate(ctre::property<Property, Value>) {
3952+
points[0].low = (std::numeric_limits<int64_t>::min)();
3953+
points[0].high = (std::numeric_limits<int64_t>::max)();
3954+
used = 1;
3955+
}
39463956
template <typename... Content> constexpr void populate(ctre::negative_set<Content...> nset) {
39473957
negative_helper(nset, [&](int64_t low, int64_t high){
39483958
this->insert(low, high);

tests/_unicode.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ static_assert(CTRE_CREATE(U"\\u20AC").match(U"€"));
5959
// UTS #18 Level 1: RL1.2: Properties
6060
// TODO only \p and \P is not supported
6161
static_assert(CTRE_SYNTAX(U"\\p{L}"));
62+
static_assert(CTRE_CREATE(U"[\\p{L}]").match("A"));
63+
static_assert(CTRE_CREATE(U"[\\p{L}]+").match("ABC"));
6264
static_assert(CTRE_SYNTAX(U"\\p{Letter}"));
6365
static_assert(CTRE_CREATE(U"\\P{Letter}").match(U"1"));
6466
static_assert(CTRE_CREATE(U"\\P{latin}").match(U"Є"));

0 commit comments

Comments
 (0)