|
FreeTensor
|
#include <shared_linked_list.h>
Public Member Functions | |
| const T & | top () const |
| bool | empty () const |
| SharedLinkedList | push (const T &data) const |
| SharedLinkedList | pop () const |
| std::vector< T > | asVector () const |
| size_t | hash () const |
Friends | |
| std::vector< T > | asVector (const SharedLinkedList &bottom, const SharedLinkedList &top) |
| bool | operator== (const SharedLinkedList &lhs, const SharedLinkedList &rhs) |
Read-only stack implemented via directed linked list
A linked list linked from the stack top to the bottom. A SharedLinkedList can be copied, and then all the common contents are shared, i.e., multiple linked lists form a tree rooted at the stack bottom
A SharedLinkedList can be hashed. Two SharedLinkedLists can be compared
|
inline |
|
inline |
|
inline |
|
inline |
Drop the tail node
This function returns a new SharedLinkedList object (a new tail), while the original object is not changed. Use list = list.pop() to update a list
|
inline |
Append a node
This function returns a new SharedLinkedList object (a new tail), while the original object is not changed. Use list = list.push(...) to update a list
|
inline |
|
friend |
|
friend |