xtd
1.0.0
Toggle main menu visibility
Loading...
Searching...
No Matches
xtd.core
include
xtd
collections
generic
extensions
list_common.hpp
Go to the documentation of this file.
1
4
#pragma once
5
#define __XTD_CORE_INTERNAL__
6
#include "
../../../internal/__span_definitions.hpp
"
7
#undef __XTD_CORE_INTERNAL__
8
#include "
../../../self.hpp
"
9
11
namespace
xtd
{
13
struct
index;
14
class
range
;
16
18
namespace
collections
{
20
namespace
generic
{
22
namespace
extensions
{
39
template
<
typename
type_t,
typename
list_t>
40
class
list_common {
41
public
:
43
48
[[nodiscard]]
virtual
auto
operator ()
(
xtd::usize
index)
const
->
const
type_t& {
49
return
self().operator [](index);
50
}
51
54
[[nodiscard]]
virtual
auto
operator ()
(
xtd::usize
index) -> type_t& {
55
return
self().operator [](index);
56
}
57
61
[[nodiscard]]
auto
operator []
(
const
xtd::index& index)
const
->
const
type_t&;
65
[[nodiscard]]
auto
operator []
(
const
xtd::index& index) -> type_t&;
66
70
[[nodiscard]]
auto
operator ()
(
const
xtd::index& index)
const
->
const
type_t&;
74
[[nodiscard]]
auto
operator ()
(
const
xtd::index& index) -> type_t&;
75
79
[[nodiscard]]
auto
operator []
(
const
xtd::range
&
range
)
const
->
xtd::read_only_span<type_t>
;
83
[[nodiscard]]
auto
operator []
(
const
xtd::range
&
range
) ->
xtd::span<type_t>
;
84
88
[[nodiscard]]
auto
operator ()
(
const
xtd::range
&
range
)
const
->
xtd::read_only_span<type_t>
;
92
[[nodiscard]]
auto
operator ()
(
const
xtd::range
&
range
) ->
xtd::span<type_t>
;
94
95
private
:
96
auto
self() const noexcept -> const list_t& {
return
static_cast<
const
list_t&
>
(
self_
);}
97
auto
self() noexcept -> list_t& {
return
static_cast<
list_t&
>
(
self_
);}
98
99
friend
list_t;
100
list_common() =
default
;
101
};
102
}
103
}
104
}
105
}
__span_definitions.hpp
xtd::collections::generic::extensions::list_common::operator()
virtual auto operator()(xtd::usize index) const -> const type_t &
Gets the element at the specified index.
Definition
list_common.hpp:48
xtd::collections::generic::extensions::list_common::operator[]
auto operator[](const xtd::index &index) const -> const type_t &
Gets the element at the specified index.
xtd::range
Represents a range that has start and end indexes.
Definition
range.hpp:28
xtd::span
Represents a non-owning view over a contiguous sequence of objects.
Definition
span.hpp:58
self_
#define self_
The self_ expression is a reference value expression whose value is the reference of the implicit obj...
Definition
self.hpp:20
xtd::usize
std::size_t usize
Represents an unsigned size of any object in bytes.
Definition
usize.hpp:22
xtd::collections::generic::extensions
The xtd::extensions namespace contains interface extensions.
Definition
collection_common.hpp:14
xtd::collections::generic
The xtd::collections::generic namespace contains interfaces and classes that define generic collectio...
Definition
comparer.hpp:16
xtd::collections
The xtd::collections namespace contains interfaces and classes that define various collections of obj...
Definition
any_pair.hpp:10
xtd
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition
abstract_object.hpp:8
xtd::read_only_span
constexpr read_only_span()
Creates an empty xtd::read_only_span whose xtd::read_only_span::data is null and xtd::read_only_span:...
Definition
read_only_span.hpp:88
self.hpp
Contains self_ keyword.
Generated on
for xtd by
Gammasoft
. All rights reserved.