# Boost.Signals: class template `last_value`

## Header

    #include <boost/last_value.hpp>

## Synopsis

    namespace boost {
      template<typename T>
      class last_value {
      public:
        typedef T result_type;

        template<typename InputIterator>
        result_type operator()(InputIterator, InputIterator) const;
      };

      template<>
      class last_value<void> {
      public:
        typedef implementation-defined result_type; // cannot be void

        template<typename InputIterator>
        result_type operator()(InputIterator, InputIterator) const;
      };
    }

## Members

`template<typename InputIterator> result_type operator()(InputIterator first, InputIterator last) const;`

- Precondition: `first != last`.
- Effects: dereferences every iterator in the sequence `[first, last)`.
- Returns: the result of dereferencing the last iterator dereferenced.

`template<typename InputIterator> result_type operator()(InputIterator first, InputIterator last) const;`

- Effects: dereferences every iterator in the sequence `[first, last)`.
- Returns: a value that cannot be meaningfully used by the user, but not `void`.
- Rationale: a function that returns `void` often requires many workarounds within systems that compose function objects, and therefore we avoid returning `void` and instead opt to return an implementation-defined, useless value that still leaves the function object easily adaptable.

Last modified: Fri Oct 11 05:42:17 EDT 2002