On Sat, Oct 5, 2013 at 11:46 AM, Marshall Clow <[email protected]>wrote:
> Author: marshall > Date: Sat Oct 5 13:46:37 2013 > New Revision: 192038 > > URL: http://llvm.org/viewvc/llvm-project?rev=192038&view=rev > Log: > Implement LWG issue 2275 'forward_as_tuple should be constexpr' > Does LWG have a distinction between a DR (applies to previous standards) and an extension (only applies to new standard), like CWG does? Or do I have to #define something extra to get C++11 plus LWG-approved bug fixes? > Modified: > libcxx/trunk/include/tuple > > libcxx/trunk/test/utilities/tuple/tuple.tuple/tuple.creation/forward_as_tuple.pass.cpp > > Modified: libcxx/trunk/include/tuple > URL: > http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/tuple?rev=192038&r1=192037&r2=192038&view=diff > > ============================================================================== > --- libcxx/trunk/include/tuple (original) > +++ libcxx/trunk/include/tuple Sat Oct 5 13:46:37 2013 > @@ -73,7 +73,7 @@ public: > const unspecified ignore; > > template <class... T> tuple<V...> make_tuple(T&&...); // constexpr in > C++14 > -template <class... T> tuple<ATypes...> forward_as_tuple(T&&...) noexcept; > +template <class... T> tuple<ATypes...> forward_as_tuple(T&&...) noexcept; > // constexpr in C++14 > template <class... T> tuple<T&...> tie(T&...) noexcept; > template <class... Tuples> tuple<CTypes...> tuple_cat(Tuples&&... tpls); > // constexpr in C++14 > > @@ -833,14 +833,6 @@ make_tuple(_Tp&&... __t) > template <class... _Tp> > inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 > tuple<_Tp&&...> > -__forward_as_tuple(_Tp&&... __t) _NOEXCEPT > -{ > - return tuple<_Tp&&...>(_VSTD::forward<_Tp>(__t)...); > -} > - > -template <class... _Tp> > -inline _LIBCPP_INLINE_VISIBILITY > -tuple<_Tp&&...> > forward_as_tuple(_Tp&&... __t) _NOEXCEPT > { > return tuple<_Tp&&...>(_VSTD::forward<_Tp>(__t)...); > @@ -1041,7 +1033,7 @@ struct __tuple_cat<tuple<_Types...>, __t > typename __tuple_cat_return_ref<tuple<_Types...>&&, _Tuple0&&>::type > operator()(tuple<_Types...> __t, _Tuple0&& __t0) > { > - return > __forward_as_tuple(_VSTD::forward<_Types>(get<_I0>(__t))..., > + return forward_as_tuple(_VSTD::forward<_Types>(get<_I0>(__t))..., > > get<_J0>(_VSTD::forward<_Tuple0>(__t0))...); > } > > @@ -1056,7 +1048,7 @@ struct __tuple_cat<tuple<_Types...>, __t > tuple<_Types..., typename __apply_cv<_Tuple0, typename > tuple_element<_J0, _T0>::type>::type&&...>, > typename __make_tuple_indices<sizeof ...(_Types) + > tuple_size<_T0>::value>::type, > typename __make_tuple_indices<tuple_size<_T1>::value>::type>() > - (__forward_as_tuple( > + (forward_as_tuple( > _VSTD::forward<_Types>(get<_I0>(__t))..., > get<_J0>(_VSTD::forward<_Tuple0>(__t0))... > ), > > Modified: > libcxx/trunk/test/utilities/tuple/tuple.tuple/tuple.creation/forward_as_tuple.pass.cpp > URL: > http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/tuple/tuple.tuple/tuple.creation/forward_as_tuple.pass.cpp?rev=192038&r1=192037&r2=192038&view=diff > > ============================================================================== > --- > libcxx/trunk/test/utilities/tuple/tuple.tuple/tuple.creation/forward_as_tuple.pass.cpp > (original) > +++ > libcxx/trunk/test/utilities/tuple/tuple.tuple/tuple.creation/forward_as_tuple.pass.cpp > Sat Oct 5 13:46:37 2013 > @@ -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 > } > } > > > _______________________________________________ > cfe-commits mailing list > [email protected] > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits >
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
