mirror of
https://github.com/EnderIce2/Fennix.git
synced 2025-05-28 15:34:31 +00:00
feat(kernel/std): ✨ add iterator_traits specialization for pointer types
This commit is contained in:
parent
7873d0e724
commit
d7abd36717
@ -18,6 +18,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
#include <cstddef>
|
||||||
|
|
||||||
namespace std
|
namespace std
|
||||||
{
|
{
|
||||||
@ -56,6 +57,18 @@ namespace std
|
|||||||
using iterator_category = typename Iter::iterator_category;
|
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
|
namespace detail
|
||||||
{
|
{
|
||||||
template <class It>
|
template <class It>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user