mirror of
https://github.com/luau-lang/luau.git
synced 2025-04-18 10:53:45 +01:00
Move std::hash specialization to header.
This commit is contained in:
parent
d13a86be41
commit
11f72000a9
2 changed files with 11 additions and 9 deletions
|
@ -1,6 +1,8 @@
|
||||||
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
|
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
namespace Luau::EqSat
|
namespace Luau::EqSat
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -18,3 +20,9 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Luau::EqSat
|
} // namespace Luau::EqSat
|
||||||
|
|
||||||
|
template<>
|
||||||
|
struct std::hash<Luau::EqSat::Id>
|
||||||
|
{
|
||||||
|
size_t operator()(Luau::EqSat::Id id) const;
|
||||||
|
};
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
|
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
|
||||||
#include "Luau/Id.h"
|
#include "Luau/Id.h"
|
||||||
|
|
||||||
#include <functional>
|
|
||||||
|
|
||||||
namespace Luau::EqSat
|
namespace Luau::EqSat
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -28,11 +26,7 @@ bool Id::operator!=(Id rhs) const
|
||||||
|
|
||||||
} // namespace Luau::EqSat
|
} // namespace Luau::EqSat
|
||||||
|
|
||||||
template<>
|
size_t std::hash<Luau::EqSat::Id>::operator()(Luau::EqSat::Id id) const
|
||||||
struct std::hash<Luau::EqSat::Id>
|
|
||||||
{
|
|
||||||
size_t operator()(Luau::EqSat::Id id) const
|
|
||||||
{
|
{
|
||||||
return std::hash<size_t>()(size_t(id));
|
return std::hash<size_t>()(size_t(id));
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue