18template <
class StorageType,
bool modifiable>
25 std::conditional_t<modifiable, typename StorageType::iterator, typename StorageType::const_iterator>;
30 using ParticleType = std::remove_pointer_t<typename StorageType::value_type>;
43 using pointer =
typename IteratorType::pointer;
63 inline std::conditional_t<modifiable, ParticleType &, const ParticleType &>
operator*()
const {
67 if constexpr (std::is_same_v<std::remove_const_t<std::remove_reference_t<RetType>>,
68 std::remove_const_t<std::remove_reference_t<
decltype(*iterator)>>>) {
70 }
else if constexpr (std::is_same_v<std::remove_const_t<std::remove_reference_t<RetType>>,
71 std::remove_const_t<std::remove_reference_t<
decltype(**iterator)>>>) {
75 return decltype(*iterator)::thisMemberDoesntExist;
83 inline std::conditional_t<modifiable, ParticleType *, const ParticleType *>
operator->()
const {
Wraps the iterator of arbitrary cells to provide a common interface.
Definition: CellIterator.h:19
std::conditional_t< modifiable, ParticleType &, const ParticleType & > operator*() const
Dereference operator.
Definition: CellIterator.h:63
typename IteratorType::value_type value_type
Type trait to be compatible with std::iterator.
Definition: CellIterator.h:39
bool operator!=(const CellIterator &rhs) const
Not equality operator.
Definition: CellIterator.h:116
typename IteratorType::reference reference
Type trait to be compatible with std::iterator.
Definition: CellIterator.h:47
bool operator==(const CellIterator &rhs) const
Equality operator.
Definition: CellIterator.h:110
bool operator<(const CellIterator &rhs) const
Comparison operator.
Definition: CellIterator.h:130
CellIterator< StorageType, modifiable > & operator++()
Increment the iterator.
Definition: CellIterator.h:91
CellIterator(IteratorType iterator)
Constructor.
Definition: CellIterator.h:57
difference_type operator-(const CellIterator &rhs) const
Distance between two iterators.
Definition: CellIterator.h:123
CellIterator< StorageType, modifiable > & operator--()
Decrement the iterator.
Definition: CellIterator.h:100
std::remove_pointer_t< typename StorageType::value_type > ParticleType
Type of the Particles in the storage.
Definition: CellIterator.h:30
typename IteratorType::iterator_category iterator_category
Type trait to be compatible with std::iterator.
Definition: CellIterator.h:51
typename IteratorType::difference_type difference_type
Type trait to be compatible with std::iterator.
Definition: CellIterator.h:35
std::conditional_t< modifiable, typename StorageType::iterator, typename StorageType::const_iterator > IteratorType
Type of the wrapped iterator.
Definition: CellIterator.h:25
typename IteratorType::pointer pointer
Type trait to be compatible with std::iterator.
Definition: CellIterator.h:43
std::conditional_t< modifiable, ParticleType *, const ParticleType * > operator->() const
Dereference operator.
Definition: CellIterator.h:83