Drake
drake_copyable.h
Go to the documentation of this file.
1 #pragma once
2 
4 
5 // ============================================================================
6 // N.B. The spelling of the macro names between doc/Doxyfile_CXX.in and this
7 // file must be kept in sync!
8 // ============================================================================
9 
35 #define DRAKE_NO_COPY_NO_MOVE_NO_ASSIGN(Classname) \
36  Classname(const Classname&) = delete; \
37  void operator=(const Classname&) = delete; \
38  Classname(Classname&&) = delete; \
39  void operator=(Classname&&) = delete;
40 
59 #define DRAKE_DEFAULT_COPY_AND_MOVE_AND_ASSIGN(Classname) \
60  Classname(const Classname&) = default; \
61  Classname& operator=(const Classname&) = default; \
62  Classname(Classname&&) = default; \
63  Classname& operator=(Classname&&) = default; \
64  /* Fails at compile-time if default-copy doesn't work. */ \
65  static void DRAKE_COPYABLE_DEMAND_COPY_CAN_COMPILE() { \
66  (void) static_cast<Classname& (Classname::*)( \
67  const Classname&)>(&Classname::operator=); \
68  }
This header provides a std::make_unique implementation to be used when the compiler does not support ...