[patch] Pass a MemoryBufferRef when we can avoid taking ownership
dblaikie at gmail.com
Tue Sep 2 14:50:14 PDT 2014
On Tue, Sep 2, 2014 at 2:38 PM, Duncan P. N. Exon Smith <
dexonsmith at apple.com> wrote:
> > On 2014 Aug 26, at 18:26, Rafael Espíndola <rafael.espindola at gmail.com>
> >> Actually I did mean && - it's not uncommon for APIs to take by movement
> >> fail to move-from in their failure path. Granted in the C++ standard
> >> that failure is demonstrated by throwing an exception, whereas this has
> >> return result.
> > OK, so this patch (on top of all previous which were already
> > committed) changes the & to &&. I personally find a
> > "foo(std::move(bar))" that doesn't always move bar to be a bit
> > confusing, but if that is common, I am OK with it.
> I agree that this is a bit unexpected, but I think David's right that
> it's better than the alternative.
*nod* 'preciate the second opinion. I could be convinced either way, but at
least wanted to float the idea.
> It's probably worth documenting the failure behaviour in the doxygen.
Yep - whether it's by T& or T&&, it should be documented.
> Otherwise (assuming David agrees) this LGTM.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-commits