.. Sequences/Intrinsic Metafunctions//front front ===== Synopsis -------- .. parsed-literal:: template< typename Sequence > struct front { typedef |unspecified| type; }; Description ----------- Returns the first element in the sequence. Header ------ .. parsed-literal:: #include Model of -------- |Tag Dispatched Metafunction| Parameters ---------- +---------------+-----------------------+-----------------------------------------------+ | Parameter | Requirement | Description | +===============+=======================+===============================================+ | ``Sequence`` | |Forward Sequence| | A sequence to be examined. | +---------------+-----------------------+-----------------------------------------------+ Expression semantics -------------------- For any |Forward Sequence| ``s``: .. parsed-literal:: typedef front::type t; :Return type: A type. :Precondition: ``empty::value == false``. :Semantics: Equivalent to .. parsed-literal:: typedef deref< begin::type >::type t; Complexity ---------- Amortized constant time. Example ------- .. parsed-literal:: typedef list::type types1; typedef list::type types2; typedef list::type types3; BOOST_MPL_ASSERT(( is_same< front::type, long > )); BOOST_MPL_ASSERT(( is_same< front::type, int> )); BOOST_MPL_ASSERT(( is_same< front::type, char> )); See also -------- |Forward Sequence|, |back|, |push_front|, |begin|, |deref|, |at|