mirror of
https://github.com/EnderIce2/Fennix.git
synced 2025-05-28 15:34:31 +00:00
feat(kernel/std): ✨ implement std::less specializations for pointer types and void
This commit is contained in:
parent
41fe55fd1f
commit
aca55f993f
@ -260,6 +260,28 @@ namespace std
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
struct less<T *>
|
||||||
|
{
|
||||||
|
constexpr bool operator()(const T *lhs, const T *rhs) const
|
||||||
|
{
|
||||||
|
if (__builtin_is_constant_evaluated())
|
||||||
|
return lhs < rhs;
|
||||||
|
return (uintptr_t)lhs < (uintptr_t)rhs;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template <>
|
||||||
|
class less<void>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
template <class T, class U>
|
||||||
|
constexpr auto operator()(T &&lhs, U &&rhs) const -> decltype(std::forward<T>(lhs) < std::forward<U>(rhs))
|
||||||
|
{
|
||||||
|
return std::forward<T>(lhs) < std::forward<U>(rhs);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
template <class F, class... Args>
|
template <class F, class... Args>
|
||||||
constexpr typename std::result_of<F()>::type bind(F &&f, Args &&...args);
|
constexpr typename std::result_of<F()>::type bind(F &&f, Args &&...args);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user