Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Core Modules
dune-common
Commits
69fdd82f
Commit
69fdd82f
authored
14 years ago
by
Christian Engwer
Browse files
Options
Downloads
Patches
Plain Diff
the size of std::array is stored as size_t, we now do the same for Dune::array
[[Imported from SVN: r6200]]
parent
ff2db99e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dune/common/array.hh
+10
-9
10 additions, 9 deletions
dune/common/array.hh
dune/common/parametertree.hh
+0
-14
0 additions, 14 deletions
dune/common/parametertree.hh
with
10 additions
and
23 deletions
dune/common/array.hh
+
10
−
9
View file @
69fdd82f
...
...
@@ -35,7 +35,7 @@ namespace Dune
* if that is not available.
*
*/
template
<
class
T
,
in
t
N
>
template
<
class
T
,
size_
t
N
>
class
array
{
public:
...
...
@@ -72,7 +72,7 @@ namespace Dune
//! Assign value to all entries
array
<
T
,
N
>&
operator
=
(
const
T
&
t
)
{
for
(
int
i
=
0
;
i
<
N
;
i
++
)
a
[
i
]
=
t
;
for
(
size_type
i
=
0
;
i
<
N
;
i
++
)
a
[
i
]
=
t
;
return
(
*
this
);
}
...
...
@@ -85,7 +85,7 @@ namespace Dune
//! \brief Assign value to all entries (according to C++0x the fill method is to be prefered)
void
fill
(
const
T
&
t
)
{
for
(
int
i
=
0
;
i
<
N
;
i
++
)
a
[
i
]
=
t
;
for
(
size_type
i
=
0
;
i
<
N
;
i
++
)
a
[
i
]
=
t
;
}
//! Component access
...
...
@@ -128,36 +128,37 @@ namespace Dune
// Comparison Operators (see [lib.container.requirements])
// -------------------------------------------------------
template
<
class
T
,
in
t
N
>
template
<
class
T
,
size_
t
N
>
inline
bool
operator
<
(
const
array
<
T
,
N
>
&
a
,
const
array
<
T
,
N
>
&
b
)
{
return
std
::
lexicographical_compare
(
a
.
begin
(),
a
.
end
(),
b
.
begin
(),
b
.
end
()
);
}
template
<
class
T
,
in
t
N
>
template
<
class
T
,
size_
t
N
>
inline
bool
operator
>
(
const
array
<
T
,
N
>
&
a
,
const
array
<
T
,
N
>
&
b
)
{
return
b
<
a
;
}
template
<
class
T
,
in
t
N
>
template
<
class
T
,
size_
t
N
>
inline
bool
operator
<=
(
const
array
<
T
,
N
>
&
a
,
const
array
<
T
,
N
>
&
b
)
{
return
!
(
a
>
b
);
}
template
<
class
T
,
in
t
N
>
template
<
class
T
,
size_
t
N
>
inline
bool
operator
>=
(
const
array
<
T
,
N
>
&
a
,
const
array
<
T
,
N
>
&
b
)
{
return
!
(
a
<
b
);
}
#endif
//! Output operator for array
template
<
class
T
,
in
t
N
>
template
<
class
T
,
size_
t
N
>
inline
std
::
ostream
&
operator
<<
(
std
::
ostream
&
s
,
const
array
<
T
,
N
>&
e
)
{
s
<<
"["
;
for
(
in
t
i
=
0
;
i
<
N
-
1
;
i
++
)
s
<<
e
[
i
]
<<
","
;
for
(
size_
t
i
=
0
;
i
<
N
-
1
;
i
++
)
s
<<
e
[
i
]
<<
","
;
s
<<
e
[
N
-
1
]
<<
"]"
;
return
s
;
}
...
...
This diff is collapsed.
Click to expand it.
dune/common/parametertree.hh
+
0
−
14
View file @
69fdd82f
...
...
@@ -315,20 +315,6 @@ namespace Dune {
}
};
// Yes, there are two specializations for array. This one is for the Dune
// implementation, which takes the size as an int.
template
<
typename
T
,
int
n
>
struct
ParameterTree
::
Parser
<
array
<
T
,
n
>
>
{
static
array
<
T
,
n
>
parse
(
const
std
::
string
&
str
)
{
array
<
T
,
n
>
val
;
parseRange
(
str
,
val
.
begin
(),
val
.
end
());
return
val
;
}
};
// Yes, there are two specializations for array. This one is for the
// implementation from the standard, which takes the size as a size_t.
template
<
typename
T
,
std
::
size_t
n
>
struct
ParameterTree
::
Parser
<
array
<
T
,
n
>
>
{
static
array
<
T
,
n
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment