LeechCraft 0.6.70-16373-g319c272718
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
intseq.h
Go to the documentation of this file.
1/**********************************************************************
2 * LeechCraft - modular cross-platform feature rich internet client.
3 * Copyright (C) 2006-2014 Georg Rudoy
4 *
5 * Distributed under the Boost Software License, Version 1.0.
6 * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7 **********************************************************************/
8
9#pragma once
10
11#include <utility>
12
13namespace LC
14{
15namespace Util
16{
17namespace IntSeq
18{
19 template<typename T, T... Fst, T... Snd>
20 std::integer_sequence<T, Fst..., Snd...>
21 ConcatImpl (std::integer_sequence<T, Fst...>, std::integer_sequence<T, Snd...>);
22
23 template<typename... Seqs>
24 struct ConcatS;
25
26 template<typename... Seqs>
27 using Concat = typename ConcatS<Seqs...>::Type_t;
28
29 template<typename Seq>
30 struct ConcatS<Seq>
31 {
32 using Type_t = Seq;
33 };
34
35 template<typename Seq1, typename Seq2, typename... Rest>
36 struct ConcatS<Seq1, Seq2, Rest...>
37 {
38 using Type_t = Concat<decltype (ConcatImpl (Seq1 {}, Seq2 {})), Rest...>;
39 };
40
41 template<typename T, T E, size_t C>
42 struct RepeatS
43 {
44 template<T... Is>
45 static auto RepeatImpl (std::integer_sequence<T, Is...>)
46 {
47 return std::integer_sequence<T, (static_cast<void> (Is), E)...> {};
48 }
49
50 using Type_t = decltype (RepeatImpl (std::make_integer_sequence<T, C> {}));
51 };
52
53 template<typename T, T E, size_t C>
55}
56}
57}
typename RepeatS< T, E, C >::Type_t Repeat
Definition intseq.h:54
typename ConcatS< Seqs... >::Type_t Concat
Definition intseq.h:27
std::integer_sequence< T, Fst..., Snd... > ConcatImpl(std::integer_sequence< T, Fst... >, std::integer_sequence< T, Snd... >)
constexpr auto Snd
Definition prelude.h:220
constexpr auto Fst
Definition prelude.h:218
Definition constants.h:15
Concat< decltype(ConcatImpl(Seq1 {}, Seq2 {})), Rest... > Type_t
Definition intseq.h:38
decltype(RepeatImpl(std::make_integer_sequence< T, C > {})) Type_t
Definition intseq.h:50
static auto RepeatImpl(std::integer_sequence< T, Is... >)
Definition intseq.h:45