Constrain __bind functor constructor such that it won't accidentally get used as a copy constructor from a non-const lvalue. Fixes <rdar://problem/11359080>.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@156182 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f07a529b77
commit
d2da6d2322
@ -1707,7 +1707,11 @@ public:
|
|||||||
|
|
||||||
#endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
#endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
||||||
|
|
||||||
template <class _Gp, class ..._BA>
|
template <class _Gp, class ..._BA,
|
||||||
|
class = typename enable_if
|
||||||
|
<
|
||||||
|
is_constructible<_Fd, _Gp>::value
|
||||||
|
>::type>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
explicit __bind(_Gp&& __f, _BA&& ...__bound_args)
|
explicit __bind(_Gp&& __f, _BA&& ...__bound_args)
|
||||||
: __f_(_VSTD::forward<_Gp>(__f)),
|
: __f_(_VSTD::forward<_Gp>(__f)),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user