CBMC
zip_iteratort< first_iteratort, second_iteratort, same_size > Struct Template Reference

Zip two ranges to make a range of pairs. More...

#include <range.h>

+ Collaboration diagram for zip_iteratort< first_iteratort, second_iteratort, same_size >:

Public Types

using difference_type = typename first_iteratort::difference_type
 
using value_type = std::pair< typename first_iteratort::value_type, typename second_iteratort::value_type >
 
using pointer = value_type *
 
using reference = value_type &
 
using iterator_category = std::forward_iterator_tag
 

Public Member Functions

bool operator== (const zip_iteratort &other) const
 
bool operator!= (const zip_iteratort &other) const
 
zip_iteratortoperator++ ()
 Preincrement operator. More...
 
zip_iteratort operator++ (int)
 Postincrement operator. More...
 
reference operator* () const
 
pointer operator-> () const
 
 zip_iteratort (first_iteratort _first_begin, first_iteratort _first_end, second_iteratort _second_begin, second_iteratort _second_end)
 

Private Member Functions

bool end_reached () const
 

Private Attributes

first_iteratort first_begin
 
first_iteratort first_end
 
second_iteratort second_begin
 
second_iteratort second_end
 
std::shared_ptr< value_typecurrent = nullptr
 

Detailed Description

template<typename first_iteratort, typename second_iteratort, bool same_size = true>
struct zip_iteratort< first_iteratort, second_iteratort, same_size >

Zip two ranges to make a range of pairs.

On increment, both iterators are incremented. Ends when both of the two ranges reach their end if same_size is true, when one of the two ranges ends otherwise.

Template Parameters
same_sizeif true invariants are checking that one range does not end before the other

Definition at line 278 of file range.h.

Member Typedef Documentation

◆ difference_type

template<typename first_iteratort , typename second_iteratort , bool same_size = true>
using zip_iteratort< first_iteratort, second_iteratort, same_size >::difference_type = typename first_iteratort::difference_type

Definition at line 281 of file range.h.

◆ iterator_category

template<typename first_iteratort , typename second_iteratort , bool same_size = true>
using zip_iteratort< first_iteratort, second_iteratort, same_size >::iterator_category = std::forward_iterator_tag

Definition at line 287 of file range.h.

◆ pointer

template<typename first_iteratort , typename second_iteratort , bool same_size = true>
using zip_iteratort< first_iteratort, second_iteratort, same_size >::pointer = value_type *

Definition at line 285 of file range.h.

◆ reference

template<typename first_iteratort , typename second_iteratort , bool same_size = true>
using zip_iteratort< first_iteratort, second_iteratort, same_size >::reference = value_type &

Definition at line 286 of file range.h.

◆ value_type

template<typename first_iteratort , typename second_iteratort , bool same_size = true>
using zip_iteratort< first_iteratort, second_iteratort, same_size >::value_type = std::pair< typename first_iteratort::value_type, typename second_iteratort::value_type>

Definition at line 282 of file range.h.

Constructor & Destructor Documentation

◆ zip_iteratort()

template<typename first_iteratort , typename second_iteratort , bool same_size = true>
zip_iteratort< first_iteratort, second_iteratort, same_size >::zip_iteratort ( first_iteratort  _first_begin,
first_iteratort  _first_end,
second_iteratort  _second_begin,
second_iteratort  _second_end 
)
inline

Definition at line 338 of file range.h.

Member Function Documentation

◆ end_reached()

template<typename first_iteratort , typename second_iteratort , bool same_size = true>
bool zip_iteratort< first_iteratort, second_iteratort, same_size >::end_reached ( ) const
inlineprivate

Definition at line 362 of file range.h.

◆ operator!=()

template<typename first_iteratort , typename second_iteratort , bool same_size = true>
bool zip_iteratort< first_iteratort, second_iteratort, same_size >::operator!= ( const zip_iteratort< first_iteratort, second_iteratort, same_size > &  other) const
inline

Definition at line 298 of file range.h.

◆ operator*()

template<typename first_iteratort , typename second_iteratort , bool same_size = true>
reference zip_iteratort< first_iteratort, second_iteratort, same_size >::operator* ( ) const
inline

Definition at line 327 of file range.h.

◆ operator++() [1/2]

template<typename first_iteratort , typename second_iteratort , bool same_size = true>
zip_iteratort& zip_iteratort< first_iteratort, second_iteratort, same_size >::operator++ ( )
inline

Preincrement operator.

Definition at line 304 of file range.h.

◆ operator++() [2/2]

template<typename first_iteratort , typename second_iteratort , bool same_size = true>
zip_iteratort zip_iteratort< first_iteratort, second_iteratort, same_size >::operator++ ( int  )
inline

Postincrement operator.

Definition at line 320 of file range.h.

◆ operator->()

template<typename first_iteratort , typename second_iteratort , bool same_size = true>
pointer zip_iteratort< first_iteratort, second_iteratort, same_size >::operator-> ( ) const
inline

Definition at line 333 of file range.h.

◆ operator==()

template<typename first_iteratort , typename second_iteratort , bool same_size = true>
bool zip_iteratort< first_iteratort, second_iteratort, same_size >::operator== ( const zip_iteratort< first_iteratort, second_iteratort, same_size > &  other) const
inline

Definition at line 289 of file range.h.

Member Data Documentation

◆ current

template<typename first_iteratort , typename second_iteratort , bool same_size = true>
std::shared_ptr<value_type> zip_iteratort< first_iteratort, second_iteratort, same_size >::current = nullptr
private

Definition at line 360 of file range.h.

◆ first_begin

template<typename first_iteratort , typename second_iteratort , bool same_size = true>
first_iteratort zip_iteratort< first_iteratort, second_iteratort, same_size >::first_begin
private

Definition at line 356 of file range.h.

◆ first_end

template<typename first_iteratort , typename second_iteratort , bool same_size = true>
first_iteratort zip_iteratort< first_iteratort, second_iteratort, same_size >::first_end
private

Definition at line 357 of file range.h.

◆ second_begin

template<typename first_iteratort , typename second_iteratort , bool same_size = true>
second_iteratort zip_iteratort< first_iteratort, second_iteratort, same_size >::second_begin
private

Definition at line 358 of file range.h.

◆ second_end

template<typename first_iteratort , typename second_iteratort , bool same_size = true>
second_iteratort zip_iteratort< first_iteratort, second_iteratort, same_size >::second_end
private

Definition at line 359 of file range.h.


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