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>.

llvm-svn: 156182
This commit is contained in:
Howard Hinnant 2012-05-04 17:21:02 +00:00
parent ae29842706
commit df7aad41fd
1 changed files with 5 additions and 1 deletions

View File

@ -1707,7 +1707,11 @@ public:
#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
explicit __bind(_Gp&& __f, _BA&& ...__bound_args)
: __f_(_VSTD::forward<_Gp>(__f)),