Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 72c36298 authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Use C++11 deleted functions to implement DISALLOW_ macros

With C++ deleted functions, compilers can generate more
descriptive error messages when we are doing something disallowed.

Change-Id: I48d23e5eced545732558e56f5ff9ff70c95a6ff0
parent ca0a0da8
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -352,13 +352,13 @@ template<typename T> AK_FORCE_INLINE const T &max(const T &a, const T &b) { retu
#define MIN_OUTPUT_INDEX_FOR_DEBUG (-1)

#define DISALLOW_DEFAULT_CONSTRUCTOR(TypeName) \
  TypeName()
  TypeName() = delete

#define DISALLOW_COPY_CONSTRUCTOR(TypeName) \
  TypeName(const TypeName&)
  TypeName(const TypeName&) = delete

#define DISALLOW_ASSIGNMENT_OPERATOR(TypeName) \
  void operator=(const TypeName&)
  void operator=(const TypeName&) = delete

#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
  DISALLOW_COPY_CONSTRUCTOR(TypeName);     \