nothrow.hpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // (C) Copyright Ion Gaztanaga 2014-2015. Distributed under the Boost
  4. // Software License, Version 1.0. (See accompanying file
  5. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. // See http://www.boost.org/libs/interprocess for documentation.
  8. //
  9. //////////////////////////////////////////////////////////////////////////////
  10. #ifndef BOOST_INTERPROCESS_DETAIL_NOTHROW_HPP
  11. #define BOOST_INTERPROCESS_DETAIL_NOTHROW_HPP
  12. #ifndef BOOST_CONFIG_HPP
  13. # include <boost/config.hpp>
  14. #endif
  15. #
  16. #if defined(BOOST_HAS_PRAGMA_ONCE)
  17. # pragma once
  18. #endif
  19. namespace std { //no namespace versioning in clang+libc++
  20. struct nothrow_t;
  21. } //namespace std {
  22. namespace boost{ namespace interprocess {
  23. template <int Dummy = 0>
  24. struct nothrow
  25. {
  26. static const std::nothrow_t &get() { return *pnothrow; }
  27. static std::nothrow_t *pnothrow;
  28. };
  29. template <int Dummy>
  30. std::nothrow_t *nothrow<Dummy>::pnothrow =
  31. reinterpret_cast<std::nothrow_t *>(0x1234); //Avoid sanitizer warnings on references to null
  32. }} //namespace boost{ namespace interprocess {
  33. #endif //#ifndef BOOST_INTERPROCESS_DETAIL_NOTHROW_HPP