.. Algorithms/Querying Algorithms//equal |100 equal ===== Synopsis -------- .. parsed-literal:: template< typename Seq1 , typename Seq2 , typename Pred = is_same<_1,_2> > struct equal { typedef |unspecified| type; }; Description ----------- Returns a true-valued |Integral Constant| if the two sequences ``Seq1`` and ``Seq2`` are identical when compared element-by-element. Header ------ .. parsed-literal:: #include Parameters ---------- +-------------------+-------------------------------+-----------------------------------+ | Parameter | Requirement | Description | +===================+===============================+===================================+ | ``Seq1``, ``Seq2``| |Forward Sequence| | Sequences to compare. | +-------------------+-------------------------------+-----------------------------------+ | ``Pred`` | Binary |Lambda Expression| | A comparison criterion. | +-------------------+-------------------------------+-----------------------------------+ Expression semantics -------------------- For any |Forward Sequence|\ s ``s1`` and ``s2`` and a binary |Lambda Expression| ``pred``: .. parsed-literal:: typedef equal::type c; :Return type: |Integral Constant| :Semantics: ``c::value == true`` is and only if ``size::value == size::value`` and for every iterator ``i`` in |begin/end| ``deref::type`` is identical to .. parsed-literal:: advance< begin::type, distance< begin::type,i >::type >::type Complexity ---------- Linear. At most ``size::value`` comparisons. Example ------- .. parsed-literal:: typedef vector s1; typedef list s2; BOOST_MPL_ASSERT(( equal )); See also -------- |Querying Algorithms|, |find|, |find_if|