Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-istl
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
Model registry
Operate
Environments
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-istl
Commits
1f896e2a
Commit
1f896e2a
authored
6 months ago
by
Simon Praetorius
Committed by
Christoph Grüninger
6 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix constructors in iterators
parent
43a98e67
No related branches found
Branches containing commit
No related tags found
1 merge request
!584
Fix constructors in iterators
Pipeline
#73730
passed
6 months ago
Stage: .pre
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dune/istl/basearray.hh
+39
-21
39 additions, 21 deletions
dune/istl/basearray.hh
dune/istl/paamg/hierarchy.hh
+15
-11
15 additions, 11 deletions
dune/istl/paamg/hierarchy.hh
with
54 additions
and
32 deletions
dune/istl/basearray.hh
+
39
−
21
View file @
1f896e2a
...
...
@@ -10,6 +10,7 @@
#include
<cstddef>
#include
<memory>
#include
<algorithm>
#include
<type_traits>
#include
"istlexception.hh"
#include
<dune/common/iteratorfacades.hh>
...
...
@@ -97,17 +98,27 @@ namespace Imp {
friend
class
RealIterator
<
ValueType
>
;
//! constructor
RealIterator
()
:
p
(
0
),
i
(
0
)
{}
RealIterator
()
=
default
;
RealIterator
(
const
B
*
_p
,
B
*
_i
)
:
p
(
_p
),
i
(
_i
)
{
}
RealIterator
(
const
B
*
_p
,
B
*
_i
)
:
p
(
_p
),
i
(
_i
)
{}
RealIterator
(
const
RealIterator
<
ValueType
>&
it
)
:
p
(
it
.
p
),
i
(
it
.
i
)
template
<
class
T_
,
std
::
enable_if_t
<
std
::
is_same_v
<
std
::
remove_const_t
<
T
>,
std
::
remove_const_t
<
T_
>>
,
int
>
=
0
>
RealIterator
(
const
RealIterator
<
T_
>&
other
)
:
p
(
other
.
p
),
i
(
other
.
i
)
{}
template
<
class
T_
,
std
::
enable_if_t
<
std
::
is_same_v
<
std
::
remove_const_t
<
T
>,
std
::
remove_const_t
<
T_
>>
,
int
>
=
0
>
RealIterator
&
operator
=
(
const
RealIterator
<
T_
>&
other
)
{
p
=
other
.
p
;
i
=
other
.
i
;
return
*
this
;
}
//! return index
size_type
index
()
const
{
...
...
@@ -163,8 +174,8 @@ namespace Imp {
i
+=
d
;
}
const
B
*
p
;
B
*
i
;
const
B
*
p
=
nullptr
;
B
*
i
=
nullptr
;
};
//! iterator type for sequential access
...
...
@@ -349,22 +360,29 @@ namespace Imp {
friend
class
RealIterator
<
ValueType
>
;
//! constructor
RealIterator
()
:
p
(
0
),
j
(
0
),
i
(
0
)
{}
RealIterator
()
=
default
;
//! constructor
RealIterator
(
B
*
_p
,
size_type
*
_j
,
size_type
_i
)
:
p
(
_p
),
j
(
_j
),
i
(
_i
)
{
}
{}
/**
* @brief Copy constructor from mutable iterator
*/
RealIterator
(
const
RealIterator
<
ValueType
>&
it
)
:
p
(
it
.
p
),
j
(
it
.
j
),
i
(
it
.
i
)
template
<
class
T_
,
std
::
enable_if_t
<
std
::
is_same_v
<
std
::
remove_const_t
<
T
>,
std
::
remove_const_t
<
T_
>>
,
int
>
=
0
>
RealIterator
(
const
RealIterator
<
T_
>&
other
)
:
p
(
other
.
p
),
j
(
other
.
j
),
i
(
other
.
i
)
{}
template
<
class
T_
,
std
::
enable_if_t
<
std
::
is_same_v
<
std
::
remove_const_t
<
T
>,
std
::
remove_const_t
<
T_
>>
,
int
>
=
0
>
RealIterator
&
operator
=
(
const
RealIterator
<
T_
>&
other
)
{
p
=
other
.
p
;
j
=
other
.
j
;
i
=
other
.
i
;
return
*
this
;
}
//! equality
bool
equals
(
const
RealIterator
<
ValueType
>&
it
)
const
...
...
@@ -424,9 +442,9 @@ namespace Imp {
return
p
[
i
];
}
B
*
p
;
size_type
*
j
;
size_type
i
;
B
*
p
=
nullptr
;
size_type
*
j
=
nullptr
;
size_type
i
=
0
;
};
/** @brief The iterator type. */
...
...
This diff is collapsed.
Click to expand it.
dune/istl/paamg/hierarchy.hh
+
15
−
11
View file @
1f896e2a
...
...
@@ -125,24 +125,28 @@ namespace Dune
public:
/** @brief Constructor. */
LevelIterator
()
{}
LevelIterator
()
=
default
;
LevelIterator
(
std
::
shared_ptr
<
Element
>
element
)
:
element_
(
element
)
:
element_
(
std
::
move
(
element
)
)
{}
/** @brief Copy constructor. */
LevelIterator
(
const
LevelIterator
<
typename
std
::
remove_const
<
C
>::
type
,
typename
std
::
remove_const
<
T1
>::
type
>&
other
)
template
<
class
C_
,
class
T1_
,
std
::
enable_if_t
<
std
::
is_same_v
<
std
::
remove_const_t
<
C
>,
std
::
remove_const_t
<
C_
>>
,
int
>
=
0
,
std
::
enable_if_t
<
std
::
is_same_v
<
std
::
remove_const_t
<
T1
>
,
std
::
remove_const_t
<
T1_
>>
,
int
>
=
0
>
LevelIterator
(
const
LevelIterator
<
C_
,
T1_
>&
other
)
:
element_
(
other
.
element_
)
{}
/** @brief Copy constructor. */
LevelIterator
(
const
LevelIterator
<
const
typename
std
::
remove_const
<
C
>::
type
,
const
typename
std
::
remove_const
<
T1
>::
type
>&
other
)
:
element_
(
other
.
element_
)
{}
template
<
class
C_
,
class
T1_
,
std
::
enable_if_t
<
std
::
is_same_v
<
std
::
remove_const_t
<
C
>,
std
::
remove_const_t
<
C_
>>
,
int
>
=
0
,
std
::
enable_if_t
<
std
::
is_same_v
<
std
::
remove_const_t
<
T1
>
,
std
::
remove_const_t
<
T1_
>>
,
int
>
=
0
>
LevelIterator
&
operator
=
(
const
LevelIterator
<
C_
,
T1_
>&
other
)
{
element_
=
other
.
element_
;
return
*
this
;
}
/**
* @brief Equality check.
...
...
@@ -209,7 +213,7 @@ namespace Dune
}
private
:
std
::
shared_ptr
<
Element
>
element_
;
std
::
shared_ptr
<
Element
>
element_
=
{}
;
};
/** @brief Type of the mutable iterator. */
...
...
This diff is collapsed.
Click to expand it.
Timo Koch
@tkoch
mentioned in commit
925ff5ed
·
3 months ago
mentioned in commit
925ff5ed
mentioned in commit 925ff5edf615e34c567a9aade88f9ebbce00dd8a
Toggle commit list
Timo Koch
@tkoch
mentioned in merge request
!597 (merged)
·
3 months ago
mentioned in merge request
!597 (merged)
mentioned in merge request !597
Toggle commit list
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