diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2016-08-11 17:14:28 +0300 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2016-09-23 19:05:09 +0300 |
commit | c8d610721721251cf72cf867d091ce993370ac6b (patch) | |
tree | 03f3b465d20acaef2b6745d920d2fcced842a286 /src/util-inl.h | |
parent | dae53238dc1aa38cbdb2dcff6c73373be1d6d071 (diff) |
src: remove VS 2013 compatibility hacks
We can remove some Visual Studio 2013-specific workarounds now that
support for that compiler has officially been dropped.
PR-URL: https://github.com/nodejs/node/pull/8067
Refs: https://github.com/nodejs/node/issues/7484
Refs: https://github.com/nodejs/node/pull/8049
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joao Reis <reis@janeasystems.com>
Diffstat (limited to 'src/util-inl.h')
-rw-r--r-- | src/util-inl.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/util-inl.h b/src/util-inl.h index 31411bb4796..9357f675021 100644 --- a/src/util-inl.h +++ b/src/util-inl.h @@ -28,33 +28,33 @@ bool ListNode<T>::IsEmpty() const { return prev_ == this; } -template <typename T, ListNodeMember(T) M> +template <typename T, ListNode<T> (T::*M)> ListHead<T, M>::Iterator::Iterator(ListNode<T>* node) : node_(node) {} -template <typename T, ListNodeMember(T) M> +template <typename T, ListNode<T> (T::*M)> T* ListHead<T, M>::Iterator::operator*() const { return ContainerOf(M, node_); } -template <typename T, ListNodeMember(T) M> +template <typename T, ListNode<T> (T::*M)> const typename ListHead<T, M>::Iterator& ListHead<T, M>::Iterator::operator++() { node_ = node_->next_; return *this; } -template <typename T, ListNodeMember(T) M> +template <typename T, ListNode<T> (T::*M)> bool ListHead<T, M>::Iterator::operator!=(const Iterator& that) const { return node_ != that.node_; } -template <typename T, ListNodeMember(T) M> +template <typename T, ListNode<T> (T::*M)> ListHead<T, M>::~ListHead() { while (IsEmpty() == false) head_.next_->Remove(); } -template <typename T, ListNodeMember(T) M> +template <typename T, ListNode<T> (T::*M)> void ListHead<T, M>::MoveBack(ListHead* that) { if (IsEmpty()) return; @@ -67,7 +67,7 @@ void ListHead<T, M>::MoveBack(ListHead* that) { head_.next_ = &head_; } -template <typename T, ListNodeMember(T) M> +template <typename T, ListNode<T> (T::*M)> void ListHead<T, M>::PushBack(T* element) { ListNode<T>* that = &(element->*M); head_.prev_->next_ = that; @@ -76,7 +76,7 @@ void ListHead<T, M>::PushBack(T* element) { head_.prev_ = that; } -template <typename T, ListNodeMember(T) M> +template <typename T, ListNode<T> (T::*M)> void ListHead<T, M>::PushFront(T* element) { ListNode<T>* that = &(element->*M); head_.next_->prev_ = that; @@ -85,12 +85,12 @@ void ListHead<T, M>::PushFront(T* element) { head_.next_ = that; } -template <typename T, ListNodeMember(T) M> +template <typename T, ListNode<T> (T::*M)> bool ListHead<T, M>::IsEmpty() const { return head_.IsEmpty(); } -template <typename T, ListNodeMember(T) M> +template <typename T, ListNode<T> (T::*M)> T* ListHead<T, M>::PopFront() { if (IsEmpty()) return nullptr; @@ -99,12 +99,12 @@ T* ListHead<T, M>::PopFront() { return ContainerOf(M, node); } -template <typename T, ListNodeMember(T) M> +template <typename T, ListNode<T> (T::*M)> typename ListHead<T, M>::Iterator ListHead<T, M>::begin() const { return Iterator(head_.next_); } -template <typename T, ListNodeMember(T) M> +template <typename T, ListNode<T> (T::*M)> typename ListHead<T, M>::Iterator ListHead<T, M>::end() const { return Iterator(const_cast<ListNode<T>*>(&head_)); } |