add doc: find algorithms

This commit is contained in:
Bolero-MURAKAMI 2013-08-20 13:07:21 +09:00
parent 5569c6d50c
commit 6f3e65071e
44 changed files with 1008 additions and 171 deletions

View file

@ -15,6 +15,13 @@ Welcome to the Sprout C++ Libraries
C++11 constexpr based Containers, Algorithms, Random numbers, Parsing, Ray tracing, Synthesizer, and others.
.. _sprout-documentation:
*******************************************************************************
Library Documentation
*******************************************************************************
The starting point for the documentation of individual libraries is the :doc:`Libraries page <./libraries>`, which gives a brief description of each library and links to its documentation.
.. _sprout-project:
*******************************************************************************
Project page

View file

@ -27,16 +27,21 @@ Containers and Data structures
=======================================
* :doc:`array <./sprout/array/index>` - STL compliant class template for storing fixed-size sequences of objects.
* :doc:`string <./sprout/string/index>`
* :doc:`tuple <./sprout/tuple/index>`
* :doc:`optional <./sprout/optional/index>`
* :doc:`variant <./sprout/variant/index>`
* :doc:`bitset <./sprout/bitset/index>`
.. _sprout-listed_by_category-algorithms:
Algorithms
=======================================
* :doc:`algorithm <./sprout/algorithm/index>` - STL like generic algorithms.
.. _sprout-listed_by_category-algorithms:
Algorithms
=======================================
* :doc:`numeric <./sprout/numeric/index>`
* :doc:`range_algorithm <./sprout/range/algorithm/index>`
* :doc:`range_numeric <./sprout/range/numeric/index>`
* :doc:`range_adaptor <./sprout/range/adaptor/index>`
.. _sprout-listed_by_category-container_supports:
Container supports

View file

@ -14,7 +14,7 @@ Interface
Returns
========================================
*true* if [first,last) is empty or if ``pred(*i)`` is true for every iterator i in the range [first,last), and *false* otherwise.
| *true* if [first,last) is empty or if ``pred(*i)`` is true for every iterator i in the range [first,last), and *false* otherwise.
Examples
========================================
@ -33,14 +33,12 @@ Examples
Complexity
========================================
At most ``last - first`` applications of the predicate.
Recursive function invocations in *O(logN)* (logarithmic) depth.
| At most ``last - first`` applications of the predicate.
| Recursive function invocations in *O(logN)* (logarithmic) depth.
Header
========================================
``sprout/algorithm/all_of.hpp``
Convenience header: ``sprout/algorithm.hpp``
| ``sprout/algorithm/all_of.hpp``
| Convenience header: ``sprout/algorithm.hpp``

View file

@ -14,7 +14,7 @@ Interface
Returns
========================================
*true* if [first,last) is empty or if ``*i == value`` is true for every iterator i in the range [first,last), and *false* otherwise.
| *true* if [first,last) is empty or if ``*i == value`` is true for every iterator i in the range [first,last), and *false* otherwise.
Examples
========================================
@ -32,14 +32,12 @@ Examples
Complexity
========================================
At most ``last - first`` applications of the predicate.
Recursive function invocations in *O(logN)* (logarithmic) depth.
| At most ``last - first`` applications of the predicate.
| Recursive function invocations in *O(logN)* (logarithmic) depth.
Header
========================================
``sprout/algorithm/all_of_equal.hpp``
Convenience header: ``sprout/algorithm.hpp``
| ``sprout/algorithm/all_of_equal.hpp``
| Convenience header: ``sprout/algorithm.hpp``

View file

@ -14,7 +14,7 @@ Interface
Returns
========================================
*false* if [first,last) is empty or if there is no iterator i in the range [first,last) such that ``pred(*i)`` is true, and *true* otherwise.
| *false* if [first,last) is empty or if there is no iterator i in the range [first,last) such that ``pred(*i)`` is true, and *true* otherwise.
Examples
========================================
@ -33,14 +33,12 @@ Examples
Complexity
========================================
At most ``last - first`` applications of the predicate.
Recursive function invocations in *O(logN)* (logarithmic) depth.
| At most ``last - first`` applications of the predicate.
| Recursive function invocations in *O(logN)* (logarithmic) depth.
Header
========================================
``sprout/algorithm/any_of.hpp``
Convenience header: ``sprout/algorithm.hpp``
| ``sprout/algorithm/any_of.hpp``
| Convenience header: ``sprout/algorithm.hpp``

View file

@ -14,7 +14,7 @@ Interface
Returns
========================================
*false* if [first,last) is empty or if there is no iterator i in the range [first,last) such that ``*i == value`` is true, and *true* otherwise.
| *false* if [first,last) is empty or if there is no iterator i in the range [first,last) such that ``*i == value`` is true, and *true* otherwise.
Examples
========================================
@ -32,14 +32,12 @@ Examples
Complexity
========================================
At most ``last - first`` applications of the predicate.
Recursive function invocations in *O(logN)* (logarithmic) depth.
| At most ``last - first`` applications of the predicate.
| Recursive function invocations in *O(logN)* (logarithmic) depth.
Header
========================================
``sprout/algorithm/any_of_equal.hpp``
Convenience header: ``sprout/algorithm.hpp``
| ``sprout/algorithm/any_of_equal.hpp``
| Convenience header: ``sprout/algorithm.hpp``

View file

@ -0,0 +1,45 @@
.. _sprout-algorithm-find:
###############################################################################
find
###############################################################################
Interface
========================================
.. sourcecode:: c++
template<typename InputIterator, typename T>
inline SPROUT_CONSTEXPR InputIterator
find(InputIterator first, InputIterator last, T const& value);
Returns
========================================
| The first iterator i in the range [first,last) for which the following corresponding conditions hold: ``*i == value``.
| Returns last if no such iterator is found.
Examples
========================================
.. sourcecode:: c++
#include <sprout/algorithm/find.hpp>
#include <sprout/array.hpp>
#include <sprout/container.hpp>
using namespace sprout;
SPROUT_STATIC_CONSTEXPR auto input = array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}};
SPROUT_STATIC_CONSTEXPR auto result = sprout::find(begin(input), end(input), 8);
static_assert(result != end(input), "found a element equal to 8 from input.");
static_assert(*result == 8, "a found iterator is pointing to 8.");
Complexity
========================================
| At most ``last - first`` applications of the predicate.
| Recursive function invocations in *O(logN)* (logarithmic) depth.
Header
========================================
| ``sprout/algorithm/find.hpp``
| Convenience header: ``sprout/algorithm.hpp``

View file

@ -0,0 +1,46 @@
.. _sprout-algorithm-find_if:
###############################################################################
find_if
###############################################################################
Interface
========================================
.. sourcecode:: c++
template<typename InputIterator, typename Predicate>
inline SPROUT_CONSTEXPR InputIterator
find_if(InputIterator first, InputIterator last, Predicate pred);
Returns
========================================
| The first iterator i in the range [first,last) for which the following corresponding conditions hold: ``pred(*i)``.
| Returns last if no such iterator is found.
Examples
========================================
.. sourcecode:: c++
#include <sprout/algorithm/find_if.hpp>
#include <sprout/array.hpp>
#include <sprout/container.hpp>
#include <sprout/functional.hpp>
using namespace sprout;
SPROUT_STATIC_CONSTEXPR auto input = array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}};
SPROUT_STATIC_CONSTEXPR auto result = sprout::find_if(begin(input), end(input), bind2nd(greater<>(), 7));
static_assert(result != end(input), "found a element greater than 7 from input.");
static_assert(*result == 8, "a found iterator is pointing to 8.");
Complexity
========================================
| At most ``last - first`` applications of the predicate.
| Recursive function invocations in *O(logN)* (logarithmic) depth.
Header
========================================
| ``sprout/algorithm/find_if.hpp``
| Convenience header: ``sprout/algorithm.hpp``

View file

@ -0,0 +1,46 @@
.. _sprout-algorithm-find_if_not:
###############################################################################
find_if_not
###############################################################################
Interface
========================================
.. sourcecode:: c++
template<typename InputIterator, typename Predicate>
inline SPROUT_CONSTEXPR InputIterator
find_if_not(InputIterator first, InputIterator last, Predicate pred);
Returns
========================================
| The first iterator i in the range [first,last) for which the following corresponding conditions hold: ``!pred(*i)``.
| Returns last if no such iterator is found.
Examples
========================================
.. sourcecode:: c++
#include <sprout/algorithm/find_if_not.hpp>
#include <sprout/array.hpp>
#include <sprout/container.hpp>
#include <sprout/functional.hpp>
using namespace sprout;
SPROUT_STATIC_CONSTEXPR auto input = array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}};
SPROUT_STATIC_CONSTEXPR auto result = sprout::find_if_not(begin(input), end(input), bind2nd(less<>(), 8));
static_assert(result != end(input), "found a element not less than 8 from input.");
static_assert(*result == 8, "a found iterator is pointing to 8.");
Complexity
========================================
| At most ``last - first`` applications of the predicate.
| Recursive function invocations in *O(logN)* (logarithmic) depth.
Header
========================================
| ``sprout/algorithm/find_if_not.hpp``
| Convenience header: ``sprout/algorithm.hpp``

View file

@ -14,6 +14,9 @@ Sprout.Algorithm
none_of_equal
one_of
one_of_equal
find
find_if
find_if_not
.. _sprout-algorithm-non_modifying:
*******************************************************************************

View file

@ -14,7 +14,7 @@ Interface
Returns
========================================
*true* if [first,last) is empty or if ``pred(*i)`` is false for every iterator i in the range [first,last), and *false* otherwise.
| *true* if [first,last) is empty or if ``pred(*i)`` is false for every iterator i in the range [first,last), and *false* otherwise.
Examples
========================================
@ -33,14 +33,12 @@ Examples
Complexity
========================================
At most ``last - first`` applications of the predicate.
Recursive function invocations in *O(logN)* (logarithmic) depth.
| At most ``last - first`` applications of the predicate.
| Recursive function invocations in *O(logN)* (logarithmic) depth.
Header
========================================
``sprout/algorithm/none_of.hpp``
Convenience header: ``sprout/algorithm.hpp``
| ``sprout/algorithm/none_of.hpp``
| Convenience header: ``sprout/algorithm.hpp``

View file

@ -14,7 +14,7 @@ Interface
Returns
========================================
*true* if [first,last) is empty or if ``*i == value`` is false for every iterator i in the range [first,last), and *false* otherwise.
| *true* if [first,last) is empty or if ``*i == value`` is false for every iterator i in the range [first,last), and *false* otherwise.
Examples
========================================
@ -32,14 +32,12 @@ Examples
Complexity
========================================
At most ``last - first`` applications of the predicate.
Recursive function invocations in *O(logN)* (logarithmic) depth.
| At most ``last - first`` applications of the predicate.
| Recursive function invocations in *O(logN)* (logarithmic) depth.
Header
========================================
``sprout/algorithm/none_of_equal.hpp``
Convenience header: ``sprout/algorithm.hpp``
| ``sprout/algorithm/none_of_equal.hpp``
| Convenience header: ``sprout/algorithm.hpp``

View file

@ -14,7 +14,7 @@ Interface
Returns
========================================
*true* if [first,last) is not empty and there is only one iterator i in the range [first,last) such that ``pred(*i)`` is true, and *false* otherwise.
| *true* if [first,last) is not empty and there is only one iterator i in the range [first,last) such that ``pred(*i)`` is true, and *false* otherwise.
Examples
========================================
@ -33,14 +33,12 @@ Examples
Complexity
========================================
At most ``last - first`` applications of the predicate.
Recursive function invocations in *O(logN)* (logarithmic) depth.
| At most ``last - first`` applications of the predicate.
| Recursive function invocations in *O(logN)* (logarithmic) depth.
Header
========================================
``sprout/algorithm/one_of.hpp``
Convenience header: ``sprout/algorithm.hpp``
| ``sprout/algorithm/one_of.hpp``
| Convenience header: ``sprout/algorithm.hpp``

View file

@ -14,7 +14,7 @@ Interface
Returns
========================================
*true* if [first,last) is not empty and there is only one iterator i in the range [first,last) such that ``*i == value`` is true, and *false* otherwise.
| *true* if [first,last) is not empty and there is only one iterator i in the range [first,last) such that ``*i == value`` is true, and *false* otherwise.
Examples
========================================
@ -32,14 +32,12 @@ Examples
Complexity
========================================
At most ``last - first`` applications of the predicate.
Recursive function invocations in *O(logN)* (logarithmic) depth.
| At most ``last - first`` applications of the predicate.
| Recursive function invocations in *O(logN)* (logarithmic) depth.
Header
========================================
``sprout/algorithm/one_of_equal.hpp``
Convenience header: ``sprout/algorithm.hpp``
| ``sprout/algorithm/one_of_equal.hpp``
| Convenience header: ``sprout/algorithm.hpp``

View file

@ -48,6 +48,7 @@
<li class="toctree-l1"><a class="reference external" href="libs/index.html">Sprout C++ Libraries</a><ul>
<li class="toctree-l2"><a class="reference external" href="libs/libraries.html">Libraries</a></li>
<li class="toctree-l2"><a class="reference external" href="libs/index.html#welcome-to-the-sprout-c-libraries">Welcome to the Sprout C++ Libraries</a></li>
<li class="toctree-l2"><a class="reference external" href="libs/index.html#library-documentation">Library Documentation</a></li>
<li class="toctree-l2"><a class="reference external" href="libs/index.html#project-page">Project page</a></li>
<li class="toctree-l2"><a class="reference external" href="libs/index.html#install">Install</a></li>
<li class="toctree-l2"><a class="reference external" href="libs/index.html#supported-compilers">Supported Compilers</a></li>

View file

@ -54,6 +54,10 @@
<h2>Welcome to the Sprout C++ Libraries<a class="headerlink" href="#welcome-to-the-sprout-c-libraries" title="Permalink to this headline"></a></h2>
<p>C++11 constexpr based Containers, Algorithms, Random numbers, Parsing, Ray tracing, Synthesizer, and others.</p>
</div>
<div class="section" id="library-documentation">
<h2>Library Documentation<a class="headerlink" href="#library-documentation" title="Permalink to this headline"></a></h2>
<p>The starting point for the documentation of individual libraries is the <a class="reference external" href="libraries.html"><em>Libraries page</em></a>, which gives a brief description of each library and links to its documentation.</p>
</div>
<div class="section" id="project-page">
<h2>Project page<a class="headerlink" href="#project-page" title="Permalink to this headline"></a></h2>
<p>Github: <a class="reference external" href="https://github.com/bolero-MURAKAMI/Sprout">https://github.com/bolero-MURAKAMI/Sprout</a></p>
@ -102,6 +106,7 @@
<ul>
<li><a class="reference external" href="#">Sprout C++ Libraries</a><ul>
<li><a class="reference external" href="#welcome-to-the-sprout-c-libraries">Welcome to the Sprout C++ Libraries</a></li>
<li><a class="reference external" href="#library-documentation">Library Documentation</a></li>
<li><a class="reference external" href="#project-page">Project page</a></li>
<li><a class="reference external" href="#install">Install</a></li>
<li><a class="reference external" href="#supported-compilers">Supported Compilers</a></li>

View file

@ -62,17 +62,23 @@
<h3>Containers and Data structures<a class="headerlink" href="#containers-and-data-structures" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li><a class="reference external" href="sprout/array/index.html"><em>array</em></a> - STL compliant class template for storing fixed-size sequences of objects.</li>
<li><tt class="xref docutils literal"><span class="pre">string</span></tt></li>
<li><tt class="xref docutils literal"><span class="pre">tuple</span></tt></li>
<li><tt class="xref docutils literal"><span class="pre">optional</span></tt></li>
<li><tt class="xref docutils literal"><span class="pre">variant</span></tt></li>
<li><tt class="xref docutils literal"><span class="pre">bitset</span></tt></li>
</ul>
</div>
<div class="section" id="algorithms">
<h3>Algorithms<a class="headerlink" href="#algorithms" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li><a class="reference external" href="sprout/algorithm/index.html"><em>algorithm</em></a> - STL like generic algorithms.</li>
<li><tt class="xref docutils literal"><span class="pre">numeric</span></tt></li>
<li><tt class="xref docutils literal"><span class="pre">range_algorithm</span></tt></li>
<li><tt class="xref docutils literal"><span class="pre">range_numeric</span></tt></li>
<li><tt class="xref docutils literal"><span class="pre">range_adaptor</span></tt></li>
</ul>
</div>
<div class="section" id="id2">
<h3>Algorithms<a class="headerlink" href="#id2" title="Permalink to this headline"></a></h3>
</div>
<div class="section" id="container-supports">
<h3>Container supports<a class="headerlink" href="#container-supports" title="Permalink to this headline"></a></h3>
</div>
@ -94,8 +100,8 @@
<div class="section" id="domain-specific">
<h3>Domain specific<a class="headerlink" href="#domain-specific" title="Permalink to this headline"></a></h3>
</div>
<div class="section" id="id4">
<h3>Domain specific<a class="headerlink" href="#id4" title="Permalink to this headline"></a></h3>
<div class="section" id="id2">
<h3>Domain specific<a class="headerlink" href="#id2" title="Permalink to this headline"></a></h3>
</div>
<div class="section" id="parsing">
<h3>Parsing<a class="headerlink" href="#parsing" title="Permalink to this headline"></a></h3>
@ -128,7 +134,6 @@
<li><a class="reference external" href="#libraries-listed-by-category">Libraries Listed by Category</a><ul>
<li><a class="reference external" href="#containers-and-data-structures">Containers and Data structures</a></li>
<li><a class="reference external" href="#algorithms">Algorithms</a></li>
<li><a class="reference external" href="#id2">Algorithms</a></li>
<li><a class="reference external" href="#container-supports">Container supports</a></li>
<li><a class="reference external" href="#function-objects">Function Objects</a></li>
<li><a class="reference external" href="#iterators">Iterators</a></li>
@ -136,7 +141,7 @@
<li><a class="reference external" href="#template-metaprogramming">Template Metaprogramming</a></li>
<li><a class="reference external" href="#preprocessor-metaprogramming">Preprocessor Metaprogramming</a></li>
<li><a class="reference external" href="#domain-specific">Domain specific</a></li>
<li><a class="reference external" href="#id4">Domain specific</a></li>
<li><a class="reference external" href="#id2">Domain specific</a></li>
<li><a class="reference external" href="#parsing">Parsing</a></li>
<li><a class="reference external" href="#ray-tracing">Ray tracing</a></li>
<li><a class="reference external" href="#synthesizer">Synthesizer</a></li>

View file

@ -61,7 +61,9 @@
</div>
<div class="section" id="returns">
<h2>Returns<a class="headerlink" href="#returns" title="Permalink to this headline"></a></h2>
<p><em>true</em> if [first,last) is empty or if <tt class="docutils literal"><span class="pre">pred(*i)</span></tt> is true for every iterator i in the range [first,last), and <em>false</em> otherwise.</p>
<div class="line-block">
<div class="line"><em>true</em> if [first,last) is empty or if <tt class="docutils literal"><span class="pre">pred(*i)</span></tt> is true for every iterator i in the range [first,last), and <em>false</em> otherwise.</div>
</div>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline"></a></h2>
@ -79,13 +81,17 @@
</div>
<div class="section" id="complexity">
<h2>Complexity<a class="headerlink" href="#complexity" title="Permalink to this headline"></a></h2>
<p>At most <tt class="docutils literal"><span class="pre">last</span> <span class="pre">-</span> <span class="pre">first</span></tt> applications of the predicate.</p>
<p>Recursive function invocations in <em>O(logN)</em> (logarithmic) depth.</p>
<div class="line-block">
<div class="line">At most <tt class="docutils literal"><span class="pre">last</span> <span class="pre">-</span> <span class="pre">first</span></tt> applications of the predicate.</div>
<div class="line">Recursive function invocations in <em>O(logN)</em> (logarithmic) depth.</div>
</div>
</div>
<div class="section" id="header">
<h2>Header<a class="headerlink" href="#header" title="Permalink to this headline"></a></h2>
<p><tt class="docutils literal"><span class="pre">sprout/algorithm/all_of.hpp</span></tt></p>
<p>Convenience header: <tt class="docutils literal"><span class="pre">sprout/algorithm.hpp</span></tt></p>
<div class="line-block">
<div class="line"><tt class="docutils literal"><span class="pre">sprout/algorithm/all_of.hpp</span></tt></div>
<div class="line">Convenience header: <tt class="docutils literal"><span class="pre">sprout/algorithm.hpp</span></tt></div>
</div>
</div>
</div>

View file

@ -61,7 +61,9 @@
</div>
<div class="section" id="returns">
<h2>Returns<a class="headerlink" href="#returns" title="Permalink to this headline"></a></h2>
<p><em>true</em> if [first,last) is empty or if <tt class="docutils literal"><span class="pre">*i</span> <span class="pre">==</span> <span class="pre">value</span></tt> is true for every iterator i in the range [first,last), and <em>false</em> otherwise.</p>
<div class="line-block">
<div class="line"><em>true</em> if [first,last) is empty or if <tt class="docutils literal"><span class="pre">*i</span> <span class="pre">==</span> <span class="pre">value</span></tt> is true for every iterator i in the range [first,last), and <em>false</em> otherwise.</div>
</div>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline"></a></h2>
@ -78,13 +80,17 @@
</div>
<div class="section" id="complexity">
<h2>Complexity<a class="headerlink" href="#complexity" title="Permalink to this headline"></a></h2>
<p>At most <tt class="docutils literal"><span class="pre">last</span> <span class="pre">-</span> <span class="pre">first</span></tt> applications of the predicate.</p>
<p>Recursive function invocations in <em>O(logN)</em> (logarithmic) depth.</p>
<div class="line-block">
<div class="line">At most <tt class="docutils literal"><span class="pre">last</span> <span class="pre">-</span> <span class="pre">first</span></tt> applications of the predicate.</div>
<div class="line">Recursive function invocations in <em>O(logN)</em> (logarithmic) depth.</div>
</div>
</div>
<div class="section" id="header">
<h2>Header<a class="headerlink" href="#header" title="Permalink to this headline"></a></h2>
<p><tt class="docutils literal"><span class="pre">sprout/algorithm/all_of_equal.hpp</span></tt></p>
<p>Convenience header: <tt class="docutils literal"><span class="pre">sprout/algorithm.hpp</span></tt></p>
<div class="line-block">
<div class="line"><tt class="docutils literal"><span class="pre">sprout/algorithm/all_of_equal.hpp</span></tt></div>
<div class="line">Convenience header: <tt class="docutils literal"><span class="pre">sprout/algorithm.hpp</span></tt></div>
</div>
</div>
</div>

View file

@ -61,7 +61,9 @@
</div>
<div class="section" id="returns">
<h2>Returns<a class="headerlink" href="#returns" title="Permalink to this headline"></a></h2>
<p><em>false</em> if [first,last) is empty or if there is no iterator i in the range [first,last) such that <tt class="docutils literal"><span class="pre">pred(*i)</span></tt> is true, and <em>true</em> otherwise.</p>
<div class="line-block">
<div class="line"><em>false</em> if [first,last) is empty or if there is no iterator i in the range [first,last) such that <tt class="docutils literal"><span class="pre">pred(*i)</span></tt> is true, and <em>true</em> otherwise.</div>
</div>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline"></a></h2>
@ -79,13 +81,17 @@
</div>
<div class="section" id="complexity">
<h2>Complexity<a class="headerlink" href="#complexity" title="Permalink to this headline"></a></h2>
<p>At most <tt class="docutils literal"><span class="pre">last</span> <span class="pre">-</span> <span class="pre">first</span></tt> applications of the predicate.</p>
<p>Recursive function invocations in <em>O(logN)</em> (logarithmic) depth.</p>
<div class="line-block">
<div class="line">At most <tt class="docutils literal"><span class="pre">last</span> <span class="pre">-</span> <span class="pre">first</span></tt> applications of the predicate.</div>
<div class="line">Recursive function invocations in <em>O(logN)</em> (logarithmic) depth.</div>
</div>
</div>
<div class="section" id="header">
<h2>Header<a class="headerlink" href="#header" title="Permalink to this headline"></a></h2>
<p><tt class="docutils literal"><span class="pre">sprout/algorithm/any_of.hpp</span></tt></p>
<p>Convenience header: <tt class="docutils literal"><span class="pre">sprout/algorithm.hpp</span></tt></p>
<div class="line-block">
<div class="line"><tt class="docutils literal"><span class="pre">sprout/algorithm/any_of.hpp</span></tt></div>
<div class="line">Convenience header: <tt class="docutils literal"><span class="pre">sprout/algorithm.hpp</span></tt></div>
</div>
</div>
</div>

View file

@ -61,7 +61,9 @@
</div>
<div class="section" id="returns">
<h2>Returns<a class="headerlink" href="#returns" title="Permalink to this headline"></a></h2>
<p><em>false</em> if [first,last) is empty or if there is no iterator i in the range [first,last) such that <tt class="docutils literal"><span class="pre">*i</span> <span class="pre">==</span> <span class="pre">value</span></tt> is true, and <em>true</em> otherwise.</p>
<div class="line-block">
<div class="line"><em>false</em> if [first,last) is empty or if there is no iterator i in the range [first,last) such that <tt class="docutils literal"><span class="pre">*i</span> <span class="pre">==</span> <span class="pre">value</span></tt> is true, and <em>true</em> otherwise.</div>
</div>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline"></a></h2>
@ -78,13 +80,17 @@
</div>
<div class="section" id="complexity">
<h2>Complexity<a class="headerlink" href="#complexity" title="Permalink to this headline"></a></h2>
<p>At most <tt class="docutils literal"><span class="pre">last</span> <span class="pre">-</span> <span class="pre">first</span></tt> applications of the predicate.</p>
<p>Recursive function invocations in <em>O(logN)</em> (logarithmic) depth.</p>
<div class="line-block">
<div class="line">At most <tt class="docutils literal"><span class="pre">last</span> <span class="pre">-</span> <span class="pre">first</span></tt> applications of the predicate.</div>
<div class="line">Recursive function invocations in <em>O(logN)</em> (logarithmic) depth.</div>
</div>
</div>
<div class="section" id="header">
<h2>Header<a class="headerlink" href="#header" title="Permalink to this headline"></a></h2>
<p><tt class="docutils literal"><span class="pre">sprout/algorithm/any_of_equal.hpp</span></tt></p>
<p>Convenience header: <tt class="docutils literal"><span class="pre">sprout/algorithm.hpp</span></tt></p>
<div class="line-block">
<div class="line"><tt class="docutils literal"><span class="pre">sprout/algorithm/any_of_equal.hpp</span></tt></div>
<div class="line">Convenience header: <tt class="docutils literal"><span class="pre">sprout/algorithm.hpp</span></tt></div>
</div>
</div>
</div>

View file

@ -0,0 +1,168 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>find &mdash; Sprout v1.0 documentation</title>
<link rel="stylesheet" href="../../../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../../',
VERSION: '1.0',
COLLAPSE_MODINDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../_static/doctools.js"></script>
<link rel="top" title="Sprout v1.0 documentation" href="../../../index.html" />
<link rel="up" title="Sprout.Algorithm" href="index.html" />
<link rel="next" title="find_if" href="find_if.html" />
<link rel="prev" title="one_of_equal" href="one_of_equal.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="find_if.html" title="find_if"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="one_of_equal.html" title="one_of_equal"
accesskey="P">previous</a> |</li>
<li><a href="../../../index.html">Sprout v1.0 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Sprout C++ Libraries</a> &raquo;</li>
<li><a href="../../libraries.html" >Libraries</a> &raquo;</li>
<li><a href="index.html" accesskey="U">Sprout.Algorithm</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="find">
<h1>find<a class="headerlink" href="#find" title="Permalink to this headline"></a></h1>
<div class="section" id="interface">
<h2>Interface<a class="headerlink" href="#interface" title="Permalink to this headline"></a></h2>
<div class="highlight-c++"><div class="highlight"><pre><span class="k">template</span><span class="o">&lt;</span><span class="k">typename</span> <span class="n">InputIterator</span><span class="p">,</span> <span class="k">typename</span> <span class="n">T</span><span class="o">&gt;</span>
<span class="kr">inline</span> <span class="n">SPROUT_CONSTEXPR</span> <span class="n">InputIterator</span>
<span class="n">find</span><span class="p">(</span><span class="n">InputIterator</span> <span class="n">first</span><span class="p">,</span> <span class="n">InputIterator</span> <span class="n">last</span><span class="p">,</span> <span class="n">T</span> <span class="k">const</span><span class="o">&amp;</span> <span class="n">value</span><span class="p">);</span>
</pre></div>
</div>
</div>
<div class="section" id="returns">
<h2>Returns<a class="headerlink" href="#returns" title="Permalink to this headline"></a></h2>
<div class="line-block">
<div class="line">The first iterator i in the range [first,last) for which the following corresponding conditions hold: <tt class="docutils literal"><span class="pre">*i</span> <span class="pre">==</span> <span class="pre">value</span></tt>.</div>
<div class="line">Returns last if no such iterator is found.</div>
</div>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline"></a></h2>
<div class="highlight-c++"><div class="highlight"><pre><span class="cp">#include &lt;sprout/algorithm/find.hpp&gt;</span>
<span class="cp">#include &lt;sprout/array.hpp&gt;</span>
<span class="cp">#include &lt;sprout/container.hpp&gt;</span>
<span class="k">using</span> <span class="k">namespace</span> <span class="n">sprout</span><span class="p">;</span>
<span class="n">SPROUT_STATIC_CONSTEXPR</span> <span class="k">auto</span> <span class="n">input</span> <span class="o">=</span> <span class="n">array</span><span class="o">&lt;</span><span class="kt">int</span><span class="p">,</span> <span class="mi">10</span><span class="o">&gt;</span><span class="p">{{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">6</span><span class="p">,</span> <span class="mi">7</span><span class="p">,</span> <span class="mi">8</span><span class="p">,</span> <span class="mi">9</span><span class="p">,</span> <span class="mi">10</span><span class="p">}};</span>
<span class="n">SPROUT_STATIC_CONSTEXPR</span> <span class="k">auto</span> <span class="n">result</span> <span class="o">=</span> <span class="n">sprout</span><span class="o">::</span><span class="n">find</span><span class="p">(</span><span class="n">begin</span><span class="p">(</span><span class="n">input</span><span class="p">),</span> <span class="n">end</span><span class="p">(</span><span class="n">input</span><span class="p">),</span> <span class="mi">8</span><span class="p">);</span>
<span class="n">static_assert</span><span class="p">(</span><span class="n">result</span> <span class="o">!=</span> <span class="n">end</span><span class="p">(</span><span class="n">input</span><span class="p">),</span> <span class="s">&quot;found a element equal to 8 from input.&quot;</span><span class="p">);</span>
<span class="n">static_assert</span><span class="p">(</span><span class="o">*</span><span class="n">result</span> <span class="o">==</span> <span class="mi">8</span><span class="p">,</span> <span class="s">&quot;a found iterator is pointing to 8.&quot;</span><span class="p">);</span>
</pre></div>
</div>
</div>
<div class="section" id="complexity">
<h2>Complexity<a class="headerlink" href="#complexity" title="Permalink to this headline"></a></h2>
<div class="line-block">
<div class="line">At most <tt class="docutils literal"><span class="pre">last</span> <span class="pre">-</span> <span class="pre">first</span></tt> applications of the predicate.</div>
<div class="line">Recursive function invocations in <em>O(logN)</em> (logarithmic) depth.</div>
</div>
</div>
<div class="section" id="header">
<h2>Header<a class="headerlink" href="#header" title="Permalink to this headline"></a></h2>
<div class="line-block">
<div class="line"><tt class="docutils literal"><span class="pre">sprout/algorithm/find.hpp</span></tt></div>
<div class="line">Convenience header: <tt class="docutils literal"><span class="pre">sprout/algorithm.hpp</span></tt></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="../../../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference external" href="#">find</a><ul>
<li><a class="reference external" href="#interface">Interface</a></li>
<li><a class="reference external" href="#returns">Returns</a></li>
<li><a class="reference external" href="#examples">Examples</a></li>
<li><a class="reference external" href="#complexity">Complexity</a></li>
<li><a class="reference external" href="#header">Header</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="one_of_equal.html"
title="previous chapter">one_of_equal</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="find_if.html"
title="next chapter">find_if</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../../_sources/libs/sprout/algorithm/find.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../../../search.html" method="get">
<input type="text" name="q" size="18" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="find_if.html" title="find_if"
>next</a> |</li>
<li class="right" >
<a href="one_of_equal.html" title="one_of_equal"
>previous</a> |</li>
<li><a href="../../../index.html">Sprout v1.0 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Sprout C++ Libraries</a> &raquo;</li>
<li><a href="../../libraries.html" >Libraries</a> &raquo;</li>
<li><a href="index.html" >Sprout.Algorithm</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2013, Bolero MURAKAMI.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.4.
</div>
</body>
</html>

View file

@ -0,0 +1,169 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>find_if &mdash; Sprout v1.0 documentation</title>
<link rel="stylesheet" href="../../../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../../',
VERSION: '1.0',
COLLAPSE_MODINDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../_static/doctools.js"></script>
<link rel="top" title="Sprout v1.0 documentation" href="../../../index.html" />
<link rel="up" title="Sprout.Algorithm" href="index.html" />
<link rel="next" title="find_if_not" href="find_if_not.html" />
<link rel="prev" title="find" href="find.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="find_if_not.html" title="find_if_not"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="find.html" title="find"
accesskey="P">previous</a> |</li>
<li><a href="../../../index.html">Sprout v1.0 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Sprout C++ Libraries</a> &raquo;</li>
<li><a href="../../libraries.html" >Libraries</a> &raquo;</li>
<li><a href="index.html" accesskey="U">Sprout.Algorithm</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="find-if">
<h1>find_if<a class="headerlink" href="#find-if" title="Permalink to this headline"></a></h1>
<div class="section" id="interface">
<h2>Interface<a class="headerlink" href="#interface" title="Permalink to this headline"></a></h2>
<div class="highlight-c++"><div class="highlight"><pre><span class="k">template</span><span class="o">&lt;</span><span class="k">typename</span> <span class="n">InputIterator</span><span class="p">,</span> <span class="k">typename</span> <span class="n">Predicate</span><span class="o">&gt;</span>
<span class="kr">inline</span> <span class="n">SPROUT_CONSTEXPR</span> <span class="n">InputIterator</span>
<span class="n">find_if</span><span class="p">(</span><span class="n">InputIterator</span> <span class="n">first</span><span class="p">,</span> <span class="n">InputIterator</span> <span class="n">last</span><span class="p">,</span> <span class="n">Predicate</span> <span class="n">pred</span><span class="p">);</span>
</pre></div>
</div>
</div>
<div class="section" id="returns">
<h2>Returns<a class="headerlink" href="#returns" title="Permalink to this headline"></a></h2>
<div class="line-block">
<div class="line">The first iterator i in the range [first,last) for which the following corresponding conditions hold: <tt class="docutils literal"><span class="pre">pred(*i)</span></tt>.</div>
<div class="line">Returns last if no such iterator is found.</div>
</div>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline"></a></h2>
<div class="highlight-c++"><div class="highlight"><pre><span class="cp">#include &lt;sprout/algorithm/find_if.hpp&gt;</span>
<span class="cp">#include &lt;sprout/array.hpp&gt;</span>
<span class="cp">#include &lt;sprout/container.hpp&gt;</span>
<span class="cp">#include &lt;sprout/functional.hpp&gt;</span>
<span class="k">using</span> <span class="k">namespace</span> <span class="n">sprout</span><span class="p">;</span>
<span class="n">SPROUT_STATIC_CONSTEXPR</span> <span class="k">auto</span> <span class="n">input</span> <span class="o">=</span> <span class="n">array</span><span class="o">&lt;</span><span class="kt">int</span><span class="p">,</span> <span class="mi">10</span><span class="o">&gt;</span><span class="p">{{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">6</span><span class="p">,</span> <span class="mi">7</span><span class="p">,</span> <span class="mi">8</span><span class="p">,</span> <span class="mi">9</span><span class="p">,</span> <span class="mi">10</span><span class="p">}};</span>
<span class="n">SPROUT_STATIC_CONSTEXPR</span> <span class="k">auto</span> <span class="n">result</span> <span class="o">=</span> <span class="n">sprout</span><span class="o">::</span><span class="n">find_if</span><span class="p">(</span><span class="n">begin</span><span class="p">(</span><span class="n">input</span><span class="p">),</span> <span class="n">end</span><span class="p">(</span><span class="n">input</span><span class="p">),</span> <span class="n">bind2nd</span><span class="p">(</span><span class="n">greater</span><span class="o">&lt;&gt;</span><span class="p">(),</span> <span class="mi">7</span><span class="p">));</span>
<span class="n">static_assert</span><span class="p">(</span><span class="n">result</span> <span class="o">!=</span> <span class="n">end</span><span class="p">(</span><span class="n">input</span><span class="p">),</span> <span class="s">&quot;found a element greater than 7 from input.&quot;</span><span class="p">);</span>
<span class="n">static_assert</span><span class="p">(</span><span class="o">*</span><span class="n">result</span> <span class="o">==</span> <span class="mi">8</span><span class="p">,</span> <span class="s">&quot;a found iterator is pointing to 8.&quot;</span><span class="p">);</span>
</pre></div>
</div>
</div>
<div class="section" id="complexity">
<h2>Complexity<a class="headerlink" href="#complexity" title="Permalink to this headline"></a></h2>
<div class="line-block">
<div class="line">At most <tt class="docutils literal"><span class="pre">last</span> <span class="pre">-</span> <span class="pre">first</span></tt> applications of the predicate.</div>
<div class="line">Recursive function invocations in <em>O(logN)</em> (logarithmic) depth.</div>
</div>
</div>
<div class="section" id="header">
<h2>Header<a class="headerlink" href="#header" title="Permalink to this headline"></a></h2>
<div class="line-block">
<div class="line"><tt class="docutils literal"><span class="pre">sprout/algorithm/find_if.hpp</span></tt></div>
<div class="line">Convenience header: <tt class="docutils literal"><span class="pre">sprout/algorithm.hpp</span></tt></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="../../../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference external" href="#">find_if</a><ul>
<li><a class="reference external" href="#interface">Interface</a></li>
<li><a class="reference external" href="#returns">Returns</a></li>
<li><a class="reference external" href="#examples">Examples</a></li>
<li><a class="reference external" href="#complexity">Complexity</a></li>
<li><a class="reference external" href="#header">Header</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="find.html"
title="previous chapter">find</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="find_if_not.html"
title="next chapter">find_if_not</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../../_sources/libs/sprout/algorithm/find_if.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../../../search.html" method="get">
<input type="text" name="q" size="18" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="find_if_not.html" title="find_if_not"
>next</a> |</li>
<li class="right" >
<a href="find.html" title="find"
>previous</a> |</li>
<li><a href="../../../index.html">Sprout v1.0 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Sprout C++ Libraries</a> &raquo;</li>
<li><a href="../../libraries.html" >Libraries</a> &raquo;</li>
<li><a href="index.html" >Sprout.Algorithm</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2013, Bolero MURAKAMI.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.4.
</div>
</body>
</html>

View file

@ -0,0 +1,159 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>find_if_not &mdash; Sprout v1.0 documentation</title>
<link rel="stylesheet" href="../../../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../../',
VERSION: '1.0',
COLLAPSE_MODINDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../_static/doctools.js"></script>
<link rel="top" title="Sprout v1.0 documentation" href="../../../index.html" />
<link rel="up" title="Sprout.Algorithm" href="index.html" />
<link rel="prev" title="find_if" href="find_if.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="find_if.html" title="find_if"
accesskey="P">previous</a> |</li>
<li><a href="../../../index.html">Sprout v1.0 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Sprout C++ Libraries</a> &raquo;</li>
<li><a href="../../libraries.html" >Libraries</a> &raquo;</li>
<li><a href="index.html" accesskey="U">Sprout.Algorithm</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="find-if-not">
<h1>find_if_not<a class="headerlink" href="#find-if-not" title="Permalink to this headline"></a></h1>
<div class="section" id="interface">
<h2>Interface<a class="headerlink" href="#interface" title="Permalink to this headline"></a></h2>
<div class="highlight-c++"><div class="highlight"><pre><span class="k">template</span><span class="o">&lt;</span><span class="k">typename</span> <span class="n">InputIterator</span><span class="p">,</span> <span class="k">typename</span> <span class="n">Predicate</span><span class="o">&gt;</span>
<span class="kr">inline</span> <span class="n">SPROUT_CONSTEXPR</span> <span class="n">InputIterator</span>
<span class="n">find_if_not</span><span class="p">(</span><span class="n">InputIterator</span> <span class="n">first</span><span class="p">,</span> <span class="n">InputIterator</span> <span class="n">last</span><span class="p">,</span> <span class="n">Predicate</span> <span class="n">pred</span><span class="p">);</span>
</pre></div>
</div>
</div>
<div class="section" id="returns">
<h2>Returns<a class="headerlink" href="#returns" title="Permalink to this headline"></a></h2>
<div class="line-block">
<div class="line">The first iterator i in the range [first,last) for which the following corresponding conditions hold: <tt class="docutils literal"><span class="pre">!pred(*i)</span></tt>.</div>
<div class="line">Returns last if no such iterator is found.</div>
</div>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline"></a></h2>
<div class="highlight-c++"><div class="highlight"><pre><span class="cp">#include &lt;sprout/algorithm/find_if_not.hpp&gt;</span>
<span class="cp">#include &lt;sprout/array.hpp&gt;</span>
<span class="cp">#include &lt;sprout/container.hpp&gt;</span>
<span class="cp">#include &lt;sprout/functional.hpp&gt;</span>
<span class="k">using</span> <span class="k">namespace</span> <span class="n">sprout</span><span class="p">;</span>
<span class="n">SPROUT_STATIC_CONSTEXPR</span> <span class="k">auto</span> <span class="n">input</span> <span class="o">=</span> <span class="n">array</span><span class="o">&lt;</span><span class="kt">int</span><span class="p">,</span> <span class="mi">10</span><span class="o">&gt;</span><span class="p">{{</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">6</span><span class="p">,</span> <span class="mi">7</span><span class="p">,</span> <span class="mi">8</span><span class="p">,</span> <span class="mi">9</span><span class="p">,</span> <span class="mi">10</span><span class="p">}};</span>
<span class="n">SPROUT_STATIC_CONSTEXPR</span> <span class="k">auto</span> <span class="n">result</span> <span class="o">=</span> <span class="n">sprout</span><span class="o">::</span><span class="n">find_if_not</span><span class="p">(</span><span class="n">begin</span><span class="p">(</span><span class="n">input</span><span class="p">),</span> <span class="n">end</span><span class="p">(</span><span class="n">input</span><span class="p">),</span> <span class="n">bind2nd</span><span class="p">(</span><span class="n">less</span><span class="o">&lt;&gt;</span><span class="p">(),</span> <span class="mi">8</span><span class="p">));</span>
<span class="n">static_assert</span><span class="p">(</span><span class="n">result</span> <span class="o">!=</span> <span class="n">end</span><span class="p">(</span><span class="n">input</span><span class="p">),</span> <span class="s">&quot;found a element not less than 8 from input.&quot;</span><span class="p">);</span>
<span class="n">static_assert</span><span class="p">(</span><span class="o">*</span><span class="n">result</span> <span class="o">==</span> <span class="mi">8</span><span class="p">,</span> <span class="s">&quot;a found iterator is pointing to 8.&quot;</span><span class="p">);</span>
</pre></div>
</div>
</div>
<div class="section" id="complexity">
<h2>Complexity<a class="headerlink" href="#complexity" title="Permalink to this headline"></a></h2>
<div class="line-block">
<div class="line">At most <tt class="docutils literal"><span class="pre">last</span> <span class="pre">-</span> <span class="pre">first</span></tt> applications of the predicate.</div>
<div class="line">Recursive function invocations in <em>O(logN)</em> (logarithmic) depth.</div>
</div>
</div>
<div class="section" id="header">
<h2>Header<a class="headerlink" href="#header" title="Permalink to this headline"></a></h2>
<div class="line-block">
<div class="line"><tt class="docutils literal"><span class="pre">sprout/algorithm/find_if_not.hpp</span></tt></div>
<div class="line">Convenience header: <tt class="docutils literal"><span class="pre">sprout/algorithm.hpp</span></tt></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="../../../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference external" href="#">find_if_not</a><ul>
<li><a class="reference external" href="#interface">Interface</a></li>
<li><a class="reference external" href="#returns">Returns</a></li>
<li><a class="reference external" href="#examples">Examples</a></li>
<li><a class="reference external" href="#complexity">Complexity</a></li>
<li><a class="reference external" href="#header">Header</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="find_if.html"
title="previous chapter">find_if</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../../_sources/libs/sprout/algorithm/find_if_not.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../../../search.html" method="get">
<input type="text" name="q" size="18" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="find_if.html" title="find_if"
>previous</a> |</li>
<li><a href="../../../index.html">Sprout v1.0 documentation</a> &raquo;</li>
<li><a href="../../index.html" >Sprout C++ Libraries</a> &raquo;</li>
<li><a href="../../libraries.html" >Libraries</a> &raquo;</li>
<li><a href="index.html" >Sprout.Algorithm</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2013, Bolero MURAKAMI.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.4.
</div>
</body>
</html>

View file

@ -61,9 +61,9 @@
<li><a class="reference external" href="none_of_equal.html"><em>none_of_equal</em></a></li>
<li><a class="reference external" href="one_of.html"><em>one_of</em></a></li>
<li><a class="reference external" href="one_of_equal.html"><em>one_of_equal</em></a></li>
<li><tt class="xref docutils literal"><span class="pre">find</span></tt></li>
<li><tt class="xref docutils literal"><span class="pre">find_if</span></tt></li>
<li><tt class="xref docutils literal"><span class="pre">find_if_not</span></tt></li>
<li><a class="reference external" href="find.html"><em>find</em></a></li>
<li><a class="reference external" href="find_if.html"><em>find_if</em></a></li>
<li><a class="reference external" href="find_if_not.html"><em>find_if_not</em></a></li>
<li><tt class="xref docutils literal"><span class="pre">find_end</span></tt></li>
<li><tt class="xref docutils literal"><span class="pre">find_first_of</span></tt></li>
<li><tt class="xref docutils literal"><span class="pre">adjacent_find</span></tt></li>

View file

@ -61,7 +61,9 @@
</div>
<div class="section" id="returns">
<h2>Returns<a class="headerlink" href="#returns" title="Permalink to this headline"></a></h2>
<p><em>true</em> if [first,last) is empty or if <tt class="docutils literal"><span class="pre">pred(*i)</span></tt> is false for every iterator i in the range [first,last), and <em>false</em> otherwise.</p>
<div class="line-block">
<div class="line"><em>true</em> if [first,last) is empty or if <tt class="docutils literal"><span class="pre">pred(*i)</span></tt> is false for every iterator i in the range [first,last), and <em>false</em> otherwise.</div>
</div>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline"></a></h2>
@ -79,13 +81,17 @@
</div>
<div class="section" id="complexity">
<h2>Complexity<a class="headerlink" href="#complexity" title="Permalink to this headline"></a></h2>
<p>At most <tt class="docutils literal"><span class="pre">last</span> <span class="pre">-</span> <span class="pre">first</span></tt> applications of the predicate.</p>
<p>Recursive function invocations in <em>O(logN)</em> (logarithmic) depth.</p>
<div class="line-block">
<div class="line">At most <tt class="docutils literal"><span class="pre">last</span> <span class="pre">-</span> <span class="pre">first</span></tt> applications of the predicate.</div>
<div class="line">Recursive function invocations in <em>O(logN)</em> (logarithmic) depth.</div>
</div>
</div>
<div class="section" id="header">
<h2>Header<a class="headerlink" href="#header" title="Permalink to this headline"></a></h2>
<p><tt class="docutils literal"><span class="pre">sprout/algorithm/none_of.hpp</span></tt></p>
<p>Convenience header: <tt class="docutils literal"><span class="pre">sprout/algorithm.hpp</span></tt></p>
<div class="line-block">
<div class="line"><tt class="docutils literal"><span class="pre">sprout/algorithm/none_of.hpp</span></tt></div>
<div class="line">Convenience header: <tt class="docutils literal"><span class="pre">sprout/algorithm.hpp</span></tt></div>
</div>
</div>
</div>

View file

@ -61,7 +61,9 @@
</div>
<div class="section" id="returns">
<h2>Returns<a class="headerlink" href="#returns" title="Permalink to this headline"></a></h2>
<p><em>true</em> if [first,last) is empty or if <tt class="docutils literal"><span class="pre">*i</span> <span class="pre">==</span> <span class="pre">value</span></tt> is false for every iterator i in the range [first,last), and <em>false</em> otherwise.</p>
<div class="line-block">
<div class="line"><em>true</em> if [first,last) is empty or if <tt class="docutils literal"><span class="pre">*i</span> <span class="pre">==</span> <span class="pre">value</span></tt> is false for every iterator i in the range [first,last), and <em>false</em> otherwise.</div>
</div>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline"></a></h2>
@ -78,13 +80,17 @@
</div>
<div class="section" id="complexity">
<h2>Complexity<a class="headerlink" href="#complexity" title="Permalink to this headline"></a></h2>
<p>At most <tt class="docutils literal"><span class="pre">last</span> <span class="pre">-</span> <span class="pre">first</span></tt> applications of the predicate.</p>
<p>Recursive function invocations in <em>O(logN)</em> (logarithmic) depth.</p>
<div class="line-block">
<div class="line">At most <tt class="docutils literal"><span class="pre">last</span> <span class="pre">-</span> <span class="pre">first</span></tt> applications of the predicate.</div>
<div class="line">Recursive function invocations in <em>O(logN)</em> (logarithmic) depth.</div>
</div>
</div>
<div class="section" id="header">
<h2>Header<a class="headerlink" href="#header" title="Permalink to this headline"></a></h2>
<p><tt class="docutils literal"><span class="pre">sprout/algorithm/none_of_equal.hpp</span></tt></p>
<p>Convenience header: <tt class="docutils literal"><span class="pre">sprout/algorithm.hpp</span></tt></p>
<div class="line-block">
<div class="line"><tt class="docutils literal"><span class="pre">sprout/algorithm/none_of_equal.hpp</span></tt></div>
<div class="line">Convenience header: <tt class="docutils literal"><span class="pre">sprout/algorithm.hpp</span></tt></div>
</div>
</div>
</div>

View file

@ -61,7 +61,9 @@
</div>
<div class="section" id="returns">
<h2>Returns<a class="headerlink" href="#returns" title="Permalink to this headline"></a></h2>
<p><em>true</em> if [first,last) is not empty and there is only one iterator i in the range [first,last) such that <tt class="docutils literal"><span class="pre">pred(*i)</span></tt> is true, and <em>false</em> otherwise.</p>
<div class="line-block">
<div class="line"><em>true</em> if [first,last) is not empty and there is only one iterator i in the range [first,last) such that <tt class="docutils literal"><span class="pre">pred(*i)</span></tt> is true, and <em>false</em> otherwise.</div>
</div>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline"></a></h2>
@ -79,13 +81,17 @@
</div>
<div class="section" id="complexity">
<h2>Complexity<a class="headerlink" href="#complexity" title="Permalink to this headline"></a></h2>
<p>At most <tt class="docutils literal"><span class="pre">last</span> <span class="pre">-</span> <span class="pre">first</span></tt> applications of the predicate.</p>
<p>Recursive function invocations in <em>O(logN)</em> (logarithmic) depth.</p>
<div class="line-block">
<div class="line">At most <tt class="docutils literal"><span class="pre">last</span> <span class="pre">-</span> <span class="pre">first</span></tt> applications of the predicate.</div>
<div class="line">Recursive function invocations in <em>O(logN)</em> (logarithmic) depth.</div>
</div>
</div>
<div class="section" id="header">
<h2>Header<a class="headerlink" href="#header" title="Permalink to this headline"></a></h2>
<p><tt class="docutils literal"><span class="pre">sprout/algorithm/one_of.hpp</span></tt></p>
<p>Convenience header: <tt class="docutils literal"><span class="pre">sprout/algorithm.hpp</span></tt></p>
<div class="line-block">
<div class="line"><tt class="docutils literal"><span class="pre">sprout/algorithm/one_of.hpp</span></tt></div>
<div class="line">Convenience header: <tt class="docutils literal"><span class="pre">sprout/algorithm.hpp</span></tt></div>
</div>
</div>
</div>

View file

@ -21,6 +21,7 @@
<script type="text/javascript" src="../../../_static/doctools.js"></script>
<link rel="top" title="Sprout v1.0 documentation" href="../../../index.html" />
<link rel="up" title="Sprout.Algorithm" href="index.html" />
<link rel="next" title="find" href="find.html" />
<link rel="prev" title="one_of" href="one_of.html" />
</head>
<body>
@ -30,6 +31,9 @@
<li class="right" style="margin-right: 10px">
<a href="../../../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="find.html" title="find"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="one_of.html" title="one_of"
accesskey="P">previous</a> |</li>
@ -57,7 +61,9 @@
</div>
<div class="section" id="returns">
<h2>Returns<a class="headerlink" href="#returns" title="Permalink to this headline"></a></h2>
<p><em>true</em> if [first,last) is not empty and there is only one iterator i in the range [first,last) such that <tt class="docutils literal"><span class="pre">*i</span> <span class="pre">==</span> <span class="pre">value</span></tt> is true, and <em>false</em> otherwise.</p>
<div class="line-block">
<div class="line"><em>true</em> if [first,last) is not empty and there is only one iterator i in the range [first,last) such that <tt class="docutils literal"><span class="pre">*i</span> <span class="pre">==</span> <span class="pre">value</span></tt> is true, and <em>false</em> otherwise.</div>
</div>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline"></a></h2>
@ -74,13 +80,17 @@
</div>
<div class="section" id="complexity">
<h2>Complexity<a class="headerlink" href="#complexity" title="Permalink to this headline"></a></h2>
<p>At most <tt class="docutils literal"><span class="pre">last</span> <span class="pre">-</span> <span class="pre">first</span></tt> applications of the predicate.</p>
<p>Recursive function invocations in <em>O(logN)</em> (logarithmic) depth.</p>
<div class="line-block">
<div class="line">At most <tt class="docutils literal"><span class="pre">last</span> <span class="pre">-</span> <span class="pre">first</span></tt> applications of the predicate.</div>
<div class="line">Recursive function invocations in <em>O(logN)</em> (logarithmic) depth.</div>
</div>
</div>
<div class="section" id="header">
<h2>Header<a class="headerlink" href="#header" title="Permalink to this headline"></a></h2>
<p><tt class="docutils literal"><span class="pre">sprout/algorithm/one_of_equal.hpp</span></tt></p>
<p>Convenience header: <tt class="docutils literal"><span class="pre">sprout/algorithm.hpp</span></tt></p>
<div class="line-block">
<div class="line"><tt class="docutils literal"><span class="pre">sprout/algorithm/one_of_equal.hpp</span></tt></div>
<div class="line">Convenience header: <tt class="docutils literal"><span class="pre">sprout/algorithm.hpp</span></tt></div>
</div>
</div>
</div>
@ -105,6 +115,9 @@
<h4>Previous topic</h4>
<p class="topless"><a href="one_of.html"
title="previous chapter">one_of</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="find.html"
title="next chapter">find</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../../_sources/libs/sprout/algorithm/one_of_equal.txt"
@ -133,6 +146,9 @@
<li class="right" style="margin-right: 10px">
<a href="../../../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="find.html" title="find"
>next</a> |</li>
<li class="right" >
<a href="one_of.html" title="one_of"
>previous</a> |</li>

File diff suppressed because one or more lines are too long

View file

@ -15,6 +15,13 @@ Welcome to the Sprout C++ Libraries
C++11 constexpr based Containers, Algorithms, Random numbers, Parsing, Ray tracing, Synthesizer, and others.
.. _sprout-documentation:
*******************************************************************************
Library Documentation
*******************************************************************************
The starting point for the documentation of individual libraries is the :doc:`Libraries page <./libraries>`, which gives a brief description of each library and links to its documentation.
.. _sprout-project:
*******************************************************************************
Project page

View file

@ -27,16 +27,21 @@ Containers and Data structures
=======================================
* :doc:`array <./sprout/array/index>` - STL compliant class template for storing fixed-size sequences of objects.
* :doc:`string <./sprout/string/index>`
* :doc:`tuple <./sprout/tuple/index>`
* :doc:`optional <./sprout/optional/index>`
* :doc:`variant <./sprout/variant/index>`
* :doc:`bitset <./sprout/bitset/index>`
.. _sprout-listed_by_category-algorithms:
Algorithms
=======================================
* :doc:`algorithm <./sprout/algorithm/index>` - STL like generic algorithms.
.. _sprout-listed_by_category-algorithms:
Algorithms
=======================================
* :doc:`numeric <./sprout/numeric/index>`
* :doc:`range_algorithm <./sprout/range/algorithm/index>`
* :doc:`range_numeric <./sprout/range/numeric/index>`
* :doc:`range_adaptor <./sprout/range/adaptor/index>`
.. _sprout-listed_by_category-container_supports:
Container supports

View file

@ -14,7 +14,7 @@ Interface
Returns
========================================
*true* if [first,last) is empty or if ``pred(*i)`` is true for every iterator i in the range [first,last), and *false* otherwise.
| *true* if [first,last) is empty or if ``pred(*i)`` is true for every iterator i in the range [first,last), and *false* otherwise.
Examples
========================================
@ -33,14 +33,12 @@ Examples
Complexity
========================================
At most ``last - first`` applications of the predicate.
Recursive function invocations in *O(logN)* (logarithmic) depth.
| At most ``last - first`` applications of the predicate.
| Recursive function invocations in *O(logN)* (logarithmic) depth.
Header
========================================
``sprout/algorithm/all_of.hpp``
Convenience header: ``sprout/algorithm.hpp``
| ``sprout/algorithm/all_of.hpp``
| Convenience header: ``sprout/algorithm.hpp``

View file

@ -14,7 +14,7 @@ Interface
Returns
========================================
*true* if [first,last) is empty or if ``*i == value`` is true for every iterator i in the range [first,last), and *false* otherwise.
| *true* if [first,last) is empty or if ``*i == value`` is true for every iterator i in the range [first,last), and *false* otherwise.
Examples
========================================
@ -32,14 +32,12 @@ Examples
Complexity
========================================
At most ``last - first`` applications of the predicate.
Recursive function invocations in *O(logN)* (logarithmic) depth.
| At most ``last - first`` applications of the predicate.
| Recursive function invocations in *O(logN)* (logarithmic) depth.
Header
========================================
``sprout/algorithm/all_of_equal.hpp``
Convenience header: ``sprout/algorithm.hpp``
| ``sprout/algorithm/all_of_equal.hpp``
| Convenience header: ``sprout/algorithm.hpp``

View file

@ -14,7 +14,7 @@ Interface
Returns
========================================
*false* if [first,last) is empty or if there is no iterator i in the range [first,last) such that ``pred(*i)`` is true, and *true* otherwise.
| *false* if [first,last) is empty or if there is no iterator i in the range [first,last) such that ``pred(*i)`` is true, and *true* otherwise.
Examples
========================================
@ -33,14 +33,12 @@ Examples
Complexity
========================================
At most ``last - first`` applications of the predicate.
Recursive function invocations in *O(logN)* (logarithmic) depth.
| At most ``last - first`` applications of the predicate.
| Recursive function invocations in *O(logN)* (logarithmic) depth.
Header
========================================
``sprout/algorithm/any_of.hpp``
Convenience header: ``sprout/algorithm.hpp``
| ``sprout/algorithm/any_of.hpp``
| Convenience header: ``sprout/algorithm.hpp``

View file

@ -14,7 +14,7 @@ Interface
Returns
========================================
*false* if [first,last) is empty or if there is no iterator i in the range [first,last) such that ``*i == value`` is true, and *true* otherwise.
| *false* if [first,last) is empty or if there is no iterator i in the range [first,last) such that ``*i == value`` is true, and *true* otherwise.
Examples
========================================
@ -32,14 +32,12 @@ Examples
Complexity
========================================
At most ``last - first`` applications of the predicate.
Recursive function invocations in *O(logN)* (logarithmic) depth.
| At most ``last - first`` applications of the predicate.
| Recursive function invocations in *O(logN)* (logarithmic) depth.
Header
========================================
``sprout/algorithm/any_of_equal.hpp``
Convenience header: ``sprout/algorithm.hpp``
| ``sprout/algorithm/any_of_equal.hpp``
| Convenience header: ``sprout/algorithm.hpp``

View file

@ -0,0 +1,45 @@
.. _sprout-algorithm-find:
###############################################################################
find
###############################################################################
Interface
========================================
.. sourcecode:: c++
template<typename InputIterator, typename T>
inline SPROUT_CONSTEXPR InputIterator
find(InputIterator first, InputIterator last, T const& value);
Returns
========================================
| The first iterator i in the range [first,last) for which the following corresponding conditions hold: ``*i == value``.
| Returns last if no such iterator is found.
Examples
========================================
.. sourcecode:: c++
#include <sprout/algorithm/find.hpp>
#include <sprout/array.hpp>
#include <sprout/container.hpp>
using namespace sprout;
SPROUT_STATIC_CONSTEXPR auto input = array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}};
SPROUT_STATIC_CONSTEXPR auto result = sprout::find(begin(input), end(input), 8);
static_assert(result != end(input), "found a element equal to 8 from input.");
static_assert(*result == 8, "a found iterator is pointing to 8.");
Complexity
========================================
| At most ``last - first`` applications of the predicate.
| Recursive function invocations in *O(logN)* (logarithmic) depth.
Header
========================================
| ``sprout/algorithm/find.hpp``
| Convenience header: ``sprout/algorithm.hpp``

View file

@ -0,0 +1,46 @@
.. _sprout-algorithm-find_if:
###############################################################################
find_if
###############################################################################
Interface
========================================
.. sourcecode:: c++
template<typename InputIterator, typename Predicate>
inline SPROUT_CONSTEXPR InputIterator
find_if(InputIterator first, InputIterator last, Predicate pred);
Returns
========================================
| The first iterator i in the range [first,last) for which the following corresponding conditions hold: ``pred(*i)``.
| Returns last if no such iterator is found.
Examples
========================================
.. sourcecode:: c++
#include <sprout/algorithm/find_if.hpp>
#include <sprout/array.hpp>
#include <sprout/container.hpp>
#include <sprout/functional.hpp>
using namespace sprout;
SPROUT_STATIC_CONSTEXPR auto input = array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}};
SPROUT_STATIC_CONSTEXPR auto result = sprout::find_if(begin(input), end(input), bind2nd(greater<>(), 7));
static_assert(result != end(input), "found a element greater than 7 from input.");
static_assert(*result == 8, "a found iterator is pointing to 8.");
Complexity
========================================
| At most ``last - first`` applications of the predicate.
| Recursive function invocations in *O(logN)* (logarithmic) depth.
Header
========================================
| ``sprout/algorithm/find_if.hpp``
| Convenience header: ``sprout/algorithm.hpp``

View file

@ -0,0 +1,46 @@
.. _sprout-algorithm-find_if_not:
###############################################################################
find_if_not
###############################################################################
Interface
========================================
.. sourcecode:: c++
template<typename InputIterator, typename Predicate>
inline SPROUT_CONSTEXPR InputIterator
find_if_not(InputIterator first, InputIterator last, Predicate pred);
Returns
========================================
| The first iterator i in the range [first,last) for which the following corresponding conditions hold: ``!pred(*i)``.
| Returns last if no such iterator is found.
Examples
========================================
.. sourcecode:: c++
#include <sprout/algorithm/find_if_not.hpp>
#include <sprout/array.hpp>
#include <sprout/container.hpp>
#include <sprout/functional.hpp>
using namespace sprout;
SPROUT_STATIC_CONSTEXPR auto input = array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}};
SPROUT_STATIC_CONSTEXPR auto result = sprout::find_if_not(begin(input), end(input), bind2nd(less<>(), 8));
static_assert(result != end(input), "found a element not less than 8 from input.");
static_assert(*result == 8, "a found iterator is pointing to 8.");
Complexity
========================================
| At most ``last - first`` applications of the predicate.
| Recursive function invocations in *O(logN)* (logarithmic) depth.
Header
========================================
| ``sprout/algorithm/find_if_not.hpp``
| Convenience header: ``sprout/algorithm.hpp``

View file

@ -14,6 +14,9 @@ Sprout.Algorithm
none_of_equal
one_of
one_of_equal
find
find_if
find_if_not
.. _sprout-algorithm-non_modifying:
*******************************************************************************

View file

@ -14,7 +14,7 @@ Interface
Returns
========================================
*true* if [first,last) is empty or if ``pred(*i)`` is false for every iterator i in the range [first,last), and *false* otherwise.
| *true* if [first,last) is empty or if ``pred(*i)`` is false for every iterator i in the range [first,last), and *false* otherwise.
Examples
========================================
@ -33,14 +33,12 @@ Examples
Complexity
========================================
At most ``last - first`` applications of the predicate.
Recursive function invocations in *O(logN)* (logarithmic) depth.
| At most ``last - first`` applications of the predicate.
| Recursive function invocations in *O(logN)* (logarithmic) depth.
Header
========================================
``sprout/algorithm/none_of.hpp``
Convenience header: ``sprout/algorithm.hpp``
| ``sprout/algorithm/none_of.hpp``
| Convenience header: ``sprout/algorithm.hpp``

View file

@ -14,7 +14,7 @@ Interface
Returns
========================================
*true* if [first,last) is empty or if ``*i == value`` is false for every iterator i in the range [first,last), and *false* otherwise.
| *true* if [first,last) is empty or if ``*i == value`` is false for every iterator i in the range [first,last), and *false* otherwise.
Examples
========================================
@ -32,14 +32,12 @@ Examples
Complexity
========================================
At most ``last - first`` applications of the predicate.
Recursive function invocations in *O(logN)* (logarithmic) depth.
| At most ``last - first`` applications of the predicate.
| Recursive function invocations in *O(logN)* (logarithmic) depth.
Header
========================================
``sprout/algorithm/none_of_equal.hpp``
Convenience header: ``sprout/algorithm.hpp``
| ``sprout/algorithm/none_of_equal.hpp``
| Convenience header: ``sprout/algorithm.hpp``

View file

@ -14,7 +14,7 @@ Interface
Returns
========================================
*true* if [first,last) is not empty and there is only one iterator i in the range [first,last) such that ``pred(*i)`` is true, and *false* otherwise.
| *true* if [first,last) is not empty and there is only one iterator i in the range [first,last) such that ``pred(*i)`` is true, and *false* otherwise.
Examples
========================================
@ -33,14 +33,12 @@ Examples
Complexity
========================================
At most ``last - first`` applications of the predicate.
Recursive function invocations in *O(logN)* (logarithmic) depth.
| At most ``last - first`` applications of the predicate.
| Recursive function invocations in *O(logN)* (logarithmic) depth.
Header
========================================
``sprout/algorithm/one_of.hpp``
Convenience header: ``sprout/algorithm.hpp``
| ``sprout/algorithm/one_of.hpp``
| Convenience header: ``sprout/algorithm.hpp``

View file

@ -14,7 +14,7 @@ Interface
Returns
========================================
*true* if [first,last) is not empty and there is only one iterator i in the range [first,last) such that ``*i == value`` is true, and *false* otherwise.
| *true* if [first,last) is not empty and there is only one iterator i in the range [first,last) such that ``*i == value`` is true, and *false* otherwise.
Examples
========================================
@ -32,14 +32,12 @@ Examples
Complexity
========================================
At most ``last - first`` applications of the predicate.
Recursive function invocations in *O(logN)* (logarithmic) depth.
| At most ``last - first`` applications of the predicate.
| Recursive function invocations in *O(logN)* (logarithmic) depth.
Header
========================================
``sprout/algorithm/one_of_equal.hpp``
Convenience header: ``sprout/algorithm.hpp``
| ``sprout/algorithm/one_of_equal.hpp``
| Convenience header: ``sprout/algorithm.hpp``