Compare commits

..
Author SHA1 Message Date
feedc0de 9dc04a60f4 Rework as esp-idf component 2023-11-23 17:17:05 +01:00
23 changed files with 145 additions and 180 deletions
+33
View File
@@ -3,6 +3,8 @@
# Distributed under the Boost Software License, Version 1.0. # Distributed under the Boost Software License, Version 1.0.
# https://www.boost.org/LICENSE_1_0.txt # https://www.boost.org/LICENSE_1_0.txt
if(NOT DEFINED IDF_TARGET)
cmake_minimum_required(VERSION 3.5...3.16) cmake_minimum_required(VERSION 3.5...3.16)
project(boost_algorithm VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX) project(boost_algorithm VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
@@ -26,6 +28,7 @@ target_link_libraries(boost_algorithm
Boost::mpl Boost::mpl
Boost::range Boost::range
Boost::regex Boost::regex
Boost::static_assert
Boost::throw_exception Boost::throw_exception
Boost::tuple Boost::tuple
Boost::type_traits Boost::type_traits
@@ -38,3 +41,33 @@ if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")
endif() endif()
else()
FILE(GLOB_RECURSE headers include/*.h include/*.hpp)
idf_component_register(
SRCS
${headers}
INCLUDE_DIRS
include
REQUIRES
boost_array
boost_assert
boost_bind
boost_concept_check
boost_config
boost_core
boost_exception
boost_function
boost_iterator
boost_mpl
boost_range
boost_regex
boost_static_assert
boost_throw_exception
boost_tuple
boost_type_traits
boost_unordered
)
endif()
+11
View File
@@ -0,0 +1,11 @@
# Boost.Algorithm Library Jamfile
#
# Copyright (c) 2018 James E. King III
#
# Use, modification, and distribution are subject to the
# Boost Software License, Version 1.0. (See accompanying file
# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
# please order by name to ease maintenance
build-project example ;
build-project test ;
+2 -2
View File
@@ -13,8 +13,8 @@ Distributed under the [Boost Software License, Version 1.0](http://www.boost.org
Branch | Travis | Appveyor | Coverity Scan | codecov.io | Deps | Docs | Tests | Branch | Travis | Appveyor | Coverity Scan | codecov.io | Deps | Docs | Tests |
:-------------: | ------ | -------- | ------------- | ---------- | ---- | ---- | ----- | :-------------: | ------ | -------- | ------------- | ---------- | ---- | ---- | ----- |
[`master`](https://github.com/boostorg/algorithm/tree/master) | [![Build Status](https://travis-ci.org/boostorg/algorithm.svg?branch=master)](https://travis-ci.org/boostorg/algorithm) | [![Build status](https://ci.appveyor.com/api/projects/status/FIXME/branch/master?svg=true)](https://ci.appveyor.com/project/USER/PROJECT/branch/master) | [![Coverity Scan Build Status](https://scan.coverity.com/projects/99999/badge.svg)](https://scan.coverity.com/projects/boostorg-algorithm) | [![codecov](https://codecov.io/gh/boostorg/algorithm/branch/master/graph/badge.svg)](https://codecov.io/gh/boostorg/algorithm/branch/master)| [![Deps](https://img.shields.io/badge/deps-master-brightgreen.svg)](https://pdimov.github.io/boostdep-report/master/algorithm.html) | [![Documentation](https://img.shields.io/badge/docs-master-brightgreen.svg)](http://www.boost.org/doc/libs/master/doc/html/algorithm.html) | [![Enter the Matrix](https://img.shields.io/badge/matrix-master-brightgreen.svg)](https://regression.boost.io/master/developer/algorithm.html) [`master`](https://github.com/boostorg/algorithm/tree/master) | [![Build Status](https://travis-ci.org/boostorg/algorithm.svg?branch=master)](https://travis-ci.org/boostorg/algorithm) | [![Build status](https://ci.appveyor.com/api/projects/status/FIXME/branch/master?svg=true)](https://ci.appveyor.com/project/USER/PROJECT/branch/master) | [![Coverity Scan Build Status](https://scan.coverity.com/projects/99999/badge.svg)](https://scan.coverity.com/projects/boostorg-algorithm) | [![codecov](https://codecov.io/gh/boostorg/algorithm/branch/master/graph/badge.svg)](https://codecov.io/gh/boostorg/algorithm/branch/master)| [![Deps](https://img.shields.io/badge/deps-master-brightgreen.svg)](https://pdimov.github.io/boostdep-report/master/algorithm.html) | [![Documentation](https://img.shields.io/badge/docs-master-brightgreen.svg)](http://www.boost.org/doc/libs/master/doc/html/algorithm.html) | [![Enter the Matrix](https://img.shields.io/badge/matrix-master-brightgreen.svg)](http://www.boost.org/development/tests/master/developer/algorithm.html)
[`develop`](https://github.com/boostorg/algorithm/tree/develop) | [![Build Status](https://travis-ci.org/boostorg/algorithm.svg?branch=develop)](https://travis-ci.org/boostorg/algorithm) | [![Build status](https://ci.appveyor.com/api/projects/status/FIXME/branch/develop?svg=true)](https://ci.appveyor.com/project/USER/PROJECT/branch/develop) | [![Coverity Scan Build Status](https://scan.coverity.com/projects/99999/badge.svg)](https://scan.coverity.com/projects/boostorg-algorithm) | [![codecov](https://codecov.io/gh/boostorg/algorithm/branch/develop/graph/badge.svg)](https://codecov.io/gh/boostorg/algorithm/branch/develop) | [![Deps](https://img.shields.io/badge/deps-develop-brightgreen.svg)](https://pdimov.github.io/boostdep-report/develop/algorithm.html) | [![Documentation](https://img.shields.io/badge/docs-develop-brightgreen.svg)](http://www.boost.org/doc/libs/develop/doc/html/algorithm.html) | [![Enter the Matrix](https://img.shields.io/badge/matrix-develop-brightgreen.svg)](https://regression.boost.io/develop/developer/algorithm.html) [`develop`](https://github.com/boostorg/algorithm/tree/develop) | [![Build Status](https://travis-ci.org/boostorg/algorithm.svg?branch=develop)](https://travis-ci.org/boostorg/algorithm) | [![Build status](https://ci.appveyor.com/api/projects/status/FIXME/branch/develop?svg=true)](https://ci.appveyor.com/project/USER/PROJECT/branch/develop) | [![Coverity Scan Build Status](https://scan.coverity.com/projects/99999/badge.svg)](https://scan.coverity.com/projects/boostorg-algorithm) | [![codecov](https://codecov.io/gh/boostorg/algorithm/branch/develop/graph/badge.svg)](https://codecov.io/gh/boostorg/algorithm/branch/develop) | [![Deps](https://img.shields.io/badge/deps-develop-brightgreen.svg)](https://pdimov.github.io/boostdep-report/develop/algorithm.html) | [![Documentation](https://img.shields.io/badge/docs-develop-brightgreen.svg)](http://www.boost.org/doc/libs/develop/doc/html/algorithm.html) | [![Enter the Matrix](https://img.shields.io/badge/matrix-develop-brightgreen.svg)](http://www.boost.org/development/tests/develop/developer/algorithm.html)
### Directories ### Directories
-41
View File
@@ -1,41 +0,0 @@
# Copyright René Ferdinand Rivera Morell 2023-2024
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
require-b2 5.2 ;
constant boost_dependencies :
/boost/array//boost_array
/boost/assert//boost_assert
/boost/bind//boost_bind
/boost/concept_check//boost_concept_check
/boost/config//boost_config
/boost/core//boost_core
/boost/exception//boost_exception
/boost/function//boost_function
/boost/iterator//boost_iterator
/boost/mpl//boost_mpl
/boost/range//boost_range
/boost/regex//boost_regex
/boost/throw_exception//boost_throw_exception
/boost/tuple//boost_tuple
/boost/type_traits//boost_type_traits
/boost/unordered//boost_unordered ;
project /boost/algorithm
: common-requirements
<include>include
;
explicit
[ alias boost_algorithm : : : : <library>$(boost_dependencies) ]
[ alias all : boost_algorithm test
example
minmax/example minmax/test
string/example string/test
]
;
call-if : boost-library algorithm
;
+10 -10
View File
@@ -16,18 +16,18 @@ using quickbook ;
using doxygen ; using doxygen ;
using boostbook ; using boostbook ;
doxygen autodoc doxygen autodoc
: :
[ glob ../include/boost/algorithm/*.hpp [ glob ../../../boost/algorithm/*.hpp
../include/boost/algorithm/searching/*.hpp ../../../boost/algorithm/searching/*.hpp
../include/boost/algorithm/cxx11/*.hpp ../../../boost/algorithm/cxx11/*.hpp
../include/boost/algorithm/cxx14/*.hpp ../../../boost/algorithm/cxx14/*.hpp
../include/boost/algorithm/cxx17/*.hpp ../../../boost/algorithm/cxx17/*.hpp
] ]
: :
<doxygen:param>"PREDEFINED=\"BOOST_ALGORITHM_DOXYGEN=1\"" <doxygen:param>"PREDEFINED=\"BOOST_ALGORITHM_DOXYGEN=1\""
<doxygen:param>WARNINGS=YES # Default NO, but useful to see warnings, especially in a logfile. <doxygen:param>WARNINGS=YES # Default NO, but useful to see warnings, especially in a logfile.
; ;
xml algorithm : algorithm.qbk ; xml algorithm : algorithm.qbk ;
@@ -36,7 +36,7 @@ boostbook standalone
: :
algorithm algorithm
: :
<dependency>autodoc <dependency>autodoc
<xsl:param>boost.root=../../../.. <xsl:param>boost.root=../../../..
<xsl:param>"boost.doxygen.reftitle=Boost.Algorithms C++ Reference" <xsl:param>"boost.doxygen.reftitle=Boost.Algorithms C++ Reference"
<xsl:param>chapter.autolabel=0 <xsl:param>chapter.autolabel=0
+2 -2
View File
@@ -8,9 +8,9 @@
# See http://www.boost.org for updates, documentation, and revision history. # See http://www.boost.org for updates, documentation, and revision history.
project project /boost/algorithm/example
: requirements : requirements
<library>/boost/algorithm//boost_algorithm <include>../../../
<optimization>speed <optimization>speed
<toolset>msvc:<define>_SCL_SECURE_NO_WARNINGS <toolset>msvc:<define>_SCL_SECURE_NO_WARNINGS
<toolset>msvc:<define>NOMINMAX <toolset>msvc:<define>NOMINMAX
@@ -100,7 +100,7 @@ namespace detail {
} }
/// \endcond /// \endcond
/// \fn is_permutation ( ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2, BinaryPredicate p ) /// \fn is_permutation ( ForwardIterator1 first, ForwardIterator1 last, ForwardIterator2 first2, BinaryPredicate p )
/// \brief Tests to see if the sequence [first,last) is a permutation of the sequence starting at first2 /// \brief Tests to see if the sequence [first,last) is a permutation of the sequence starting at first2
/// ///
/// \param first1 The start of the input sequence /// \param first1 The start of the input sequence
@@ -127,11 +127,11 @@ bool is_permutation ( ForwardIterator1 first1, ForwardIterator1 last1,
return true; return true;
} }
/// \fn is_permutation ( ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2 ) /// \fn is_permutation ( ForwardIterator1 first, ForwardIterator1 last, ForwardIterator2 first2 )
/// \brief Tests to see if the sequence [first,last) is a permutation of the sequence starting at first2 /// \brief Tests to see if the sequence [first,last) is a permutation of the sequence starting at first2
/// ///
/// \param first1 The start of the input sequence /// \param first1 The start of the input sequence
/// \param last1 One past the end of the input sequence /// \param last2 One past the end of the input sequence
/// \param first2 The start of the second sequence /// \param first2 The start of the second sequence
/// \note This function is part of the C++2011 standard library. /// \note This function is part of the C++2011 standard library.
template< class ForwardIterator1, class ForwardIterator2 > template< class ForwardIterator1, class ForwardIterator2 >
+6 -6
View File
@@ -1,4 +1,4 @@
/* /*
Copyright 2008 Adobe Systems Incorporated Copyright 2008 Adobe Systems Incorporated
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -84,7 +84,7 @@ namespace boost { namespace algorithm {
template < template <
typename BidirectionalIterator, // models BidirectionalIterator typename BidirectionalIterator, // models BidirectionalIterator
typename Pred> // models UnaryPredicate typename Pred> // models UnaryPredicate
std::pair<BidirectionalIterator, BidirectionalIterator> gather std::pair<BidirectionalIterator, BidirectionalIterator> gather
( BidirectionalIterator first, BidirectionalIterator last, BidirectionalIterator pivot, Pred pred ) ( BidirectionalIterator first, BidirectionalIterator last, BidirectionalIterator pivot, Pred pred )
{ {
// The first call partitions everything up to (but not including) the pivot element, // The first call partitions everything up to (but not including) the pivot element,
@@ -106,11 +106,11 @@ template <
typename BidirectionalRange, // typename BidirectionalRange, //
typename Pred> // Pred models UnaryPredicate typename Pred> // Pred models UnaryPredicate
std::pair< std::pair<
typename boost::range_iterator<BidirectionalRange>::type, typename boost::range_iterator<const BidirectionalRange>::type,
typename boost::range_iterator<BidirectionalRange>::type> typename boost::range_iterator<const BidirectionalRange>::type>
gather ( gather (
BidirectionalRange &range, const BidirectionalRange &range,
typename boost::range_iterator<BidirectionalRange>::type pivot, typename boost::range_iterator<const BidirectionalRange>::type pivot,
Pred pred ) Pred pred )
{ {
return boost::algorithm::gather ( boost::begin ( range ), boost::end ( range ), pivot, pred ); return boost::algorithm::gather ( boost::begin ( range ), boost::end ( range ), pivot, pred );
@@ -10,7 +10,6 @@
#ifndef BOOST_ALGORITHM_BOYER_MOORE_SEARCH_HPP #ifndef BOOST_ALGORITHM_BOYER_MOORE_SEARCH_HPP
#define BOOST_ALGORITHM_BOYER_MOORE_SEARCH_HPP #define BOOST_ALGORITHM_BOYER_MOORE_SEARCH_HPP
#include <algorithm> // for std::reverse_copy
#include <iterator> // for std::iterator_traits #include <iterator> // for std::iterator_traits
#include <boost/config.hpp> #include <boost/config.hpp>
@@ -108,11 +107,12 @@ Requirements:
typename traits::skip_table_t skip_; typename traits::skip_table_t skip_;
std::vector <difference_type> suffix_; std::vector <difference_type> suffix_;
/// \fn do_search ( corpusIter corpus_first, corpusIter corpus_last ) /// \fn operator ( corpusIter corpus_first, corpusIter corpus_last, Pred p )
/// \brief Searches the corpus for the pattern that was passed into the constructor /// \brief Searches the corpus for the pattern that was passed into the constructor
/// ///
/// \param corpus_first The start of the data to search (Random Access Iterator) /// \param corpus_first The start of the data to search (Random Access Iterator)
/// \param corpus_last One past the end of the data to search /// \param corpus_last One past the end of the data to search
/// \param p A predicate used for the search comparisons.
/// ///
template <typename corpusIter> template <typename corpusIter>
std::pair<corpusIter, corpusIter> std::pair<corpusIter, corpusIter>
@@ -107,6 +107,7 @@ http://www-igm.univ-mlv.fr/%7Elecroq/string/node18.html
/// ///
/// \param corpus_first The start of the data to search (Random Access Iterator) /// \param corpus_first The start of the data to search (Random Access Iterator)
/// \param corpus_last One past the end of the data to search /// \param corpus_last One past the end of the data to search
/// \param k_corpus_length The length of the corpus to search
/// ///
template <typename corpusIter> template <typename corpusIter>
std::pair<corpusIter, corpusIter> std::pair<corpusIter, corpusIter>
@@ -62,11 +62,12 @@ namespace boost { namespace algorithm {
~knuth_morris_pratt () {} ~knuth_morris_pratt () {}
/// \fn operator ( corpusIter corpus_first, corpusIter corpus_last ) /// \fn operator ( corpusIter corpus_first, corpusIter corpus_last, Pred p )
/// \brief Searches the corpus for the pattern that was passed into the constructor /// \brief Searches the corpus for the pattern that was passed into the constructor
/// ///
/// \param corpus_first The start of the data to search (Random Access Iterator) /// \param corpus_first The start of the data to search (Random Access Iterator)
/// \param corpus_last One past the end of the data to search /// \param corpus_last One past the end of the data to search
/// \param p A predicate used for the search comparisons.
/// ///
template <typename corpusIter> template <typename corpusIter>
std::pair<corpusIter, corpusIter> std::pair<corpusIter, corpusIter>
@@ -98,16 +99,16 @@ namespace boost { namespace algorithm {
const difference_type k_pattern_length; const difference_type k_pattern_length;
std::vector <difference_type> skip_; std::vector <difference_type> skip_;
/// \fn do_search ( corpusIter corpus_first, corpusIter corpus_last, difference_type k_corpus_length ) /// \fn operator ( corpusIter corpus_first, corpusIter corpus_last, Pred p )
/// \brief Searches the corpus for the pattern that was passed into the constructor /// \brief Searches the corpus for the pattern that was passed into the constructor
/// ///
/// \param corpus_first The start of the data to search (Random Access Iterator) /// \param corpus_first The start of the data to search (Random Access Iterator)
/// \param corpus_last One past the end of the data to search /// \param corpus_last One past the end of the data to search
/// \param k_corpus_length The length of the corpus to search /// \param p A predicate used for the search comparisons.
/// ///
template <typename corpusIter> template <typename corpusIter>
std::pair<corpusIter, corpusIter> std::pair<corpusIter, corpusIter>
do_search ( corpusIter corpus_first, corpusIter corpus_last, do_search ( corpusIter corpus_first, corpusIter corpus_last,
difference_type k_corpus_length ) const { difference_type k_corpus_length ) const {
difference_type match_start = 0; // position in the corpus that we're matching difference_type match_start = 0; // position in the corpus that we're matching
@@ -85,22 +85,6 @@ namespace boost {
return detail::is_classifiedF(std::ctype_base::alpha, Loc); return detail::is_classifiedF(std::ctype_base::alpha, Loc);
} }
#ifndef BOOST_NO_CXX11
//! is_blank predicate
/*!
Construct the \c is_classified predicate for the \c ctype_base::blank category.
\param Loc A locale used for classification
\return An instance of the \c is_classified predicate
\since c++11
*/
inline detail::is_classifiedF
is_blank(const std::locale& Loc=std::locale())
{
return detail::is_classifiedF(std::ctype_base::blank, Loc);
}
#endif
//! is_cntrl predicate //! is_cntrl predicate
/*! /*!
Construct the \c is_classified predicate for the \c ctype_base::cntrl category. Construct the \c is_classified predicate for the \c ctype_base::cntrl category.
@@ -310,9 +294,6 @@ namespace boost {
// pull names to the boost namespace // pull names to the boost namespace
using algorithm::is_classified; using algorithm::is_classified;
using algorithm::is_space; using algorithm::is_space;
#ifndef BOOST_NO_CXX11
using algorithm::is_blank;
#endif
using algorithm::is_alnum; using algorithm::is_alnum;
using algorithm::is_alpha; using algorithm::is_alpha;
using algorithm::is_cntrl; using algorithm::is_cntrl;
+1 -1
View File
@@ -75,7 +75,7 @@ namespace boost {
Constructs an \c empty_formatter. Empty formatter always returns an empty Constructs an \c empty_formatter. Empty formatter always returns an empty
sequence. sequence.
\param - container used to select a correct value_type for the \param Input container used to select a correct value_type for the
resulting empty_container<>. resulting empty_container<>.
\return An instance of the \c empty_formatter object. \return An instance of the \c empty_formatter object.
*/ */
@@ -108,6 +108,7 @@ namespace boost {
\param Input An input sequence \param Input An input sequence
\param Loc A locale used for 'space' classification \param Loc A locale used for 'space' classification
\return A trimmed copy of the input
*/ */
template<typename SequenceT> template<typename SequenceT>
inline void trim_all(SequenceT& Input, const std::locale& Loc =std::locale()) inline void trim_all(SequenceT& Input, const std::locale& Loc =std::locale())
@@ -190,6 +191,7 @@ namespace boost {
\param Input An input sequence \param Input An input sequence
\param Fill A string used to fill the inner spaces \param Fill A string used to fill the inner spaces
\param Loc A locale used for 'space' classification \param Loc A locale used for 'space' classification
\return A trimmed copy of the input
*/ */
template<typename SequenceT, typename RangeT> template<typename SequenceT, typename RangeT>
inline void trim_fill(SequenceT& Input, const RangeT& Fill, const std::locale& Loc =std::locale()) inline void trim_fill(SequenceT& Input, const RangeT& Fill, const std::locale& Loc =std::locale())
-5
View File
@@ -7,11 +7,6 @@
# http://www.boost.org/LICENSE_1_0.txt) # http://www.boost.org/LICENSE_1_0.txt)
# #
project
: requirements
<library>/boost/algorithm//boost_algorithm
<library>/boost/timer//boost_timer ;
exe minmax_ex : minmax_ex.cpp ; exe minmax_ex : minmax_ex.cpp ;
exe minmax_timer : minmax_timer.cpp ; exe minmax_timer : minmax_timer.cpp ;
+19 -18
View File
@@ -15,10 +15,8 @@
// What's the proper BOOST_ flag for <iomanip.h> vs <ios> // What's the proper BOOST_ flag for <iomanip.h> vs <ios>
#include <iomanip> #include <iomanip>
#include <boost/timer.hpp>
#include <boost/algorithm/minmax.hpp> #include <boost/algorithm/minmax.hpp>
#include <boost/algorithm/minmax_element.hpp>
#include <boost/iterator/filter_iterator.hpp>
#include <boost/timer/timer.hpp>
template <class T1, class T2> template <class T1, class T2>
void tie(std::pair<T1, T2> p, T1& min, T2& max) void tie(std::pair<T1, T2> p, T1& min, T2& max)
@@ -58,19 +56,17 @@ inline int opt_boost_minmax_count(int n) {
int repeats = 10; int repeats = 10;
#define TIMER( n, cmd , cmdname ) \ #define TIMER( n, cmd , cmdname ) \
t.start(); \ t.restart(); \
for (int i=0; i<n*repeats; ++i) { cmd ; } \ for (int i=0; i<repeats; ++i) { cmd ; } \
t.stop(); \
std::cout << " " << std::setprecision(4) \ std::cout << " " << std::setprecision(4) \
<< 1e3 * (double)(n*repeats) / (double)t.elapsed().wall \ << (double)n*repeats/t.elapsed()/1.0E6 \
<< "M items/sec " << cmdname << "\n" << "M items/sec " << cmdname << "\n"
#define CTIMER( n, cmd , cmdname, count, opt ) \ #define CTIMER( n, cmd , cmdname, count, opt ) \
t.start(); lc.reset(); \ t.restart(); lc.reset(); \
for (int i=0; i<n*repeats; ++i) { cmd ; } \ for (int i=0; i<repeats; ++i) { cmd ; } \
t.stop(); \
std::cout << " " << std::setprecision(4) \ std::cout << " " << std::setprecision(4) \
<< 1e3 * (double)(n*repeats) / (double)t.elapsed().wall \ << (double)n*repeats/t.elapsed()/1.0E6 \
<< "M items/sec " << cmdname \ << "M items/sec " << cmdname \
<< " ("<< (count)/repeats << " vs " << opt << ")\n" << " ("<< (count)/repeats << " vs " << opt << ")\n"
@@ -78,7 +74,7 @@ template <class CIterator>
void test_minmax_element(CIterator first, CIterator last, int n, char* name) void test_minmax_element(CIterator first, CIterator last, int n, char* name)
{ {
typedef typename std::iterator_traits<CIterator>::value_type vtype; typedef typename std::iterator_traits<CIterator>::value_type vtype;
boost::timer::cpu_timer t; boost::timer t;
std::cout << " ON " << name << " WITH OPERATOR<()\n"; std::cout << " ON " << name << " WITH OPERATOR<()\n";
TIMER( n, std::min_element(first, last), TIMER( n, std::min_element(first, last),
@@ -103,11 +99,15 @@ void test_minmax_element(CIterator first, CIterator last, int n, char* name)
"boost::last_min_last_max_element" << name << " "); "boost::last_min_last_max_element" << name << " ");
#define pred std::bind2nd( std::greater<vtype>(), vtype(10) ) #define pred std::bind2nd( std::greater<vtype>(), vtype(10) )
TIMER( n, std::min_element(boost::make_filter_iterator(pred, first, last), TIMER( n, boost::min_element_if(first, last, pred),
boost::make_filter_iterator(pred, last, last)), "boost::min_element_if" << name << "");
TIMER( n, boost::max_element_if(first, last, pred),
"boost::max_element_if" << name << "");
TIMER( n, std::min_element(boost::make_filter_iterator(first, last, pred),
boost::make_filter_iterator(last, last, pred)),
"std::min_element_with_filter_iterator" << name << ""); "std::min_element_with_filter_iterator" << name << "");
TIMER( n, std::max_element(boost::make_filter_iterator(pred, first, last), TIMER( n, std::max_element(boost::make_filter_iterator(first, last, pred),
boost::make_filter_iterator(pred, last, last)), boost::make_filter_iterator(last, last, pred)),
"std::max_element_if_with_filter_iterator" << name << ""); "std::max_element_if_with_filter_iterator" << name << "");
#undef pred #undef pred
@@ -199,9 +199,10 @@ void test(int n)
test_range(first, last, n); test_range(first, last, n);
} }
int main(int argc, char** argv) int
main(char argc, char** argv)
{ {
int n = 1000; int n = 100;
if (argc > 1) n = atoi(argv[1]); if (argc > 1) n = atoi(argv[1]);
if (argc > 2) repeats = atoi(argv[2]); if (argc > 2) repeats = atoi(argv[2]);
+3 -5
View File
@@ -9,19 +9,17 @@
import testing ; import testing ;
project : requirements <library>/boost/algorithm//boost_algorithm ;
alias unit_test_framework alias unit_test_framework
: # sources : # sources
/boost/test//boost_unit_test_framework /boost//unit_test_framework
; ;
{ {
test-suite algorithm/minmax test-suite algorithm/minmax
: [ run minmax_element_test.cpp unit_test_framework : [ run minmax_element_test.cpp unit_test_framework
: : : : minmax_element ] : : : : minmax_element ]
[ run minmax_test.cpp unit_test_framework [ run minmax_test.cpp unit_test_framework
: : : : minmax ] : : : : minmax ]
; ;
} }
+28 -28
View File
@@ -10,40 +10,40 @@
import toolset ; import toolset ;
toolset.using doxygen ; toolset.using doxygen ;
boostbook string_algo : string_algo.xml autodoc boostbook string_algo : string_algo.xml autodoc
: :
<xsl:param>boost.root=../../../../.. <xsl:param>boost.root=../../../../..
<format>pdf:<xsl:param>boost.url.prefix=http://www.boost.org/doc/libs/release/doc/html <format>pdf:<xsl:param>boost.url.prefix=http://www.boost.org/doc/libs/release/doc/html
; ;
doxygen autodoc doxygen autodoc
: :
[ glob ../../include/boost/algorithm/string.hpp ] [ glob ../../../../boost/algorithm/string.hpp ]
[ glob ../../include/boost/algorithm/string_regex.hpp ] [ glob ../../../../boost/algorithm/string_regex.hpp ]
[ glob ../../include/boost/algorithm/string/classification.hpp ] [ glob ../../../../boost/algorithm/string/classification.hpp ]
[ glob ../../include/boost/algorithm/string/iterator_range.hpp ] [ glob ../../../../boost/algorithm/string/iterator_range.hpp ]
[ glob ../../include/boost/algorithm/string/sequence_traits.hpp ] [ glob ../../../../boost/algorithm/string/sequence_traits.hpp ]
[ glob ../../include/boost/algorithm/string/std_containers_traits.hpp ] [ glob ../../../../boost/algorithm/string/std_containers_traits.hpp ]
[ glob ../../include/boost/algorithm/string/concept.hpp ] [ glob ../../../../boost/algorithm/string/concept.hpp ]
[ glob ../../include/boost/algorithm/string/compare.hpp ] [ glob ../../../../boost/algorithm/string/compare.hpp ]
[ glob ../../include/boost/algorithm/string/constants.hpp ] [ glob ../../../../boost/algorithm/string/constants.hpp ]
[ glob ../../include/boost/algorithm/string/case_conv.hpp ] [ glob ../../../../boost/algorithm/string/case_conv.hpp ]
[ glob ../../include/boost/algorithm/string/find.hpp ] [ glob ../../../../boost/algorithm/string/find.hpp ]
[ glob ../../include/boost/algorithm/string/finder.hpp ] [ glob ../../../../boost/algorithm/string/finder.hpp ]
[ glob ../../include/boost/algorithm/string/find_iterator.hpp ] [ glob ../../../../boost/algorithm/string/find_iterator.hpp ]
[ glob ../../include/boost/algorithm/string/trim.hpp ] [ glob ../../../../boost/algorithm/string/trim.hpp ]
[ glob ../../include/boost/algorithm/string/predicate.hpp ] [ glob ../../../../boost/algorithm/string/predicate.hpp ]
[ glob ../../include/boost/algorithm/string/split.hpp ] [ glob ../../../../boost/algorithm/string/split.hpp ]
[ glob ../../include/boost/algorithm/string/iter_find.hpp ] [ glob ../../../../boost/algorithm/string/iter_find.hpp ]
[ glob ../../include/boost/algorithm/string/erase.hpp ] [ glob ../../../../boost/algorithm/string/erase.hpp ]
[ glob ../../include/boost/algorithm/string/join.hpp ] [ glob ../../../../boost/algorithm/string/join.hpp ]
[ glob ../../include/boost/algorithm/string/replace.hpp ] [ glob ../../../../boost/algorithm/string/replace.hpp ]
[ glob ../../include/boost/algorithm/string/find_format.hpp ] [ glob ../../../../boost/algorithm/string/find_format.hpp ]
[ glob ../../include/boost/algorithm/string/formatter.hpp ] [ glob ../../../../boost/algorithm/string/formatter.hpp ]
[ glob ../../include/boost/algorithm/string/regex.hpp ] [ glob ../../../../boost/algorithm/string/regex.hpp ]
[ glob ../../include/boost/algorithm/string/regex_find_format.hpp ] [ glob ../../../../boost/algorithm/string/regex_find_format.hpp ]
[ glob ../../include/boost/algorithm/string/trim_all.hpp ] [ glob ../../../../boost/algorithm/string/trim_all.hpp ]
: :
<doxygen:param>HIDE_UNDOC_MEMBERS=YES <doxygen:param>HIDE_UNDOC_MEMBERS=YES
<doxygen:param>EXTRACT_PRIVATE=NO <doxygen:param>EXTRACT_PRIVATE=NO
@@ -53,7 +53,7 @@ doxygen autodoc
<doxygen:param>SEARCH_INCLUDES=YES <doxygen:param>SEARCH_INCLUDES=YES
<doxygen:param>PREDEFINED="BOOST_STRING_TYPENAME=typename \"BOOST_STATIC_CONSTANT(type,var)=static const type var;\"" <doxygen:param>PREDEFINED="BOOST_STRING_TYPENAME=typename \"BOOST_STATIC_CONSTANT(type,var)=static const type var;\""
; ;
-7
View File
@@ -667,13 +667,6 @@
<functionname>is_space()</functionname> <functionname>is_space()</functionname>
</entry> </entry>
</row> </row>
<row>
<entry>is_blank</entry>
<entry>Recognize blanks</entry>
<entry>
<functionname>is_blank()</functionname>
</entry>
</row>
<row> <row>
<entry>is_alnum</entry> <entry>is_alnum</entry>
<entry>Recognize alphanumeric characters</entry> <entry>Recognize alphanumeric characters</entry>
-1
View File
@@ -7,7 +7,6 @@
# #
# See http://www.boost.org for updates, documentation, and revision history. # See http://www.boost.org for updates, documentation, and revision history.
project : requirements <library>/boost/algorithm//boost_algorithm ;
exe conv_example : conv_example.cpp ; exe conv_example : conv_example.cpp ;
exe predicate_example : predicate_example.cpp ; exe predicate_example : predicate_example.cpp ;
+11 -13
View File
@@ -9,33 +9,31 @@
import testing ; import testing ;
project : requirements <library>/boost/algorithm//boost_algorithm ;
alias unit_test_framework alias unit_test_framework
: # sources : # sources
/boost/test//boost_unit_test_framework /boost//unit_test_framework
; ;
test-suite algorithm/string test-suite algorithm/string
: [ run : [ run
trim_test.cpp unit_test_framework trim_test.cpp unit_test_framework
: : : :
: :
: trim : trim
] ]
[ run [ run
conv_test.cpp unit_test_framework conv_test.cpp unit_test_framework
: : : :
: :
: conv : conv
] ]
[ run [ run
predicate_test.cpp unit_test_framework predicate_test.cpp unit_test_framework
: : : :
: :
: predicate : predicate
] ]
[ run [ run
find_test.cpp unit_test_framework find_test.cpp unit_test_framework
: : : :
: :
@@ -53,23 +51,23 @@ test-suite algorithm/string
: :
: join : join
] ]
[ run [ run
replace_test.cpp unit_test_framework replace_test.cpp unit_test_framework
: : : :
: :
: replace : replace
] ]
[ run [ run
regex_test.cpp unit_test_framework regex_test.cpp unit_test_framework
../../../regex/build//boost_regex ../../../regex/build//boost_regex
: : : :
: :
: regex : regex
] ]
[ run [ run
find_format_test.cpp unit_test_framework find_format_test.cpp unit_test_framework
: : : :
: :
: find_format : find_format
] ]
; ;
+1 -6
View File
@@ -138,12 +138,7 @@ void classification_test()
TEST_CLASS( is_any_of( string("abc") ), "aaabbcc", "aaxb" ); TEST_CLASS( is_any_of( string("abc") ), "aaabbcc", "aaxb" );
TEST_CLASS( is_any_of( "abc" ), "aaabbcc", "aaxb" ); TEST_CLASS( is_any_of( "abc" ), "aaabbcc", "aaxb" );
TEST_CLASS( is_from_range( 'a', 'c' ), "aaabbcc", "aaxb" ); TEST_CLASS( is_from_range( 'a', 'c' ), "aaabbcc", "aaxb" );
#ifndef BOOST_NO_CXX11
TEST_CLASS( is_blank(), " \t", "\t \n\r" );
TEST_CLASS( !is_blank(), "abc\n\v\f\r", "a x\t" );
#endif
TEST_CLASS( !is_classified(std::ctype_base::space), "...", "..\n\r\t " ); TEST_CLASS( !is_classified(std::ctype_base::space), "...", "..\n\r\t " );
TEST_CLASS( ( !is_any_of("abc") && is_from_range('a','e') ) || is_space(), "d e", "abcde" ); TEST_CLASS( ( !is_any_of("abc") && is_from_range('a','e') ) || is_space(), "d e", "abcde" );
+2 -4
View File
@@ -9,11 +9,9 @@
import testing ; import testing ;
project : requirements <library>/boost/algorithm//boost_algorithm ;
alias unit_test_framework alias unit_test_framework
: # sources : # sources
/boost/test//boost_unit_test_framework /boost//unit_test_framework
; ;
@@ -87,7 +85,7 @@ alias unit_test_framework
# Is_partitioned_until tests # Is_partitioned_until tests
[ run is_partitioned_until_test.cpp unit_test_framework : : : : is_partitioned_until_test ] [ run is_partitioned_until_test.cpp unit_test_framework : : : : is_partitioned_until_test ]
# Apply_permutation tests # Apply_permutation tests
[ run apply_permutation_test.cpp unit_test_framework : : : : apply_permutation_test ] [ run apply_permutation_test.cpp unit_test_framework : : : : apply_permutation_test ]
# Find tests # Find tests