Changeset 4a7e47b in mainline
- Timestamp:
- 2018-07-05T21:41:21Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e29ce3d
- Parents:
- 3d6f7f3
- git-author:
- Dzejrou <dzejrou@…> (2018-04-22 15:50:54)
- git-committer:
- Dzejrou <dzejrou@…> (2018-07-05 21:41:21)
- Location:
- uspace/lib/cpp/include
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/cpp/include/impl/list.hpp
r3d6f7f3 r4a7e47b 31 31 32 32 #include <cstdlib> 33 #include <internal/list.hpp> 33 34 #include <iterator> 34 35 #include <memory> … … 42 43 namespace aux 43 44 { 44 template<class T>45 struct list_node46 {47 T value;48 list_node* next;49 list_node* prev;50 51 template<class... Args>52 list_node(Args&&... args)53 : value{forward<Args>(args)...},54 next{}, prev{}55 {56 next = this;57 prev = this;58 }59 60 list_node(const T& val)61 : value{val}, next{}, prev{}62 {63 next = this;64 prev = this;65 }66 67 list_node(T&& val)68 : value{forward<T>(val)}, next{}, prev{}69 {70 next = this;71 prev = this;72 }73 74 void append(list_node* node)75 {76 node->next = next;77 node->prev = this;78 next->prev = node;79 next = node;80 }81 82 void prepend(list_node* node)83 {84 node->next = this;85 node->prev = prev;86 prev->next = node;87 prev = node;88 }89 90 void unlink()91 {92 prev->next = next;93 next->prev = prev;94 }95 };96 97 45 template<class T> 98 46 class list_const_iterator
Note:
See TracChangeset
for help on using the changeset viewer.