Signals Library
sig::Optional_last_value< T > Class Template Reference

A functor class that returns the last value in an iterator range. More...

#include <optional_last_value.hpp>

Public Types

using Result_type = std::optional< T >
 Type of object the iterator range points to.
 

Public Member Functions

template<typename InputIterator >
auto operator() (InputIterator first, InputIterator last) const -> Result_type
 

Detailed Description

template<typename T>
class sig::Optional_last_value< T >

A functor class that returns the last value in an iterator range.

Attempts to dereference every iterator in the range [first, last). If the iterator range is empty, an empty opt::Optional object is returned, otherwise an opt::Optional wrapping the last value is returned.

Member Function Documentation

◆ operator()()

template<typename T >
template<typename InputIterator >
auto sig::Optional_last_value< T >::operator() ( InputIterator  first,
InputIterator  last 
) const -> Result_type
inline
Parameters
firstInput iterator to the first element in the range.
lastInput iterator to one past the last element in the range.
Returns
The value stored in the last iterator of the range, wrapped in an opt::Optional.

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