Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
b5988db6
Commit
b5988db6
authored
Apr 20, 2018
by
Davis King
Browse files
Added .begin() and .end() to array2d.
parent
30101dff
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
0 deletions
+62
-0
dlib/array2d/array2d_kernel.h
dlib/array2d/array2d_kernel.h
+24
-0
dlib/array2d/array2d_kernel_abstract.h
dlib/array2d/array2d_kernel_abstract.h
+38
-0
No files found.
dlib/array2d/array2d_kernel.h
View file @
b5988db6
...
...
@@ -60,6 +60,9 @@ namespace dlib
typedef
T
type
;
typedef
mem_manager
mem_manager_type
;
typedef
T
*
iterator
;
typedef
const
T
*
const_iterator
;
// -----------------------------------
...
...
@@ -321,6 +324,27 @@ namespace dlib
return
nc_
*
sizeof
(
T
);
}
iterator
begin
()
{
return
data
;
}
iterator
end
()
{
return
data
+
size
();
}
const_iterator
begin
()
const
{
return
data
;
}
const_iterator
end
()
const
{
return
data
+
size
();
}
private:
...
...
dlib/array2d/array2d_kernel_abstract.h
View file @
b5988db6
...
...
@@ -64,6 +64,8 @@ namespace dlib
typedef
T
type
;
typedef
mem_manager
mem_manager_type
;
typedef
T
*
iterator
;
typedef
const
T
*
const_iterator
;
// ----------------------------------------
...
...
@@ -255,6 +257,42 @@ namespace dlib
An example of such an object is the dlib::cv_image.
!*/
iterator
begin
(
);
/*!
ensures
- returns a random access iterator pointing to the first element in this
object.
- The iterator will iterate over the elements of the object in row major
order.
!*/
iterator
end
(
);
/*!
ensures
- returns a random access iterator pointing to one past the end of the last
element in this object.
!*/
const_iterator
begin
(
)
const
;
/*!
ensures
- returns a random access iterator pointing to the first element in this
object.
- The iterator will iterate over the elements of the object in row major
order.
!*/
const_iterator
end
(
)
const
;
/*!
ensures
- returns a random access iterator pointing to one past the end of the last
element in this object.
!*/
};
template
<
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment