static_cast<T&&>(t) also works as a constexpr C++11 forward. On Sep 13, 2016 4:07 PM, "Keno Fischer" <kfisc...@college.harvard.edu> wrote:
> loladiro added inline comments. > > ================ > Comment at: include/memory:2137 > @@ -2132,3 +2136,3 @@ > > - _LIBCPP_INLINE_VISIBILITY > + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR > __libcpp_compressed_pair_imp& operator=(__libcpp_compressed_pair_imp&& > __p) > ---------------- > mclow.lists wrote: > > loladiro wrote: > > > mclow.lists wrote: > > > > Have you tested this on C++11? > > > > I suspect that some of these need to be > `_LIBCPP_CONSTEXPR_AFTER_CXX11` > > > Well, as I mentioned there are other problems on C++11, namely forward > not being constexpr (so even the simple constructors below can't be > constant initialized in C++11). I would REALLY like for unique_ptr to be > constant initialized even in C++11 mode. I feel like arguably the standard > requires it by marking the constructor `constexpr`. > > One way to deal with that is to define a call `__forward()` that is the > same as `forward()` except that it's constexpr in C++11, and have > compressed_pair call that. > > > I was worried that something in the definition of forward required C++14 > constexpr semantics? Is that not the case. If so this sounds like a good > solution, and I can update the patch accordingly. > > > Repository: > rL LLVM > > https://reviews.llvm.org/D24372 > > > >
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits