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
cd75bb0b
Commit
cd75bb0b
authored
Mar 10, 2012
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed more cruft
parent
7e00f43e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
170 deletions
+0
-170
array_kernel_c.h
dlib/array/array_kernel_c.h
+0
-170
No files found.
dlib/array/array_kernel_c.h
deleted
100644 → 0
View file @
7e00f43e
// Copyright (C) 2003 Davis E. King (davis@dlib.net)
// License: Boost Software License See LICENSE.txt for the full license.
#ifndef DLIB_ARRAY_KERNEl_C_
#define DLIB_ARRAY_KERNEl_C_
#include "array_kernel_abstract.h"
#include "../algs.h"
#include "../assert.h"
namespace
dlib
{
template
<
typename
array_base
>
class
array_kernel_c
:
public
array_base
{
typedef
typename
array_base
::
type
T
;
public
:
const
T
&
operator
[]
(
unsigned
long
pos
)
const
;
T
&
operator
[]
(
unsigned
long
pos
);
void
set_size
(
unsigned
long
size
);
const
T
&
element
(
)
const
;
T
&
element
(
);
};
template
<
typename
array_base
>
inline
void
swap
(
array_kernel_c
<
array_base
>&
a
,
array_kernel_c
<
array_base
>&
b
)
{
a
.
swap
(
b
);
}
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
// member function definitions
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
template
<
typename
array_base
>
const
typename
array_base
::
type
&
array_kernel_c
<
array_base
>::
operator
[]
(
unsigned
long
pos
)
const
{
// make sure requires clause is not broken
DLIB_CASSERT
(
pos
<
this
->
size
()
,
"
\t
const T& array::operator[]"
<<
"
\n\t
pos must < size()"
<<
"
\n\t
pos: "
<<
pos
<<
"
\n\t
size(): "
<<
this
->
size
()
<<
"
\n\t
this: "
<<
this
);
// call the real function
return
array_base
::
operator
[](
pos
);
}
// ----------------------------------------------------------------------------------------
template
<
typename
array_base
>
typename
array_base
::
type
&
array_kernel_c
<
array_base
>::
operator
[]
(
unsigned
long
pos
)
{
// make sure requires clause is not broken
DLIB_CASSERT
(
pos
<
this
->
size
()
,
"
\t
T& array::operator[]"
<<
"
\n\t
pos must be < size()"
<<
"
\n\t
pos: "
<<
pos
<<
"
\n\t
size(): "
<<
this
->
size
()
<<
"
\n\t
this: "
<<
this
);
// call the real function
return
array_base
::
operator
[](
pos
);
}
// ----------------------------------------------------------------------------------------
template
<
typename
array_base
>
void
array_kernel_c
<
array_base
>::
set_size
(
unsigned
long
size
)
{
// make sure requires clause is not broken
DLIB_CASSERT
((
size
<=
this
->
max_size
()
),
"
\t
void array::set_size"
<<
"
\n\t
size must be <= max_size()"
<<
"
\n\t
size: "
<<
size
<<
"
\n\t
max size: "
<<
this
->
max_size
()
<<
"
\n\t
this: "
<<
this
);
// call the real function
array_base
::
set_size
(
size
);
}
// ----------------------------------------------------------------------------------------
template
<
typename
array_base
>
const
typename
array_base
::
type
&
array_kernel_c
<
array_base
>::
element
(
)
const
{
// make sure requires clause is not broken
DLIB_CASSERT
(
this
->
current_element_valid
(),
"
\t
const T& array::element()"
<<
"
\n\t
The current element must be valid if you are to access it."
<<
"
\n\t
this: "
<<
this
);
// call the real function
return
array_base
::
element
();
}
// ----------------------------------------------------------------------------------------
template
<
typename
array_base
>
typename
array_base
::
type
&
array_kernel_c
<
array_base
>::
element
(
)
{
// make sure requires clause is not broken
DLIB_CASSERT
(
this
->
current_element_valid
(),
"
\t
T& array::element()"
<<
"
\n\t
The current element must be valid if you are to access it."
<<
"
\n\t
this: "
<<
this
);
// call the real function
return
array_base
::
element
();
}
// ----------------------------------------------------------------------------------------
}
#endif // DLIB_ARRAY_KERNEl_C_
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