<?xml version="1.0" encoding="utf-8"?>
<!--
   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
  
   Distributed under the Boost Software License, Version 1.0.
   (See accompanying file LICENSE_1_0.txt or copy at
   http://www.boost.org/LICENSE_1_0.txt)
  -->
<!DOCTYPE header PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
  "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
<header name="boost/last_value.hpp" last-revision="$Date: 2006/11/03 19:45:41 $">
  <namespace name="boost">
    <class name="last_value">
      <template>
        <template-type-parameter name="T"/>
      </template>

      <purpose>Evaluate an <conceptname>InputIterator</conceptname> sequence and return the
      last value in the sequence.</purpose>

      <typedef name="result_type"><type>T</type></typedef>

      <method-group name="invocation">
        <method name="operator()" cv="const">
          <template> 
            <template-type-parameter name="InputIterator"/>
          </template>
          <type>result_type</type>
          <parameter name="first">
            <paramtype>InputIterator</paramtype>
          </parameter>
          <parameter name="last">
            <paramtype>InputIterator</paramtype>
          </parameter>

          <requires><para><computeroutput>first != last</computeroutput></para></requires>
          <effects><para>Dereferences every iterator in the sequence <computeroutput>[first, last)</computeroutput>.</para></effects>

          <returns><para>The result of dereferencing the iterator <computeroutput>last-1</computeroutput>.</para></returns>
        </method>
      </method-group>
    </class>

    <class-specialization name="last_value">
      <template/>
      <specialization>
        <template-arg>void</template-arg>
      </specialization>

      <purpose>Evaluate an InputIterator sequence.</purpose>

      <typedef name="result_type">
        <type><emphasis>unspecified</emphasis></type>
      </typedef>

      <method-group name="invocation">
        <method name="operator()" cv="const">
          <template> 
            <template-type-parameter name="InputIterator"/>
          </template>
          <type>result_type</type>
          <parameter name="first">
            <paramtype>InputIterator</paramtype>
          </parameter>
          <parameter name="last">
            <paramtype>InputIterator</paramtype>
          </parameter>

          <effects><para>Dereferences every iterator in the sequence <computeroutput>[first, last)</computeroutput>.</para></effects>
        </method>
      </method-group>
    </class-specialization>
  </namespace>
</header>
