File tree 1 file changed +19
-1
lines changed
1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -146,6 +146,10 @@ class ArrayRefGenerator {
146
146
}
147
147
};
148
148
149
+ namespace generator_details {
150
+ template <class T > struct is_simple_generator_ref ;
151
+ }
152
+
149
153
// / An abstracting reference to an existing generator.
150
154
// /
151
155
// / The implementation of this type holds the reference to the existing
@@ -182,7 +186,8 @@ class SimpleGeneratorRef {
182
186
constexpr SimpleGeneratorRef () : vtable(nullptr ), pointer(nullptr ) {}
183
187
184
188
template <class G >
185
- constexpr SimpleGeneratorRef (G &generator)
189
+ constexpr SimpleGeneratorRef (G &generator,
190
+ typename std::enable_if<!generator_details::is_simple_generator_ref<G>::value, bool >::type = false )
186
191
: vtable(&VTableImpl<G>::vtable), pointer(&generator) {}
187
192
188
193
// / Test whether this generator ref was initialized with a
@@ -212,6 +217,19 @@ class SimpleGeneratorRef {
212
217
}
213
218
};
214
219
220
+ namespace generator_details {
221
+
222
+ template <class T >
223
+ struct is_simple_generator_ref <SimpleGeneratorRef<T>> {
224
+ static constexpr bool value = true ;
225
+ };
226
+ template <class T >
227
+ struct is_simple_generator_ref {
228
+ static constexpr bool value = false ;
229
+ };
230
+
231
+ }
232
+
215
233
} // end namespace swift
216
234
217
235
#endif
You can’t perform that action at this time.
0 commit comments