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

[common][indexedit] modify doc

parent caa52fd2
...@@ -19,10 +19,8 @@ ...@@ -19,10 +19,8 @@
/*! /*!
* \file * \file
* \ingroup Common * \ingroup Common
* \brief Base class for stl conformant forward iterators. * \brief Iterator facade that allows iterating over a subset of a container with
* The implementations are strongly inspired by Dune, see * random access, where the subset is given by means of indices.
* https://gitlab.dune-project.org/core/dune-common/-/blob/master/dune/common/iteratorfacades.hh
*
*/ */
#ifndef FRACKIT_COMMON_ITERATORFACADES_HH #ifndef FRACKIT_COMMON_ITERATORFACADES_HH
#define FRACKIT_COMMON_ITERATORFACADES_HH #define FRACKIT_COMMON_ITERATORFACADES_HH
...@@ -35,27 +33,10 @@ namespace Frackit { ...@@ -35,27 +33,10 @@ namespace Frackit {
/*! /*!
* \ingroup Common * \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 * 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 * 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 IT Iterator implementation
* \tparam VT The value type * \tparam VT The value type
* \tparam RT The reference type * \tparam RT The reference type
...@@ -86,19 +67,19 @@ public: ...@@ -86,19 +67,19 @@ public:
pointer operator->() const pointer operator->() const
{ return &(static_cast<const Implementation *>(this)->dereference()); } { return &(static_cast<const Implementation *>(this)->dereference()); }
//! Preincrement operator //! pre-increment operator
Implementation& operator++() Implementation& operator++()
{ {
static_cast<Implementation *>(this)->increment(); static_cast<Implementation *>(this)->increment();
return *static_cast<Implementation *>(this); return *static_cast<Implementation *>(this);
} }
//! Postincrement operator //! post-increment operator
Implementation operator++(int) Implementation operator++(int)
{ {
Implementation tmp(static_cast<Implementation const&>(*this)); Implementation tmp(static_cast<Implementation const&>(*this));
this->operator++(); this->operator++();
return tmp; return tmp;
} }
//! equality operator //! equality operator
...@@ -106,6 +87,7 @@ public: ...@@ -106,6 +87,7 @@ public:
friend inline bool operator==(const Implementation& it, const OtherIt& otherIt) friend inline bool operator==(const Implementation& it, const OtherIt& otherIt)
{ return it.equals(otherIt); } { return it.equals(otherIt); }
//! equality operator
template<class OtherIt, std::enable_if_t<isInteroperable<OtherIt> template<class OtherIt, std::enable_if_t<isInteroperable<OtherIt>
&& !std::is_same_v<OtherIt, Implementation>, int> = 0> && !std::is_same_v<OtherIt, Implementation>, int> = 0>
friend inline bool operator==(const OtherIt& otherIt, const Implementation& it) friend inline bool operator==(const OtherIt& otherIt, const Implementation& it)
...@@ -116,6 +98,7 @@ public: ...@@ -116,6 +98,7 @@ public:
friend inline bool operator!=(const Implementation& it, const OtherIt& otherIt) friend inline bool operator!=(const Implementation& it, const OtherIt& otherIt)
{ return !it.equals(otherIt); } { return !it.equals(otherIt); }
//! inequality operator
template<class OtherIt, std::enable_if_t<isInteroperable<OtherIt> template<class OtherIt, std::enable_if_t<isInteroperable<OtherIt>
&& !std::is_same_v<OtherIt, Implementation>, int> = 0> && !std::is_same_v<OtherIt, Implementation>, int> = 0>
friend inline bool operator!=(const OtherIt& otherIt, const Implementation& it) 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