Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:30:41

0001 // (C) Copyright Jeremy Siek 2001.
0002 // Distributed under the Boost Software License, Version 1.0. (See accompany-
0003 // ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0004 
0005 /*
0006  *
0007  * Copyright (c) 1994
0008  * Hewlett-Packard Company
0009  *
0010  * Permission to use, copy, modify, distribute and sell this software
0011  * and its documentation for any purpose is hereby granted without fee,
0012  * provided that the above copyright notice appear in all copies and
0013  * that both that copyright notice and this permission notice appear
0014  * in supporting documentation.  Hewlett-Packard Company makes no
0015  * representations about the suitability of this software for any
0016  * purpose.  It is provided "as is" without express or implied warranty.
0017  *
0018  *
0019  * Copyright (c) 1996
0020  * Silicon Graphics Computer Systems, Inc.
0021  *
0022  * Permission to use, copy, modify, distribute and sell this software
0023  * and its documentation for any purpose is hereby granted without fee,
0024  * provided that the above copyright notice appear in all copies and
0025  * that both that copyright notice and this permission notice appear
0026  * in supporting documentation.  Silicon Graphics makes no
0027  * representations about the suitability of this software for any
0028  * purpose.  It is provided "as is" without express or implied warranty.
0029  */
0030 
0031 #ifndef BOOST_ALGORITHM_HPP
0032 #define BOOST_ALGORITHM_HPP
0033 
0034 // Algorithms on sequences
0035 //
0036 // The functions in this file have not yet gone through formal
0037 // review, and are subject to change. This is a work in progress.
0038 // They have been checked into the detail directory because
0039 // there are some graph algorithms that use these functions.
0040 
0041 #include <algorithm>
0042 #include <vector>
0043 #include <boost/range/begin.hpp>
0044 #include <boost/range/end.hpp>
0045 #include <boost/range/algorithm/copy.hpp>
0046 #include <boost/range/algorithm/equal.hpp>
0047 #include <boost/range/algorithm/sort.hpp>
0048 #include <boost/range/algorithm/stable_sort.hpp>
0049 #include <boost/range/algorithm/find_if.hpp>
0050 #include <boost/range/algorithm/count.hpp>
0051 #include <boost/range/algorithm/count_if.hpp>
0052 #include <boost/range/algorithm_ext/is_sorted.hpp>
0053 #include <boost/range/algorithm_ext/iota.hpp>
0054 
0055 namespace boost
0056 {
0057 
0058 template < typename InputIterator, typename Predicate >
0059 bool any_if(InputIterator first, InputIterator last, Predicate p)
0060 {
0061     return std::find_if(first, last, p) != last;
0062 }
0063 
0064 template < typename Container, typename Predicate >
0065 bool any_if(const Container& c, Predicate p)
0066 {
0067     return any_if(boost::begin(c), boost::end(c), p);
0068 }
0069 
0070 template < typename InputIterator, typename T >
0071 bool container_contains(InputIterator first, InputIterator last, T value)
0072 {
0073     return std::find(first, last, value) != last;
0074 }
0075 template < typename Container, typename T >
0076 bool container_contains(const Container& c, const T& value)
0077 {
0078     return container_contains(boost::begin(c), boost::end(c), value);
0079 }
0080 
0081 } // namespace boost
0082 
0083 #endif // BOOST_ALGORITHM_HPP