.. Sequences/Intrinsic Metafunctions//back back ==== Synopsis -------- .. parsed-literal:: template< typename Sequence > struct back { typedef |unspecified| type; }; Description ----------- Returns the last element in the sequence. Header ------ .. parsed-literal:: #include Model of -------- |Tag Dispatched Metafunction| Parameters ---------- +---------------+---------------------------+-----------------------------------+ | Parameter | Requirement | Description | +===============+===========================+===================================+ | ``Sequence`` | |Bidirectional Sequence| | A sequence to be examined. | +---------------+---------------------------+-----------------------------------+ Expression semantics -------------------- For any |Bidirectional Sequence| ``s``: .. parsed-literal:: typedef back::type t; :Return type: A type. :Precondition: ``empty::value == false``. :Semantics: Equivalent to .. parsed-literal:: typedef deref< prior< end::type >::type >::type t; Complexity ---------- Amortized constant time. Example ------- .. parsed-literal:: typedef range_c range1; typedef range_c range2; typedef range_c range3; BOOST_MPL_ASSERT_RELATION( back::value, ==, 0 ); BOOST_MPL_ASSERT_RELATION( back::value, ==, 9 ); BOOST_MPL_ASSERT_RELATION( back::value, ==, -1 ); See also -------- |Bidirectional Sequence|, |front|, |push_back|, |end|, |deref|, |at|