Compare commits

...

25 Commits

Author SHA1 Message Date
3b3bd8d3db Merge changes from develop for the 1.76.0 release 2021-04-07 09:28:02 -07:00
c9077bd495 Add CMakeLists.txt 2021-03-18 17:32:16 +02:00
bcd55d9992 Merge pull request #80 from gcerretani/patch-1
String Usage doc typo
2021-03-03 18:18:24 -08:00
b139b72230 Merge pull request #84 from eldiener/develop
[skip ci] Add "cxxstd" json field
2021-01-18 18:26:35 -08:00
137c92dac0 [skip ci] Add "cxxstd" json field. The "cxxstd" json field is being added to each Boost library's meta json information for libraries in order to specify the minumum C++ standard compilation level. The value of this field matches one of the values for 'cxxstd' in Boost.Build. The purpose of doing this is to provide information for the Boost website documentation for each library which will specify the minimum C++ standard compilation that an end-user must employ in order to use the particular library. This will aid end-users who want to know if they can successfully use a Boost library based on their C++ compiler's compilation level, without having to search the library's documentation to find this out. 2021-01-18 20:32:12 -05:00
bd81ca42a2 Merge pull request #82 from eldiener/develop
Remove erroneous inclusion of C++11 type_traits header file.
2020-11-18 09:56:38 -08:00
fc86cd34f7 Remove erroneous inclusion of C++11 type_traits header file. 2020-11-18 12:46:50 -05:00
ca77e55428 Bug fixes for 1/75/0 2020-11-17 15:45:39 -08:00
8c26a50a12 Fix incorrect include guards (copypasta). Thanks to Anton Vasin (tony-space) for the bug report and fix 2020-11-12 08:32:46 -08:00
c16b8ffadd Update usage.xml
Doc typo.
2020-10-23 15:27:49 +02:00
1e098f39d4 Merge pull request #77 from vgvassilev/patch-2
Add missing include
2020-07-18 06:47:16 -07:00
e4c3628f4d Merge pull request #75 from vgvassilev/patch-1
Add missing includes
2020-07-18 06:44:49 -07:00
49d284392c Add missing include
This patch allows the header to be built standalone, as part of clang C++ modules builds
2020-07-17 11:06:33 +03:00
68100d9198 Add missing includes
This patch allows the header to be built standalone, as part of clang C++ modules builds.
2020-07-17 08:16:46 +03:00
1634b819b3 Merge pull request #74 from vgvassilev/patch-1
Add missing include
2020-07-16 18:21:46 -07:00
4547b1a5fe Add missing include
This patch allows the header to be built standalone, as part of clang C++ modules builds.
2020-07-17 01:52:08 +03:00
7f527f3c4d Merge changes from develop for the 1.74.0 release 2020-06-24 09:47:23 -07:00
130e4da8cb Remove empty loop bodies to prevent clang 'extra-semi-stmt warnings'. Thanks to Eugene for the heads-up 2020-05-28 22:05:47 -07:00
7975c764bb Merge pull request #72 from Lastique/remove_iterator_hpp2
Remove a few leftover uses of boost/detail/iterator.hpp
2020-05-11 08:44:40 -07:00
8710bbd4b6 Remove a few leftover uses of boost/detail/iterator.hpp. 2020-05-11 18:42:15 +03:00
cfb7c429f7 Merge pull request #71 from Lastique/remove_iterator_hpp
Avoid using deprecated header boost/detail/iterator.hpp
2020-05-11 08:17:52 -07:00
ed4033f0cc Avoid using deprecated header boost/detail/iterator.hpp.
This header is deprecated in favor of <iterator> and will be removed in a
future release. This silences deprecation warnings.
2020-05-11 18:03:41 +03:00
6d86fb3aaa Change include of boost/bind.hpp -> boost/bind/bind.hpp. Thanks to Andrey for the suggested patch 2020-04-28 12:41:10 -07:00
ce81930319 Merge pull request #69 from eldiener/develop
Changes for Embarcadero C++ clang-based compilers, targeting Boost 1.74. Change __BORLANDC__ to BOOST_BORLANDC, which is defined in Boost conf…
2020-04-12 09:49:45 -07:00
8e23ffde9e Change __BORLANDC__ to BOOST_BORLANDC, which is defined in Boost config for the Embarcadero non-clang-based compilers. 2020-03-30 18:47:19 -04:00
18 changed files with 98 additions and 49 deletions

41
CMakeLists.txt Normal file
View File

@ -0,0 +1,41 @@
# Generated by `boostdep --cmake algorithm`
# Copyright 2020 Peter Dimov
# Distributed under the Boost Software License, Version 1.0.
# https://www.boost.org/LICENSE_1_0.txt
cmake_minimum_required(VERSION 3.5...3.16)
project(boost_algorithm VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
add_library(boost_algorithm INTERFACE)
add_library(Boost::algorithm ALIAS boost_algorithm)
target_include_directories(boost_algorithm INTERFACE include)
target_link_libraries(boost_algorithm
INTERFACE
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
)
if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")
add_subdirectory(test)
endif()

View File

@ -19,7 +19,6 @@
#define BOOST_ALGORITHM_APPLY_PERMUTATION_HPP #define BOOST_ALGORITHM_APPLY_PERMUTATION_HPP
#include <algorithm> #include <algorithm>
#include <type_traits>
#include <boost/config.hpp> #include <boost/config.hpp>
#include <boost/range/begin.hpp> #include <boost/range/begin.hpp>

View File

@ -9,8 +9,8 @@
/// \brief Combine the (transformed) elements of a sequence (or two) into a single value. /// \brief Combine the (transformed) elements of a sequence (or two) into a single value.
/// \author Marshall Clow /// \author Marshall Clow
#ifndef BOOST_ALGORITHM_TRANSFORM_REDUCE_HPP #ifndef BOOST_ALGORITHM_INCLUSIVE_SCAN_HPP
#define BOOST_ALGORITHM_TRANSFORM_REDUCE_HPP #define BOOST_ALGORITHM_INCLUSIVE_SCAN_HPP
#include <functional> // for std::plus #include <functional> // for std::plus
#include <iterator> // for std::iterator_traits #include <iterator> // for std::iterator_traits
@ -58,4 +58,4 @@ OutputIterator inclusive_scan(InputIterator first, InputIterator last,
}} // namespace boost and algorithm }} // namespace boost and algorithm
#endif // BOOST_ALGORITHM_TRANSFORM_REDUCE_HPP #endif // BOOST_ALGORITHM_INCLUSIVE_SCAN_HPP

View File

@ -22,9 +22,10 @@
#include <algorithm> // for std::stable_partition #include <algorithm> // for std::stable_partition
#include <functional> #include <functional>
#include <utility> // for std::make_pair
#include <boost/config.hpp> #include <boost/config.hpp>
#include <boost/bind.hpp> // for boost::bind #include <boost/bind/bind.hpp> // for boost::bind
#include <boost/range/begin.hpp> // for boost::begin(range) #include <boost/range/begin.hpp> // for boost::begin(range)
#include <boost/range/end.hpp> // for boost::end(range) #include <boost/range/end.hpp> // for boost::end(range)
@ -81,13 +82,14 @@ namespace boost { namespace algorithm {
*/ */
template < template <
typename BidirectionalIterator, // Iter models BidirectionalIterator typename BidirectionalIterator, // models BidirectionalIterator
typename Pred> // 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,
// while the second call partitions the rest of the sequence. // while the second call partitions the rest of the sequence.
using namespace boost::placeholders;
return std::make_pair ( return std::make_pair (
std::stable_partition ( first, pivot, !boost::bind<bool> ( pred, _1 )), std::stable_partition ( first, pivot, !boost::bind<bool> ( pred, _1 )),
std::stable_partition ( pivot, last, boost::bind<bool> ( pred, _1 ))); std::stable_partition ( pivot, last, boost::bind<bool> ( pred, _1 )));

View File

@ -65,7 +65,7 @@ namespace boost {
template< typename T1, typename T2 > template< typename T1, typename T2 >
bool operator()( const T1& Arg1, const T2& Arg2 ) const bool operator()( const T1& Arg1, const T2& Arg2 ) const
{ {
#if defined(__BORLANDC__) && (__BORLANDC__ >= 0x560) && (__BORLANDC__ <= 0x564) && !defined(_USE_OLD_RW_STL) #if defined(BOOST_BORLANDC) && (BOOST_BORLANDC >= 0x560) && (BOOST_BORLANDC <= 0x564) && !defined(_USE_OLD_RW_STL)
return std::toupper(Arg1)==std::toupper(Arg2); return std::toupper(Arg1)==std::toupper(Arg2);
#else #else
return std::toupper<T1>(Arg1,m_Loc)==std::toupper<T2>(Arg2,m_Loc); return std::toupper<T1>(Arg1,m_Loc)==std::toupper<T2>(Arg2,m_Loc);
@ -118,7 +118,7 @@ namespace boost {
template< typename T1, typename T2 > template< typename T1, typename T2 >
bool operator()( const T1& Arg1, const T2& Arg2 ) const bool operator()( const T1& Arg1, const T2& Arg2 ) const
{ {
#if defined(__BORLANDC__) && (__BORLANDC__ >= 0x560) && (__BORLANDC__ <= 0x564) && !defined(_USE_OLD_RW_STL) #if defined(BOOST_BORLANDC) && (BOOST_BORLANDC >= 0x560) && (BOOST_BORLANDC <= 0x564) && !defined(_USE_OLD_RW_STL)
return std::toupper(Arg1)<std::toupper(Arg2); return std::toupper(Arg1)<std::toupper(Arg2);
#else #else
return std::toupper<T1>(Arg1,m_Loc)<std::toupper<T2>(Arg2,m_Loc); return std::toupper<T1>(Arg1,m_Loc)<std::toupper<T2>(Arg2,m_Loc);
@ -171,7 +171,7 @@ namespace boost {
template< typename T1, typename T2 > template< typename T1, typename T2 >
bool operator()( const T1& Arg1, const T2& Arg2 ) const bool operator()( const T1& Arg1, const T2& Arg2 ) const
{ {
#if defined(__BORLANDC__) && (__BORLANDC__ >= 0x560) && (__BORLANDC__ <= 0x564) && !defined(_USE_OLD_RW_STL) #if defined(BOOST_BORLANDC) && (BOOST_BORLANDC >= 0x560) && (BOOST_BORLANDC <= 0x564) && !defined(_USE_OLD_RW_STL)
return std::toupper(Arg1)<=std::toupper(Arg2); return std::toupper(Arg1)<=std::toupper(Arg2);
#else #else
return std::toupper<T1>(Arg1,m_Loc)<=std::toupper<T2>(Arg2,m_Loc); return std::toupper<T1>(Arg1,m_Loc)<=std::toupper<T2>(Arg2,m_Loc);

View File

@ -15,6 +15,9 @@
#include <locale> #include <locale>
#include <functional> #include <functional>
#include <boost/iterator/transform_iterator.hpp>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/type_traits/make_unsigned.hpp> #include <boost/type_traits/make_unsigned.hpp>
namespace boost { namespace boost {
@ -40,7 +43,7 @@ namespace boost {
// Operation // Operation
CharT operator ()( CharT Ch ) const CharT operator ()( CharT Ch ) const
{ {
#if defined(__BORLANDC__) && (__BORLANDC__ >= 0x560) && (__BORLANDC__ <= 0x564) && !defined(_USE_OLD_RW_STL) #if defined(BOOST_BORLANDC) && (BOOST_BORLANDC >= 0x560) && (BOOST_BORLANDC <= 0x564) && !defined(_USE_OLD_RW_STL)
return std::tolower( static_cast<typename boost::make_unsigned <CharT>::type> ( Ch )); return std::tolower( static_cast<typename boost::make_unsigned <CharT>::type> ( Ch ));
#else #else
return std::tolower<CharT>( Ch, *m_Loc ); return std::tolower<CharT>( Ch, *m_Loc );
@ -62,7 +65,7 @@ namespace boost {
// Operation // Operation
CharT operator ()( CharT Ch ) const CharT operator ()( CharT Ch ) const
{ {
#if defined(__BORLANDC__) && (__BORLANDC__ >= 0x560) && (__BORLANDC__ <= 0x564) && !defined(_USE_OLD_RW_STL) #if defined(BOOST_BORLANDC) && (BOOST_BORLANDC >= 0x560) && (BOOST_BORLANDC <= 0x564) && !defined(_USE_OLD_RW_STL)
return std::toupper( static_cast<typename boost::make_unsigned <CharT>::type> ( Ch )); return std::toupper( static_cast<typename boost::make_unsigned <CharT>::type> ( Ch ));
#else #else
return std::toupper<CharT>( Ch, *m_Loc ); return std::toupper<CharT>( Ch, *m_Loc );

View File

@ -13,10 +13,12 @@
#include <boost/algorithm/string/config.hpp> #include <boost/algorithm/string/config.hpp>
#include <algorithm> #include <algorithm>
#include <cstring>
#include <functional> #include <functional>
#include <locale> #include <locale>
#include <boost/range/begin.hpp> #include <boost/range/begin.hpp>
#include <boost/range/distance.hpp>
#include <boost/range/end.hpp> #include <boost/range/end.hpp>
#include <boost/algorithm/string/predicate_facade.hpp> #include <boost/algorithm/string/predicate_facade.hpp>
@ -45,7 +47,7 @@ namespace boost {
return std::use_facet< std::ctype<CharT> >(m_Locale).is( m_Type, Ch ); return std::use_facet< std::ctype<CharT> >(m_Locale).is( m_Type, Ch );
} }
#if defined(__BORLANDC__) && (__BORLANDC__ >= 0x560) && (__BORLANDC__ <= 0x582) && !defined(_USE_OLD_RW_STL) #if defined(BOOST_BORLANDC) && (BOOST_BORLANDC >= 0x560) && (BOOST_BORLANDC <= 0x582) && !defined(_USE_OLD_RW_STL)
template<> template<>
bool operator()( char const Ch ) const bool operator()( char const Ch ) const
{ {

View File

@ -18,6 +18,8 @@
#include <boost/algorithm/string/detail/find_format_store.hpp> #include <boost/algorithm/string/detail/find_format_store.hpp>
#include <boost/algorithm/string/detail/replace_storage.hpp> #include <boost/algorithm/string/detail/replace_storage.hpp>
#include <deque>
namespace boost { namespace boost {
namespace algorithm { namespace algorithm {
namespace detail { namespace detail {

View File

@ -13,7 +13,7 @@
#include <boost/algorithm/string/config.hpp> #include <boost/algorithm/string/config.hpp>
#include <boost/algorithm/string/constants.hpp> #include <boost/algorithm/string/constants.hpp>
#include <boost/detail/iterator.hpp> #include <iterator>
#include <boost/range/iterator_range_core.hpp> #include <boost/range/iterator_range_core.hpp>
#include <boost/range/begin.hpp> #include <boost/range/begin.hpp>
@ -127,8 +127,8 @@ namespace boost {
if( boost::empty(m_Search) ) if( boost::empty(m_Search) )
return result_type( End, End ); return result_type( End, End );
typedef BOOST_STRING_TYPENAME boost::detail:: typedef BOOST_STRING_TYPENAME
iterator_traits<ForwardIteratorT>::iterator_category category; std::iterator_traits<ForwardIteratorT>::iterator_category category;
return findit( Begin, End, category() ); return findit( Begin, End, category() );
} }
@ -344,9 +344,8 @@ namespace boost {
typedef iterator_range<ForwardIteratorT> result_type; typedef iterator_range<ForwardIteratorT> result_type;
input_iterator_type It=Begin; input_iterator_type It=Begin;
for( for( unsigned int Index=0; Index<N && It!=End; ++Index,++It )
unsigned int Index=0; ;
Index<N && It!=End; ++Index,++It ) {};
return result_type( Begin, It ); return result_type( Begin, It );
} }
@ -375,8 +374,8 @@ namespace boost {
ForwardIteratorT End, ForwardIteratorT End,
unsigned int N ) unsigned int N )
{ {
typedef BOOST_STRING_TYPENAME boost::detail:: typedef BOOST_STRING_TYPENAME
iterator_traits<ForwardIteratorT>::iterator_category category; std::iterator_traits<ForwardIteratorT>::iterator_category category;
return ::boost::algorithm::detail::find_head_impl( Begin, End, N, category() ); return ::boost::algorithm::detail::find_head_impl( Begin, End, N, category() );
} }
@ -397,10 +396,12 @@ namespace boost {
input_iterator_type It2=Begin; input_iterator_type It2=Begin;
// Advance It2 by N increments // Advance It2 by N increments
for( Index=0; Index<N && It2!=End; ++Index,++It2 ) {}; for( Index=0; Index<N && It2!=End; ++Index,++It2 )
;
// Advance It, It2 to the end // Advance It, It2 to the end
for(; It2!=End; ++It,++It2 ) {}; for(; It2!=End; ++It,++It2 )
;
return result_type( It, It2 ); return result_type( It, It2 );
} }
@ -417,9 +418,8 @@ namespace boost {
typedef iterator_range<ForwardIteratorT> result_type; typedef iterator_range<ForwardIteratorT> result_type;
input_iterator_type It=End; input_iterator_type It=End;
for( for( unsigned int Index=0; Index<N && It!=Begin; ++Index,--It )
unsigned int Index=0; ;
Index<N && It!=Begin; ++Index,--It ) {};
return result_type( It, End ); return result_type( It, End );
} }
@ -448,8 +448,8 @@ namespace boost {
ForwardIteratorT End, ForwardIteratorT End,
unsigned int N ) unsigned int N )
{ {
typedef BOOST_STRING_TYPENAME boost::detail:: typedef BOOST_STRING_TYPENAME
iterator_traits<ForwardIteratorT>::iterator_category category; std::iterator_traits<ForwardIteratorT>::iterator_category category;
return ::boost::algorithm::detail::find_tail_impl( Begin, End, N, category() ); return ::boost::algorithm::detail::find_tail_impl( Begin, End, N, category() );
} }

View File

@ -42,7 +42,7 @@ namespace boost {
m_Format(::boost::begin(Format), ::boost::end(Format)) {} m_Format(::boost::begin(Format), ::boost::end(Format)) {}
// Operation // Operation
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) #if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
template<typename Range2T> template<typename Range2T>
result_type& operator()(const Range2T&) result_type& operator()(const Range2T&)
{ {

View File

@ -12,7 +12,7 @@
#define BOOST_STRING_TRIM_DETAIL_HPP #define BOOST_STRING_TRIM_DETAIL_HPP
#include <boost/algorithm/string/config.hpp> #include <boost/algorithm/string/config.hpp>
#include <boost/detail/iterator.hpp> #include <iterator>
namespace boost { namespace boost {
namespace algorithm { namespace algorithm {
@ -80,8 +80,8 @@ namespace boost {
ForwardIteratorT InEnd, ForwardIteratorT InEnd,
PredicateT IsSpace ) PredicateT IsSpace )
{ {
typedef BOOST_STRING_TYPENAME boost::detail:: typedef BOOST_STRING_TYPENAME
iterator_traits<ForwardIteratorT>::iterator_category category; std::iterator_traits<ForwardIteratorT>::iterator_category category;
return ::boost::algorithm::detail::trim_end_iter_select( InBegin, InEnd, IsSpace, category() ); return ::boost::algorithm::detail::trim_end_iter_select( InBegin, InEnd, IsSpace, category() );
} }

View File

@ -12,7 +12,6 @@
#define BOOST_STRING_FIND_FORMAT_HPP #define BOOST_STRING_FIND_FORMAT_HPP
#include <deque> #include <deque>
#include <boost/detail/iterator.hpp>
#include <boost/range/iterator_range_core.hpp> #include <boost/range/iterator_range_core.hpp>
#include <boost/range/begin.hpp> #include <boost/range/begin.hpp>
#include <boost/range/end.hpp> #include <boost/range/end.hpp>
@ -40,7 +39,7 @@ namespace boost {
this substring and replace it in the input. this substring and replace it in the input.
The result is a modified copy of the input. It is returned as a sequence The result is a modified copy of the input. It is returned as a sequence
or copied to the output iterator. or copied to the output iterator.
\param Output An output iterator to which the result will be copied \param Output An output iterator to which the result will be copied
\param Input An input sequence \param Input An input sequence
\param Finder A Finder object used to search for a match to be replaced \param Finder A Finder object used to search for a match to be replaced

View File

@ -11,7 +11,6 @@
#ifndef BOOST_STRING_FORMATTER_HPP #ifndef BOOST_STRING_FORMATTER_HPP
#define BOOST_STRING_FORMATTER_HPP #define BOOST_STRING_FORMATTER_HPP
#include <boost/detail/iterator.hpp>
#include <boost/range/value_type.hpp> #include <boost/range/value_type.hpp>
#include <boost/range/iterator_range_core.hpp> #include <boost/range/iterator_range_core.hpp>
#include <boost/range/as_literal.hpp> #include <boost/range/as_literal.hpp>

View File

@ -11,6 +11,7 @@
#ifndef BOOST_STRING_PREDICATE_HPP #ifndef BOOST_STRING_PREDICATE_HPP
#define BOOST_STRING_PREDICATE_HPP #define BOOST_STRING_PREDICATE_HPP
#include <iterator>
#include <boost/algorithm/string/config.hpp> #include <boost/algorithm/string/config.hpp>
#include <boost/range/begin.hpp> #include <boost/range/begin.hpp>
#include <boost/range/end.hpp> #include <boost/range/end.hpp>
@ -144,10 +145,10 @@ namespace boost {
iterator_range<BOOST_STRING_TYPENAME range_const_iterator<Range1T>::type> lit_input(::boost::as_literal(Input)); iterator_range<BOOST_STRING_TYPENAME range_const_iterator<Range1T>::type> lit_input(::boost::as_literal(Input));
iterator_range<BOOST_STRING_TYPENAME range_const_iterator<Range2T>::type> lit_test(::boost::as_literal(Test)); iterator_range<BOOST_STRING_TYPENAME range_const_iterator<Range2T>::type> lit_test(::boost::as_literal(Test));
typedef BOOST_STRING_TYPENAME typedef BOOST_STRING_TYPENAME
range_const_iterator<Range1T>::type Iterator1T; range_const_iterator<Range1T>::type Iterator1T;
typedef BOOST_STRING_TYPENAME boost::detail:: typedef BOOST_STRING_TYPENAME
iterator_traits<Iterator1T>::iterator_category category; std::iterator_traits<Iterator1T>::iterator_category category;
return detail:: return detail::
ends_with_iter_select( ends_with_iter_select(

View File

@ -11,7 +11,8 @@
], ],
"maintainers": [ "maintainers": [
"Marshall Clow <marshall -at- idio.com>" "Marshall Clow <marshall -at- idio.com>"
] ],
"cxxstd": "03"
}, },
{ {
"key": "algorithm/minmax", "key": "algorithm/minmax",
@ -26,7 +27,8 @@
], ],
"maintainers": [ "maintainers": [
"Marshall Clow <marshall -at- idio.com>" "Marshall Clow <marshall -at- idio.com>"
] ],
"cxxstd": "03"
}, },
{ {
"key": "algorithm/string", "key": "algorithm/string",
@ -42,6 +44,7 @@
], ],
"maintainers": [ "maintainers": [
"Marshall Clow <marshall -at- idio.com>" "Marshall Clow <marshall -at- idio.com>"
] ],
"cxxstd": "03"
} }
] ]

View File

@ -265,7 +265,7 @@
<title>Find Iterator</title> <title>Find Iterator</title>
<para> <para>
An extension to find algorithms it the Find Iterator. Instead of searching for just a one part of a string, An extension to find algorithms is the Find Iterator. Instead of searching for just a one part of a string,
the find iterator allows us to iterate over the substrings matching the specified criteria. the find iterator allows us to iterate over the substrings matching the specified criteria.
This facility is using the <link linkend="string_algo.finder_concept">Finder</link> to incrementally This facility is using the <link linkend="string_algo.finder_concept">Finder</link> to incrementally
search the string. search the string.

View File

@ -12,8 +12,6 @@
#include <functional> #include <functional>
#include <boost/algorithm/string/predicate.hpp> #include <boost/algorithm/string/predicate.hpp>
#include <boost/algorithm/string/classification.hpp> #include <boost/algorithm/string/classification.hpp>
#include <boost/bind.hpp>
using namespace std; using namespace std;
using namespace boost; using namespace boost;

View File

@ -16,7 +16,7 @@
#include <string> #include <string>
#include <iostream> #include <iostream>
#include <limits> #include <limits>
#include <boost/detail/iterator.hpp> #include <iterator>
#include <boost/algorithm/string/find_format.hpp> #include <boost/algorithm/string/find_format.hpp>
#include <boost/algorithm/string/finder.hpp> #include <boost/algorithm/string/finder.hpp>
@ -46,7 +46,7 @@ struct find_compressF
ForwardIteratorT End ) const ForwardIteratorT End ) const
{ {
typedef ForwardIteratorT input_iterator_type; typedef ForwardIteratorT input_iterator_type;
typedef typename boost::detail::iterator_traits<input_iterator_type>::value_type value_type; typedef typename std::iterator_traits<input_iterator_type>::value_type value_type;
typedef iterator_range<input_iterator_type> result_type; typedef iterator_range<input_iterator_type> result_type;
// begin of the matching segment // begin of the matching segment
@ -144,7 +144,7 @@ struct find_decompressF
ForwardIteratorT End ) const ForwardIteratorT End ) const
{ {
typedef ForwardIteratorT input_iterator_type; typedef ForwardIteratorT input_iterator_type;
typedef typename boost::detail::iterator_traits<input_iterator_type>::value_type value_type; typedef typename std::iterator_traits<input_iterator_type>::value_type value_type;
typedef iterator_range<input_iterator_type> result_type; typedef iterator_range<input_iterator_type> result_type;
for(input_iterator_type It=Begin; It!=End; It++) for(input_iterator_type It=Begin; It!=End; It++)
@ -153,12 +153,12 @@ struct find_decompressF
{ {
// Repeat mark found, extract body // Repeat mark found, extract body
input_iterator_type It2=It++; input_iterator_type It2=It++;
if ( It==End ) break; if ( It==End ) break;
It++; It++;
if ( It==End ) break; if ( It==End ) break;
It++; It++;
return result_type( It2, It ); return result_type( It2, It );
} }
} }