65 if (_head ==
nullptr) {
74 while (node !=
nullptr) {
75 if (node->getSibling() ==
nullptr) {
77 node->setSibling(newNode);
81 node = node->getSibling();
86 bool remove(T removeNode)
88 if (removeNode ==
nullptr) {
93 if (removeNode == _head) {
94 if (_head !=
nullptr) {
95 _head = _head->getSibling();
101 for (T node = getHead(); node !=
nullptr; node = node->getSibling()) {
103 if (node->getSibling() == removeNode) {
105 if (node->getSibling() !=
nullptr) {
106 node->setSibling(node->getSibling()->getSibling());
109 node->setSibling(
nullptr);
123 operator T()
const {
return node; }
124 operator T &() {
return node; }
129 node = node->getSibling();
136 Iterator
begin() {
return Iterator(getHead()); }
137 Iterator
end() {
return Iterator(
nullptr); }
141 bool empty()
const {
return getHead() ==
nullptr; }
147 for (
auto node = getHead(); node !=
nullptr; node = node->getSibling()) {
164 auto node = getHead();
166 while (node !=
nullptr) {
167 auto next = node->getSibling();
Dual< Scalar, N > operator*(const Dual< Scalar, N > &a, const Dual< Scalar, N > &b)
void setSibling(T sibling)
const T getSibling() const