Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:53:31

0001 /*
0002  *             Copyright Andy Tompkins 2006.
0003  * Distributed under the Boost Software License, Version 1.0.
0004  *    (See accompanying file LICENSE_1_0.txt or copy at
0005  *          https://www.boost.org/LICENSE_1_0.txt)
0006  */
0007 /*!
0008  * \file   uuid/detail/uuid_generic.ipp
0009  *
0010  * \brief  This header contains generic implementation of \c boost::uuid operations.
0011  */
0012 
0013 #ifndef BOOST_UUID_DETAIL_UUID_GENERIC_IPP_INCLUDED_
0014 #define BOOST_UUID_DETAIL_UUID_GENERIC_IPP_INCLUDED_
0015 
0016 #include <string.h>
0017 
0018 namespace boost {
0019 namespace uuids {
0020 
0021 inline bool uuid::is_nil() const BOOST_NOEXCEPT
0022 {
0023     for (std::size_t i = 0; i < sizeof(data); ++i)
0024     {
0025         if (data[i] != 0U)
0026             return false;
0027     }
0028     return true;
0029 }
0030 
0031 inline void uuid::swap(uuid& rhs) BOOST_NOEXCEPT
0032 {
0033     uuid tmp = *this;
0034     *this = rhs;
0035     rhs = tmp;
0036 }
0037 
0038 inline bool operator== (uuid const& lhs, uuid const& rhs) BOOST_NOEXCEPT
0039 {
0040     return memcmp(lhs.data, rhs.data, sizeof(lhs.data)) == 0;
0041 }
0042 
0043 inline bool operator< (uuid const& lhs, uuid const& rhs) BOOST_NOEXCEPT
0044 {
0045     return memcmp(lhs.data, rhs.data, sizeof(lhs.data)) < 0;
0046 }
0047 
0048 } // namespace uuids
0049 } // namespace boost
0050 
0051 #endif // BOOST_UUID_DETAIL_UUID_GENERIC_IPP_INCLUDED_