@@ -117,8 +117,16 @@ namespace sqlite_reflection {
117117 {
118118 public:
119119 template <typename T, typename R>
120- Equal (R T::* fn, R value)
120+ explicit Equal (R T::* fn, R value)
121121 : QueryPredicate(fn, value, " =" ) {}
122+
123+ template <typename T>
124+ explicit Equal (int64_t T::* fn, int value)
125+ : Equal(fn, (int64_t )value) {}
126+
127+ template <typename T>
128+ explicit Equal (std::wstring T::* fn, const wchar_t * value)
129+ : Equal(fn, std::wstring(value)) {}
122130 };
123131
124132 // / A wrapper for an inequality predicate, for which the value of the
@@ -127,8 +135,16 @@ namespace sqlite_reflection {
127135 {
128136 public:
129137 template <typename T, typename R>
130- Unequal (R T::* fn, R value)
138+ explicit Unequal (R T::* fn, R value)
131139 : QueryPredicate(fn, value, " !=" ) {}
140+
141+ template <typename T>
142+ explicit Unequal (int64_t T::* fn, int value)
143+ : Unequal(fn, (int64_t )value) {}
144+
145+ template <typename T>
146+ explicit Unequal (std::wstring T::* fn, const wchar_t * value)
147+ : Unequal(fn, std::wstring(value)) {}
132148 };
133149
134150 // / A wrapper for a similarity predicate, for which the value of the
@@ -137,10 +153,18 @@ namespace sqlite_reflection {
137153 {
138154 public:
139155 template <typename T, typename R>
140- Like (R T::* fn, R value)
156+ explicit Like (R T::* fn, R value)
141157 : QueryPredicate(fn, value, " LIKE" , [&](void * v, SqliteStorageClass storage_class){
142158 return GetStringForValue (v, storage_class);
143159 }) {}
160+
161+ template <typename T>
162+ explicit Like (int64_t T::* fn, int value)
163+ : Like(fn, (int64_t )value) {}
164+
165+ template <typename T>
166+ explicit Like (std::wstring T::* fn, const wchar_t * value)
167+ : Like(fn, std::wstring(value)) {}
144168
145169 protected:
146170 std::string GetStringForValue (void * v, SqliteStorageClass storage_class) const override ;
@@ -153,11 +177,15 @@ namespace sqlite_reflection {
153177 {
154178 public:
155179 template <typename T>
156- GreaterThan (int64_t T::* fn, int64_t value)
180+ explicit GreaterThan (int64_t T::* fn, int64_t value)
157181 : QueryPredicate(fn, value, " >" ) {}
182+
183+ template <typename T>
184+ explicit GreaterThan (int64_t T::* fn, int value)
185+ : QueryPredicate(fn, (int64_t )value, ">") {}
158186
159187 template <typename T>
160- GreaterThan (double T::* fn, double value)
188+ explicit GreaterThan (double T::* fn, double value)
161189 : QueryPredicate(fn, value, " >" ) {}
162190 };
163191
@@ -167,11 +195,15 @@ namespace sqlite_reflection {
167195 {
168196 public:
169197 template <typename T>
170- GreaterThanOrEqual (int64_t T::* fn, int64_t value)
198+ explicit GreaterThanOrEqual (int64_t T::* fn, int64_t value)
171199 : QueryPredicate(fn, value, " >=" ) {}
200+
201+ template <typename T>
202+ explicit GreaterThanOrEqual (int64_t T::* fn, int value)
203+ : QueryPredicate(fn, (int64_t )value, ">=") {}
172204
173205 template <typename T>
174- GreaterThanOrEqual (double T::* fn, double value)
206+ explicit GreaterThanOrEqual (double T::* fn, double value)
175207 : QueryPredicate(fn, value, " >=" ) {}
176208 };
177209
@@ -181,11 +213,15 @@ namespace sqlite_reflection {
181213 {
182214 public:
183215 template <typename T>
184- SmallerThan (int64_t T::* fn, int64_t value)
216+ explicit SmallerThan (int64_t T::* fn, int64_t value)
185217 : QueryPredicate(fn, value, " <" ) {}
218+
219+ template <typename T>
220+ explicit SmallerThan (int64_t T::* fn, int value)
221+ : QueryPredicate(fn, (int64_t )value, "<") {}
186222
187223 template <typename T>
188- SmallerThan (double T::* fn, double value)
224+ explicit SmallerThan (double T::* fn, double value)
189225 : QueryPredicate(fn, value, " <" ) {}
190226 };
191227
@@ -195,11 +231,15 @@ namespace sqlite_reflection {
195231 {
196232 public:
197233 template <typename T>
198- SmallerThanOrEqual (int64_t T::* fn, int64_t value)
234+ explicit SmallerThanOrEqual (int64_t T::* fn, int64_t value)
199235 : QueryPredicate(fn, value, " <=" ) {}
236+
237+ template <typename T>
238+ explicit SmallerThanOrEqual (int64_t T::* fn, int value)
239+ : QueryPredicate(fn, (int64_t )value, "<=") {}
200240
201241 template <typename T>
202- SmallerThanOrEqual (double T::* fn, double value)
242+ explicit SmallerThanOrEqual (double T::* fn, double value)
203243 : QueryPredicate(fn, value, " <=" ) {}
204244 };
205245
0 commit comments