Implement LWG issue 2301: Mark std::tie as constexpr

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@202158 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Marshall Clow
2014-02-25 16:11:46 +00:00
parent 4ffb67eca5
commit 8e554d93da
3 changed files with 12 additions and 3 deletions

View File

@@ -27,4 +27,13 @@ int main()
assert(i == 42);
assert(s == "C++");
}
#if _LIBCPP_STD_VER > 11
{
static constexpr int i = 42;
static constexpr double f = 1.1;
constexpr std::tuple<const int &, const double &> t = std::tie(i, f);
static_assert ( std::get<0>(t) == 42, "" );
static_assert ( std::get<1>(t) == 1.1, "" );
}
#endif
}