Changeset c300bb5 in mainline for uspace/lib/cpp/include/impl/list.hpp
- Timestamp:
- 2018-07-05T21:41:24Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7452b155
- Parents:
- bb1d15c
- git-author:
- Dzejrou <dzejrou@…> (2018-05-17 00:49:32)
- git-committer:
- Dzejrou <dzejrou@…> (2018-07-05 21:41:24)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/cpp/include/impl/list.hpp
rbb1d15c rc300bb5 71 71 72 72 list_const_iterator(const list_iterator<T>& other) 73 : current_{other. current_}, head_{other.head_}73 : current_{other.node()}, head_{other.head()} 74 74 { /* DUMMY BODY */ } 75 75 … … 125 125 list_node<value_type>* node() 126 126 { 127 return const_cast<list_node<value_type>*>(current_); 128 } 129 130 const list_node<value_type>* node() const 131 { 127 132 return current_; 128 133 } 129 134 130 const list_node<value_type>* node() const 131 { 132 return current_; 135 list_node<value_type>* head() 136 { 137 return const_cast<list_node<value_type>*>(head_); 138 } 139 140 const list_node<value_type>* head() const 141 { 142 return head_; 133 143 } 134 144 … … 154 164 155 165 private: 156 list_node<value_type>* current_;157 list_node<value_type>* head_;166 const list_node<value_type>* current_; 167 const list_node<value_type>* head_; 158 168 bool end_; 159 169 }; … … 253 263 } 254 264 255 operator list_const_iterator<T>() const 256 { 257 return list_const_iterator<T>{current_}; 265 list_node<value_type>* head() 266 { 267 return head_; 268 } 269 270 const list_node<value_type>* head() const 271 { 272 return head_; 258 273 } 259 274 … … 746 761 747 762 auto first_node = first.node(); 748 auto last_node = last.node() ;763 auto last_node = last.node()->prev; 749 764 auto prev = first_node->prev; 750 765 auto next = last_node->next; 751 766 752 prev->append(next); 753 754 while (first_node != next) 755 { 756 // TODO: test with head in the range 757 /* if (first_node == head_) */ 758 /* head_ = last.node()->next; */ 767 first_node->prev = nullptr; 768 last_node->next = nullptr; 769 prev->next = next; 770 next->prev = prev; 771 772 while (first_node) 773 { 774 if (first_node == head_) 775 { 776 head_ = next; 777 head_->prev = prev; 778 } 759 779 760 780 auto tmp = first_node;
Note:
See TracChangeset
for help on using the changeset viewer.