[PATCH] D40259: [libcxx] LWG2993: reference_wrapper<T> conversion from T&&

Eric Fiselier via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 20 11:41:40 PST 2017


EricWF requested changes to this revision.
EricWF added a comment.
This revision now requires changes to proceed.

I would much rather take this change in all dialects except for C++03.



================
Comment at: include/__functional_base:398
+        !is_same<__uncvref_t<_Up>, reference_wrapper>::value
+    >, class = typename __void_t<
+        decltype(_VSTD::__lvref_bind<_Tp>(_VSTD::declval<_Up>()))
----------------
The `__void_t` isn't necessary here. Plus I think we can be clever and write this condition as:

```
bool _IsNoexcept = noexcept(<expr>)
```

And then we can re-use `_Noexcept` to make the function conditionally `noexcept` instead of duplicating the expression.


https://reviews.llvm.org/D40259





More information about the cfe-commits mailing list