<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - std::index_sequence_for<T...>::size() returns always 1"
href="http://llvm.org/bugs/show_bug.cgi?id=22328">22328</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>std::index_sequence_for<T...>::size() returns always 1
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>C++14
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>kikairoya+llvm@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre><a href="http://melpon.org/wandbox/permlink/QuELiPyJatHx3buq">http://melpon.org/wandbox/permlink/QuELiPyJatHx3buq</a>
index_sequence_for<T...>::size() should return sizeof...(T) but always 1.
make_index_sequence<sizeof...(T)>::size() works fine.
===============
#include <utility>
template <typename ...Ts>
struct X {
static constexpr std::size_t size1() {
return std::index_sequence_for<Ts...>::size();
}
static constexpr std::size_t size2() {
return std::make_index_sequence<sizeof...(Ts)>::size();
}
};
#include <iostream>
int main() {
const auto f = [](auto x) { std::cout << x.size1() << ',' << x.size2() <<
std::endl; };
f(X<>());
f(X<int>());
f(X<int, long>());
f(X<int, long, char>());
}
==============
1,0
1,1
1,2
1,3
==============</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>