title: Editing Google's C++ DISALLOW_COPY_AND_ASSIGN Preprocessor Macro for C++11 Move Semantics
body: <p>I've been using Google's DISALLOW_COPY_AND_ASSIGN macro from their <a href="https://google.github.io/styleguide/cppguide.html" rel="nofollow noreferrer">C++ Style Guide</a> for a couple of months now, but it recently occurred to me that it would be useful to additionally disable the move constructor and move assignment.</p>
  
  <p>I haven't written any real macros before (in fact, I've been trying to stay away from them as much as possible), so I'd like to get some feedback from the rest of you on whether I've implemented it correctly.</p>
  
  <pre><code>// Original Version
  #define DISALLOW_COPY_AND_ASSIGN(TypeName) \
  TypeName(const TypeName&amp;);                 \
  void operator=(const TypeName&amp;)
  
  // Modified Version (no move semantics)
  #define DISALLOW_COPY_MOVE_AND_ASSIGN(TypeName) \
  TypeName(const TypeName&amp;);                      \
  void operator=(const TypeName&amp;);                \
  TypeName(TypeName&amp;&amp;);                           \
  void operator=(const TypeName&amp;&amp;)
  </code></pre>
  
  <p>Suggestions and criticism are very welcome.</p>
  
  <p>Thanks for your time!</p>