Skip to content
Snippets Groups Projects
Commit 228f5b2f authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

Restore LLUUID to a plain old data type in a post-c++11 world

parent e45b6159
No related branches found
No related tags found
No related merge requests found
...@@ -1009,36 +1009,6 @@ LLUUID::LLUUID() ...@@ -1009,36 +1009,6 @@ LLUUID::LLUUID()
return !(word[0] | word[1] | word[2] | word[3]); return !(word[0] | word[1] | word[2] | word[3]);
} }
// Copy constructor
LLUUID::LLUUID(const LLUUID& rhs)
{
U32 *tmp = (U32 *)mData;
U32 *rhstmp = (U32 *)rhs.mData;
tmp[0] = rhstmp[0];
tmp[1] = rhstmp[1];
tmp[2] = rhstmp[2];
tmp[3] = rhstmp[3];
}
LLUUID::~LLUUID()
{
}
// Assignment
LLUUID& LLUUID::operator=(const LLUUID& rhs)
{
// No need to check the case where this==&rhs. The branch is slower than the write.
U32 *tmp = (U32 *)mData;
U32 *rhstmp = (U32 *)rhs.mData;
tmp[0] = rhstmp[0];
tmp[1] = rhstmp[1];
tmp[2] = rhstmp[2];
tmp[3] = rhstmp[3];
return *this;
}
LLUUID::LLUUID(const char *in_string) LLUUID::LLUUID(const char *in_string)
{ {
if (!in_string || in_string[0] == 0) if (!in_string || in_string[0] == 0)
......
...@@ -55,10 +55,7 @@ class LL_COMMON_API LLUUID ...@@ -55,10 +55,7 @@ class LL_COMMON_API LLUUID
LLUUID(); LLUUID();
explicit LLUUID(const char *in_string); // Convert from string. explicit LLUUID(const char *in_string); // Convert from string.
explicit LLUUID(const std::string& in_string); // Convert from string. explicit LLUUID(const std::string& in_string); // Convert from string.
LLUUID(const LLUUID &in); ~LLUUID() = default;
LLUUID &operator=(const LLUUID &rhs);
~LLUUID();
// //
// MANIPULATORS // MANIPULATORS
...@@ -131,6 +128,9 @@ class LL_COMMON_API LLUUID ...@@ -131,6 +128,9 @@ class LL_COMMON_API LLUUID
U8 mData[UUID_BYTES]; U8 mData[UUID_BYTES];
}; };
static_assert(std::is_trivially_copyable<LLUUID>::value, "LLUUID must be trivial copy");
static_assert(std::is_trivially_move_assignable<LLUUID>::value, "LLUUID must be trivial move");
static_assert(std::is_standard_layout<LLUUID>::value, "LLUUID must be a standard layout type");
typedef std::vector<LLUUID> uuid_vec_t; typedef std::vector<LLUUID> uuid_vec_t;
typedef std::set<LLUUID> uuid_set_t; typedef std::set<LLUUID> uuid_set_t;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment