nil_generator.hpp 586 B

12345678910111213141516171819202122232425262728293031
  1. #ifndef BOOST_UUID_NIL_GENERATOR_HPP_INCLUDED
  2. #define BOOST_UUID_NIL_GENERATOR_HPP_INCLUDED
  3. // Copyright 2010 Andy Tompkins.
  4. // Distributed under the Boost Software License, Version 1.0.
  5. // https://www.boost.org/LICENSE_1_0.txt
  6. #include <boost/uuid/uuid.hpp>
  7. namespace boost {
  8. namespace uuids {
  9. // generate a nil uuid
  10. struct nil_generator
  11. {
  12. using result_type = uuid;
  13. uuid operator()() const noexcept
  14. {
  15. return {{}};
  16. }
  17. };
  18. inline uuid nil_uuid() noexcept
  19. {
  20. return {{}};
  21. }
  22. }} // namespace boost::uuids
  23. #endif // BOOST_UUID_NIL_GENERATOR_HPP_INCLUDED