| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////// |
|
2
|
|
|
|
|
|
|
// |
|
3
|
|
|
|
|
|
|
// (C) Copyright Ion Gaztanaga 2008-2013. Distributed under the Boost |
|
4
|
|
|
|
|
|
|
// Software License, Version 1.0. (See accompanying file |
|
5
|
|
|
|
|
|
|
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
|
6
|
|
|
|
|
|
|
// |
|
7
|
|
|
|
|
|
|
// See http://www.boost.org/libs/container for documentation. |
|
8
|
|
|
|
|
|
|
// |
|
9
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////// |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
#ifndef BOOST_CONTAINER_DETAIL_VARIADIC_TEMPLATES_TOOLS_HPP |
|
12
|
|
|
|
|
|
|
#define BOOST_CONTAINER_DETAIL_VARIADIC_TEMPLATES_TOOLS_HPP |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
#ifndef BOOST_CONFIG_HPP |
|
15
|
|
|
|
|
|
|
# include |
|
16
|
|
|
|
|
|
|
#endif |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
#if defined(BOOST_HAS_PRAGMA_ONCE) |
|
19
|
|
|
|
|
|
|
# pragma once |
|
20
|
|
|
|
|
|
|
#endif |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
#include |
|
23
|
|
|
|
|
|
|
#include |
|
24
|
|
|
|
|
|
|
#include |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
#include |
|
27
|
|
|
|
|
|
|
#include //std::size_t |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
namespace boost { |
|
30
|
|
|
|
|
|
|
namespace container { |
|
31
|
|
|
|
|
|
|
namespace dtl { |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
template |
|
34
|
|
|
|
|
|
|
class tuple; |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
template<> class tuple<> |
|
37
|
|
|
|
|
|
|
{}; |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
template |
|
40
|
|
|
|
|
|
|
class tuple |
|
41
|
|
|
|
|
|
|
: private tuple |
|
42
|
|
|
|
|
|
|
{ |
|
43
|
|
|
|
|
|
|
typedef tuple inherited; |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
public: |
|
46
|
|
|
|
|
|
|
tuple() |
|
47
|
|
|
|
|
|
|
: inherited(), m_head() |
|
48
|
|
|
|
|
|
|
{} |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
template |
|
51
|
0
|
|
|
|
|
|
tuple(U &&u, Args && ...args) |
|
52
|
0
|
|
|
|
|
|
: inherited(::boost::forward(args)...), m_head(::boost::forward(u)) |
|
53
|
0
|
|
|
|
|
|
{} |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
// Construct tuple from another tuple. |
|
56
|
|
|
|
|
|
|
template |
|
57
|
|
|
|
|
|
|
tuple(const tuple& other) |
|
58
|
|
|
|
|
|
|
: inherited(other.tail()), m_head(other.head()) |
|
59
|
|
|
|
|
|
|
{} |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
template |
|
62
|
|
|
|
|
|
|
tuple& operator=(const tuple& other) |
|
63
|
|
|
|
|
|
|
{ |
|
64
|
|
|
|
|
|
|
m_head = other.head(); |
|
65
|
|
|
|
|
|
|
tail() = other.tail(); |
|
66
|
|
|
|
|
|
|
return this; |
|
67
|
|
|
|
|
|
|
} |
|
68
|
|
|
|
|
|
|
|
|
69
|
0
|
|
|
|
|
|
typename add_reference::type head() { return m_head; } |
|
70
|
|
|
|
|
|
|
typename add_reference::type head() const { return m_head; } |
|
71
|
|
|
|
|
|
|
|
|
72
|
0
|
|
|
|
|
|
inherited& tail() { return *this; } |
|
73
|
|
|
|
|
|
|
const inherited& tail() const { return *this; } |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
protected: |
|
76
|
|
|
|
|
|
|
Head m_head; |
|
77
|
|
|
|
|
|
|
}; |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
template |
|
81
|
|
|
|
|
|
|
tuple forward_as_tuple_impl(Values&&... values) |
|
82
|
|
|
|
|
|
|
{ return tuple(::boost::forward(values)...); } |
|
83
|
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
template |
|
85
|
|
|
|
|
|
|
struct tuple_element; |
|
86
|
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
template |
|
88
|
|
|
|
|
|
|
struct tuple_element > |
|
89
|
|
|
|
|
|
|
{ |
|
90
|
|
|
|
|
|
|
typedef typename tuple_element >::type type; |
|
91
|
|
|
|
|
|
|
}; |
|
92
|
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
template |
|
94
|
|
|
|
|
|
|
struct tuple_element<0, tuple > |
|
95
|
|
|
|
|
|
|
{ |
|
96
|
|
|
|
|
|
|
typedef Head type; |
|
97
|
|
|
|
|
|
|
}; |
|
98
|
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
template |
|
100
|
|
|
|
|
|
|
class get_impl; |
|
101
|
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
template |
|
103
|
|
|
|
|
|
|
class get_impl > |
|
104
|
|
|
|
|
|
|
{ |
|
105
|
|
|
|
|
|
|
typedef typename tuple_element >::type Element; |
|
106
|
|
|
|
|
|
|
typedef get_impl > Next; |
|
107
|
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
public: |
|
109
|
|
|
|
|
|
|
typedef typename add_reference::type type; |
|
110
|
|
|
|
|
|
|
typedef typename add_const_reference::type const_type; |
|
111
|
0
|
|
|
|
|
|
static type get(tuple& t) { return Next::get(t.tail()); } |
|
112
|
|
|
|
|
|
|
static const_type get(const tuple& t) { return Next::get(t.tail()); } |
|
113
|
|
|
|
|
|
|
}; |
|
114
|
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
template |
|
116
|
|
|
|
|
|
|
class get_impl<0, tuple > |
|
117
|
|
|
|
|
|
|
{ |
|
118
|
|
|
|
|
|
|
public: |
|
119
|
|
|
|
|
|
|
typedef typename add_reference::type type; |
|
120
|
|
|
|
|
|
|
typedef typename add_const_reference::type const_type; |
|
121
|
0
|
|
|
|
|
|
static type get(tuple& t) { return t.head(); } |
|
122
|
|
|
|
|
|
|
static const_type get(const tuple& t){ return t.head(); } |
|
123
|
|
|
|
|
|
|
}; |
|
124
|
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
template |
|
126
|
0
|
|
|
|
|
|
typename get_impl >::type get(tuple& t) |
|
127
|
0
|
|
|
|
|
|
{ return get_impl >::get(t); } |
|
128
|
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
template |
|
130
|
|
|
|
|
|
|
typename get_impl >::const_type get(const tuple& t) |
|
131
|
|
|
|
|
|
|
{ return get_impl >::get(t); } |
|
132
|
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
//////////////////////////////////////////////////// |
|
134
|
|
|
|
|
|
|
// Builds an index_tuple<0, 1, 2, ..., Num-1>, that will |
|
135
|
|
|
|
|
|
|
// be used to "unpack" into comma-separated values |
|
136
|
|
|
|
|
|
|
// in a function call. |
|
137
|
|
|
|
|
|
|
//////////////////////////////////////////////////// |
|
138
|
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
template struct index_tuple{ typedef index_tuple type; }; |
|
140
|
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
template struct concat_index_tuple; |
|
142
|
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
template |
|
144
|
|
|
|
|
|
|
struct concat_index_tuple, index_tuple> |
|
145
|
|
|
|
|
|
|
: index_tuple{}; |
|
146
|
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
template struct build_number_seq; |
|
148
|
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
template |
|
150
|
|
|
|
|
|
|
struct build_number_seq |
|
151
|
|
|
|
|
|
|
: concat_index_tuple::type |
|
152
|
|
|
|
|
|
|
,typename build_number_seq::type |
|
153
|
|
|
|
|
|
|
>::type |
|
154
|
|
|
|
|
|
|
{}; |
|
155
|
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
template<> struct build_number_seq<0> : index_tuple<>{}; |
|
157
|
|
|
|
|
|
|
template<> struct build_number_seq<1> : index_tuple<0>{}; |
|
158
|
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
}}} //namespace boost { namespace container { namespace dtl { |
|
160
|
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
#include |
|
162
|
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
#endif //#ifndef BOOST_CONTAINER_DETAIL_VARIADIC_TEMPLATES_TOOLS_HPP |