Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 2 additions & 18 deletions src/coreclr/jit/jitstd/iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,6 @@ struct iterator
typedef Category iterator_category;
};

struct input_iterator_tag
{
};

struct forward_iterator_tag : public input_iterator_tag
{
};

struct bidirectional_iterator_tag : public forward_iterator_tag
{
};

struct random_access_iterator_tag : public bidirectional_iterator_tag
{
};

struct int_not_an_iterator_tag
{
};
Expand All @@ -55,7 +39,7 @@ struct iterator_traits<T*>
typedef T value_type;
typedef T* pointer;
typedef T& reference;
typedef random_access_iterator_tag iterator_category;
typedef std::random_access_iterator_tag iterator_category;
};

template <typename T>
Expand All @@ -65,7 +49,7 @@ struct iterator_traits<const T*>
typedef T value_type;
typedef const T* pointer;
typedef const T& reference;
typedef random_access_iterator_tag iterator_category;
typedef std::random_access_iterator_tag iterator_category;
};

template<>
Expand Down
27 changes: 15 additions & 12 deletions src/coreclr/jit/jitstd/list.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class list
public:
// nested classes
class iterator;
class const_iterator : public jitstd::iterator<bidirectional_iterator_tag, T>
class const_iterator : public jitstd::iterator<std::bidirectional_iterator_tag, T>
{
private:
const_iterator(Node* ptr);
Expand All @@ -67,7 +67,7 @@ class list
Node* m_pNode;
};

class iterator : public jitstd::iterator<bidirectional_iterator_tag, T>
class iterator : public jitstd::iterator<std::bidirectional_iterator_tag, T>
{
iterator(Node* ptr);
public:
Expand All @@ -94,7 +94,7 @@ class list
};

class reverse_iterator;
class const_reverse_iterator : public jitstd::iterator<bidirectional_iterator_tag, T>
class const_reverse_iterator : public jitstd::iterator<std::bidirectional_iterator_tag, T>
{
private:
const_reverse_iterator(Node* ptr);
Expand All @@ -121,7 +121,7 @@ class list
Node* m_pNode;
};

class reverse_iterator : public jitstd::iterator<bidirectional_iterator_tag, T>
class reverse_iterator : public jitstd::iterator<std::bidirectional_iterator_tag, T>
{
private:
reverse_iterator(Node* ptr);
Expand Down Expand Up @@ -268,15 +268,15 @@ class list

void construct_helper(size_type n, const T& value, int_not_an_iterator_tag);
template <typename InputIterator>
void construct_helper(InputIterator first, InputIterator last, forward_iterator_tag);
void construct_helper(InputIterator first, InputIterator last, std::forward_iterator_tag);

void assign_helper(size_type n, const T& value, int_not_an_iterator_tag);
template <typename InputIterator>
void assign_helper(InputIterator first, InputIterator last, forward_iterator_tag);
void assign_helper(InputIterator first, InputIterator last, std::forward_iterator_tag);

void insert_helper(iterator position, size_type n, const T& value, int_not_an_iterator_tag);
template <typename InputIterator>
void insert_helper(iterator position, InputIterator first, InputIterator last, forward_iterator_tag);
void insert_helper(iterator position, InputIterator first, InputIterator last, std::forward_iterator_tag);

void insert_new_node_helper(Node* pInsert, Node* pNewNode);

Expand Down Expand Up @@ -332,7 +332,7 @@ list<T, Allocator>::list(const list<T, Allocator>& other)
, m_allocator(other.m_allocator)
, m_nodeAllocator(other.m_nodeAllocator)
{
construct_helper(other.begin(), other.end(), forward_iterator_tag());
construct_helper(other.begin(), other.end(), std::forward_iterator_tag());
}

template <typename T, typename Allocator>
Expand Down Expand Up @@ -551,7 +551,7 @@ template <typename T, typename Allocator>
list<T, Allocator>& list<T, Allocator>::operator=(const list<T, Allocator>& lst)
{
destroy_helper();
construct_helper(lst.begin(), lst.end(), forward_iterator_tag());
construct_helper(lst.begin(), lst.end(), std::forward_iterator_tag());
return *this;
}

Expand Down Expand Up @@ -803,7 +803,7 @@ void list<T, Allocator>::construct_helper(size_type n, const T& value, int_not_a

template <typename T, typename Allocator>
template <typename InputIterator>
void list<T, Allocator>::construct_helper(InputIterator first, InputIterator last, forward_iterator_tag)
void list<T, Allocator>::construct_helper(InputIterator first, InputIterator last, std::forward_iterator_tag)
{
while (first != last)
{
Expand All @@ -824,7 +824,7 @@ void list<T, Allocator>::assign_helper(size_type n, const T& value, int_not_an_i

template <typename T, typename Allocator>
template <typename InputIterator>
void list<T, Allocator>::assign_helper(InputIterator first, InputIterator last, forward_iterator_tag)
void list<T, Allocator>::assign_helper(InputIterator first, InputIterator last, std::forward_iterator_tag)
{
destroy_helper();
while (first != last)
Expand All @@ -845,7 +845,10 @@ void list<T, Allocator>::insert_helper(iterator position, size_type n, const T&

template <typename T, typename Allocator>
template <typename InputIterator>
void list<T, Allocator>::insert_helper(iterator position, InputIterator first, InputIterator last, forward_iterator_tag)
void list<T, Allocator>::insert_helper(iterator position,
InputIterator first,
InputIterator last,
std::forward_iterator_tag)
{
while (first != last)
{
Expand Down
23 changes: 13 additions & 10 deletions src/coreclr/jit/jitstd/vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class vector
typedef T value_type;

// nested classes
class iterator : public jitstd::iterator<random_access_iterator_tag, T>
class iterator : public jitstd::iterator<std::random_access_iterator_tag, T>
{
iterator(T* ptr);
public:
Expand All @@ -58,7 +58,7 @@ class vector
pointer m_pElem;
};

class const_iterator : public jitstd::iterator<random_access_iterator_tag, T>
class const_iterator : public jitstd::iterator<std::random_access_iterator_tag, T>
{
private:
const_iterator(T* ptr);
Expand All @@ -84,7 +84,7 @@ class vector
pointer m_pElem;
};

class reverse_iterator : public jitstd::iterator<random_access_iterator_tag, T>
class reverse_iterator : public jitstd::iterator<std::random_access_iterator_tag, T>
{
private:
reverse_iterator(T* ptr);
Expand All @@ -110,7 +110,7 @@ class vector
pointer m_pElem;
};

class const_reverse_iterator : public jitstd::iterator<random_access_iterator_tag, T>
class const_reverse_iterator : public jitstd::iterator<std::random_access_iterator_tag, T>
{
private:
const_reverse_iterator(T* ptr);
Expand Down Expand Up @@ -233,19 +233,19 @@ class vector
bool ensure_capacity(size_type capacity);

template <typename InputIterator>
void construct_helper(InputIterator first, InputIterator last, forward_iterator_tag);
void construct_helper(InputIterator first, InputIterator last, std::forward_iterator_tag);
template <typename InputIterator>
void construct_helper(InputIterator first, InputIterator last, int_not_an_iterator_tag);
void construct_helper(size_type size, const T& value);

template <typename InputIterator>
void insert_helper(iterator iter, InputIterator first, InputIterator last, forward_iterator_tag);
void insert_helper(iterator iter, InputIterator first, InputIterator last, std::forward_iterator_tag);
template <typename InputIterator>
void insert_helper(iterator iter, InputIterator first, InputIterator last, int_not_an_iterator_tag);
void insert_elements_helper(iterator iter, size_type size, const T& value);

template <typename InputIterator>
void assign_helper(InputIterator first, InputIterator last, forward_iterator_tag);
void assign_helper(InputIterator first, InputIterator last, std::forward_iterator_tag);
template <typename InputIterator>
void assign_helper(InputIterator first, InputIterator last, int_not_an_iterator_tag);

Expand Down Expand Up @@ -728,7 +728,7 @@ void vector<T, Allocator>::construct_helper(InputIterator first, InputIterator l

template <typename T, typename Allocator>
template <typename InputIterator>
void vector<T, Allocator>::construct_helper(InputIterator first, InputIterator last, forward_iterator_tag)
void vector<T, Allocator>::construct_helper(InputIterator first, InputIterator last, std::forward_iterator_tag)
{
size_type size = iterator_difference(first, last);

Expand Down Expand Up @@ -779,7 +779,10 @@ void vector<T, Allocator>::insert_helper(iterator iter, InputIterator first, Inp

template <typename T, typename Allocator>
template <typename InputIterator>
void vector<T, Allocator>::insert_helper(iterator iter, InputIterator first, InputIterator last, forward_iterator_tag)
void vector<T, Allocator>::insert_helper(iterator iter,
InputIterator first,
InputIterator last,
std::forward_iterator_tag)
{
// m_pElem could be NULL then m_pArray would be NULL too.
size_type pos = iter.m_pElem - m_pArray;
Expand Down Expand Up @@ -809,7 +812,7 @@ void vector<T, Allocator>::insert_helper(iterator iter, InputIterator first, Inp

template <typename T, typename Allocator>
template <typename InputIterator>
void vector<T, Allocator>::assign_helper(InputIterator first, InputIterator last, forward_iterator_tag)
void vector<T, Allocator>::assign_helper(InputIterator first, InputIterator last, std::forward_iterator_tag)
{
size_type size = iterator_difference(first, last);

Expand Down
Loading