Commit defc80dd authored by Dennis Gläser's avatar Dennis Gläser
Browse files

[common][indexedit] modify doc

parent caa52fd2
......@@ -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 facades.
* 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()); }
//! Preincrement operator
//! pre-increment operator
Implementation& operator++()
{
static_cast<Implementation *>(this)->increment();
return *static_cast<Implementation *>(this);
static_cast<Implementation *>(this)->increment();
return *static_cast<Implementation *>(this);
}
//! Postincrement operator
//! post-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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment