null_resource.hpp 783 B

1234567891011121314151617181920212223242526272829303132333435
  1. //
  2. // Copyright (c) 2020 Vinnie Falco (vinnie.falco@gmail.com)
  3. //
  4. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. // Official repository: https://github.com/boostorg/json
  8. //
  9. #ifndef BOOST_JSON_NULL_RESOURCE_HPP
  10. #define BOOST_JSON_NULL_RESOURCE_HPP
  11. #include <boost/json/detail/config.hpp>
  12. #include <boost/json/memory_resource.hpp>
  13. BOOST_JSON_NS_BEGIN
  14. /** Return a pointer to the null resource.
  15. This memory resource always throws the exception
  16. `std::bad_alloc` in calls to `allocate`.
  17. @par Complexity
  18. Constant.
  19. @par Exception Safety
  20. No-throw guarantee.
  21. */
  22. BOOST_JSON_DECL
  23. memory_resource*
  24. get_null_resource() noexcept;
  25. BOOST_JSON_NS_END
  26. #endif