Chris@16: // Boost nil_generator.hpp header file ----------------------------------------------// Chris@16: Chris@16: // Copyright 2010 Andy Tompkins. Chris@16: // Distributed under the Boost Software License, Version 1.0. (See Chris@16: // accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: #ifndef BOOST_UUID_NIL_GENERATOR_HPP Chris@16: #define BOOST_UUID_NIL_GENERATOR_HPP Chris@16: Chris@16: #include Chris@16: Chris@16: namespace boost { Chris@16: namespace uuids { Chris@16: Chris@16: // generate a nil uuid Chris@16: struct nil_generator { Chris@16: typedef uuid result_type; Chris@16: Chris@16: uuid operator()() const { Chris@16: // initialize to all zeros Chris@16: uuid u = {{0}}; Chris@16: return u; Chris@16: } Chris@16: }; Chris@16: Chris@16: inline uuid nil_uuid() { Chris@16: return nil_generator()(); Chris@16: } Chris@16: Chris@16: }} // namespace boost::uuids Chris@16: Chris@16: #endif // BOOST_UUID_NIL_GENERATOR_HPP Chris@16: