Skip to content

Instantly share code, notes, and snippets.

@flandr
Created January 21, 2015 18:48
Show Gist options
  • Save flandr/dc4475761a5929e1fa01 to your computer and use it in GitHub Desktop.
Save flandr/dc4475761a5929e1fa01 to your computer and use it in GitHub Desktop.
xcode 6.1.1 std functional move constructor
template<class _Rp, class ..._ArgTypes>
template <class _Alloc>
function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc&,
function&& __f)
{
if (__f.__f_ == 0)
__f_ = 0;
else if (__f.__f_ == (__base*)&__f.__buf_)
{
__f_ = (__base*)&__buf_;
__f.__f_->__clone(__f_);
}
else
{
__f_ = __f.__f_;
__f.__f_ = 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment