/* Copyright (C) 2016 * swift Project Community / Contributors * * This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level * directory of this distribution. No part of swift project, including this file, may be copied, modified, propagated, * or distributed except according to the terms contained in the LICENSE file. */ //! \file #ifndef BLACKMISC_INTEGERSEQUENCE_H #define BLACKMISC_INTEGERSEQUENCE_H #include #include #include namespace BlackMisc { //! \cond PRIVATE namespace Private { // Remove elements from an index_sequence for which a pack parameter fails to satisfy a given predicate. template struct MaskSequenceImpl { using type = T; }; template struct MaskSequenceImpl, std::index_sequence, true, Mask...> { using type = typename MaskSequenceImpl, std::index_sequence, Mask...>::type; }; template struct MaskSequenceImpl, std::index_sequence, false, Mask...> { using type = typename MaskSequenceImpl, std::index_sequence, Mask...>::type; }; template using MaskSequence = typename MaskSequenceImpl, Mask...>::type; } // namespace Private //! \endcond } // namespace BlackMisc #endif // guard