feat(kernel/std): add iterator_traits specialization for pointer types

This commit is contained in:
EnderIce2 2025-05-11 16:31:33 +00:00
parent 7873d0e724
commit d7abd36717
Signed by: enderice2
GPG Key ID: FEB6B8A8507BA62E

View File

@ -18,6 +18,7 @@
#pragma once
#include <type_traits>
#include <cstddef>
namespace std
{
@ -56,6 +57,18 @@ namespace std
using iterator_category = typename Iter::iterator_category;
};
template <class T>
struct iterator_traits<T *>
{
public:
using difference_type = std::ptrdiff_t;
using value_type = std::remove_cv_t<T>;
using pointer = T *;
using reference = T &;
using iterator_category = std::random_access_iterator_tag;
using iterator_concept = std::contiguous_iterator_tag;
};
namespace detail
{
template <class It>