MARLEY (Model of Argon Reaction Low Energy Yields)  v1.2.0
A Monte Carlo event generator for tens-of-MeV neutrino interactions
Public Types | Public Member Functions | Public Attributes | Protected Attributes | List of all members
marley::IteratorToMember< It, R > Class Template Reference

Template class that creates an iterator to a class member based on an iterator to the class object. More...

#include <IteratorToMember.hh>

Public Types

typedef std::iterator_traits< It >::difference_type difference_type
 
typedef std::iterator_traits< It >::iterator_category iterator_category
 
typedef R * pointer
 
typedef R & reference
 
typedef std::iterator_traits< It >::value_type T
 Type pointed to by original iterator.
 
typedef R value_type
 

Public Member Functions

 IteratorToMember (It from, R T::*memptr)
 Construction from an iterator and a pointer to member. More...
 
bool operator!= (const IteratorToMember< It, R > &rhs) const
 
reference operator* () const
 
IteratorToMember operator+ (difference_type n) const
 
IteratorToMemberoperator++ ()
 
IteratorToMember operator++ (int)
 Postfix operator++ (dummy argument) More...
 
IteratorToMemberoperator+= (difference_type n)
 
difference_type operator- (const IteratorToMember< It, R > &rhs) const
 
IteratorToMember operator- (difference_type n) const
 
IteratorToMemberoperator-- ()
 
IteratorToMember operator-- (int)
 Postfix operator-- (see note about the postfix operator++)
 
IteratorToMemberoperator-= (difference_type n)
 
pointer operator-> () const
 
bool operator== (const IteratorToMember< It, R > &rhs) const
 
reference operator[] (difference_type n) const
 

Public Attributes

It m_it
 

Protected Attributes

value_type T::* m_memptr
 

Detailed Description

template<typename It, typename R>
class marley::IteratorToMember< It, R >

Template class that creates an iterator to a class member based on an iterator to the class object.

The IteratorToMember class is based on this code.

Template Parameters
Ittype of the original iterator
Rtype of the class member we want to point to

Constructor & Destructor Documentation

◆ IteratorToMember()

template<typename It , typename R >
marley::IteratorToMember< It, R >::IteratorToMember ( It  from,
R T::*  memptr 
)
inline

Construction from an iterator and a pointer to member.

Parameters
fromIterator to the object
memptrPointer to the member of interest

Member Function Documentation

◆ operator++()

template<typename It , typename R >
IteratorToMember< It, R > marley::IteratorToMember< It, R >::operator++ ( int  )
inline

Postfix operator++ (dummy argument)

Note
The standard behavior for this operator is to return the un-incremented value while incrementing the operand. See discussion here.

The documentation for this class was generated from the following file: