|
31 | 31 |
|
32 | 32 | namespace realm { |
33 | 33 |
|
34 | | -// Quick hack to make "Queries with Integer null columns" able to compile in Visual Studio 2015 which doesn't full |
35 | | -// support sfinae |
36 | | -// (real cause hasn't been investigated yet, cannot exclude that we don't obey c++11 standard) |
37 | | -struct HackClass { |
38 | | - template <class A, class B, class C> |
39 | | - bool can_match(A, B, C) |
40 | | - { |
41 | | - REALM_ASSERT(false); |
42 | | - return false; |
43 | | - } |
44 | | - template <class A, class B, class C> |
45 | | - bool will_match(A, B, C) |
46 | | - { |
47 | | - REALM_ASSERT(false); |
48 | | - return false; |
49 | | - } |
50 | | -}; |
51 | | - |
52 | 34 | // Does v2 contain v1? |
53 | | -struct Contains : public HackClass { |
| 35 | +struct Contains { |
54 | 36 | bool operator()(StringData v1, const char*, const char*, StringData v2, bool = false, bool = false) const |
55 | 37 | { |
56 | 38 | return v2.contains(v1); |
@@ -108,7 +90,7 @@ struct Contains : public HackClass { |
108 | 90 | }; |
109 | 91 |
|
110 | 92 | // Does v2 contain something like v1 (wildcard matching)? |
111 | | -struct Like : public HackClass { |
| 93 | +struct Like { |
112 | 94 | bool operator()(StringData v1, const char*, const char*, StringData v2, bool = false, bool = false) const |
113 | 95 | { |
114 | 96 | return v2.like(v1); |
@@ -172,7 +154,7 @@ struct Like : public HackClass { |
172 | 154 | }; |
173 | 155 |
|
174 | 156 | // Does v2 begin with v1? |
175 | | -struct BeginsWith : public HackClass { |
| 157 | +struct BeginsWith { |
176 | 158 | bool operator()(StringData v1, const char*, const char*, StringData v2, bool = false, bool = false) const |
177 | 159 | { |
178 | 160 | return v2.begins_with(v1); |
@@ -223,7 +205,7 @@ struct BeginsWith : public HackClass { |
223 | 205 | }; |
224 | 206 |
|
225 | 207 | // Does v2 end with v1? |
226 | | -struct EndsWith : public HackClass { |
| 208 | +struct EndsWith { |
227 | 209 | bool operator()(StringData v1, const char*, const char*, StringData v2, bool = false, bool = false) const |
228 | 210 | { |
229 | 211 | return v2.ends_with(v1); |
@@ -363,7 +345,7 @@ struct NotEqual { |
363 | 345 | }; |
364 | 346 |
|
365 | 347 | // Does v2 contain v1? |
366 | | -struct ContainsIns : public HackClass { |
| 348 | +struct ContainsIns { |
367 | 349 | bool operator()(StringData v1, const char* v1_upper, const char* v1_lower, StringData v2, bool = false, |
368 | 350 | bool = false) const |
369 | 351 | { |
@@ -449,7 +431,7 @@ struct ContainsIns : public HackClass { |
449 | 431 | }; |
450 | 432 |
|
451 | 433 | // Does v2 contain something like v1 (wildcard matching)? |
452 | | -struct LikeIns : public HackClass { |
| 434 | +struct LikeIns { |
453 | 435 | bool operator()(StringData v1, const char* v1_upper, const char* v1_lower, StringData v2, bool = false, |
454 | 436 | bool = false) const |
455 | 437 | { |
@@ -534,7 +516,7 @@ struct LikeIns : public HackClass { |
534 | 516 | }; |
535 | 517 |
|
536 | 518 | // Does v2 begin with v1? |
537 | | -struct BeginsWithIns : public HackClass { |
| 519 | +struct BeginsWithIns { |
538 | 520 | bool operator()(StringData v1, const char* v1_upper, const char* v1_lower, StringData v2, bool = false, |
539 | 521 | bool = false) const |
540 | 522 | { |
@@ -600,7 +582,7 @@ struct BeginsWithIns : public HackClass { |
600 | 582 | }; |
601 | 583 |
|
602 | 584 | // Does v2 end with v1? |
603 | | -struct EndsWithIns : public HackClass { |
| 585 | +struct EndsWithIns { |
604 | 586 | bool operator()(StringData v1, const char* v1_upper, const char* v1_lower, StringData v2, bool = false, |
605 | 587 | bool = false) const |
606 | 588 | { |
@@ -666,7 +648,7 @@ struct EndsWithIns : public HackClass { |
666 | 648 | static const int condition = -1; |
667 | 649 | }; |
668 | 650 |
|
669 | | -struct EqualIns : public HackClass { |
| 651 | +struct EqualIns { |
670 | 652 | bool operator()(StringData v1, const char* v1_upper, const char* v1_lower, StringData v2, bool = false, |
671 | 653 | bool = false) const |
672 | 654 | { |
@@ -738,7 +720,7 @@ struct EqualIns : public HackClass { |
738 | 720 | static const int condition = -1; |
739 | 721 | }; |
740 | 722 |
|
741 | | -struct NotEqualIns : public HackClass { |
| 723 | +struct NotEqualIns { |
742 | 724 | bool operator()(StringData v1, const char* v1_upper, const char* v1_lower, StringData v2, bool = false, |
743 | 725 | bool = false) const |
744 | 726 | { |
@@ -944,7 +926,7 @@ struct Less { |
944 | 926 | } |
945 | 927 | }; |
946 | 928 |
|
947 | | -struct LessEqual : public HackClass { |
| 929 | +struct LessEqual { |
948 | 930 | static const int avx = 0x12; // _CMP_LE_OQ |
949 | 931 | template <class T> |
950 | 932 | bool operator()(const T& v1, const T& v2, bool v1null = false, bool v2null = false) const |
@@ -984,7 +966,7 @@ struct LessEqual : public HackClass { |
984 | 966 | static const int condition = -1; |
985 | 967 | }; |
986 | 968 |
|
987 | | -struct GreaterEqual : public HackClass { |
| 969 | +struct GreaterEqual { |
988 | 970 | static const int avx = 0x1D; // _CMP_GE_OQ |
989 | 971 | template <class T> |
990 | 972 | bool operator()(const T& v1, const T& v2, bool v1null = false, bool v2null = false) const |
|
0 commit comments