libkeepass 0.2.0
KeePass key database importer/exporter library
Loading...
Searching...
No Matches
keepass::bounds_checked_iterator< C > Class Template Reference

An output iterator that throws on writing past the end of a container. More...

#include <iterator.hh>

Public Types

using iterator_category = std::output_iterator_tag
 
using value_type = void
 
using difference_type = void
 
using pointer = void
 
using reference = void
 

Public Member Functions

 bounds_checked_iterator (C &container)
 
bounds_checked_iterator & operator= (const typename C::value_type &value)
 Assigns a value through the iterator, throwing if the end is exceeded.
 
bounds_checked_iterator & operator= (typename C::value_type &&value)
 Move-assigns a value through the iterator, throwing if the end is exceeded.
 
bounds_checked_iterator & operator* ()
 
bounds_checked_iterator & operator++ ()
 
bounds_checked_iterator operator++ (int)
 

Protected Attributes

C::iterator first_
 
C::iterator last_
 

Detailed Description

template<typename C>
class keepass::bounds_checked_iterator< C >

An output iterator that throws on writing past the end of a container.

The iterator wraps a range of a container and throws std::out_of_range whenever an assignment would exceed the container's bounds.

Template Parameters
Cthe underlying container type.

Constructor & Destructor Documentation

◆ bounds_checked_iterator()

template<typename C >
keepass::bounds_checked_iterator< C >::bounds_checked_iterator ( C &  container)
inlineexplicit

Creates a bounds-checked iterator over the given container.

Parameters
containerthe container to iterate over.

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