19 template<
class type_t,
class allocator_t = xtd::collections::
generic::helpers::allocator<type_t>>
42 template<
class type_t>
93 if (!data_->list || !data_->list->count() || data_->iterator == end())
return xtd::nullopt;
94 auto tmp = data_->iterator;
106 if (!data_->list || !data_->list->count() || data_->iterator == begin())
return xtd::nullopt;
107 auto tmp = data_->iterator;
119 return data_->value.has_value() ? data_->value.value() : *data_->iterator;
129 return data_->value.has_value() ? data_->value.value() : *data_->iterator;
140 using iterator_type =
typename base_type::iterator;
144 data_->iterator = iterator;
148 auto begin() const -> iterator_type {
return data_->list->data_->items.begin();}
150 auto end() const -> iterator_type {
return data_->list->data_->items.end();}
153 linked_list<type_t>* list =
null;
154 iterator_type iterator;
Contains xtd::collections::generic::helpers::allocator alias.
Represents a node in a LinkedList<T>. This class cannot be inherited.
Definition linked_list_node.hpp:43
type_t value_type
Represents the linked list node value type.
Definition linked_list_node.hpp:49
auto value() -> value_type &
Gets the value contained in the node.
Definition linked_list_node.hpp:127
auto previous() const -> xtd::optional< linked_list_node >
Gets the previous node in the LinkedList<T>.
Definition linked_list_node.hpp:104
auto next() const -> xtd::optional< linked_list_node >
Gets the next node in the LinkedList<T>.
Definition linked_list_node.hpp:91
auto list() const noexcept -> xtd::ref< const linked_list< type_t > >
Gets the xtd::collections::generic::linked_list <type_t> that the xtd::collections::generic::linked_l...
Definition linked_list_node.hpp:84
typename linked_list_type::base_type base_type
Represents the linked list base type.
Definition linked_list_node.hpp:53
auto value() const -> const value_type &
Gets the value contained in the node.
Definition linked_list_node.hpp:117
linked_list< value_type > linked_list_type
Represents the linked list type.
Definition linked_list_node.hpp:51
linked_list_node(const value_type &value)
Initializes a new instance of the xtd::collections::generic::linked_list_node <type_t> class,...
Definition linked_list_node.hpp:67
typename linked_list_type::size_type size_type
Represents the size type.
Definition linked_list_node.hpp:55
Represents a doubly linked list.
Definition linked_list.hpp:51
std::list< value_type, allocator_t > base_type
Definition linked_list.hpp:59
xtd::size size_type
Definition linked_list.hpp:61
Represents a strongly typed list of objects that can be accessed by index. Provides methods to search...
Definition list.hpp:80
static void throws(xtd::helpers::exception_case exception_case, const source_location &location=source_location::current())
Throws an exption with specified exception case.
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:44
Represents the version number of an assembly, operating system, or the xtd. This class cannot be inhe...
Definition version.hpp:115
@ invalid_operation
The operation is not valid.
Definition exception_case.hpp:65
null_ptr null
Represents a null pointer value.
xtd::reference_wrapper_object< type_t > ref
The xtd::ref object is a reference wrapper.
Definition ref.hpp:25
xtd::sptr< type_t > ptr
The xtd::ptr object is a shared pointer.
Definition ptr.hpp:27
std::optional< type_t > optional
Represents the optional alias on std::optional.
Definition optional.hpp:25
constexpr null_opt nullopt
Represents a nullopt value. Used to indicate that an std::optional does not contain a value.
Definition nullopt.hpp:26
ptr< type_t > new_ptr(args_t &&... args)
The xtd::new_ptr operator creates a xtd::ptr object.
Definition new_ptr.hpp:24
The xtd::collections::generic namespace contains interfaces and classes that define generic collectio...
Definition comparer.hpp:16
The xtd::collections namespace contains interfaces and classes that define various collections of obj...
Definition any_pair.hpp:10
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
const_iterator begin() const
Returns an iterator to the beginning.
Definition read_only_span.hpp:183
Contains xtd::null pointer valiue.
Contains xtd::nullopt valiue.
Contains xtd::object class.
Contains xtd::optional type.