30 template <
typename T>
class Tree {
88 while (it !=
nullptr) {
100 while (it !=
nullptr) {
123 while (it !=
nullptr) {
129 friend class Tree<
T>;
175 while (it !=
nullptr) {
191 return children.emplace_back(*
this);
367 operator bool()
const {
return ptr !=
nullptr; }
389 if (
ptr->getNext() !=
nullptr) {
398 while (it !=
nullptr) {
399 if (!it->getChildren().empty())
ptr = &it->getChildren().front();
400 it = it->getPrevious();
412 if (
ptr ==
nullptr) {
418 if (
ptr->getParent() ==
nullptr)
return *
this;
421 if (
ptr->getPrevious() !=
nullptr) {
633 return *std::find_if(
begin(),
end(), [&](
const Child& child) {
RawIterator< const Child > ConstIterator
Tree(Tree &&other)=delete
void operator=(Tree &&other)=delete
const Child & front() const
RawIterator< Child > Iterator
std::unique_ptr< Child > root
const Child & operator()(size_t horizontal, size_t vertical) const
Child & operator()(size_t horizontal, size_t vertical)
const Child & back() const
ConstIterator cbegin() const
ConstIterator cend() const
const Child * getPrevious() const
void operator=(const Child &other)=delete
void removeChild(size_t horizontal)
std::list< Child > & getChildren()
Child(const Child &other)=delete
const Child * getNext() const
size_t getVerticalIndex() const
void operator=(Child &&other)=delete
Child(Child &&other)=delete
const Child * getParent() const
size_t getHorizontalIndex() const
const T * operator->() const
std::list< Child > children
Child(Child &parent, const T &value)
const T & getValue() const
Child & addChild(const T &value)
Child(Tree &tree, const T &value)
const std::list< Child > & getChildren() const
bool operator==(const RawIterator< S > it) const
const S * getConstPtr() const
RawIterator< S > & operator++()
RawIterator< S > & operator--()
bool operator!=(const RawIterator< S > it) const
const S & operator*() const
RawIterator(const Tree &tree, S *ptr=nullptr)
RawIterator< S > operator++(int)
const S * operator->() const
RawIterator< S > & operator=(S *ptr)
RawIterator< S > operator--(int)
std::bidirectional_iterator_tag iterator_category