mirror of
https://github.com/luau-lang/luau.git
synced 2025-01-10 13:29:09 +00:00
33 lines
524 B
C++
33 lines
524 B
C++
|
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
|
||
|
#include "Luau/Id.h"
|
||
|
|
||
|
namespace Luau::EqSat
|
||
|
{
|
||
|
|
||
|
Id::Id(size_t id)
|
||
|
: id(id)
|
||
|
{
|
||
|
}
|
||
|
|
||
|
Id::operator size_t() const
|
||
|
{
|
||
|
return id;
|
||
|
}
|
||
|
|
||
|
bool Id::operator==(Id rhs) const
|
||
|
{
|
||
|
return id == rhs.id;
|
||
|
}
|
||
|
|
||
|
bool Id::operator!=(Id rhs) const
|
||
|
{
|
||
|
return id != rhs.id;
|
||
|
}
|
||
|
|
||
|
} // namespace Luau::EqSat
|
||
|
|
||
|
size_t std::hash<Luau::EqSat::Id>::operator()(Luau::EqSat::Id id) const
|
||
|
{
|
||
|
return std::hash<size_t>()(size_t(id));
|
||
|
}
|