Implement LWG issue 2275 'forward_as_tuple should be constexpr'

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192038 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Marshall Clow
2013-10-05 18:46:37 +00:00
parent 520dc52b4a
commit 1d927e38d1
2 changed files with 15 additions and 11 deletions

View File

@@ -51,6 +51,15 @@ test2a(const Tuple& t)
assert(std::get<1>(t) == 'a');
}
#if _LIBCPP_STD_VER > 11
template <class Tuple>
constexpr int
test3(const Tuple& t)
{
return std::tuple_size<Tuple>::value;
}
#endif
int main()
{
{
@@ -67,5 +76,8 @@ int main()
double i = 2.5;
char c = 'a';
test2a(std::forward_as_tuple(i, c));
#if _LIBCPP_STD_VER > 11
static_assert ( test3 (std::forward_as_tuple(i, c)) == 2, "" );
#endif
}
}