Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
b5988db6
Commit
b5988db6
authored
6 years ago
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added .begin() and .end() to array2d.
parent
30101dff
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
0 deletions
+62
-0
array2d_kernel.h
dlib/array2d/array2d_kernel.h
+24
-0
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
:
...
...
This diff is collapsed.
Click to expand it.
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
<
...
...
This diff is collapsed.
Click to expand it.
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