[llvm] r206372 - [Allocator] Make BumpPtrAllocator movable and move assignable.

Duncan Exon Smith dexonsmith at apple.com
Thu Apr 17 07:04:50 PDT 2014


> On Apr 17, 2014, at 0:33, Chandler Carruth <chandlerc at gmail.com> wrote:
> 
> 
>> On Wed, Apr 16, 2014 at 3:55 PM, Duncan P. N. Exon Smith <dexonsmith at apple.com> wrote:
>> > -  BumpPtrAllocatorImpl(const BumpPtrAllocatorImpl &) LLVM_DELETED_FUNCTION;
>> > -  void operator=(const BumpPtrAllocatorImpl &) LLVM_DELETED_FUNCTION;
>> > -
>> 
>> Why delete these?
> 
> When you provide a move constructor, they are implicitly deleted.

Yup. 

> The existence of a move constructor without a corresponding explicit copy constructor seems sufficiently explicit of a marker for "move only" to me.

I think it looks more like an accident, not a marker.

I prefer Stroustrup's advice [1] on this.  It's not practical to follow all the time in this project because of MSVC support (no sense explicitly defining a default definition move constructor by hand if it's not going to be used anyway), but the style still makes sense to me when it's possible.  It's cheap, and makes it clear that the omission is intentional. 

[1]: http://www.stroustrup.com/C++11FAQ.html#default2

Do you disagree strongly?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140417/8d7fb5c6/attachment.html>


More information about the llvm-commits mailing list