//===--- Pack.h - Helpers for wording with class template packs -*- C++ -*-===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // //===----------------------------------------------------------------------===// #ifndef SWIFT_BASIC_PACKS_H #define SWIFT_BASIC_PACKS_H namespace swift { namespace packs { /// A pack of types. template struct Pack; /// A trait indicating whether the given type is a specialization /// of Pack<...>. template struct IsPack { static constexpr bool value = false; }; template struct IsPack> { static constexpr bool value = true; }; /// Transform a variadic list of types using the given transform, a class /// template which is expected to define a `result` type providing the /// result of the transform. /// /// template /// class Transform { /// using result = ...; /// }; /// /// In principle, this would be cleaner as a member template, but that /// works out poorly because in practice the member template must be /// partially specialized in order to destructure it. template