mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 17:35:34 +08:00
refs #290 added some new predicates and transform functions to use in combination with the iterator adaptors.
This required refactoring index_sequence out of tuple_private.h so it could be used by the predicates.
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#ifndef BLACKMISC_TUPLE_PRIVATE_H
|
||||
#define BLACKMISC_TUPLE_PRIVATE_H
|
||||
|
||||
#include "index_sequence.h"
|
||||
#include <QtGlobal>
|
||||
#include <QDBusArgument>
|
||||
#include <QHash>
|
||||
@@ -55,26 +56,6 @@ namespace BlackMisc
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Our own implementation of std::index_sequence (because not implemented by MSVC2013)
|
||||
template <size_t... Is>
|
||||
struct index_sequence
|
||||
{
|
||||
static const size_t size = sizeof...(Is);
|
||||
typedef std::tuple<std::integral_constant<size_t, Is>...> tuple_type;
|
||||
};
|
||||
template <size_t I, size_t C, size_t... Is>
|
||||
struct GenSequence
|
||||
{
|
||||
typedef typename GenSequence<I + 1, C, Is..., I>::type type;
|
||||
};
|
||||
template <size_t C, size_t... Is>
|
||||
struct GenSequence<C, C, Is...>
|
||||
{
|
||||
typedef index_sequence<Is...> type;
|
||||
};
|
||||
template <size_t C>
|
||||
using make_index_sequence = typename GenSequence<0, C>::type;
|
||||
|
||||
// Create an index_sequence containing indices which match a given predicate.
|
||||
template <class P, size_t I, size_t C, bool B = false, size_t I2 = 0xDeadBeef, size_t... Is>
|
||||
struct GenSequenceOnPredicate;
|
||||
|
||||
Reference in New Issue
Block a user