Re: [Lldb-commits] Use explicit delete in DISALLOW_COPY_AND_ASSIGN

2016-09-27 Thread Zachary Turner via lldb-commits
Not sure why operator= is returning a const&. It doesn't matter in practice
but it's a bit strange. Anyway lgtm
On Tue, Sep 27, 2016 at 7:11 PM Daniel Austin Noland via lldb-commits <
lldb-commits@lists.llvm.org> wrote:

> Explicit delete is preferable to declaring a method private when
> your intention is to prevent that method from ever being used.
>
> * better compiler error messages
> * can't be bypassed by friendship
> * clearer intent
>
> This was discussed here:
> http://lists.llvm.org/pipermail/lldb-dev/2016-September/011394.html
>
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] Use explicit delete in DISALLOW_COPY_AND_ASSIGN

2016-09-27 Thread Daniel Austin Noland via lldb-commits
Explicit delete is preferable to declaring a method private when
your intention is to prevent that method from ever being used.
   
* better compiler error messages
* can't be bypassed by friendship
* clearer intent
   
This was discussed here:
http://lists.llvm.org/pipermail/lldb-dev/2016-September/011394.html

diff --git a/include/lldb/lldb-defines.h b/include/lldb/lldb-defines.h
index a8e6776..a1318f4 100644
--- a/include/lldb/lldb-defines.h
+++ b/include/lldb/lldb-defines.h
@@ -157,8 +157,8 @@
 /// assignment operators in C++ classes.
 //--
 #define DISALLOW_COPY_AND_ASSIGN(TypeName) 
\
-  TypeName(const TypeName &);  
\
-  const TypeName =(const TypeName &)
+  TypeName(const TypeName &) = delete; 
\
+  const TypeName =(const TypeName &) = delete
 
 #endif // #if defined(__cplusplus)
 


signature.asc
Description: OpenPGP digital signature
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits