more ~master (2021-04-25T17:22:00Z)
Home
Dub
Repo
LimitArray.CommonMixin
more
array
LimitArray
Undocumented in source.
template
LimitArray
(T)
static if
(!(
!is(T == Unqual!T)
))
enum
CommonMixin
=
q{
pragma
(
inline
) @
property
auto
asArray
() {
return
this
.
ptr
[
0
..
limit
-
ptr
]; }
pragma
(
inline
)
auto
slice
(
size_t
offset
) {
auto
newPtr
=
ptr
+
offset
;
assert
(
newPtr
<=
limit
,
"slice offset range violation"
);
return
typeof
(
this
)(
newPtr
,
limit
); }
pragma
(
inline
)
auto
slice
(
size_t
offset
,
size_t
newLimit
)
in
{
assert
(
newLimit
>=
offset
,
"slice offset range violation"
); }
do
{
auto
newLimitPtr
=
ptr
+
newLimit
;
assert
(
newLimitPtr
<=
limit
,
"slice limit range violation"
);
return
typeof
(
this
)(
ptr
+
offset
,
ptr
+
newLimit
); }
pragma
(
inline
)
auto
ptrSlice
(
typeof
(
this
.
ptr
)
ptr
) {
auto
copy
=
this
;
copy.ptr
=
ptr
;
return
copy
; }
}
;
Meta
Source
See Source File
more
array
LimitArray
aliases
LimitArray
manifest constants
CommonMixin
structs
const_
immutable_
mutable