mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 01:57:45 +00:00
AK: Simplify NetworkOrdered somewhat.
This commit is contained in:
parent
f0a6b42066
commit
a2e5b821b4
1 changed files with 1 additions and 16 deletions
|
@ -21,27 +21,12 @@ template<typename T>
|
||||||
class [[gnu::packed]] NetworkOrdered
|
class [[gnu::packed]] NetworkOrdered
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NetworkOrdered()
|
NetworkOrdered() {}
|
||||||
: m_network_value(0)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
NetworkOrdered(const T& host_value)
|
NetworkOrdered(const T& host_value)
|
||||||
: m_network_value(convert_between_host_and_network(host_value))
|
: m_network_value(convert_between_host_and_network(host_value))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
NetworkOrdered(const NetworkOrdered& other)
|
|
||||||
: m_network_value(other.m_network_value)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
NetworkOrdered& operator=(const NetworkOrdered& other)
|
|
||||||
{
|
|
||||||
m_network_value = other.m_network_value;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
operator T() const { return convert_between_host_and_network(m_network_value); }
|
operator T() const { return convert_between_host_and_network(m_network_value); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue