[NFC] Introduce a little generators library

This commit is contained in:
John McCall
2023-03-20 19:55:12 -04:00
parent a05fef5122
commit 0cfbe8c84e
2 changed files with 139 additions and 0 deletions

View File

@@ -167,6 +167,17 @@ template<typename Orig, typename Projected>
using CastArrayRefView =
ArrayRefView<Orig, Projected *, arrayRefViewCastHelper<Projected, Orig>>;
namespace generator_details {
template <class T> struct is_array_ref_like;
template <class Orig, class Projected, Projected (&Project)(const Orig &),
bool AllowOrigAccess>
struct is_array_ref_like<ArrayRefView<Orig, Projected, Project,
AllowOrigAccess>> {
enum { value = true };
};
}
} // end namespace swift
#endif // SWIFT_BASIC_ARRAYREFVIEW_H