Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tools
frackit
Commits
defc80dd
Commit
defc80dd
authored
Dec 18, 2020
by
Dennis Gläser
Browse files
[common][indexedit] modify doc
parent
caa52fd2
Changes
1
Hide whitespace changes
Inline
Side-by-side
frackit/common/iteratorfacades.hh
View file @
defc80dd
...
...
@@ -19,10 +19,8 @@
/*!
* \file
* \ingroup Common
* \brief Base class for stl conformant forward iterators.
* The implementations are strongly inspired by Dune, see
* https://gitlab.dune-project.org/core/dune-common/-/blob/master/dune/common/iteratorfacades.hh
*
* \brief Iterator facade that allows iterating over a subset of a container with
* random access, where the subset is given by means of indices.
*/
#ifndef FRACKIT_COMMON_ITERATORFACADES_HH
#define FRACKIT_COMMON_ITERATORFACADES_HH
...
...
@@ -35,27 +33,10 @@ namespace Frackit {
/*!
* \ingroup Common
* \brief Base class for
stl conformant
forward iterators.
* \brief Base class for forward iterator
facade
s.
* The implementation is strongly inspired by the one in Dune, see
* https://gitlab.dune-project.org/core/dune-common/-/blob/master/dune/common/iteratorfacades.hh
*
* Implementations must define following functions:
*
* \code
*
* // Access the value referred to.
* reference dereference() const;
*
* // Compare for equality with iterator j
* bool equals(j);
*
* // position the iterator at the next element.
* void increment()
*
* \endcode
*
* See the above link to dune-common for more information.
*
* \tparam IT Iterator implementation
* \tparam VT The value type
* \tparam RT The reference type
...
...
@@ -86,19 +67,19 @@ public:
pointer
operator
->
()
const
{
return
&
(
static_cast
<
const
Implementation
*>
(
this
)
->
dereference
());
}
//!
P
reincrement operator
//!
p
re
-
increment operator
Implementation
&
operator
++
()
{
static_cast
<
Implementation
*>
(
this
)
->
increment
();
return
*
static_cast
<
Implementation
*>
(
this
);
static_cast
<
Implementation
*>
(
this
)
->
increment
();
return
*
static_cast
<
Implementation
*>
(
this
);
}
//!
P
ostincrement operator
//!
p
ost
-
increment operator
Implementation
operator
++
(
int
)
{
Implementation
tmp
(
static_cast
<
Implementation
const
&>
(
*
this
));
this
->
operator
++
();
return
tmp
;
Implementation
tmp
(
static_cast
<
Implementation
const
&>
(
*
this
));
this
->
operator
++
();
return
tmp
;
}
//! equality operator
...
...
@@ -106,6 +87,7 @@ public:
friend
inline
bool
operator
==
(
const
Implementation
&
it
,
const
OtherIt
&
otherIt
)
{
return
it
.
equals
(
otherIt
);
}
//! equality operator
template
<
class
OtherIt
,
std
::
enable_if_t
<
isInteroperable
<
OtherIt
>
&&
!
std
::
is_same_v
<
OtherIt
,
Implementation
>
,
int
>
=
0
>
friend
inline
bool
operator
==
(
const
OtherIt
&
otherIt
,
const
Implementation
&
it
)
...
...
@@ -116,6 +98,7 @@ public:
friend
inline
bool
operator
!=
(
const
Implementation
&
it
,
const
OtherIt
&
otherIt
)
{
return
!
it
.
equals
(
otherIt
);
}
//! inequality operator
template
<
class
OtherIt
,
std
::
enable_if_t
<
isInteroperable
<
OtherIt
>
&&
!
std
::
is_same_v
<
OtherIt
,
Implementation
>
,
int
>
=
0
>
friend
inline
bool
operator
!=
(
const
OtherIt
&
otherIt
,
const
Implementation
&
it
)
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment