|
|
@@ -49,82 +49,82 @@ void intrusive_list<T>::assign( std::initializer_list<pointer> ilist ) {
|
|
|
}
|
|
|
|
|
|
template <typename T>
|
|
|
-inline typename intrusive_list<T>::pointer intrusive_list<T>::front() {
|
|
|
- return head_->get();
|
|
|
+inline auto intrusive_list<T>::front() -> reference {
|
|
|
+ return *begin();
|
|
|
}
|
|
|
|
|
|
template <typename T>
|
|
|
-inline typename intrusive_list<T>::const_pointer intrusive_list<T>::front() const {
|
|
|
- return head_->get();
|
|
|
+inline auto intrusive_list<T>::front() const -> const_reference {
|
|
|
+ return *begin();
|
|
|
}
|
|
|
|
|
|
template <typename T>
|
|
|
-inline typename intrusive_list<T>::pointer intrusive_list<T>::back() {
|
|
|
- return end_.prev_->get();
|
|
|
+inline auto intrusive_list<T>::back() -> reference {
|
|
|
+ return *--end();
|
|
|
}
|
|
|
|
|
|
template <typename T>
|
|
|
-inline typename intrusive_list<T>::const_pointer intrusive_list<T>::back() const {
|
|
|
- return end_.prev_->get();
|
|
|
+inline auto intrusive_list<T>::back() const -> const_reference {
|
|
|
+ return *--end();
|
|
|
}
|
|
|
|
|
|
template <typename T>
|
|
|
-inline typename intrusive_list<T>::iterator intrusive_list<T>::begin() noexcept {
|
|
|
+inline auto intrusive_list<T>::begin() noexcept -> iterator {
|
|
|
return iterator{head_};
|
|
|
}
|
|
|
|
|
|
template <typename T>
|
|
|
-inline typename intrusive_list<T>::const_iterator intrusive_list<T>::begin() const noexcept {
|
|
|
+inline auto intrusive_list<T>::begin() const noexcept -> const_iterator {
|
|
|
return const_iterator{head_};
|
|
|
}
|
|
|
|
|
|
template <typename T>
|
|
|
-inline typename intrusive_list<T>::const_iterator intrusive_list<T>::cbegin() const noexcept {
|
|
|
+inline auto intrusive_list<T>::cbegin() const noexcept -> const_iterator {
|
|
|
return const_iterator{head_};
|
|
|
}
|
|
|
|
|
|
template <typename T>
|
|
|
-inline typename intrusive_list<T>::iterator intrusive_list<T>::end() noexcept {
|
|
|
+inline auto intrusive_list<T>::end() noexcept -> iterator {
|
|
|
return iterator{tail_};
|
|
|
}
|
|
|
|
|
|
template <typename T>
|
|
|
-inline typename intrusive_list<T>::const_iterator intrusive_list<T>::end() const noexcept {
|
|
|
+inline auto intrusive_list<T>::end() const noexcept -> const_iterator {
|
|
|
return const_iterator{tail_};
|
|
|
}
|
|
|
|
|
|
template <typename T>
|
|
|
-inline typename intrusive_list<T>::const_iterator intrusive_list<T>::cend() const noexcept {
|
|
|
+inline auto intrusive_list<T>::cend() const noexcept -> const_iterator {
|
|
|
return const_iterator{tail_};
|
|
|
}
|
|
|
|
|
|
template <typename T>
|
|
|
-inline typename intrusive_list<T>::reverse_iterator intrusive_list<T>::rbegin() {
|
|
|
+inline auto intrusive_list<T>::rbegin() -> reverse_iterator {
|
|
|
return reverse_iterator{end()};
|
|
|
}
|
|
|
|
|
|
template <typename T>
|
|
|
-inline typename intrusive_list<T>::const_reverse_iterator intrusive_list<T>::rbegin() const noexcept {
|
|
|
+inline auto intrusive_list<T>::rbegin() const noexcept -> const_reverse_iterator {
|
|
|
return const_reverse_iterator{end()};
|
|
|
}
|
|
|
|
|
|
template <typename T>
|
|
|
-inline typename intrusive_list<T>::const_reverse_iterator intrusive_list<T>::crbegin() const noexcept {
|
|
|
+inline auto intrusive_list<T>::crbegin() const noexcept -> const_reverse_iterator {
|
|
|
return const_reverse_iterator{cend()};
|
|
|
}
|
|
|
|
|
|
template <typename T>
|
|
|
-inline typename intrusive_list<T>::reverse_iterator intrusive_list<T>::rend() noexcept {
|
|
|
+inline auto intrusive_list<T>::rend() noexcept -> reverse_iterator {
|
|
|
return reverse_iterator{begin()};
|
|
|
}
|
|
|
|
|
|
template <typename T>
|
|
|
-inline typename intrusive_list<T>::const_reverse_iterator intrusive_list<T>::rend() const noexcept {
|
|
|
+inline auto intrusive_list<T>::rend() const noexcept -> const_reverse_iterator {
|
|
|
return const_reverse_iterator{begin()};
|
|
|
}
|
|
|
|
|
|
template <typename T>
|
|
|
-inline typename intrusive_list<T>::const_reverse_iterator intrusive_list<T>::crend() const noexcept{
|
|
|
+inline auto intrusive_list<T>::crend() const noexcept -> const_reverse_iterator {
|
|
|
return const_reverse_iterator{cbegin()};
|
|
|
}
|
|
|
|
|
|
@@ -134,12 +134,12 @@ inline bool intrusive_list<T>::empty() const noexcept {
|
|
|
}
|
|
|
|
|
|
template <typename T>
|
|
|
-inline typename intrusive_list<T>::size_type intrusive_list<T>::size() const noexcept {
|
|
|
+inline auto intrusive_list<T>::size() const noexcept -> size_type {
|
|
|
return size_;
|
|
|
}
|
|
|
|
|
|
template <typename T>
|
|
|
-inline typename intrusive_list<T>::size_type intrusive_list<T>::max_size() const noexcept {
|
|
|
+inline auto intrusive_list<T>::max_size() const noexcept -> size_type {
|
|
|
return std::numeric_limits<size_type>::max();
|
|
|
}
|
|
|
|
|
|
@@ -149,8 +149,7 @@ inline void intrusive_list<T>::clear() noexcept {
|
|
|
}
|
|
|
|
|
|
template <typename T>
|
|
|
-typename intrusive_list<T>::iterator
|
|
|
-intrusive_list<T>::insert(const_iterator pos, pointer value) {
|
|
|
+auto intrusive_list<T>::insert(const_iterator pos, pointer value) -> iterator {
|
|
|
node_type* n = &(value->*node_);
|
|
|
if ( n->list_ == nullptr ) {
|
|
|
insert_impl( pos, n );
|
|
|
@@ -161,8 +160,7 @@ intrusive_list<T>::insert(const_iterator pos, pointer value) {
|
|
|
}
|
|
|
|
|
|
template <typename T>
|
|
|
-typename intrusive_list<T>::iterator
|
|
|
-intrusive_list<T>::transfer(const_iterator pos, pointer value) {
|
|
|
+auto intrusive_list<T>::transfer(const_iterator pos, pointer value) -> iterator {
|
|
|
node_type* n = &(value->*node_);
|
|
|
n->unlink( );
|
|
|
insert_impl( pos, n );
|
|
|
@@ -178,8 +176,7 @@ void intrusive_list<T>::insert_impl( const_iterator pos, node_type * n ) {
|
|
|
}
|
|
|
|
|
|
template <typename T>
|
|
|
-typename intrusive_list<T>::iterator
|
|
|
- intrusive_list<T>::insert(const_iterator pos, std::initializer_list<pointer> ilist) {
|
|
|
+auto intrusive_list<T>::insert(const_iterator pos, std::initializer_list<pointer> ilist) -> iterator {
|
|
|
for (pointer p : ilist) {
|
|
|
insert( pos, p );
|
|
|
}
|
|
|
@@ -187,7 +184,7 @@ typename intrusive_list<T>::iterator
|
|
|
}
|
|
|
|
|
|
template <typename T>
|
|
|
-typename intrusive_list<T>::iterator intrusive_list<T>::erase(iterator pos) {
|
|
|
+auto intrusive_list<T>::erase(iterator pos) -> iterator {
|
|
|
unlink(pos.get());
|
|
|
pos.get()->list_ = nullptr;
|
|
|
--size_;
|
|
|
@@ -195,7 +192,7 @@ typename intrusive_list<T>::iterator intrusive_list<T>::erase(iterator pos) {
|
|
|
}
|
|
|
|
|
|
template <typename T>
|
|
|
-typename intrusive_list<T>::iterator intrusive_list<T>::erase(iterator first, iterator last) {
|
|
|
+auto intrusive_list<T>::erase(iterator first, iterator last) -> iterator {
|
|
|
while (first != last) {
|
|
|
first = erase(first);
|
|
|
}
|