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:
parent
4ffb67eca5
commit
8e554d93da
@ -74,7 +74,7 @@ const unspecified ignore;
|
|||||||
|
|
||||||
template <class... T> tuple<V...> make_tuple(T&&...); // constexpr in C++14
|
template <class... T> tuple<V...> make_tuple(T&&...); // constexpr in C++14
|
||||||
template <class... T> tuple<ATypes...> forward_as_tuple(T&&...) noexcept; // constexpr in C++14
|
template <class... T> tuple<ATypes...> forward_as_tuple(T&&...) noexcept; // constexpr in C++14
|
||||||
template <class... T> tuple<T&...> tie(T&...) noexcept;
|
template <class... T> tuple<T&...> tie(T&...) noexcept; // constexpr in C++14
|
||||||
template <class... Tuples> tuple<CTypes...> tuple_cat(Tuples&&... tpls); // constexpr in C++14
|
template <class... Tuples> tuple<CTypes...> tuple_cat(Tuples&&... tpls); // constexpr in C++14
|
||||||
|
|
||||||
// 20.4.1.4, tuple helper classes:
|
// 20.4.1.4, tuple helper classes:
|
||||||
@ -796,7 +796,7 @@ constexpr _T1&& get(tuple<_Args...>&& __tup) noexcept
|
|||||||
// tie
|
// tie
|
||||||
|
|
||||||
template <class ..._Tp>
|
template <class ..._Tp>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
|
||||||
tuple<_Tp&...>
|
tuple<_Tp&...>
|
||||||
tie(_Tp&... __t) _NOEXCEPT
|
tie(_Tp&... __t) _NOEXCEPT
|
||||||
{
|
{
|
||||||
|
@ -27,4 +27,13 @@ int main()
|
|||||||
assert(i == 42);
|
assert(i == 42);
|
||||||
assert(s == "C++");
|
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
|
||||||
}
|
}
|
||||||
|
@ -240,7 +240,7 @@
|
|||||||
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2258">2258</a></td><td>a.erase(q1, q2) unable to directly return q2</td><td>Issaquah</td><td>Complete</td></tr>
|
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2258">2258</a></td><td>a.erase(q1, q2) unable to directly return q2</td><td>Issaquah</td><td>Complete</td></tr>
|
||||||
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2263">2263</a></td><td>Comparing iterators and allocator pointers with different const-character</td><td>Issaquah</td><td></td></tr>
|
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2263">2263</a></td><td>Comparing iterators and allocator pointers with different const-character</td><td>Issaquah</td><td></td></tr>
|
||||||
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2293">2293</a></td><td>Wrong facet used by num_put::do_put</td><td>Issaquah</td><td>Complete</td></tr>
|
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2293">2293</a></td><td>Wrong facet used by num_put::do_put</td><td>Issaquah</td><td>Complete</td></tr>
|
||||||
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2301">2301</a></td><td>Why is std::tie not constexpr?</td><td>Issaquah</td><td></td></tr>
|
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2301">2301</a></td><td>Why is std::tie not constexpr?</td><td>Issaquah</td><td>Complete</td></tr>
|
||||||
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2304">2304</a></td><td>Complexity of count in unordered associative containers</td><td>Issaquah</td><td>Complete</td></tr>
|
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2304">2304</a></td><td>Complexity of count in unordered associative containers</td><td>Issaquah</td><td>Complete</td></tr>
|
||||||
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2306">2306</a></td><td>match_results::reference should be value_type&, not const value_type&</td><td>Issaquah</td><td></td></tr>
|
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2306">2306</a></td><td>match_results::reference should be value_type&, not const value_type&</td><td>Issaquah</td><td></td></tr>
|
||||||
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2308">2308</a></td><td>Clarify container destructor requirements w.r.t. std::array</td><td>Issaquah</td><td>Complete</td></tr>
|
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2308">2308</a></td><td>Clarify container destructor requirements w.r.t. std::array</td><td>Issaquah</td><td>Complete</td></tr>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user