Skip to content

Commit cce1c94

Browse files
author
Hana Dusíková
committed
MSVC is on it
1 parent a662f29 commit cce1c94

File tree

5 files changed

+39
-39
lines changed

5 files changed

+39
-39
lines changed

include/ctll/parser.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ template <typename Grammar, const auto & input, typename ActionSelector = empty_
7575
template <size_t Pos> static constexpr auto get_current_term() noexcept {
7676
if constexpr (Pos < input.size()) {
7777
constexpr auto value = input[Pos];
78-
if constexpr (value <= static_cast<decltype(value)>(std::numeric_limits<char>::max())) {
78+
if constexpr (value <= static_cast<decltype(value)>((std::numeric_limits<char>::max)())) {
7979
return term<static_cast<char>(value)>{};
8080
} else {
8181
return term<value>{};
@@ -92,7 +92,7 @@ template <typename Grammar, const auto & input, typename ActionSelector = empty_
9292
return epsilon{};
9393
} else if constexpr ((Pos-1) < input.size()) {
9494
constexpr auto value = input[Pos-1];
95-
if constexpr (value <= static_cast<decltype(value)>(std::numeric_limits<char>::max())) {
95+
if constexpr (value <= static_cast<decltype(value)>((std::numeric_limits<char>::max)())) {
9696
return term<static_cast<char>(value)>{};
9797
} else {
9898
return term<value>{};

include/ctre/actions/hexdec.inc.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ template <auto V, size_t N, typename... Ts, typename Parameters> static constexp
1818
}
1919
// hexdec character support (convert to character)
2020
template <auto V, size_t N, typename... Ts, typename Parameters> static constexpr auto apply(pcre::finish_hexdec, ctll::term<V>, pcre_context<ctll::list<number<N>, Ts...>, Parameters> subject) {
21-
constexpr size_t max_char = std::numeric_limits<char>::max();
21+
constexpr size_t max_char = (std::numeric_limits<char>::max)();
2222
if constexpr (N <= max_char) {
2323
return pcre_context{ctll::push_front(character<char{N}>(), ctll::list<Ts...>()), subject.parameters};
2424
} else {

include/ctre/first.hpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -304,25 +304,25 @@ template <typename... Content> constexpr size_t calculate_size_of_first(ctre::se
304304
}
305305

306306
template <auto A, typename CB> constexpr int64_t negative_helper(ctre::character<A>, CB & cb, int64_t start) {
307-
if (A != std::numeric_limits<int64_t>::min()) {
307+
if (A != (std::numeric_limits<int64_t>::min)()) {
308308
if (start < A) {
309309
cb(start, A-1);
310310
}
311311
}
312-
if (A != std::numeric_limits<int64_t>::max()) {
312+
if (A != (std::numeric_limits<int64_t>::max)()) {
313313
return A+1;
314314
} else {
315315
return A;
316316
}
317317
}
318318

319319
template <auto A, auto B, typename CB> constexpr int64_t negative_helper(ctre::char_range<A,B>, CB & cb, int64_t start) {
320-
if (A != std::numeric_limits<int64_t>::min()) {
320+
if (A != (std::numeric_limits<int64_t>::min)()) {
321321
if (start < A) {
322322
cb(start, A-1);
323323
}
324324
}
325-
if (B != std::numeric_limits<int64_t>::max()) {
325+
if (B != (std::numeric_limits<int64_t>::max)()) {
326326
return B+1;
327327
} else {
328328
return B;
@@ -357,14 +357,14 @@ template <typename Head, typename... Rest, typename CB> constexpr int64_t negati
357357
return negative_helper(ctre::set<Rest...>{}, cb, start);
358358
}
359359

360-
template <typename Head, typename... Rest, typename CB> constexpr void negative_helper(ctre::negative_set<Head, Rest...>, CB && cb, int64_t start = std::numeric_limits<int64_t>::min()) {
360+
template <typename Head, typename... Rest, typename CB> constexpr void negative_helper(ctre::negative_set<Head, Rest...>, CB && cb, int64_t start = (std::numeric_limits<int64_t>::min)()) {
361361
start = negative_helper(Head{}, cb, start);
362362
negative_helper(ctre::negative_set<Rest...>{}, std::forward<CB>(cb), start);
363363
}
364364

365-
template <typename CB> constexpr void negative_helper(ctre::negative_set<>, CB && cb, int64_t start = std::numeric_limits<int64_t>::min()) {
366-
if (start < std::numeric_limits<int64_t>::max()) {
367-
cb(start, std::numeric_limits<int64_t>::max());
365+
template <typename CB> constexpr void negative_helper(ctre::negative_set<>, CB && cb, int64_t start = (std::numeric_limits<int64_t>::min)()) {
366+
if (start < (std::numeric_limits<int64_t>::max)()) {
367+
cb(start, (std::numeric_limits<int64_t>::max)());
368368
}
369369
}
370370

@@ -495,8 +495,8 @@ template <size_t Capacity> class point_set {
495495
insert(A,B);
496496
}
497497
constexpr void populate(can_be_anything) {
498-
points[0].low = std::numeric_limits<int64_t>::min();
499-
points[0].high = std::numeric_limits<int64_t>::max();
498+
points[0].low = (std::numeric_limits<int64_t>::min)();
499+
points[0].high = (std::numeric_limits<int64_t>::max)();
500500
used = 1;
501501
}
502502
template <typename... Content> constexpr void populate(ctre::negative_set<Content...> nset) {

single-header/ctre-unicode.hpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ template <typename Grammar, const auto & input, typename ActionSelector = empty_
787787
template <size_t Pos> static constexpr auto get_current_term() noexcept {
788788
if constexpr (Pos < input.size()) {
789789
constexpr auto value = input[Pos];
790-
if constexpr (value <= static_cast<decltype(value)>(std::numeric_limits<char>::max())) {
790+
if constexpr (value <= static_cast<decltype(value)>((std::numeric_limits<char>::max)())) {
791791
return term<static_cast<char>(value)>{};
792792
} else {
793793
return term<value>{};
@@ -804,7 +804,7 @@ template <typename Grammar, const auto & input, typename ActionSelector = empty_
804804
return epsilon{};
805805
} else if constexpr ((Pos-1) < input.size()) {
806806
constexpr auto value = input[Pos-1];
807-
if constexpr (value <= static_cast<decltype(value)>(std::numeric_limits<char>::max())) {
807+
if constexpr (value <= static_cast<decltype(value)>((std::numeric_limits<char>::max)())) {
808808
return term<static_cast<char>(value)>{};
809809
} else {
810810
return term<value>{};
@@ -2167,7 +2167,7 @@ template <auto V, size_t N, typename... Ts, typename Parameters> static constexp
21672167
}
21682168
// hexdec character support (convert to character)
21692169
template <auto V, size_t N, typename... Ts, typename Parameters> static constexpr auto apply(pcre::finish_hexdec, ctll::term<V>, pcre_context<ctll::list<number<N>, Ts...>, Parameters> subject) {
2170-
constexpr size_t max_char = std::numeric_limits<char>::max();
2170+
constexpr size_t max_char = (std::numeric_limits<char>::max)();
21712171
if constexpr (N <= max_char) {
21722172
return pcre_context{ctll::push_front(character<char{N}>(), ctll::list<Ts...>()), subject.parameters};
21732173
} else {
@@ -3742,25 +3742,25 @@ template <typename... Content> constexpr size_t calculate_size_of_first(ctre::se
37423742
}
37433743

37443744
template <auto A, typename CB> constexpr int64_t negative_helper(ctre::character<A>, CB & cb, int64_t start) {
3745-
if (A != std::numeric_limits<int64_t>::min()) {
3745+
if (A != (std::numeric_limits<int64_t>::min)()) {
37463746
if (start < A) {
37473747
cb(start, A-1);
37483748
}
37493749
}
3750-
if (A != std::numeric_limits<int64_t>::max()) {
3750+
if (A != (std::numeric_limits<int64_t>::max)()) {
37513751
return A+1;
37523752
} else {
37533753
return A;
37543754
}
37553755
}
37563756

37573757
template <auto A, auto B, typename CB> constexpr int64_t negative_helper(ctre::char_range<A,B>, CB & cb, int64_t start) {
3758-
if (A != std::numeric_limits<int64_t>::min()) {
3758+
if (A != (std::numeric_limits<int64_t>::min)()) {
37593759
if (start < A) {
37603760
cb(start, A-1);
37613761
}
37623762
}
3763-
if (B != std::numeric_limits<int64_t>::max()) {
3763+
if (B != (std::numeric_limits<int64_t>::max)()) {
37643764
return B+1;
37653765
} else {
37663766
return B;
@@ -3795,14 +3795,14 @@ template <typename Head, typename... Rest, typename CB> constexpr int64_t negati
37953795
return negative_helper(ctre::set<Rest...>{}, cb, start);
37963796
}
37973797

3798-
template <typename Head, typename... Rest, typename CB> constexpr void negative_helper(ctre::negative_set<Head, Rest...>, CB && cb, int64_t start = std::numeric_limits<int64_t>::min()) {
3798+
template <typename Head, typename... Rest, typename CB> constexpr void negative_helper(ctre::negative_set<Head, Rest...>, CB && cb, int64_t start = (std::numeric_limits<int64_t>::min)()) {
37993799
start = negative_helper(Head{}, cb, start);
38003800
negative_helper(ctre::negative_set<Rest...>{}, std::forward<CB>(cb), start);
38013801
}
38023802

3803-
template <typename CB> constexpr void negative_helper(ctre::negative_set<>, CB && cb, int64_t start = std::numeric_limits<int64_t>::min()) {
3804-
if (start < std::numeric_limits<int64_t>::max()) {
3805-
cb(start, std::numeric_limits<int64_t>::max());
3803+
template <typename CB> constexpr void negative_helper(ctre::negative_set<>, CB && cb, int64_t start = (std::numeric_limits<int64_t>::min)()) {
3804+
if (start < (std::numeric_limits<int64_t>::max)()) {
3805+
cb(start, (std::numeric_limits<int64_t>::max)());
38063806
}
38073807
}
38083808

@@ -3933,8 +3933,8 @@ template <size_t Capacity> class point_set {
39333933
insert(A,B);
39343934
}
39353935
constexpr void populate(can_be_anything) {
3936-
points[0].low = std::numeric_limits<int64_t>::min();
3937-
points[0].high = std::numeric_limits<int64_t>::max();
3936+
points[0].low = (std::numeric_limits<int64_t>::min)();
3937+
points[0].high = (std::numeric_limits<int64_t>::max)();
39383938
used = 1;
39393939
}
39403940
template <typename... Content> constexpr void populate(ctre::negative_set<Content...> nset) {

single-header/ctre.hpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ template <typename Grammar, const auto & input, typename ActionSelector = empty_
784784
template <size_t Pos> static constexpr auto get_current_term() noexcept {
785785
if constexpr (Pos < input.size()) {
786786
constexpr auto value = input[Pos];
787-
if constexpr (value <= static_cast<decltype(value)>(std::numeric_limits<char>::max())) {
787+
if constexpr (value <= static_cast<decltype(value)>((std::numeric_limits<char>::max)())) {
788788
return term<static_cast<char>(value)>{};
789789
} else {
790790
return term<value>{};
@@ -801,7 +801,7 @@ template <typename Grammar, const auto & input, typename ActionSelector = empty_
801801
return epsilon{};
802802
} else if constexpr ((Pos-1) < input.size()) {
803803
constexpr auto value = input[Pos-1];
804-
if constexpr (value <= static_cast<decltype(value)>(std::numeric_limits<char>::max())) {
804+
if constexpr (value <= static_cast<decltype(value)>((std::numeric_limits<char>::max)())) {
805805
return term<static_cast<char>(value)>{};
806806
} else {
807807
return term<value>{};
@@ -2164,7 +2164,7 @@ template <auto V, size_t N, typename... Ts, typename Parameters> static constexp
21642164
}
21652165
// hexdec character support (convert to character)
21662166
template <auto V, size_t N, typename... Ts, typename Parameters> static constexpr auto apply(pcre::finish_hexdec, ctll::term<V>, pcre_context<ctll::list<number<N>, Ts...>, Parameters> subject) {
2167-
constexpr size_t max_char = std::numeric_limits<char>::max();
2167+
constexpr size_t max_char = (std::numeric_limits<char>::max)();
21682168
if constexpr (N <= max_char) {
21692169
return pcre_context{ctll::push_front(character<char{N}>(), ctll::list<Ts...>()), subject.parameters};
21702170
} else {
@@ -3739,25 +3739,25 @@ template <typename... Content> constexpr size_t calculate_size_of_first(ctre::se
37393739
}
37403740

37413741
template <auto A, typename CB> constexpr int64_t negative_helper(ctre::character<A>, CB & cb, int64_t start) {
3742-
if (A != std::numeric_limits<int64_t>::min()) {
3742+
if (A != (std::numeric_limits<int64_t>::min)()) {
37433743
if (start < A) {
37443744
cb(start, A-1);
37453745
}
37463746
}
3747-
if (A != std::numeric_limits<int64_t>::max()) {
3747+
if (A != (std::numeric_limits<int64_t>::max)()) {
37483748
return A+1;
37493749
} else {
37503750
return A;
37513751
}
37523752
}
37533753

37543754
template <auto A, auto B, typename CB> constexpr int64_t negative_helper(ctre::char_range<A,B>, CB & cb, int64_t start) {
3755-
if (A != std::numeric_limits<int64_t>::min()) {
3755+
if (A != (std::numeric_limits<int64_t>::min)()) {
37563756
if (start < A) {
37573757
cb(start, A-1);
37583758
}
37593759
}
3760-
if (B != std::numeric_limits<int64_t>::max()) {
3760+
if (B != (std::numeric_limits<int64_t>::max)()) {
37613761
return B+1;
37623762
} else {
37633763
return B;
@@ -3792,14 +3792,14 @@ template <typename Head, typename... Rest, typename CB> constexpr int64_t negati
37923792
return negative_helper(ctre::set<Rest...>{}, cb, start);
37933793
}
37943794

3795-
template <typename Head, typename... Rest, typename CB> constexpr void negative_helper(ctre::negative_set<Head, Rest...>, CB && cb, int64_t start = std::numeric_limits<int64_t>::min()) {
3795+
template <typename Head, typename... Rest, typename CB> constexpr void negative_helper(ctre::negative_set<Head, Rest...>, CB && cb, int64_t start = (std::numeric_limits<int64_t>::min)()) {
37963796
start = negative_helper(Head{}, cb, start);
37973797
negative_helper(ctre::negative_set<Rest...>{}, std::forward<CB>(cb), start);
37983798
}
37993799

3800-
template <typename CB> constexpr void negative_helper(ctre::negative_set<>, CB && cb, int64_t start = std::numeric_limits<int64_t>::min()) {
3801-
if (start < std::numeric_limits<int64_t>::max()) {
3802-
cb(start, std::numeric_limits<int64_t>::max());
3800+
template <typename CB> constexpr void negative_helper(ctre::negative_set<>, CB && cb, int64_t start = (std::numeric_limits<int64_t>::min)()) {
3801+
if (start < (std::numeric_limits<int64_t>::max)()) {
3802+
cb(start, (std::numeric_limits<int64_t>::max)());
38033803
}
38043804
}
38053805

@@ -3930,8 +3930,8 @@ template <size_t Capacity> class point_set {
39303930
insert(A,B);
39313931
}
39323932
constexpr void populate(can_be_anything) {
3933-
points[0].low = std::numeric_limits<int64_t>::min();
3934-
points[0].high = std::numeric_limits<int64_t>::max();
3933+
points[0].low = (std::numeric_limits<int64_t>::min)();
3934+
points[0].high = (std::numeric_limits<int64_t>::max)();
39353935
used = 1;
39363936
}
39373937
template <typename... Content> constexpr void populate(ctre::negative_set<Content...> nset) {

0 commit comments

Comments
 (0)