Experimental template formatting with be_t<> support

This commit is contained in:
Nekotekina
2015-01-12 21:12:06 +03:00
parent ad2b2c9c62
commit b6ec618f97
29 changed files with 577 additions and 86 deletions
+11 -8
View File
@@ -284,15 +284,9 @@ union _CRT_ALIGN(16) u128
_u64[1] = _u64[0] = 0;
}
std::string to_hex() const
{
return fmt::Format("%016llx%016llx", _u64[1], _u64[0]);
}
std::string to_hex() const;
std::string to_xyzw() const
{
return fmt::Format("x: %g y: %g z: %g w: %g", _f[3], _f[2], _f[1], _f[0]);
}
std::string to_xyzw() const;
static __forceinline u128 byteswap(const u128 val)
{
@@ -608,6 +602,15 @@ public:
return ToBE();
#endif
}
const stype& data() const
{
#ifdef IS_LE_MACHINE
return ToBE();
#else
return ToLE();
#endif
}
be_t& operator = (const be_t& value) = default;