Rename nil() to isNil() to allow usage in objective-c

This commit is contained in:
2024-04-08 17:26:58 +02:00
parent dd54910eb6
commit 0819272170
2 changed files with 5 additions and 6 deletions

View File

@@ -64,8 +64,7 @@ namespace stud
//
uuid () = default;
bool
nil () const;
bool isNil () const;
explicit operator bool () const;

View File

@@ -6,7 +6,7 @@ namespace stud
// NOTE: the order of definitions is important to MinGW GCC (DLL linkage).
inline bool uuid::
nil () const
isNil () const
{
return
time_low == 0 &&
@@ -21,7 +21,7 @@ namespace stud
inline uuid::
operator bool () const
{
return !nil ();
return !isNil ();
}
inline void uuid::
@@ -172,7 +172,7 @@ namespace stud
inline uuid::variant_type uuid::
variant () const
{
return nil ()
return isNil ()
? variant_type::dce
: ((clock_seq_hir & 0x80) == 0 ? variant_type::ncs :
(clock_seq_hir & 0x40) == 0 ? variant_type::dce :
@@ -183,7 +183,7 @@ namespace stud
inline uuid::version_type uuid::
version () const
{
return nil ()
return isNil ()
? version_type::random
: static_cast<version_type> ((time_hiv >> 12) & 0x0f);
}