m_cpp_utils.h 668 B

12345678910111213141516171819202122232425262728
  1. /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  4. * You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. // Original author: ekr@rtfm.com
  6. #ifndef m_cpp_utils_h__
  7. #define m_cpp_utils_h__
  8. #include "mozilla/Attributes.h"
  9. namespace mozilla {
  10. #define DISALLOW_ASSIGNMENT(T) \
  11. void operator=(const T& other) = delete
  12. #define DISALLOW_COPY(T) \
  13. T(const T& other) = delete
  14. #define DISALLOW_COPY_ASSIGN(T) \
  15. DISALLOW_COPY(T); \
  16. DISALLOW_ASSIGNMENT(T)
  17. } // close namespace
  18. #endif