From b4ed9beb90e759bbdbf5ed4426fd7c8da5bc4af5 Mon Sep 17 00:00:00 2001 From: nobody Date: Tue, 21 Mar 2006 02:26:31 +0000 Subject: [PATCH 01/20] This commit was manufactured by cvs2svn to create branch 'RC_1_34_0'. [SVN r33417] From d9bc7e800bb761e20968023e773d5e9b97d5ac21 Mon Sep 17 00:00:00 2001 From: Pavol Droba Date: Mon, 17 Apr 2006 17:16:11 +0000 Subject: [PATCH 02/20] Merged patch from main trunk for borland by Nicola Musatti [SVN r33723] --- include/boost/algorithm/string/compare.hpp | 6 +++--- include/boost/algorithm/string/detail/case_conv.hpp | 4 ++-- include/boost/algorithm/string/detail/classification.hpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/boost/algorithm/string/compare.hpp b/include/boost/algorithm/string/compare.hpp index bb15c80..c2a0bba 100644 --- a/include/boost/algorithm/string/compare.hpp +++ b/include/boost/algorithm/string/compare.hpp @@ -67,7 +67,7 @@ namespace boost { #if defined(__BORLANDC__) && (__BORLANDC__ >= 0x560) && (__BORLANDC__ <= 0x564) && !defined(_USE_OLD_RW_STL) return std::toupper(Arg1)==std::toupper(Arg2); #else - return std::toupper(Arg1,m_Loc)==std::toupper(Arg2,m_Loc); + return std::toupper(Arg1,m_Loc)==std::toupper(Arg2,m_Loc); #endif } @@ -120,7 +120,7 @@ namespace boost { #if defined(__BORLANDC__) && (__BORLANDC__ >= 0x560) && (__BORLANDC__ <= 0x564) && !defined(_USE_OLD_RW_STL) return std::toupper(Arg1)(Arg1,m_Loc)(Arg2,m_Loc); #endif } @@ -173,7 +173,7 @@ namespace boost { #if defined(__BORLANDC__) && (__BORLANDC__ >= 0x560) && (__BORLANDC__ <= 0x564) && !defined(_USE_OLD_RW_STL) return std::toupper(Arg1)<=std::toupper(Arg2); #else - return std::toupper(Arg1,m_Loc)<=std::toupper(Arg2,m_Loc); + return std::toupper(Arg1,m_Loc)<=std::toupper(Arg2,m_Loc); #endif } diff --git a/include/boost/algorithm/string/detail/case_conv.hpp b/include/boost/algorithm/string/detail/case_conv.hpp index 95f9d85..ffc4514 100644 --- a/include/boost/algorithm/string/detail/case_conv.hpp +++ b/include/boost/algorithm/string/detail/case_conv.hpp @@ -33,7 +33,7 @@ namespace boost { #if defined(__BORLANDC__) && (__BORLANDC__ >= 0x560) && (__BORLANDC__ <= 0x564) && !defined(_USE_OLD_RW_STL) return std::tolower( Ch); #else - return std::tolower( Ch, m_Loc ); + return std::tolower( Ch, m_Loc ); #endif } private: @@ -53,7 +53,7 @@ namespace boost { #if defined(__BORLANDC__) && (__BORLANDC__ >= 0x560) && (__BORLANDC__ <= 0x564) && !defined(_USE_OLD_RW_STL) return std::toupper( Ch); #else - return std::toupper( Ch, m_Loc ); + return std::toupper( Ch, m_Loc ); #endif } private: diff --git a/include/boost/algorithm/string/detail/classification.hpp b/include/boost/algorithm/string/detail/classification.hpp index 3e305c3..c950bfa 100644 --- a/include/boost/algorithm/string/detail/classification.hpp +++ b/include/boost/algorithm/string/detail/classification.hpp @@ -46,7 +46,7 @@ namespace boost { return std::use_facet< std::ctype >(m_Locale).is( m_Type, Ch ); } - #if defined(__BORLANDC__) && (__BORLANDC__ >= 0x560) && (__BORLANDC__ <= 0x564) && !defined(_USE_OLD_RW_STL) + #if defined(__BORLANDC__) && (__BORLANDC__ >= 0x560) && (__BORLANDC__ <= 0x582) && !defined(_USE_OLD_RW_STL) template<> bool operator()( char const Ch ) const { From 8af639b7cfa9caba8d9e0cfc553ac220911bb756 Mon Sep 17 00:00:00 2001 From: Pavol Droba Date: Tue, 30 May 2006 19:13:08 +0000 Subject: [PATCH 03/20] missing 'using' directives for join_if and join_if_regex added missing #include added to string_algo.hpp [SVN r34122] --- include/boost/algorithm/string.hpp | 1 + include/boost/algorithm/string/regex.hpp | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/include/boost/algorithm/string.hpp b/include/boost/algorithm/string.hpp index 9a5f624..1a664f1 100644 --- a/include/boost/algorithm/string.hpp +++ b/include/boost/algorithm/string.hpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include diff --git a/include/boost/algorithm/string/regex.hpp b/include/boost/algorithm/string/regex.hpp index d882843..630d117 100644 --- a/include/boost/algorithm/string/regex.hpp +++ b/include/boost/algorithm/string/regex.hpp @@ -584,7 +584,7 @@ namespace boost { // Construct container to hold the result ResultT Result; - + // Roll to the first element that will be added while( @@ -630,6 +630,14 @@ namespace boost { using algorithm::find_all_regex; using algorithm::split_regex; +#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING + using algorithm::join_if; +#else // BOOST_NO_FUNCTION_TEMPLATE_ORDERING + using algorithm::join_if_regex; +#endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING + + + } // namespace boost From 6f3e85528f7f172b2c50e9dea06d4c07d3278210 Mon Sep 17 00:00:00 2001 From: Pavol Droba Date: Wed, 16 Aug 2006 07:10:48 +0000 Subject: [PATCH 04/20] License added to the xml documentation files [SVN r34894] --- string/doc/concept.xml | 7 +++++++ string/doc/credits.xml | 7 +++++++ string/doc/design.xml | 6 ++++++ string/doc/environment.xml | 7 +++++++ string/doc/intro.xml | 6 ++++++ string/doc/quickref.xml | 6 ++++++ string/doc/rationale.xml | 7 +++++++ string/doc/release_notes.xml | 6 ++++++ string/doc/string_algo.xml | 6 ++++++ string/doc/usage.xml | 6 ++++++ 10 files changed, 64 insertions(+) diff --git a/string/doc/concept.xml b/string/doc/concept.xml index b615ead..4829839 100644 --- a/string/doc/concept.xml +++ b/string/doc/concept.xml @@ -1,6 +1,13 @@ + + + +
Concepts diff --git a/string/doc/credits.xml b/string/doc/credits.xml index ecc11e6..d397660 100644 --- a/string/doc/credits.xml +++ b/string/doc/credits.xml @@ -1,6 +1,13 @@ + + + +
Credits
diff --git a/string/doc/design.xml b/string/doc/design.xml index 2affb7a..30db18c 100644 --- a/string/doc/design.xml +++ b/string/doc/design.xml @@ -1,6 +1,12 @@ + + +
Design Topics diff --git a/string/doc/environment.xml b/string/doc/environment.xml index aec08e4..5b3c1e7 100644 --- a/string/doc/environment.xml +++ b/string/doc/environment.xml @@ -1,6 +1,13 @@ + + + +
Environment
diff --git a/string/doc/intro.xml b/string/doc/intro.xml index f59cd2f..e90d759 100644 --- a/string/doc/intro.xml +++ b/string/doc/intro.xml @@ -1,6 +1,12 @@ + + +
Introduction diff --git a/string/doc/quickref.xml b/string/doc/quickref.xml index a6541be..0972893 100644 --- a/string/doc/quickref.xml +++ b/string/doc/quickref.xml @@ -1,6 +1,12 @@ + + +
Quick Reference diff --git a/string/doc/rationale.xml b/string/doc/rationale.xml index efbd502..54524a7 100644 --- a/string/doc/rationale.xml +++ b/string/doc/rationale.xml @@ -1,6 +1,13 @@ + + + +
Rationale diff --git a/string/doc/release_notes.xml b/string/doc/release_notes.xml index e9007c8..b60b74b 100644 --- a/string/doc/release_notes.xml +++ b/string/doc/release_notes.xml @@ -1,6 +1,12 @@ + + +
Release Notes diff --git a/string/doc/string_algo.xml b/string/doc/string_algo.xml index c31999a..ae472b0 100644 --- a/string/doc/string_algo.xml +++ b/string/doc/string_algo.xml @@ -1,6 +1,12 @@ + + + diff --git a/string/doc/usage.xml b/string/doc/usage.xml index 6c7261d..42cb4df 100644 --- a/string/doc/usage.xml +++ b/string/doc/usage.xml @@ -1,6 +1,12 @@ + + +
Usage From 7c0101aa51b68dfe00f643523a9770365f3941b5 Mon Sep 17 00:00:00 2001 From: Pavol Droba Date: Sun, 20 Aug 2006 20:14:48 +0000 Subject: [PATCH 05/20] Copyright added to index.html unneeded file removed [SVN r34908] --- string/doc/external_concepts.html | 38 ------------------------------- string/index.html | 6 +++++ 2 files changed, 6 insertions(+), 38 deletions(-) delete mode 100644 string/doc/external_concepts.html diff --git a/string/doc/external_concepts.html b/string/doc/external_concepts.html deleted file mode 100644 index 7a4a502..0000000 --- a/string/doc/external_concepts.html +++ /dev/null @@ -1,38 +0,0 @@ - Concepts and External Concepts

Concepts and External Concepts

Generic programming in C++ is characterized by the use of function and class templates where - the template parameter(s) must satisfy certain requirements.Often these - requirements are so important that we give them a name: we call - such a set of type requirements a concept. We say that a type - conforms to a concept or that it is a model of a concept if it - satisfies all of those requirements. The concept can be specified as a set - of member functions with well-defined semantics - and a set of nested typedefs with well-defined properties.

Often it much more flexible to provide free-standing functions and typedefs - which provides the exact same semantics (but a different syntax) as - specified - by the concept. This allows generic code to treat different types as if - they fulfilled the concept. In this case we say that the concept has - been externalized or that the new requirements constitutes an external - concept . We say that a type conforms to an external concept - or that it is a model of an external concept . A concept may exist - without a corresponding external concept and conversely.

Whenever a concept specifies a member function, the corresponding external - concept - must specify a free-standing function of the same name, same return type and - the same argument list except there is an extra first argument which must - be of the type (or a reference to that type) that is to fulfill the external - concept. If the corresonding member function has any cv-qulifiers, the - first argument must have the same cv-qualifiers. Whenever a concept - specifies a nested typedef, the corresponding external concept - specifies a type-generator, that is, a type with a nested typedef - named type. The type-generator has the name as the nested typedef with - _of appended. - The converse relationship of an external concept and its corresponding concept - also holds.

Example:

A type T fulfills the FooConcept if it - has the follwing public members:

void T::foo( int ) const;
- int T::bar();
- typedef implementation defined foo_type;

The corresponding external concept is the ExternalFooConcept.

A type T fullfills the ExternalFooConcept if these - free-standing functions and type-generators exists:

void foo( const T&, int );
- int bar( T& );
- foo_type_of< T >::type;



Literature


© Thorsten Ottosen 2003-2004 (nesotto_AT_cs.auc.dk). - Permission to copy, use, modify, sell and distribute this software is granted provided this copyright notice appears - in all copies. This software is provided "as is" without express or implied warranty, and with no - claim as to its suitability for any purpose.































- \ No newline at end of file diff --git a/string/index.html b/string/index.html index 717d7cf..a98cbc3 100644 --- a/string/index.html +++ b/string/index.html @@ -1,3 +1,9 @@ + + + From d8683f24983621322e30c71191ea5d5a8c2d5637 Mon Sep 17 00:00:00 2001 From: Pavol Droba Date: Fri, 27 Oct 2006 17:37:37 +0000 Subject: [PATCH 06/20] unused parameters removed [SVN r35753] --- .../boost/algorithm/string/detail/find_format.hpp | 15 --------------- include/boost/algorithm/string/find_format.hpp | 3 --- 2 files changed, 18 deletions(-) diff --git a/include/boost/algorithm/string/detail/find_format.hpp b/include/boost/algorithm/string/detail/find_format.hpp index 9382f0e..2ba7ba2 100644 --- a/include/boost/algorithm/string/detail/find_format.hpp +++ b/include/boost/algorithm/string/detail/find_format.hpp @@ -26,20 +26,17 @@ namespace boost { template< typename OutputIteratorT, typename InputT, - typename FinderT, typename FormatterT, typename FindResultT > inline OutputIteratorT find_format_copy_impl( OutputIteratorT Output, const InputT& Input, - FinderT Finder, FormatterT Formatter, const FindResultT& FindResult ) { return find_format_copy_impl2( Output, Input, - Finder, Formatter, FindResult, Formatter(FindResult) ); @@ -48,14 +45,12 @@ namespace boost { template< typename OutputIteratorT, typename InputT, - typename FinderT, typename FormatterT, typename FindResultT, typename FormatResultT > inline OutputIteratorT find_format_copy_impl2( OutputIteratorT Output, const InputT& Input, - FinderT Finder, FormatterT Formatter, const FindResultT& FindResult, const FormatResultT& FormatResult ) @@ -91,18 +86,15 @@ namespace boost { template< typename InputT, - typename FinderT, typename FormatterT, typename FindResultT > inline InputT find_format_copy_impl( const InputT& Input, - FinderT Finder, FormatterT Formatter, const FindResultT& FindResult) { return find_format_copy_impl2( Input, - Finder, Formatter, FindResult, Formatter(FindResult) ); @@ -110,13 +102,11 @@ namespace boost { template< typename InputT, - typename FinderT, typename FormatterT, typename FindResultT, typename FormatResultT > inline InputT find_format_copy_impl2( const InputT& Input, - FinderT Finder, FormatterT Formatter, const FindResultT& FindResult, const FormatResultT& FormatResult) @@ -151,18 +141,15 @@ namespace boost { template< typename InputT, - typename FinderT, typename FormatterT, typename FindResultT > inline void find_format_impl( InputT& Input, - FinderT Finder, FormatterT Formatter, const FindResultT& FindResult) { find_format_impl2( Input, - Finder, Formatter, FindResult, Formatter(FindResult) ); @@ -170,13 +157,11 @@ namespace boost { template< typename InputT, - typename FinderT, typename FormatterT, typename FindResultT, typename FormatResultT > inline void find_format_impl2( InputT& Input, - FinderT, FormatterT Formatter, const FindResultT& FindResult, const FormatResultT& FormatResult) diff --git a/include/boost/algorithm/string/find_format.hpp b/include/boost/algorithm/string/find_format.hpp index c2683b9..7a7d87b 100644 --- a/include/boost/algorithm/string/find_format.hpp +++ b/include/boost/algorithm/string/find_format.hpp @@ -71,7 +71,6 @@ namespace boost { return detail::find_format_copy_impl( Output, Input, - Finder, Formatter, Finder( begin(Input), end(Input) ) ); } @@ -100,7 +99,6 @@ namespace boost { return detail::find_format_copy_impl( Input, - Finder, Formatter, Finder(begin(Input), end(Input))); } @@ -134,7 +132,6 @@ namespace boost { detail::find_format_impl( Input, - Finder, Formatter, Finder(begin(Input), end(Input))); } From c509c3fbadcb71d4f7f30e331e6ddd8d6a495ce6 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Mon, 6 Nov 2006 17:10:46 +0000 Subject: [PATCH 07/20] Remove obsolete Boost.Build v1 files. [SVN r35880] --- minmax/example/Jamfile | 14 ------- minmax/test/Jamfile | 33 ---------------- string/example/Jamfile | 75 ------------------------------------- string/test/Jamfile | 85 ------------------------------------------ 4 files changed, 207 deletions(-) delete mode 100644 minmax/example/Jamfile delete mode 100644 minmax/test/Jamfile delete mode 100644 string/example/Jamfile delete mode 100644 string/test/Jamfile diff --git a/minmax/example/Jamfile b/minmax/example/Jamfile deleted file mode 100644 index 6cb2e55..0000000 --- a/minmax/example/Jamfile +++ /dev/null @@ -1,14 +0,0 @@ -# Boost.Minmax Library Example Jamfile -# -# Copyright (C) 2002--2004, Herve Bronnimann -# -# Use, modification, and distribution is 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) -# - -subproject libs/algorithm/minmax/example ; - -exe minmax_ex : minmax_ex.cpp ; -exe minmax_timer : minmax_timer.cpp ; - diff --git a/minmax/test/Jamfile b/minmax/test/Jamfile deleted file mode 100644 index 1a4e85b..0000000 --- a/minmax/test/Jamfile +++ /dev/null @@ -1,33 +0,0 @@ -# Boost.Minmax Library Test Jamfile -# -# Copyright (C) 2002--2004, Herve Bronnimann -# -# Use, modification, and distribution is 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) -# - -subproject libs/algorithm/minmax/test ; - -# bring in rules for testing -import testing ; - -# Make tests run by default. -DEPENDS all : test ; - -{ - test-suite algorithm/minmax - : [ run - minmax_element_test.cpp - : : - : - : minmax_element - ] - [ run - minmax_test.cpp - : : - : - : minmax - ] - ; -} diff --git a/string/example/Jamfile b/string/example/Jamfile deleted file mode 100644 index ac5a52d..0000000 --- a/string/example/Jamfile +++ /dev/null @@ -1,75 +0,0 @@ -# Boost string_algo library examples Jamfile --------------------------------- -# -# Copyright Pavol Droba 2002-2003. Use, modification and -# distribution is 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) -# -# See http://www.boost.org for updates, documentation, and revision history. - -subproject libs/algorithm/string/example ; - -exe conv_example - : - conv_example.cpp - : - $(BOOST_ROOT) - : - ; - -exe predicate_example - : - predicate_example.cpp - : - $(BOOST_ROOT) - : - ; - -exe find_example - : - find_example.cpp - : - $(BOOST_ROOT) - : - ; - -exe replace_example - : - replace_example.cpp - : - $(BOOST_ROOT) - : - ; - -exe rle_example - : - rle_example.cpp - : - $(BOOST_ROOT) - : - ; - -exe trim_example - : - trim_example.cpp - : - $(BOOST_ROOT) - : - ; - -exe regex_example - : - regex_example.cpp - ../../../regex/build/boost_regex - : - $(BOOST_ROOT) - : - ; - -exe split_example - : - split_example.cpp - : - $(BOOST_ROOT) - : - ; diff --git a/string/test/Jamfile b/string/test/Jamfile deleted file mode 100644 index 301f2fb..0000000 --- a/string/test/Jamfile +++ /dev/null @@ -1,85 +0,0 @@ -# Boost string_algo library test suite Jamfile ---------------------------- -# -# Copyright Pavol Droba 2002-2003. Use, modification and -# distribution is 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) -# -# See http://www.boost.org for updates, documentation, and revision history. - -subproject libs/algorithm/string/test ; - -# bring in rules for testing -import testing ; - -# Make tests run by default. -DEPENDS all : test ; - -{ - test-suite algorithm/string - : [ run - trim_test.cpp - : : - : - std::locale-support - std::facet-support - : trim - ] - [ run - conv_test.cpp - : : - : - std::locale-support - std::facet-support - : conv - ] - [ run - predicate_test.cpp - : : - : - std::locale-support - std::facet-support - : predicate - ] - [ run - find_test.cpp - : : - : - std::locale-support - std::facet-support - : find - ] - [ run - split_test.cpp - : : - : - std::locale-support - std::facet-support - : split - ] - [ run - join_test.cpp - : : - : - std::locale-support - std::facet-support - : join - ] - [ run - replace_test.cpp - : : - : - std::locale-support - std::facet-support - : replace - ] - [ run - regex_test.cpp - ../../../regex/build/boost_regex - : : - : - : regex - ] - ; -} - From a71a4ed5b1e62c77b9dd313e6195ce1a3f33bc63 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Tue, 7 Nov 2006 19:27:00 +0000 Subject: [PATCH 08/20] Merged copyright and license addition [SVN r35907] --- string/index.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/string/index.html b/string/index.html index a98cbc3..3fe4b48 100644 --- a/string/index.html +++ b/string/index.html @@ -10,6 +10,11 @@ Automatic redirection failed, please go to -../../doc/html/string_algo.html +../../doc/html/string_algo.html
+

© Copyright Beman Dawes, 2001

+

Distributed under the Boost Software License, Version 1.0. (See accompanying +file LICENSE_1_0.txt or copy +at www.boost.org/LICENSE_1_0.txt)

- + \ No newline at end of file From 37581bac552cc48a707fc5048b7f8d5f0c52e255 Mon Sep 17 00:00:00 2001 From: Pavol Droba Date: Tue, 30 Jan 2007 07:59:28 +0000 Subject: [PATCH 09/20] documentation typo fixed [SVN r36843] --- string/doc/usage.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/string/doc/usage.xml b/string/doc/usage.xml index 42cb4df..c6836b1 100644 --- a/string/doc/usage.xml +++ b/string/doc/usage.xml @@ -289,9 +289,9 @@ // aBC typedef split_iterator<string::iterator> string_split_iterator; - for(string_find_iterator It= + for(string_split_iterator It= make_split_iterator(str1, first_finder("-*-", is_iequal())); - It!=string_find_iterator(); + It!=string_split_iterator(); ++It) { cout << copy_range<std::string>(*It) << endl; From 630937961899cbb7ff2e9994ae860213134561bb Mon Sep 17 00:00:00 2001 From: Pavol Droba Date: Sun, 29 Apr 2007 07:02:21 +0000 Subject: [PATCH 10/20] release notes for 1.34 added [SVN r37532] --- string/doc/release_notes.xml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/string/doc/release_notes.xml b/string/doc/release_notes.xml index b60b74b..4ae21e6 100644 --- a/string/doc/release_notes.xml +++ b/string/doc/release_notes.xml @@ -19,5 +19,23 @@ 1.33 Internal version of collection traits removed, library adapted to Boost.Range + + 1.34 + + + lexicographical_compare() + + + join + + + New comparison predicates is_less, is_not_greater + + + Negative indexes support (like Perl) in various algorihtms + (*_head/tail, *_nth). + + +
From 1a02969303fe5e8d164dbcfa7f78246618c82201 Mon Sep 17 00:00:00 2001 From: Pavol Droba Date: Sun, 29 Apr 2007 07:04:58 +0000 Subject: [PATCH 11/20] release notes - fix the incorrect functionname spelling [SVN r37533] --- string/doc/release_notes.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/string/doc/release_notes.xml b/string/doc/release_notes.xml index 4ae21e6..b40504b 100644 --- a/string/doc/release_notes.xml +++ b/string/doc/release_notes.xml @@ -8,6 +8,10 @@ -->
+ + + + Release Notes @@ -26,7 +30,7 @@ lexicographical_compare() - join + join() and join_if() New comparison predicates is_less, is_not_greater From 5bdbb2b30852c4a3381640cdbdac5e59f10eaa44 Mon Sep 17 00:00:00 2001 From: Pavol Droba Date: Fri, 1 Jun 2007 13:50:51 +0000 Subject: [PATCH 12/20] Documentation for iter_find/iter_split added [SVN r37842] --- string/doc/Jamfile.v2 | 1 + string/doc/quickref.xml | 20 +++++++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/string/doc/Jamfile.v2 b/string/doc/Jamfile.v2 index 13e0df3..f402ba4 100644 --- a/string/doc/Jamfile.v2 +++ b/string/doc/Jamfile.v2 @@ -31,6 +31,7 @@ doxygen autodoc [ glob ../../../../boost/algorithm/string/trim.hpp ] [ glob ../../../../boost/algorithm/string/predicate.hpp ] [ glob ../../../../boost/algorithm/string/split.hpp ] + [ glob ../../../../boost/algorithm/string/iter_find.hpp ] [ glob ../../../../boost/algorithm/string/erase.hpp ] [ glob ../../../../boost/algorithm/string/join.hpp ] [ glob ../../../../boost/algorithm/string/replace.hpp ] diff --git a/string/doc/quickref.xml b/string/doc/quickref.xml index 0972893..3c65ae2 100644 --- a/string/doc/quickref.xml +++ b/string/doc/quickref.xml @@ -151,7 +151,7 @@ lexicographical_compare - Check if a string is lexicographicaly less then another one + Check if a string is lexicographically less then another one lexicographical_compare() @@ -434,7 +434,7 @@ find_all_regex() - + split Split input into parts @@ -442,7 +442,21 @@ split_regex() - + + + iter_find + Iteratively apply the finder to the input to find all matching substrings + + iter_find() + + + + iter_split + Use the finder to find matching substrings in the input and use them as separators to split the input into parts + + iter_split() + + From 05af96f84c32a9a9652f5c61dcdae9fa0d8e61a9 Mon Sep 17 00:00:00 2001 From: nobody Date: Tue, 24 Jul 2007 19:28:14 +0000 Subject: [PATCH 13/20] This commit was manufactured by cvs2svn to create tag 'Version_1_34_1'. [SVN r38286] From d4b95734dd3dd9827c4d65d4a8d69fe965d454b9 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Fri, 5 Oct 2007 14:25:06 +0000 Subject: [PATCH 14/20] Starting point for releases [SVN r39706] From 50b5726a6f38b345f403b187441eb9b66c4796de Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Sun, 25 Nov 2007 18:07:19 +0000 Subject: [PATCH 15/20] Full merge from trunk at revision 41356 of entire boost-root tree. [SVN r41369] --- include/boost/algorithm/minmax.hpp | 6 +- include/boost/algorithm/minmax_element.hpp | 6 +- include/boost/algorithm/string.hpp | 12 +-- include/boost/algorithm/string/case_conv.hpp | 69 ++++++--------- .../boost/algorithm/string/classification.hpp | 15 ++-- include/boost/algorithm/string/compare.hpp | 11 +-- include/boost/algorithm/string/concept.hpp | 11 +-- include/boost/algorithm/string/config.hpp | 11 +-- include/boost/algorithm/string/constants.hpp | 11 +-- .../algorithm/string/detail/case_conv.hpp | 54 ++++++++++-- .../string/detail/classification.hpp | 11 +-- .../algorithm/string/detail/find_format.hpp | 11 +-- .../string/detail/find_format_all.hpp | 11 +-- .../string/detail/find_format_store.hpp | 11 +-- .../algorithm/string/detail/find_iterator.hpp | 11 +-- .../boost/algorithm/string/detail/finder.hpp | 12 +-- .../algorithm/string/detail/finder_regex.hpp | 11 +-- .../algorithm/string/detail/formatter.hpp | 9 +- .../string/detail/formatter_regex.hpp | 11 +-- .../algorithm/string/detail/predicate.hpp | 11 +-- .../string/detail/replace_storage.hpp | 11 +-- .../algorithm/string/detail/sequence.hpp | 11 +-- .../boost/algorithm/string/detail/trim.hpp | 11 +-- .../boost/algorithm/string/detail/util.hpp | 11 +-- include/boost/algorithm/string/erase.hpp | 11 +-- include/boost/algorithm/string/find.hpp | 73 +++++++-------- .../boost/algorithm/string/find_format.hpp | 24 +++-- .../boost/algorithm/string/find_iterator.hpp | 43 +++++---- include/boost/algorithm/string/finder.hpp | 71 +++++++-------- include/boost/algorithm/string/formatter.hpp | 28 ++++-- include/boost/algorithm/string/iter_find.hpp | 34 ++++--- include/boost/algorithm/string/join.hpp | 21 ++--- include/boost/algorithm/string/predicate.hpp | 88 +++++++++++-------- .../algorithm/string/predicate_facade.hpp | 11 +-- include/boost/algorithm/string/regex.hpp | 32 +++---- .../algorithm/string/regex_find_format.hpp | 11 +-- include/boost/algorithm/string/replace.hpp | 11 +-- .../algorithm/string/sequence_traits.hpp | 11 +-- include/boost/algorithm/string/split.hpp | 11 +-- .../algorithm/string/std/list_traits.hpp | 11 +-- .../algorithm/string/std/rope_traits.hpp | 11 +-- .../algorithm/string/std/slist_traits.hpp | 11 +-- .../algorithm/string/std/string_traits.hpp | 11 +-- .../string/std_containers_traits.hpp | 11 +-- include/boost/algorithm/string/trim.hpp | 37 +++++--- .../boost/algorithm/string/yes_no_type.hpp | 11 +-- include/boost/algorithm/string_regex.hpp | 11 +-- 47 files changed, 532 insertions(+), 421 deletions(-) diff --git a/include/boost/algorithm/minmax.hpp b/include/boost/algorithm/minmax.hpp index 2b5101a..053a7d6 100644 --- a/include/boost/algorithm/minmax.hpp +++ b/include/boost/algorithm/minmax.hpp @@ -1,7 +1,7 @@ // (C) Copyright Herve Bronnimann 2004. -// 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) +// +// 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) /* Revision history: diff --git a/include/boost/algorithm/minmax_element.hpp b/include/boost/algorithm/minmax_element.hpp index 6c88b63..0d2efd8 100644 --- a/include/boost/algorithm/minmax_element.hpp +++ b/include/boost/algorithm/minmax_element.hpp @@ -1,7 +1,7 @@ // (C) Copyright Herve Bronnimann 2004. -// 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) +// +// 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) /* Revision history: diff --git a/include/boost/algorithm/string.hpp b/include/boost/algorithm/string.hpp index 1a664f1..a2f943e 100644 --- a/include/boost/algorithm/string.hpp +++ b/include/boost/algorithm/string.hpp @@ -1,11 +1,12 @@ // Boost string_algo library string_algo.hpp header file ---------------------------// -// Copyright Pavol Droba 2002-2004. Use, modification and -// distribution is 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) +// Copyright Pavol Droba 2002-2004. +// +// 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) -// See http://www.boost.org for updates, documentation, and revision history. +// See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_ALGO_HPP #define BOOST_STRING_ALGO_HPP @@ -20,7 +21,6 @@ #include #include #include -#include #include #include #include diff --git a/include/boost/algorithm/string/case_conv.hpp b/include/boost/algorithm/string/case_conv.hpp index 5f61bf1..536c022 100644 --- a/include/boost/algorithm/string/case_conv.hpp +++ b/include/boost/algorithm/string/case_conv.hpp @@ -1,11 +1,12 @@ // Boost string_algo library case_conv.hpp header file ---------------------------// -// Copyright Pavol Droba 2002-2003. Use, modification and -// distribution is 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) +// Copyright Pavol Droba 2002-2003. +// +// 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) -// See http://www.boost.org for updates, documentation, and revision history. +// See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_CASE_CONV_HPP #define BOOST_STRING_CASE_CONV_HPP @@ -15,6 +16,7 @@ #include #include +#include #include #include #include @@ -55,11 +57,10 @@ namespace boost { const RangeT& Input, const std::locale& Loc=std::locale()) { - return std::transform( - begin(Input), - end(Input), - Output, - ::boost::algorithm::detail::to_lowerF< + return ::boost::algorithm::detail::transform_range_copy( + Output, + as_literal(Input), + ::boost::algorithm::detail::to_lowerF< typename range_value::type >(Loc)); } @@ -72,15 +73,10 @@ namespace boost { const SequenceT& Input, const std::locale& Loc=std::locale()) { - return SequenceT( - make_transform_iterator( - begin(Input), - ::boost::algorithm::detail::to_lowerF< - typename range_value::type >(Loc)), - make_transform_iterator( - end(Input), - ::boost::algorithm::detail::to_lowerF< - typename range_value::type >(Loc))); + return ::boost::algorithm::detail::transform_range_copy( + Input, + ::boost::algorithm::detail::to_lowerF< + typename range_value::type >(Loc)); } //! Convert to lower case @@ -96,10 +92,8 @@ namespace boost { WritableRangeT& Input, const std::locale& Loc=std::locale()) { - std::transform( - begin(Input), - end(Input), - begin(Input), + ::boost::algorithm::detail::transform_range( + as_literal(Input), ::boost::algorithm::detail::to_lowerF< typename range_value::type >(Loc)); } @@ -128,11 +122,10 @@ namespace boost { const RangeT& Input, const std::locale& Loc=std::locale()) { - return std::transform( - begin(Input), - end(Input), - Output, - ::boost::algorithm::detail::to_upperF< + return ::boost::algorithm::detail::transform_range_copy( + Output, + as_literal(Input), + ::boost::algorithm::detail::to_upperF< typename range_value::type >(Loc)); } @@ -145,16 +138,10 @@ namespace boost { const SequenceT& Input, const std::locale& Loc=std::locale()) { - return SequenceT( - make_transform_iterator( - begin(Input), - ::boost::algorithm::detail::to_upperF< - typename range_value::type >(Loc)), - make_transform_iterator( - end(Input), - ::boost::algorithm::detail::to_upperF< - typename range_value::type >(Loc))); - + return ::boost::algorithm::detail::transform_range_copy( + Input, + ::boost::algorithm::detail::to_upperF< + typename range_value::type >(Loc)); } //! Convert to upper case @@ -170,10 +157,8 @@ namespace boost { WritableRangeT& Input, const std::locale& Loc=std::locale()) { - std::transform( - begin(Input), - end(Input), - begin(Input), + ::boost::algorithm::detail::transform_range( + as_literal(Input), ::boost::algorithm::detail::to_upperF< typename range_value::type >(Loc)); } diff --git a/include/boost/algorithm/string/classification.hpp b/include/boost/algorithm/string/classification.hpp index 232050f..a2e2b4d 100644 --- a/include/boost/algorithm/string/classification.hpp +++ b/include/boost/algorithm/string/classification.hpp @@ -1,11 +1,12 @@ // Boost string_algo library classification.hpp header file ---------------------------// -// Copyright Pavol Droba 2002-2003. Use, modification and -// distribution is 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) +// Copyright Pavol Droba 2002-2003. +// +// 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) -// See http://www.boost.org for updates, documentation, and revision history. +// See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_CLASSIFICATION_HPP #define BOOST_STRING_CLASSIFICATION_HPP @@ -13,9 +14,11 @@ #include #include #include +#include #include #include + /*! \file Classification predicates are included in the library to give some more convenience when using algorithms like \c trim() and \c all(). @@ -200,7 +203,7 @@ namespace boost { is_any_of( const RangeT& Set ) { return detail::is_any_ofF< - BOOST_STRING_TYPENAME range_value::type>(Set); + BOOST_STRING_TYPENAME range_value::type>(as_literal(Set)); } //! is_from_range predicate diff --git a/include/boost/algorithm/string/compare.hpp b/include/boost/algorithm/string/compare.hpp index c2a0bba..734303a 100644 --- a/include/boost/algorithm/string/compare.hpp +++ b/include/boost/algorithm/string/compare.hpp @@ -1,11 +1,12 @@ // Boost string_algo library compare.hpp header file -------------------------// -// Copyright Pavol Droba 2002-2006. Use, modification and -// distribution is 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) +// Copyright Pavol Droba 2002-2006. +// +// 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) -// See http://www.boost.org for updates, documentation, and revision history. +// See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_COMPARE_HPP #define BOOST_STRING_COMPARE_HPP diff --git a/include/boost/algorithm/string/concept.hpp b/include/boost/algorithm/string/concept.hpp index 1efda27..3ebc88c 100644 --- a/include/boost/algorithm/string/concept.hpp +++ b/include/boost/algorithm/string/concept.hpp @@ -1,11 +1,12 @@ // Boost string_algo library concept.hpp header file ---------------------------// -// Copyright Pavol Droba 2002-2003. Use, modification and -// distribution is 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) +// Copyright Pavol Droba 2002-2003. +// +// 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) -// See http://www.boost.org for updates, documentation, and revision history. +// See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_CONCEPT_HPP #define BOOST_STRING_CONCEPT_HPP diff --git a/include/boost/algorithm/string/config.hpp b/include/boost/algorithm/string/config.hpp index da28643..559750a 100644 --- a/include/boost/algorithm/string/config.hpp +++ b/include/boost/algorithm/string/config.hpp @@ -1,11 +1,12 @@ // Boost string_algo library config.hpp header file ---------------------------// -// Copyright Pavol Droba 2002-2003. Use, modification and -// distribution is 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) +// Copyright Pavol Droba 2002-2003. +// +// 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) -// See http://www.boost.org for updates, documentation, and revision history. +// See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_CONFIG_HPP #define BOOST_STRING_CONFIG_HPP diff --git a/include/boost/algorithm/string/constants.hpp b/include/boost/algorithm/string/constants.hpp index d9dbe0d..6ed70ef 100644 --- a/include/boost/algorithm/string/constants.hpp +++ b/include/boost/algorithm/string/constants.hpp @@ -1,11 +1,12 @@ // Boost string_algo library constants.hpp header file ---------------------------// -// Copyright Pavol Droba 2002-2003. Use, modification and -// distribution is 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) +// Copyright Pavol Droba 2002-2003. +// +// 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) -// See http://www.boost.org for updates, documentation, and revision history. +// See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_CONSTANTS_HPP #define BOOST_STRING_CONSTANTS_HPP diff --git a/include/boost/algorithm/string/detail/case_conv.hpp b/include/boost/algorithm/string/detail/case_conv.hpp index ffc4514..0eaad19 100644 --- a/include/boost/algorithm/string/detail/case_conv.hpp +++ b/include/boost/algorithm/string/detail/case_conv.hpp @@ -1,11 +1,12 @@ // Boost string_algo library string_funct.hpp header file ---------------------------// -// Copyright Pavol Droba 2002-2003. Use, modification and -// distribution is 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) +// Copyright Pavol Droba 2002-2003. +// +// 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) -// See http://www.boost.org for updates, documentation, and revision history. +// See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_CASE_CONV_DETAIL_HPP #define BOOST_STRING_CASE_CONV_DETAIL_HPP @@ -60,6 +61,49 @@ namespace boost { const std::locale& m_Loc; }; +// algorithm implementation ------------------------------------------------------------------------- + + // Transform a range + template + OutputIteratorT transform_range_copy( + OutputIteratorT Output, + const RangeT& Input, + FunctorT Functor) + { + return std::transform( + begin(Input), + end(Input), + Output, + Functor); + } + + // Transform a range (in-place) + template + void transform_range( + const RangeT& Input, + FunctorT Functor) + { + std::transform( + begin(Input), + end(Input), + begin(Input), + Functor); + } + + template + inline SequenceT transform_range_copy( + const RangeT& Input, + FunctorT Functor) + { + return SequenceT( + make_transform_iterator( + begin(Input), + Functor), + make_transform_iterator( + end(Input), + Functor)); + } + } // namespace detail } // namespace algorithm } // namespace boost diff --git a/include/boost/algorithm/string/detail/classification.hpp b/include/boost/algorithm/string/detail/classification.hpp index c950bfa..d3139ad 100644 --- a/include/boost/algorithm/string/detail/classification.hpp +++ b/include/boost/algorithm/string/detail/classification.hpp @@ -1,11 +1,12 @@ // Boost string_algo library classification.hpp header file ---------------------------// -// Copyright Pavol Droba 2002-2003. Use, modification and -// distribution is 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) +// Copyright Pavol Droba 2002-2003. +// +// 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) -// See http://www.boost.org for updates, documentation, and revision history. +// See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_CLASSIFICATION_DETAIL_HPP #define BOOST_STRING_CLASSIFICATION_DETAIL_HPP diff --git a/include/boost/algorithm/string/detail/find_format.hpp b/include/boost/algorithm/string/detail/find_format.hpp index 2ba7ba2..f1dcc0c 100644 --- a/include/boost/algorithm/string/detail/find_format.hpp +++ b/include/boost/algorithm/string/detail/find_format.hpp @@ -1,11 +1,12 @@ // Boost string_algo library find_format.hpp header file ---------------------------// -// Copyright Pavol Droba 2002-2003. Use, modification and -// distribution is 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) +// Copyright Pavol Droba 2002-2003. +// +// 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) -// See http://www.boost.org for updates, documentation, and revision history. +// See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_FIND_FORMAT_DETAIL_HPP #define BOOST_STRING_FIND_FORMAT_DETAIL_HPP diff --git a/include/boost/algorithm/string/detail/find_format_all.hpp b/include/boost/algorithm/string/detail/find_format_all.hpp index a6be0b6..28c60b8 100644 --- a/include/boost/algorithm/string/detail/find_format_all.hpp +++ b/include/boost/algorithm/string/detail/find_format_all.hpp @@ -1,11 +1,12 @@ // Boost string_algo library find_format_all.hpp header file ---------------------------// -// Copyright Pavol Droba 2002-2003. Use, modification and -// distribution is 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) +// Copyright Pavol Droba 2002-2003. +// +// 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) -// See http://www.boost.org for updates, documentation, and revision history. +// See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_FIND_FORMAT_ALL_DETAIL_HPP #define BOOST_STRING_FIND_FORMAT_ALL_DETAIL_HPP diff --git a/include/boost/algorithm/string/detail/find_format_store.hpp b/include/boost/algorithm/string/detail/find_format_store.hpp index a1afc55..6dbbcba 100644 --- a/include/boost/algorithm/string/detail/find_format_store.hpp +++ b/include/boost/algorithm/string/detail/find_format_store.hpp @@ -1,11 +1,12 @@ // Boost string_algo library find_format_store.hpp header file ---------------------------// -// Copyright Pavol Droba 2002-2003. Use, modification and -// distribution is 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) +// Copyright Pavol Droba 2002-2003. +// +// 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) -// See http://www.boost.org for updates, documentation, and revision history. +// See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_FIND_FORMAT_STORE_DETAIL_HPP #define BOOST_STRING_FIND_FORMAT_STORE_DETAIL_HPP diff --git a/include/boost/algorithm/string/detail/find_iterator.hpp b/include/boost/algorithm/string/detail/find_iterator.hpp index ebfd59a..c76993a 100644 --- a/include/boost/algorithm/string/detail/find_iterator.hpp +++ b/include/boost/algorithm/string/detail/find_iterator.hpp @@ -1,11 +1,12 @@ // Boost string_algo library find_iterator.hpp header file ---------------------------// -// Copyright Pavol Droba 2002-2003. Use, modification and -// distribution is 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) +// Copyright Pavol Droba 2002-2003. +// +// 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) -// See http://www.boost.org for updates, documentation, and revision history. +// See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_FIND_ITERATOR_DETAIL_HPP #define BOOST_STRING_FIND_ITERATOR_DETAIL_HPP diff --git a/include/boost/algorithm/string/detail/finder.hpp b/include/boost/algorithm/string/detail/finder.hpp index cd6d6f7..194296e 100644 --- a/include/boost/algorithm/string/detail/finder.hpp +++ b/include/boost/algorithm/string/detail/finder.hpp @@ -1,11 +1,12 @@ // Boost string_algo library finder.hpp header file ---------------------------// -// Copyright Pavol Droba 2002-2006. Use, modification and -// distribution is 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) +// Copyright Pavol Droba 2002-2006. +// +// 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) -// See http://www.boost.org for updates, documentation, and revision history. +// See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_FINDER_DETAIL_HPP #define BOOST_STRING_FINDER_DETAIL_HPP @@ -18,6 +19,7 @@ #include #include #include +#include namespace boost { namespace algorithm { diff --git a/include/boost/algorithm/string/detail/finder_regex.hpp b/include/boost/algorithm/string/detail/finder_regex.hpp index 7f178da..1eeda01 100644 --- a/include/boost/algorithm/string/detail/finder_regex.hpp +++ b/include/boost/algorithm/string/detail/finder_regex.hpp @@ -1,11 +1,12 @@ // Boost string_algo library find_regex.hpp header file ---------------------------// -// Copyright Pavol Droba 2002-2003. Use, modification and -// distribution is 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) +// Copyright Pavol Droba 2002-2003. +// +// 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) -// See http://www.boost.org for updates, documentation, and revision history. +// See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_FINDER_REGEX_DETAIL_HPP #define BOOST_STRING_FINDER_REGEX_DETAIL_HPP diff --git a/include/boost/algorithm/string/detail/formatter.hpp b/include/boost/algorithm/string/detail/formatter.hpp index 367bf67..2af1573 100644 --- a/include/boost/algorithm/string/detail/formatter.hpp +++ b/include/boost/algorithm/string/detail/formatter.hpp @@ -1,9 +1,10 @@ // Boost string_algo library formatter.hpp header file ---------------------------// -// Copyright Pavol Droba 2002-2003. Use, modification and -// distribution is 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) +// Copyright Pavol Droba 2002-2003. +// +// 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) // See http://www.boost.org for updates, documentation, and revision history. diff --git a/include/boost/algorithm/string/detail/formatter_regex.hpp b/include/boost/algorithm/string/detail/formatter_regex.hpp index 0f28fd2..5f26407 100644 --- a/include/boost/algorithm/string/detail/formatter_regex.hpp +++ b/include/boost/algorithm/string/detail/formatter_regex.hpp @@ -1,11 +1,12 @@ // Boost string_algo library formatter_regex.hpp header file ---------------------------// -// Copyright Pavol Droba 2002-2003. Use, modification and -// distribution is 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) +// Copyright Pavol Droba 2002-2003. +// +// 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) -// See http://www.boost.org for updates, documentation, and revision history. +// See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_FORMATTER_REGEX_DETAIL_HPP #define BOOST_STRING_FORMATTER_REGEX_DETAIL_HPP diff --git a/include/boost/algorithm/string/detail/predicate.hpp b/include/boost/algorithm/string/detail/predicate.hpp index ea1794d..a04b5b1 100644 --- a/include/boost/algorithm/string/detail/predicate.hpp +++ b/include/boost/algorithm/string/detail/predicate.hpp @@ -1,11 +1,12 @@ // Boost string_algo library predicate.hpp header file ---------------------------// -// Copyright Pavol Droba 2002-2003. Use, modification and -// distribution is 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) +// Copyright Pavol Droba 2002-2003. +// +// 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) -// See http://www.boost.org for updates, documentation, and revision history. +// See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_PREDICATE_DETAIL_HPP #define BOOST_STRING_PREDICATE_DETAIL_HPP diff --git a/include/boost/algorithm/string/detail/replace_storage.hpp b/include/boost/algorithm/string/detail/replace_storage.hpp index 248eb31..759036e 100644 --- a/include/boost/algorithm/string/detail/replace_storage.hpp +++ b/include/boost/algorithm/string/detail/replace_storage.hpp @@ -1,11 +1,12 @@ // Boost string_algo library replace_storage.hpp header file ---------------------------// -// Copyright Pavol Droba 2002-2003. Use, modification and -// distribution is 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) +// Copyright Pavol Droba 2002-2003. +// +// 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) -// See http://www.boost.org for updates, documentation, and revision history. +// See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_REPLACE_STORAGE_DETAIL_HPP #define BOOST_STRING_REPLACE_STORAGE_DETAIL_HPP diff --git a/include/boost/algorithm/string/detail/sequence.hpp b/include/boost/algorithm/string/detail/sequence.hpp index 03c7fd0..87d7eab 100644 --- a/include/boost/algorithm/string/detail/sequence.hpp +++ b/include/boost/algorithm/string/detail/sequence.hpp @@ -1,11 +1,12 @@ // Boost string_algo library sequence.hpp header file ---------------------------// -// Copyright Pavol Droba 2002-2003. Use, modification and -// distribution is 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) +// Copyright Pavol Droba 2002-2003. +// +// 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) -// See http://www.boost.org for updates, documentation, and revision history. +// See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_DETAIL_SEQUENCE_HPP #define BOOST_STRING_DETAIL_SEQUENCE_HPP diff --git a/include/boost/algorithm/string/detail/trim.hpp b/include/boost/algorithm/string/detail/trim.hpp index 502eca3..8e5c0fb 100644 --- a/include/boost/algorithm/string/detail/trim.hpp +++ b/include/boost/algorithm/string/detail/trim.hpp @@ -1,11 +1,12 @@ // Boost string_algo library trim.hpp header file ---------------------------// -// Copyright Pavol Droba 2002-2003. Use, modification and -// distribution is 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) +// Copyright Pavol Droba 2002-2003. +// +// 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) -// See http://www.boost.org for updates, documentation, and revision history. +// See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_TRIM_DETAIL_HPP #define BOOST_STRING_TRIM_DETAIL_HPP diff --git a/include/boost/algorithm/string/detail/util.hpp b/include/boost/algorithm/string/detail/util.hpp index 09663bd..7e8471f 100644 --- a/include/boost/algorithm/string/detail/util.hpp +++ b/include/boost/algorithm/string/detail/util.hpp @@ -1,11 +1,12 @@ // Boost string_algo library util.hpp header file ---------------------------// -// Copyright Pavol Droba 2002-2003. Use, modification and -// distribution is 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) +// Copyright Pavol Droba 2002-2003. +// +// 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) -// See http://www.boost.org for updates, documentation, and revision history. +// See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_UTIL_DETAIL_HPP #define BOOST_STRING_UTIL_DETAIL_HPP diff --git a/include/boost/algorithm/string/erase.hpp b/include/boost/algorithm/string/erase.hpp index 3f6eae5..b50323b 100644 --- a/include/boost/algorithm/string/erase.hpp +++ b/include/boost/algorithm/string/erase.hpp @@ -1,11 +1,12 @@ // Boost string_algo library erase.hpp header file ---------------------------// -// Copyright Pavol Droba 2002-2006. Use, modification and -// distribution is 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) +// Copyright Pavol Droba 2002-2006. +// +// 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) -// See http://www.boost.org for updates, documentation, and revision history. +// See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_ERASE_HPP #define BOOST_STRING_ERASE_HPP diff --git a/include/boost/algorithm/string/find.hpp b/include/boost/algorithm/string/find.hpp index 8c49ebe..1f7202d 100644 --- a/include/boost/algorithm/string/find.hpp +++ b/include/boost/algorithm/string/find.hpp @@ -1,11 +1,12 @@ // Boost string_algo library find.hpp header file ---------------------------// -// Copyright Pavol Droba 2002-2003. Use, modification and -// distribution is 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) +// Copyright Pavol Droba 2002-2003. +// +// 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) -// See http://www.boost.org for updates, documentation, and revision history. +// See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_FIND_HPP #define BOOST_STRING_FIND_HPP @@ -16,8 +17,7 @@ #include #include #include -#include -#include +#include #include #include @@ -48,19 +48,21 @@ namespace boost { */ template inline iterator_range< - BOOST_STRING_TYPENAME range_result_iterator::type> + BOOST_STRING_TYPENAME range_iterator::type> find( RangeT& Input, - FinderT Finder) + const FinderT& Finder) { - return Finder(begin(Input),end(Input)); + iterator_range::type> lit_input(as_literal(Input)); + + return Finder(begin(lit_input),end(lit_input)); } // find_first -----------------------------------------------// //! Find first algorithm /*! - Search for the first occurence of the substring in the input. + Search for the first occurrence of the substring in the input. \param Input A string which will be searched. \param Search A substring to be searched for. @@ -74,13 +76,12 @@ namespace boost { */ template inline iterator_range< - BOOST_STRING_TYPENAME range_result_iterator::type> + BOOST_STRING_TYPENAME range_iterator::type> find_first( Range1T& Input, const Range2T& Search) { - return first_finder(Search)( - begin(Input),end(Input)); + return find(Input, first_finder(Search)); } //! Find first algorithm ( case insensitive ) @@ -101,21 +102,20 @@ namespace boost { */ template inline iterator_range< - BOOST_STRING_TYPENAME range_result_iterator::type> + BOOST_STRING_TYPENAME range_iterator::type> ifind_first( Range1T& Input, const Range2T& Search, const std::locale& Loc=std::locale()) { - return first_finder(Search,is_iequal(Loc))( - begin(Input),end(Input)); + return find(Input, first_finder(Search,is_iequal(Loc))); } // find_last -----------------------------------------------// //! Find last algorithm /*! - Search for the last occurence of the substring in the input. + Search for the last occurrence of the substring in the input. \param Input A string which will be searched. \param Search A substring to be searched for. @@ -129,13 +129,12 @@ namespace boost { */ template inline iterator_range< - BOOST_STRING_TYPENAME range_result_iterator::type> + BOOST_STRING_TYPENAME range_iterator::type> find_last( Range1T& Input, const Range2T& Search) { - return last_finder(Search)( - begin(Input),end(Input)); + return find(Input, last_finder(Search)); } //! Find last algorithm ( case insensitive ) @@ -156,21 +155,20 @@ namespace boost { */ template inline iterator_range< - BOOST_STRING_TYPENAME range_result_iterator::type> + BOOST_STRING_TYPENAME range_iterator::type> ifind_last( Range1T& Input, const Range2T& Search, const std::locale& Loc=std::locale()) { - return last_finder(Search, is_iequal(Loc))( - begin(Input),end(Input)); + return find(Input, last_finder(Search, is_iequal(Loc))); } // find_nth ----------------------------------------------------------------------// //! Find n-th algorithm /*! - Search for the n-th (zero-indexed) occurence of the substring in the + Search for the n-th (zero-indexed) occurrence of the substring in the input. \param Input A string which will be searched. @@ -185,14 +183,13 @@ namespace boost { */ template inline iterator_range< - BOOST_STRING_TYPENAME range_result_iterator::type> + BOOST_STRING_TYPENAME range_iterator::type> find_nth( Range1T& Input, const Range2T& Search, int Nth) { - return nth_finder(Search,Nth)( - begin(Input),end(Input)); + return find(Input, nth_finder(Search,Nth)); } //! Find n-th algorithm ( case insensitive ). @@ -216,15 +213,14 @@ namespace boost { */ template inline iterator_range< - BOOST_STRING_TYPENAME range_result_iterator::type> + BOOST_STRING_TYPENAME range_iterator::type> ifind_nth( Range1T& Input, const Range2T& Search, int Nth, const std::locale& Loc=std::locale()) { - return nth_finder(Search,Nth,is_iequal(Loc))( - begin(Input),end(Input)); + return find(Input, nth_finder(Search,Nth,is_iequal(Loc))); } // find_head ----------------------------------------------------------------------// @@ -249,13 +245,12 @@ namespace boost { */ template inline iterator_range< - BOOST_STRING_TYPENAME range_result_iterator::type> + BOOST_STRING_TYPENAME range_iterator::type> find_head( RangeT& Input, int N) { - return head_finder(N)( - begin(Input),end(Input)); + return find(Input, head_finder(N)); } // find_tail ----------------------------------------------------------------------// @@ -281,13 +276,12 @@ namespace boost { */ template inline iterator_range< - BOOST_STRING_TYPENAME range_result_iterator::type> + BOOST_STRING_TYPENAME range_iterator::type> find_tail( RangeT& Input, int N) { - return tail_finder(N)( - begin(Input),end(Input)); + return find(Input, tail_finder(N)); } // find_token --------------------------------------------------------------------// @@ -311,14 +305,13 @@ namespace boost { */ template inline iterator_range< - BOOST_STRING_TYPENAME range_result_iterator::type> + BOOST_STRING_TYPENAME range_iterator::type> find_token( RangeT& Input, PredicateT Pred, token_compress_mode_type eCompress=token_compress_off) { - return token_finder(Pred, eCompress)( - begin(Input),end(Input)); + return find(Input, token_finder(Pred, eCompress)); } } // namespace algorithm diff --git a/include/boost/algorithm/string/find_format.hpp b/include/boost/algorithm/string/find_format.hpp index 7a7d87b..cb3dd7c 100644 --- a/include/boost/algorithm/string/find_format.hpp +++ b/include/boost/algorithm/string/find_format.hpp @@ -1,11 +1,12 @@ // Boost string_algo library find_format.hpp header file ---------------------------// -// Copyright Pavol Droba 2002-2003. Use, modification and -// distribution is 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) +// Copyright Pavol Droba 2002-2003. +// +// 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) -// See http://www.boost.org for updates, documentation, and revision history. +// See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_FIND_FORMAT_HPP #define BOOST_STRING_FIND_FORMAT_HPP @@ -16,6 +17,7 @@ #include #include #include +#include #include #include @@ -68,11 +70,13 @@ namespace boost { FormatterT, FinderT,BOOST_STRING_TYPENAME range_const_iterator::type> >(); + iterator_range::type> lit_input(as_literal(Input)); + return detail::find_format_copy_impl( Output, - Input, + lit_input, Formatter, - Finder( begin(Input), end(Input) ) ); + Finder( begin(lit_input), end(lit_input) ) ); } //! Generic replace algorithm @@ -176,12 +180,14 @@ namespace boost { FormatterT, FinderT,BOOST_STRING_TYPENAME range_const_iterator::type> >(); + iterator_range::type> lit_input(as_literal(Input)); + return detail::find_format_all_copy_impl( Output, - Input, + lit_input, Finder, Formatter, - Finder(begin(Input), end(Input))); + Finder(begin(lit_input), end(lit_input))); } //! Generic replace all algorithm diff --git a/include/boost/algorithm/string/find_iterator.hpp b/include/boost/algorithm/string/find_iterator.hpp index 26891dd..aba28d8 100644 --- a/include/boost/algorithm/string/find_iterator.hpp +++ b/include/boost/algorithm/string/find_iterator.hpp @@ -1,10 +1,12 @@ // Boost string_algo library find_iterator.hpp header file ---------------------------// -// Copyright Pavol Droba 2002-2004. Use, modification and -// distribution is 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) -// See http://www.boost.org for updates, documentation, and revision history. +// Copyright Pavol Droba 2002-2004. +// +// 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) + +// See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_FIND_ITERATOR_HPP #define BOOST_STRING_FIND_ITERATOR_HPP @@ -16,7 +18,8 @@ #include #include #include -#include +#include +#include #include @@ -114,10 +117,12 @@ namespace boost { find_iterator( RangeT& Col, FinderT Finder ) : - detail::find_iterator_base(Finder,0), - m_Match(begin(Col),begin(Col)), - m_End(end(Col)) + detail::find_iterator_base(Finder,0) { + iterator_range::type> lit_col(as_literal(Col)); + m_Match=make_iterator_range(begin(lit_col), begin(lit_col)); + m_End=end(lit_col); + increment(); } @@ -180,13 +185,13 @@ namespace boost { */ template inline find_iterator< - BOOST_STRING_TYPENAME range_result_iterator::type> + BOOST_STRING_TYPENAME range_iterator::type> make_find_iterator( RangeT& Collection, FinderT Finder) { - return find_iterator::type>( - begin(Collection), end(Collection), Finder); + return find_iterator::type>( + Collection, Finder); } // split iterator -----------------------------------------------// @@ -278,11 +283,13 @@ namespace boost { RangeT& Col, FinderT Finder ) : detail::find_iterator_base(Finder,0), - m_Match(begin(Col),begin(Col)), - m_Next(begin(Col)), - m_End(end(Col)), m_bEof(false) { + iterator_range::type> lit_col(as_literal(Col)); + m_Match=make_iterator_range(begin(lit_col), begin(lit_col)); + m_Next=begin(lit_col); + m_End=end(lit_col); + increment(); } @@ -356,13 +363,13 @@ namespace boost { */ template inline split_iterator< - BOOST_STRING_TYPENAME range_result_iterator::type> + BOOST_STRING_TYPENAME range_iterator::type> make_split_iterator( RangeT& Collection, FinderT Finder) { - return split_iterator::type>( - begin(Collection), end(Collection), Finder); + return split_iterator::type>( + Collection, Finder); } diff --git a/include/boost/algorithm/string/finder.hpp b/include/boost/algorithm/string/finder.hpp index 6a64369..c936ddb 100644 --- a/include/boost/algorithm/string/finder.hpp +++ b/include/boost/algorithm/string/finder.hpp @@ -1,11 +1,12 @@ // Boost string_algo library finder.hpp header file ---------------------------// -// Copyright Pavol Droba 2002-2006. Use, modification and -// distribution is 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) +// Copyright Pavol Droba 2002-2006. +// +// 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) -// See http://www.boost.org for updates, documentation, and revision history. +// See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_FINDER_HPP #define BOOST_STRING_FINDER_HPP @@ -45,35 +46,35 @@ namespace boost { \param Comp An element comparison predicate \return An instance of the \c first_finder object */ - template + template inline detail::first_finderF< - BOOST_STRING_TYPENAME range_const_iterator::type, + BOOST_STRING_TYPENAME range_const_iterator::type, is_equal> - first_finder( const ContainerT& Search ) + first_finder( const RangeT& Search ) { return detail::first_finderF< BOOST_STRING_TYPENAME - range_const_iterator::type, - is_equal>( Search, is_equal() ) ; + range_const_iterator::type, + is_equal>( as_literal(Search), is_equal() ) ; } //! "First" finder /*! \overload */ - template + template inline detail::first_finderF< - BOOST_STRING_TYPENAME range_const_iterator::type, + BOOST_STRING_TYPENAME range_const_iterator::type, PredicateT> first_finder( - const ContainerT& Search, PredicateT Comp ) + const RangeT& Search, PredicateT Comp ) { return detail::first_finderF< BOOST_STRING_TYPENAME - range_const_iterator::type, - PredicateT>( Search, Comp ); + range_const_iterator::type, + PredicateT>( as_literal(Search), Comp ); } //! "Last" finder @@ -86,33 +87,33 @@ namespace boost { \param Comp An element comparison predicate \return An instance of the \c last_finder object */ - template + template inline detail::last_finderF< - BOOST_STRING_TYPENAME range_const_iterator::type, + BOOST_STRING_TYPENAME range_const_iterator::type, is_equal> - last_finder( const ContainerT& Search ) + last_finder( const RangeT& Search ) { return detail::last_finderF< BOOST_STRING_TYPENAME - range_const_iterator::type, - is_equal>( Search, is_equal() ); + range_const_iterator::type, + is_equal>( as_literal(Search), is_equal() ); } //! "Last" finder /*! \overload */ - template + template inline detail::last_finderF< - BOOST_STRING_TYPENAME range_const_iterator::type, + BOOST_STRING_TYPENAME range_const_iterator::type, PredicateT> - last_finder( const ContainerT& Search, PredicateT Comp ) + last_finder( const RangeT& Search, PredicateT Comp ) { return detail::last_finderF< BOOST_STRING_TYPENAME - range_const_iterator::type, - PredicateT>( Search, Comp ) ; + range_const_iterator::type, + PredicateT>( as_literal(Search), Comp ) ; } //! "Nth" finder @@ -126,38 +127,38 @@ namespace boost { \param Comp An element comparison predicate \return An instance of the \c nth_finder object */ - template + template inline detail::nth_finderF< - BOOST_STRING_TYPENAME range_const_iterator::type, + BOOST_STRING_TYPENAME range_const_iterator::type, is_equal> nth_finder( - const ContainerT& Search, + const RangeT& Search, int Nth) { return detail::nth_finderF< BOOST_STRING_TYPENAME - range_const_iterator::type, - is_equal>( Search, Nth, is_equal() ) ; + range_const_iterator::type, + is_equal>( as_literal(Search), Nth, is_equal() ) ; } //! "Nth" finder /*! \overload */ - template + template inline detail::nth_finderF< - BOOST_STRING_TYPENAME range_const_iterator::type, + BOOST_STRING_TYPENAME range_const_iterator::type, PredicateT> nth_finder( - const ContainerT& Search, + const RangeT& Search, int Nth, PredicateT Comp ) { return detail::nth_finderF< BOOST_STRING_TYPENAME - range_const_iterator::type, - PredicateT>( Search, Nth, Comp ); + range_const_iterator::type, + PredicateT>( as_literal(Search), Nth, Comp ); } //! "Head" finder diff --git a/include/boost/algorithm/string/formatter.hpp b/include/boost/algorithm/string/formatter.hpp index 74234df..e04a50f 100644 --- a/include/boost/algorithm/string/formatter.hpp +++ b/include/boost/algorithm/string/formatter.hpp @@ -1,11 +1,12 @@ // Boost string_algo library formatter.hpp header file ---------------------------// -// Copyright Pavol Droba 2002-2003. Use, modification and -// distribution is 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) +// Copyright Pavol Droba 2002-2003. +// +// 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) -// See http://www.boost.org for updates, documentation, and revision history. +// See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_FORMATTER_HPP #define BOOST_STRING_FORMATTER_HPP @@ -13,6 +14,7 @@ #include #include #include +#include #include @@ -41,10 +43,14 @@ namespace boost { \return An instance of the \c const_formatter object. */ template - inline detail::const_formatF + inline detail::const_formatF< + iterator_range< + BOOST_STRING_TYPENAME range_const_iterator::type> > const_formatter(const RangeT& Format) { - return detail::const_formatF(Format); + return detail::const_formatF< + iterator_range< + BOOST_STRING_TYPENAME range_const_iterator::type> >(as_literal(Format)); } //! Identity formatter @@ -55,10 +61,14 @@ namespace boost { \return An instance of the \c identity_formatter object. */ template - inline detail::identity_formatF + inline detail::identity_formatF< + iterator_range< + BOOST_STRING_TYPENAME range_const_iterator::type> > identity_formatter() { - return detail::identity_formatF(); + return detail::identity_formatF< + iterator_range< + BOOST_STRING_TYPENAME range_const_iterator::type> >(); } //! Empty formatter diff --git a/include/boost/algorithm/string/iter_find.hpp b/include/boost/algorithm/string/iter_find.hpp index c9b51ca..73887a8 100644 --- a/include/boost/algorithm/string/iter_find.hpp +++ b/include/boost/algorithm/string/iter_find.hpp @@ -1,11 +1,12 @@ // Boost string_algo library iter_find.hpp header file ---------------------------// -// Copyright Pavol Droba 2002-2003. Use, modification and -// distribution is 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) +// Copyright Pavol Droba 2002-2003. +// +// 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) -// See http://www.boost.org for updates, documentation, and revision history. +// See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_ITER_FIND_HPP #define BOOST_STRING_ITER_FIND_HPP @@ -18,8 +19,9 @@ #include #include #include -#include +#include #include +#include #include #include @@ -74,24 +76,26 @@ namespace boost { { function_requires< FinderConcept::type> >(); + BOOST_STRING_TYPENAME range_iterator::type> >(); + + iterator_range::type> lit_input(as_literal(Input)); typedef BOOST_STRING_TYPENAME - range_result_iterator::type input_iterator_type; + range_iterator::type input_iterator_type; typedef find_iterator find_iterator_type; typedef detail::copy_iterator_rangeF< BOOST_STRING_TYPENAME range_value::type, input_iterator_type> copy_range_type; - input_iterator_type InputEnd=end(Input); + input_iterator_type InputEnd=end(lit_input); typedef transform_iterator transform_iter_type; transform_iter_type itBegin= make_transform_iterator( - find_iterator_type( begin(Input), InputEnd, Finder ), + find_iterator_type( begin(lit_input), InputEnd, Finder ), copy_range_type()); transform_iter_type itEnd= @@ -141,24 +145,26 @@ namespace boost { { function_requires< FinderConcept::type> >(); + BOOST_STRING_TYPENAME range_iterator::type> >(); + + iterator_range::type> lit_input(as_literal(Input)); typedef BOOST_STRING_TYPENAME - range_result_iterator::type input_iterator_type; + range_iterator::type input_iterator_type; typedef split_iterator find_iterator_type; typedef detail::copy_iterator_rangeF< BOOST_STRING_TYPENAME range_value::type, input_iterator_type> copy_range_type; - input_iterator_type InputEnd=end(Input); + input_iterator_type InputEnd=end(lit_input); typedef transform_iterator transform_iter_type; transform_iter_type itBegin= make_transform_iterator( - find_iterator_type( begin(Input), InputEnd, Finder ), + find_iterator_type( begin(lit_input), InputEnd, Finder ), copy_range_type() ); transform_iter_type itEnd= diff --git a/include/boost/algorithm/string/join.hpp b/include/boost/algorithm/string/join.hpp index b4e0791..d2bc382 100644 --- a/include/boost/algorithm/string/join.hpp +++ b/include/boost/algorithm/string/join.hpp @@ -1,11 +1,12 @@ // Boost string_algo library join.hpp header file ---------------------------// -// Copyright Pavol Droba 2002-2006. Use, modification and -// distribution is 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) +// Copyright Pavol Droba 2002-2006. +// +// 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) -// See http://www.boost.org for updates, documentation, and revision history. +// See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_JOIN_HPP #define BOOST_STRING_JOIN_HPP @@ -13,7 +14,7 @@ #include #include #include - +#include /*! \file Defines join algorithm. @@ -44,7 +45,7 @@ namespace boost { inline typename range_value::type join( const SequenceSequenceT& Input, - Range1T& Separator) + const Range1T& Separator) { // Define working types typedef typename range_value::type ResultT; @@ -67,7 +68,7 @@ namespace boost { for(;itBegin!=itEnd; ++itBegin) { // Add separator - detail::insert(Result, end(Result), Separator); + detail::insert(Result, end(Result), as_literal(Separator)); // Add element detail::insert(Result, end(Result), *itBegin); } @@ -94,7 +95,7 @@ namespace boost { inline typename range_value::type join_if( const SequenceSequenceT& Input, - Range1T& Separator, + const Range1T& Separator, PredicateT Pred) { // Define working types @@ -122,7 +123,7 @@ namespace boost { if(Pred(*itBegin)) { // Add separator - detail::insert(Result, end(Result), Separator); + detail::insert(Result, end(Result), as_literal(Separator)); // Add element detail::insert(Result, end(Result), *itBegin); } diff --git a/include/boost/algorithm/string/predicate.hpp b/include/boost/algorithm/string/predicate.hpp index 41ed456..4edd553 100644 --- a/include/boost/algorithm/string/predicate.hpp +++ b/include/boost/algorithm/string/predicate.hpp @@ -1,11 +1,12 @@ // Boost string_algo library predicate.hpp header file ---------------------------// -// Copyright Pavol Droba 2002-2003. Use, modification and -// distribution is 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) +// Copyright Pavol Droba 2002-2003. +// +// 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) -// See http://www.boost.org for updates, documentation, and revision history. +// See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_PREDICATE_HPP #define BOOST_STRING_PREDICATE_HPP @@ -15,6 +16,8 @@ #include #include #include +#include +#include #include #include @@ -56,16 +59,19 @@ namespace boost { const Range2T& Test, PredicateT Comp) { + iterator_range::type> lit_input(as_literal(Input)); + iterator_range::type> lit_test(as_literal(Test)); + typedef BOOST_STRING_TYPENAME range_const_iterator::type Iterator1T; typedef BOOST_STRING_TYPENAME range_const_iterator::type Iterator2T; - Iterator1T InputEnd=end(Input); - Iterator2T TestEnd=end(Test); + Iterator1T InputEnd=end(lit_input); + Iterator2T TestEnd=end(lit_test); - Iterator1T it=begin(Input); - Iterator2T pit=begin(Test); + Iterator1T it=begin(lit_input); + Iterator2T pit=begin(lit_test); for(; it!=InputEnd && pit!=TestEnd; ++it,++pit) @@ -135,6 +141,9 @@ namespace boost { const Range2T& Test, PredicateT Comp) { + iterator_range::type> lit_input(as_literal(Input)); + iterator_range::type> lit_test(as_literal(Test)); + typedef BOOST_STRING_TYPENAME range_const_iterator::type Iterator1T; typedef BOOST_STRING_TYPENAME boost::detail:: @@ -142,10 +151,10 @@ namespace boost { return detail:: ends_with_iter_select( - begin(Input), - end(Input), - begin(Test), - end(Test), + begin(lit_input), + end(lit_input), + begin(lit_test), + end(lit_test), Comp, category()); } @@ -206,14 +215,17 @@ namespace boost { const Range2T& Test, PredicateT Comp) { - if (empty(Test)) + iterator_range::type> lit_input(as_literal(Input)); + iterator_range::type> lit_test(as_literal(Test)); + + if (empty(lit_test)) { // Empty range is contained always return true; } // Use the temporary variable to make VACPP happy - bool bResult=(first_finder(Test,Comp)(begin(Input), end(Input))); + bool bResult=(first_finder(lit_test,Comp)(begin(lit_input), end(lit_input))); return bResult; } @@ -274,16 +286,19 @@ namespace boost { const Range2T& Test, PredicateT Comp) { + iterator_range::type> lit_input(as_literal(Input)); + iterator_range::type> lit_test(as_literal(Test)); + typedef BOOST_STRING_TYPENAME range_const_iterator::type Iterator1T; typedef BOOST_STRING_TYPENAME range_const_iterator::type Iterator2T; - Iterator1T InputEnd=end(Input); - Iterator2T TestEnd=end(Test); + Iterator1T InputEnd=end(lit_input); + Iterator2T TestEnd=end(lit_test); - Iterator1T it=begin(Input); - Iterator2T pit=begin(Test); + Iterator1T it=begin(lit_input); + Iterator2T pit=begin(lit_test); for(; it!=InputEnd && pit!=TestEnd; ++it,++pit) @@ -357,11 +372,14 @@ namespace boost { const Range2T& Arg2, PredicateT Pred) { + iterator_range::type> lit_arg1(as_literal(Arg1)); + iterator_range::type> lit_arg2(as_literal(Arg2)); + return std::lexicographical_compare( - begin(Arg1), - end(Arg1), - begin(Arg2), - end(Arg2), + begin(lit_arg1), + end(lit_arg1), + begin(lit_arg2), + end(lit_arg2), Pred); } @@ -374,12 +392,7 @@ namespace boost { const Range1T& Arg1, const Range2T& Arg2) { - return std::lexicographical_compare( - begin(Arg1), - end(Arg1), - begin(Arg2), - end(Arg2), - is_less()); + return lexicographical_compare(Arg1, Arg2, is_less()); } //! Lexicographical compare predicate (case-insensitive) @@ -393,6 +406,7 @@ namespace boost { \param Arg1 First argument \param Arg2 Second argument + \param Loc A locale used for case insensitive comparison \return The result of the test \note This function provides the strong exception-safety guarantee @@ -400,14 +414,10 @@ namespace boost { template inline bool ilexicographical_compare( const Range1T& Arg1, - const Range2T& Arg2) + const Range2T& Arg2, + const std::locale& Loc=std::locale()) { - return std::lexicographical_compare( - begin(Arg1), - end(Arg1), - begin(Arg2), - end(Arg2), - is_iless()); + return lexicographical_compare(Arg1, Arg2, is_iless(Loc)); } @@ -429,11 +439,13 @@ namespace boost { const RangeT& Input, PredicateT Pred) { + iterator_range::type> lit_input(as_literal(Input)); + typedef BOOST_STRING_TYPENAME range_const_iterator::type Iterator1T; - Iterator1T InputEnd=end(Input); - for( Iterator1T It=begin(Input); It!=InputEnd; ++It) + Iterator1T InputEnd=end(lit_input); + for( Iterator1T It=begin(lit_input); It!=InputEnd; ++It) { if (!Pred(*It)) return false; diff --git a/include/boost/algorithm/string/predicate_facade.hpp b/include/boost/algorithm/string/predicate_facade.hpp index 70730f8..c8319f7 100644 --- a/include/boost/algorithm/string/predicate_facade.hpp +++ b/include/boost/algorithm/string/predicate_facade.hpp @@ -1,11 +1,12 @@ // Boost string_algo library predicate_facade.hpp header file ---------------------------// -// Copyright Pavol Droba 2002-2003. Use, modification and -// distribution is 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) +// Copyright Pavol Droba 2002-2003. +// +// 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) -// See http://www.boost.org for updates, documentation, and revision history. +// See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_PREDICATE_FACADE_HPP #define BOOST_STRING_PREDICATE_FACADE_HPP diff --git a/include/boost/algorithm/string/regex.hpp b/include/boost/algorithm/string/regex.hpp index 630d117..98a0dfc 100644 --- a/include/boost/algorithm/string/regex.hpp +++ b/include/boost/algorithm/string/regex.hpp @@ -1,11 +1,12 @@ // Boost string_algo library regex.hpp header file ---------------------------// -// Copyright Pavol Droba 2002-2003. Use, modification and -// distribution is 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) +// Copyright Pavol Droba 2002-2003. +// +// 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) -// See http://www.boost.org for updates, documentation, and revision history. +// See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_REGEX_HPP #define BOOST_STRING_REGEX_HPP @@ -16,7 +17,8 @@ #include #include #include -#include +#include +#include #include #include @@ -52,14 +54,16 @@ namespace boost { typename CharT, typename RegexTraitsT> inline iterator_range< - BOOST_STRING_TYPENAME range_result_iterator::type > + BOOST_STRING_TYPENAME range_iterator::type > find_regex( RangeT& Input, const basic_regex& Rx, match_flag_type Flags=match_default ) { + iterator_range::type> lit_input(as_literal(Input)); + return regex_finder(Rx,Flags)( - begin(Input), end(Input) ); + begin(lit_input), end(lit_input) ); } // replace_regex --------------------------------------------------------------------// @@ -502,7 +506,7 @@ namespace boost { inline typename range_value::type join_if( const SequenceSequenceT& Input, - Range1T& Separator, + const Range1T& Separator, const basic_regex& Rx, match_flag_type Flags=match_default ) { @@ -535,7 +539,7 @@ namespace boost { if(regex_match(begin(*itBegin), end(*itBegin), Rx, Flags)) { // Add separator - detail::insert(Result, end(Result), Separator); + detail::insert(Result, end(Result), as_literal(Separator)); // Add element detail::insert(Result, end(Result), *itBegin); } @@ -570,7 +574,7 @@ namespace boost { inline typename range_value::type join_if_regex( const SequenceSequenceT& Input, - Range1T& Separator, + const Range1T& Separator, const basic_regex& Rx, match_flag_type Flags=match_default ) { @@ -584,7 +588,7 @@ namespace boost { // Construct container to hold the result ResultT Result; - + // Roll to the first element that will be added while( @@ -603,7 +607,7 @@ namespace boost { if(regex_match(begin(*itBegin), end(*itBegin), Rx, Flags)) { // Add separator - detail::insert(Result, end(Result), Separator); + detail::insert(Result, end(Result), as_literal(Separator)); // Add element detail::insert(Result, end(Result), *itBegin); } @@ -636,8 +640,6 @@ namespace boost { using algorithm::join_if_regex; #endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING - - } // namespace boost diff --git a/include/boost/algorithm/string/regex_find_format.hpp b/include/boost/algorithm/string/regex_find_format.hpp index 4f28973..f698004 100644 --- a/include/boost/algorithm/string/regex_find_format.hpp +++ b/include/boost/algorithm/string/regex_find_format.hpp @@ -1,11 +1,12 @@ // Boost string_algo library regex_find_format.hpp header file ---------------------------// -// Copyright Pavol Droba 2002-2003. Use, modification and -// distribution is 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) +// Copyright Pavol Droba 2002-2003. +// +// 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) -// See http://www.boost.org for updates, documentation, and revision history. +// See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_REGEX_FIND_FORMAT_HPP #define BOOST_STRING_REGEX_FIND_FORMAT_HPP diff --git a/include/boost/algorithm/string/replace.hpp b/include/boost/algorithm/string/replace.hpp index 8f1a92c..1c59ec7 100644 --- a/include/boost/algorithm/string/replace.hpp +++ b/include/boost/algorithm/string/replace.hpp @@ -1,11 +1,12 @@ // Boost string_algo library replace.hpp header file ---------------------------// -// Copyright Pavol Droba 2002-2006. Use, modification and -// distribution is 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) +// Copyright Pavol Droba 2002-2006. +// +// 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) -// See http://www.boost.org for updates, documentation, and revision history. +// See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_REPLACE_HPP #define BOOST_STRING_REPLACE_HPP diff --git a/include/boost/algorithm/string/sequence_traits.hpp b/include/boost/algorithm/string/sequence_traits.hpp index e53f656..b1ac67e 100644 --- a/include/boost/algorithm/string/sequence_traits.hpp +++ b/include/boost/algorithm/string/sequence_traits.hpp @@ -1,11 +1,12 @@ // Boost string_algo library sequence_traits.hpp header file ---------------------------// -// Copyright Pavol Droba 2002-2003. Use, modification and -// distribution is 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) +// Copyright Pavol Droba 2002-2003. +// +// 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) -// See http://www.boost.org for updates, documentation, and revision history. +// See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_SEQUENCE_TRAITS_HPP #define BOOST_STRING_SEQUENCE_TRAITS_HPP diff --git a/include/boost/algorithm/string/split.hpp b/include/boost/algorithm/string/split.hpp index 71bf43f..f5c323c 100644 --- a/include/boost/algorithm/string/split.hpp +++ b/include/boost/algorithm/string/split.hpp @@ -1,11 +1,12 @@ // Boost string_algo library split.hpp header file ---------------------------// -// Copyright Pavol Droba 2002-2006. Use, modification and -// distribution is 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) +// Copyright Pavol Droba 2002-2006. +// +// 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) -// See http://www.boost.org for updates, documentation, and revision history. +// See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_SPLIT_HPP #define BOOST_STRING_SPLIT_HPP diff --git a/include/boost/algorithm/string/std/list_traits.hpp b/include/boost/algorithm/string/std/list_traits.hpp index e58a66a..ce2379d 100644 --- a/include/boost/algorithm/string/std/list_traits.hpp +++ b/include/boost/algorithm/string/std/list_traits.hpp @@ -1,11 +1,12 @@ // Boost string_algo library list_traits.hpp header file ---------------------------// -// Copyright Pavol Droba 2002-2003. Use, modification and -// distribution is 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) +// Copyright Pavol Droba 2002-2003. +// +// 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) -// See http://www.boost.org for updates, documentation, and revision history. +// See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_STD_LIST_TRAITS_HPP #define BOOST_STRING_STD_LIST_TRAITS_HPP diff --git a/include/boost/algorithm/string/std/rope_traits.hpp b/include/boost/algorithm/string/std/rope_traits.hpp index 98f3451..c2cd549 100644 --- a/include/boost/algorithm/string/std/rope_traits.hpp +++ b/include/boost/algorithm/string/std/rope_traits.hpp @@ -1,11 +1,12 @@ // Boost string_algo library string_traits.hpp header file ---------------------------// -// Copyright Pavol Droba 2002-2003. Use, modification and -// distribution is 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) +// Copyright Pavol Droba 2002-2003. +// +// 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) -// See http://www.boost.org for updates, documentation, and revision history. +// See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_STD_ROPE_TRAITS_HPP #define BOOST_STRING_STD_ROPE_TRAITS_HPP diff --git a/include/boost/algorithm/string/std/slist_traits.hpp b/include/boost/algorithm/string/std/slist_traits.hpp index d05c729..7b915a3 100644 --- a/include/boost/algorithm/string/std/slist_traits.hpp +++ b/include/boost/algorithm/string/std/slist_traits.hpp @@ -1,11 +1,12 @@ // Boost string_algo library slist_traits.hpp header file ---------------------------// -// Copyright Pavol Droba 2002-2003. Use, modification and -// distribution is 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) +// Copyright Pavol Droba 2002-2003. +// +// 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) -// See http://www.boost.org for updates, documentation, and revision history. +// See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_STD_SLIST_TRAITS_HPP #define BOOST_STRING_STD_SLIST_TRAITS_HPP diff --git a/include/boost/algorithm/string/std/string_traits.hpp b/include/boost/algorithm/string/std/string_traits.hpp index d603a4a..c466d26 100644 --- a/include/boost/algorithm/string/std/string_traits.hpp +++ b/include/boost/algorithm/string/std/string_traits.hpp @@ -1,11 +1,12 @@ // Boost string_algo library string_traits.hpp header file ---------------------------// -// Copyright Pavol Droba 2002-2003. Use, modification and -// distribution is 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) +// Copyright Pavol Droba 2002-2003. +// +// 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) -// See http://www.boost.org for updates, documentation, and revision history. +// See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_STD_STRING_TRAITS_HPP #define BOOST_STRING_STD_STRING_TRAITS_HPP diff --git a/include/boost/algorithm/string/std_containers_traits.hpp b/include/boost/algorithm/string/std_containers_traits.hpp index ab0cf3f..3f02246 100644 --- a/include/boost/algorithm/string/std_containers_traits.hpp +++ b/include/boost/algorithm/string/std_containers_traits.hpp @@ -1,11 +1,12 @@ // Boost string_algo library std_containers_traits.hpp header file ---------------------------// -// Copyright Pavol Droba 2002-2003. Use, modification and -// distribution is 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) +// Copyright Pavol Droba 2002-2003. +// +// 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) -// See http://www.boost.org for updates, documentation, and revision history. +// See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_STD_CONTAINERS_TRAITS_HPP #define BOOST_STRING_STD_CONTAINERS_TRAITS_HPP diff --git a/include/boost/algorithm/string/trim.hpp b/include/boost/algorithm/string/trim.hpp index 6a3425b..b2bdc04 100644 --- a/include/boost/algorithm/string/trim.hpp +++ b/include/boost/algorithm/string/trim.hpp @@ -1,11 +1,12 @@ // Boost string_algo library trim.hpp header file ---------------------------// -// Copyright Pavol Droba 2002-2003. Use, modification and -// distribution is 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) +// Copyright Pavol Droba 2002-2003. +// +// 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) -// See http://www.boost.org for updates, documentation, and revision history. +// See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_TRIM_HPP #define BOOST_STRING_TRIM_HPP @@ -15,6 +16,8 @@ #include #include #include +#include +#include #include #include @@ -60,12 +63,14 @@ namespace boost { const RangeT& Input, PredicateT IsSpace) { + iterator_range::type> lit_range(as_literal(Input)); + std::copy( ::boost::algorithm::detail::trim_begin( - begin(Input), - end(Input), + begin(lit_range), + end(lit_range), IsSpace ), - end(Input), + end(lit_range), Output); return Output; @@ -166,11 +171,13 @@ namespace boost { const RangeT& Input, PredicateT IsSpace ) { + iterator_range::type> lit_range(as_literal(Input)); + std::copy( - begin(Input), + begin(lit_range), ::boost::algorithm::detail::trim_end( - begin(Input), - end(Input), + begin(lit_range), + end(lit_range), IsSpace ), Output ); @@ -276,16 +283,18 @@ namespace boost { const RangeT& Input, PredicateT IsSpace) { + iterator_range::type> lit_range(as_literal(Input)); + BOOST_STRING_TYPENAME range_const_iterator::type TrimEnd= ::boost::algorithm::detail::trim_end( - begin(Input), - end(Input), + begin(lit_range), + end(lit_range), IsSpace); std::copy( detail::trim_begin( - begin(Input), TrimEnd, IsSpace), + begin(lit_range), TrimEnd, IsSpace), TrimEnd, Output ); diff --git a/include/boost/algorithm/string/yes_no_type.hpp b/include/boost/algorithm/string/yes_no_type.hpp index dc3da7a..b76cc6c 100644 --- a/include/boost/algorithm/string/yes_no_type.hpp +++ b/include/boost/algorithm/string/yes_no_type.hpp @@ -1,11 +1,12 @@ // Boost string_algo library yes_no_type.hpp header file ---------------------------// -// Copyright Pavol Droba 2002-2003. Use, modification and -// distribution is 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) +// Copyright Pavol Droba 2002-2003. +// +// 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) -// See http://www.boost.org for updates, documentation, and revision history. +// See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_YES_NO_TYPE_DETAIL_HPP #define BOOST_STRING_YES_NO_TYPE_DETAIL_HPP diff --git a/include/boost/algorithm/string_regex.hpp b/include/boost/algorithm/string_regex.hpp index c91b3a7..6fd8ad9 100644 --- a/include/boost/algorithm/string_regex.hpp +++ b/include/boost/algorithm/string_regex.hpp @@ -1,11 +1,12 @@ // Boost string_algo library string_regex.hpp header file ---------------------------// -// Copyright Pavol Droba 2002-2004. Use, modification and -// distribution is 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) +// Copyright Pavol Droba 2002-2004. +// +// 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) -// See http://www.boost.org for updates, documentation, and revision history. +// See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_ALGO_REGEX_HPP #define BOOST_STRING_ALGO_REGEX_HPP From 89c76ea1bb4ab60d3f2be8289e3f7a839f7c9fc6 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Sun, 25 Nov 2007 18:38:02 +0000 Subject: [PATCH 16/20] Full merge from trunk at revision 41356 of entire boost-root tree. [SVN r41370] --- minmax/example/Jamfile | 12 ++++++++++ string/doc/Jamfile.v2 | 2 +- string/doc/concept.xml | 1 - string/doc/credits.xml | 1 - string/doc/design.xml | 1 + string/doc/environment.xml | 1 - string/doc/external_concepts.html | 38 +++++++++++++++++++++++++++++++ string/doc/intro.xml | 1 + string/doc/rationale.xml | 1 - string/doc/string_algo.xml | 2 +- string/doc/usage.xml | 2 ++ string/example/Jamfile | 18 +++++++++++++++ string/index.html | 6 ----- string/test/split_test.cpp | 19 ++++++++++++++++ 14 files changed, 93 insertions(+), 12 deletions(-) create mode 100644 minmax/example/Jamfile create mode 100644 string/doc/external_concepts.html create mode 100644 string/example/Jamfile diff --git a/minmax/example/Jamfile b/minmax/example/Jamfile new file mode 100644 index 0000000..d8650e0 --- /dev/null +++ b/minmax/example/Jamfile @@ -0,0 +1,12 @@ +# Boost.Minmax Library Example Jamfile +# +# Copyright (C) 2002--2004, Herve Bronnimann +# +# Use, modification, and distribution is 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) +# + +exe minmax_ex : minmax_ex.cpp ; +exe minmax_timer : minmax_timer.cpp ; + diff --git a/string/doc/Jamfile.v2 b/string/doc/Jamfile.v2 index f402ba4..ac3a43b 100644 --- a/string/doc/Jamfile.v2 +++ b/string/doc/Jamfile.v2 @@ -10,7 +10,7 @@ import toolset ; toolset.using doxygen ; -boostbook string_algo : string_algo.xml ; +boostbook string_algo : string_algo.xml autodoc ; doxygen autodoc : diff --git a/string/doc/concept.xml b/string/doc/concept.xml index 4829839..1f3c8d1 100644 --- a/string/doc/concept.xml +++ b/string/doc/concept.xml @@ -7,7 +7,6 @@ (See accompanying file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0) --> -
Concepts diff --git a/string/doc/credits.xml b/string/doc/credits.xml index d397660..ff7996f 100644 --- a/string/doc/credits.xml +++ b/string/doc/credits.xml @@ -7,7 +7,6 @@ (See accompanying file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0) --> -
Credits
diff --git a/string/doc/design.xml b/string/doc/design.xml index 30db18c..23d7bd5 100644 --- a/string/doc/design.xml +++ b/string/doc/design.xml @@ -2,6 +2,7 @@ + \ No newline at end of file diff --git a/string/doc/intro.xml b/string/doc/intro.xml index e90d759..42e0923 100644 --- a/string/doc/intro.xml +++ b/string/doc/intro.xml @@ -2,6 +2,7 @@ + -
Rationale diff --git a/string/doc/string_algo.xml b/string/doc/string_algo.xml index ae472b0..2313066 100644 --- a/string/doc/string_algo.xml +++ b/string/doc/string_algo.xml @@ -44,7 +44,7 @@ - + diff --git a/string/doc/usage.xml b/string/doc/usage.xml index c6836b1..f6b8f58 100644 --- a/string/doc/usage.xml +++ b/string/doc/usage.xml @@ -2,11 +2,13 @@ + +
Usage diff --git a/string/example/Jamfile b/string/example/Jamfile new file mode 100644 index 0000000..74c923f --- /dev/null +++ b/string/example/Jamfile @@ -0,0 +1,18 @@ +# Boost string_algo library examples Jamfile --------------------------------- +# +# Copyright Pavol Droba 2002-2003. Use, modification and +# distribution is 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) +# +# See http://www.boost.org for updates, documentation, and revision history. + + +exe conv_example : conv_example.cpp ; +exe predicate_example : predicate_example.cpp ; +exe find_example : find_example.cpp ; +exe replace_example : replace_example.cpp ; +exe rle_example : rle_example.cpp ; +exe trim_example : trim_example.cpp ; +exe regex_example : regex_example.cpp /boost/regex//boost_regex ; +exe split_example : split_example.cpp ; \ No newline at end of file diff --git a/string/index.html b/string/index.html index 3fe4b48..dc0e1b9 100644 --- a/string/index.html +++ b/string/index.html @@ -1,9 +1,3 @@ - - - diff --git a/string/test/split_test.cpp b/string/test/split_test.cpp index f1de543..bb4e1a2 100644 --- a/string/test/split_test.cpp +++ b/string/test/split_test.cpp @@ -122,6 +122,25 @@ void iterator_test() BOOST_CHECK( tokens[2]==string("") ); BOOST_CHECK( tokens[3]==string("xx") ); BOOST_CHECK( tokens[4]==string("abb") ); + + find_iterator fiter=make_find_iterator(str1, first_finder("xx")); + BOOST_CHECK(equals(*fiter, "xx")); + ++fiter; + BOOST_CHECK(equals(*fiter, "xx")); + ++fiter; + BOOST_CHECK(fiter==find_iterator()); + + split_iterator siter=make_split_iterator(str1, token_finder(is_any_of("-"), token_compress_on)); + BOOST_CHECK(equals(*siter, "xx")); + ++siter; + BOOST_CHECK(equals(*siter, "abc")); + ++siter; + BOOST_CHECK(equals(*siter, "xx")); + ++siter; + BOOST_CHECK(equals(*siter, "abb")); + ++siter; + BOOST_CHECK(siter==split_iterator()); + } // test main From 352e16aade14624db0f7ab0ba3197effd8004d29 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sun, 10 Feb 2008 16:39:38 +0000 Subject: [PATCH 17/20] Merged revisions 43206,43208-43213 via svnmerge from https://svn.boost.org/svn/boost/trunk ........ r43206 | danieljames | 2008-02-10 09:55:03 +0000 (Sun, 10 Feb 2008) | 1 line Fix some broken links. ........ r43209 | danieljames | 2008-02-10 14:56:22 +0000 (Sun, 10 Feb 2008) | 1 line Link to people pages on the website, as they've been removed from the download. ........ r43210 | danieljames | 2008-02-10 15:02:17 +0000 (Sun, 10 Feb 2008) | 1 line Point links to the pages that used to be in 'more' to the site. ........ r43212 | danieljames | 2008-02-10 16:10:16 +0000 (Sun, 10 Feb 2008) | 1 line Fix links on the home page as well. ........ r43213 | danieljames | 2008-02-10 16:21:22 +0000 (Sun, 10 Feb 2008) | 1 line Generated documentation which is no longer generated. ........ [SVN r43214] --- string/doc/design.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/string/doc/design.xml b/string/doc/design.xml index 23d7bd5..8701b45 100644 --- a/string/doc/design.xml +++ b/string/doc/design.xml @@ -217,7 +217,7 @@ For more information about the exception safety topics, follow this - link + link
From 822636418b95c60108dec5acf12252ad5927ee17 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Wed, 27 Feb 2008 20:00:24 +0000 Subject: [PATCH 18/20] Merged revisions 43211,43214-43219,43222-43225,43227-43238,43242,43244-43245,43249-43250,43257-43259,43261,43263,43265,43267-43268,43270-43271,43273,43275-43279,43284-43289,43291,43295,43297-43298,43304-43305,43307,43313,43315,43324,43326-43327,43331,43333,43339-43343,43345,43348,43350,43352-43353,43355-43356,43358,43360,43366-43367,43369-43370,43372-43376,43378-43389,43394,43396-43398,43400-43401,43403-43404,43406-43408,43413-43415,43417-43418,43420,43422-43423 via svnmerge from https://svn.boost.org/svn/boost/trunk ........ r43417 | danieljames | 2008-02-26 22:04:55 +0000 (Tue, 26 Feb 2008) | 2 lines Fix a link to Boost.Bimap. ........ r43418 | danieljames | 2008-02-26 22:07:25 +0000 (Tue, 26 Feb 2008) | 2 lines Change another link that's no longer in the repository to link to the website. ........ r43422 | danieljames | 2008-02-27 18:51:14 +0000 (Wed, 27 Feb 2008) | 1 line Fix broken copyright urls. Fixes #1573. ........ r43423 | danieljames | 2008-02-27 19:22:01 +0000 (Wed, 27 Feb 2008) | 1 line Fix incorrect links to copyright of the form 'http:#www.boost.org ........ [SVN r43425] --- string/doc/concept.xml | 2 +- string/doc/credits.xml | 2 +- string/doc/design.xml | 2 +- string/doc/environment.xml | 2 +- string/doc/intro.xml | 2 +- string/doc/quickref.xml | 2 +- string/doc/rationale.xml | 2 +- string/doc/release_notes.xml | 2 +- string/doc/string_algo.xml | 2 +- string/doc/usage.xml | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/string/doc/concept.xml b/string/doc/concept.xml index 1f3c8d1..ed43108 100644 --- a/string/doc/concept.xml +++ b/string/doc/concept.xml @@ -4,7 +4,7 @@
diff --git a/string/doc/credits.xml b/string/doc/credits.xml index ff7996f..6acdf74 100644 --- a/string/doc/credits.xml +++ b/string/doc/credits.xml @@ -4,7 +4,7 @@
diff --git a/string/doc/design.xml b/string/doc/design.xml index 8701b45..980c722 100644 --- a/string/doc/design.xml +++ b/string/doc/design.xml @@ -5,7 +5,7 @@
diff --git a/string/doc/environment.xml b/string/doc/environment.xml index 667b965..4fef5d9 100644 --- a/string/doc/environment.xml +++ b/string/doc/environment.xml @@ -4,7 +4,7 @@
diff --git a/string/doc/intro.xml b/string/doc/intro.xml index 42e0923..47a7e18 100644 --- a/string/doc/intro.xml +++ b/string/doc/intro.xml @@ -5,7 +5,7 @@
diff --git a/string/doc/quickref.xml b/string/doc/quickref.xml index 3c65ae2..0290bd4 100644 --- a/string/doc/quickref.xml +++ b/string/doc/quickref.xml @@ -4,7 +4,7 @@
diff --git a/string/doc/rationale.xml b/string/doc/rationale.xml index fbc65f2..e2d1ab1 100644 --- a/string/doc/rationale.xml +++ b/string/doc/rationale.xml @@ -4,7 +4,7 @@
diff --git a/string/doc/release_notes.xml b/string/doc/release_notes.xml index b40504b..9314064 100644 --- a/string/doc/release_notes.xml +++ b/string/doc/release_notes.xml @@ -4,7 +4,7 @@
diff --git a/string/doc/string_algo.xml b/string/doc/string_algo.xml index 2313066..f803968 100644 --- a/string/doc/string_algo.xml +++ b/string/doc/string_algo.xml @@ -4,7 +4,7 @@ From fc0f3dcffc6add9eb04b53bc00adb742f0ae58c7 Mon Sep 17 00:00:00 2001 From: Pavol Droba Date: Thu, 19 Jun 2008 12:07:24 +0000 Subject: [PATCH 19/20] Cummulative merge of updates from the main trunk [SVN r46505] --- include/boost/algorithm/string.hpp | 1 + .../boost/algorithm/string/classification.hpp | 4 +- include/boost/algorithm/string/concept.hpp | 4 +- .../algorithm/string/detail/case_conv.hpp | 23 +++- .../string/detail/classification.hpp | 128 +++++++++++++++++- .../algorithm/string/detail/find_format.hpp | 14 +- .../string/detail/find_format_all.hpp | 30 ++-- .../string/detail/find_format_store.hpp | 7 + .../boost/algorithm/string/detail/finder.hpp | 12 +- .../algorithm/string/detail/formatter.hpp | 4 +- .../string/detail/replace_storage.hpp | 2 +- .../algorithm/string/detail/sequence.hpp | 6 +- include/boost/algorithm/string/find.hpp | 2 +- .../boost/algorithm/string/find_format.hpp | 12 +- .../boost/algorithm/string/find_iterator.hpp | 24 +--- include/boost/algorithm/string/iter_find.hpp | 8 +- include/boost/algorithm/string/join.hpp | 20 +-- include/boost/algorithm/string/predicate.hpp | 38 +++--- include/boost/algorithm/string/regex.hpp | 30 ++-- include/boost/algorithm/string/trim.hpp | 48 +++---- string/doc/concept.xml | 2 +- string/example/rle_example.cpp | 29 ++-- string/test/predicate_test.cpp | 8 ++ string/test/replace_test.cpp | 1 + 24 files changed, 296 insertions(+), 161 deletions(-) diff --git a/include/boost/algorithm/string.hpp b/include/boost/algorithm/string.hpp index a2f943e..0771517 100644 --- a/include/boost/algorithm/string.hpp +++ b/include/boost/algorithm/string.hpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include diff --git a/include/boost/algorithm/string/classification.hpp b/include/boost/algorithm/string/classification.hpp index a2e2b4d..33ff9be 100644 --- a/include/boost/algorithm/string/classification.hpp +++ b/include/boost/algorithm/string/classification.hpp @@ -202,8 +202,8 @@ namespace boost { BOOST_STRING_TYPENAME range_value::type> is_any_of( const RangeT& Set ) { - return detail::is_any_ofF< - BOOST_STRING_TYPENAME range_value::type>(as_literal(Set)); + iterator_range::type> lit_set(as_literal(Set)); + return detail::is_any_ofF::type>(lit_set); } //! is_from_range predicate diff --git a/include/boost/algorithm/string/concept.hpp b/include/boost/algorithm/string/concept.hpp index 3ebc88c..9876e98 100644 --- a/include/boost/algorithm/string/concept.hpp +++ b/include/boost/algorithm/string/concept.hpp @@ -65,8 +65,8 @@ namespace boost { void constraints() { // Operation - begin((*pFo)( (*pF)(i,i) )); - end((*pFo)( (*pF)(i,i) )); + ::boost::begin((*pFo)( (*pF)(i,i) )); + ::boost::end((*pFo)( (*pF)(i,i) )); } private: IteratorT i; diff --git a/include/boost/algorithm/string/detail/case_conv.hpp b/include/boost/algorithm/string/detail/case_conv.hpp index 0eaad19..5253454 100644 --- a/include/boost/algorithm/string/detail/case_conv.hpp +++ b/include/boost/algorithm/string/detail/case_conv.hpp @@ -21,6 +21,11 @@ namespace boost { // case conversion functors -----------------------------------------------// +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(push) +#pragma warning(disable:4512) //assignment operator could not be generated +#endif + // a tolower functor template struct to_lowerF : public std::unary_function @@ -61,6 +66,10 @@ namespace boost { const std::locale& m_Loc; }; +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(pop) +#endif + // algorithm implementation ------------------------------------------------------------------------- // Transform a range @@ -71,8 +80,8 @@ namespace boost { FunctorT Functor) { return std::transform( - begin(Input), - end(Input), + ::boost::begin(Input), + ::boost::end(Input), Output, Functor); } @@ -84,9 +93,9 @@ namespace boost { FunctorT Functor) { std::transform( - begin(Input), - end(Input), - begin(Input), + ::boost::begin(Input), + ::boost::end(Input), + ::boost::begin(Input), Functor); } @@ -97,10 +106,10 @@ namespace boost { { return SequenceT( make_transform_iterator( - begin(Input), + ::boost::begin(Input), Functor), make_transform_iterator( - end(Input), + ::boost::end(Input), Functor)); } diff --git a/include/boost/algorithm/string/detail/classification.hpp b/include/boost/algorithm/string/detail/classification.hpp index d3139ad..2fa3b6d 100644 --- a/include/boost/algorithm/string/detail/classification.hpp +++ b/include/boost/algorithm/string/detail/classification.hpp @@ -15,7 +15,6 @@ #include #include #include -#include #include #include @@ -29,6 +28,10 @@ namespace boost { // classification functors -----------------------------------------------// +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(push) +#pragma warning(disable:4512) //assignment operator could not be generated +#endif // is_classified functor struct is_classifiedF : public predicate_facade @@ -60,6 +63,10 @@ namespace boost { const std::locale m_Locale; }; +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(pop) +#endif + // is_any_of functor /* returns true if the value is from the specified set @@ -68,25 +75,132 @@ namespace boost { struct is_any_ofF : public predicate_facade > { + private: + // set cannot operate on const value-type + typedef typename remove_const::type set_value_type; + // Size of the static storage (size of pointer*2) + static const ::std::size_t FIXED_STORAGE_SIZE = sizeof(set_value_type*)*2; + + public: // Boost.Lambda support template struct sig { typedef bool type; }; // Constructor template - is_any_ofF( const RangeT& Range ) : - m_Set( begin(Range), end(Range) ) {} + is_any_ofF( const RangeT& Range ) : m_Size(0) + { + // Prepare storage + m_Storage.m_dynSet=0; + + std::size_t Size=::boost::distance(Range); + m_Size=Size; + set_value_type* Storage=0; + + if(m_Size<=FIXED_STORAGE_SIZE) + { + // Use fixed storage + Storage=&m_Storage.m_fixSet[0]; + } + else + { + // Use dynamic storage + m_Storage.m_dynSet=new set_value_type[m_Size]; + Storage=m_Storage.m_dynSet; + } + + // Use fixed storage + ::std::copy(::boost::begin(Range), ::boost::end(Range), Storage); + ::std::sort(Storage, Storage+m_Size); + } + + // Copy constructor + is_any_ofF(const is_any_ofF& Other) : m_Size(Other.m_Size) + { + // Prepare storage + m_Storage.m_dynSet=0; + const set_value_type* SrcStorage=0; + set_value_type* DestStorage=0; + + if(m_Size<=FIXED_STORAGE_SIZE) + { + // Use fixed storage + DestStorage=&m_Storage.m_fixSet[0]; + SrcStorage=&Other.m_Storage.m_fixSet[0]; + } + else + { + // Use dynamic storage + m_Storage.m_dynSet=new set_value_type[m_Size]; + DestStorage=m_Storage.m_dynSet; + SrcStorage=Other.m_Storage.m_dynSet; + } + + // Use fixed storage + ::memcpy(DestStorage, SrcStorage, sizeof(set_value_type)*m_Size); + } + + // Destructor + ~is_any_ofF() + { + if(m_Size>FIXED_STORAGE_SIZE && m_Storage.m_dynSet!=0) + { + delete m_Storage.m_dynSet; + } + } + + // Assignment + is_any_ofF& operator=(const is_any_ofF& Other) + { + // Prepare storage + m_Storage.m_dynSet=0; + m_Size=Other.m_Size; + const set_value_type* SrcStorage=0; + set_value_type* DestStorage=0; + + if(m_Size<=FIXED_STORAGE_SIZE) + { + // Use fixed storage + DestStorage=&m_Storage.m_fixSet[0]; + SrcStorage=&Other.m_Storage.m_fixSet[0]; + } + else + { + // Use dynamic storage + m_Storage.m_dynSet=new set_value_type[m_Size]; + DestStorage=m_Storage.m_dynSet; + SrcStorage=Other.m_Storage.m_dynSet; + } + + // Use fixed storage + ::memcpy(DestStorage, SrcStorage, sizeof(set_value_type)*m_Size); + + return *this; + } // Operation template bool operator()( Char2T Ch ) const { - return m_Set.find(Ch)!=m_Set.end(); + const set_value_type* Storage= + (m_Size<=FIXED_STORAGE_SIZE) + ? &m_Storage.m_fixSet[0] + : m_Storage.m_dynSet; + + return ::std::binary_search(Storage, Storage+m_Size, Ch); } private: - // set cannot operate on const value-type - typedef typename remove_const::type set_value_type; - std::set m_Set; + // storage + // The actual used storage is selected on the type + union + { + set_value_type* m_dynSet; + set_value_type m_fixSet[FIXED_STORAGE_SIZE]; + } + m_Storage; + + // storage size + ::std::size_t m_Size; }; // is_from_range functor diff --git a/include/boost/algorithm/string/detail/find_format.hpp b/include/boost/algorithm/string/detail/find_format.hpp index f1dcc0c..8fb625e 100644 --- a/include/boost/algorithm/string/detail/find_format.hpp +++ b/include/boost/algorithm/string/detail/find_format.hpp @@ -68,17 +68,17 @@ namespace boost { if ( !M ) { // Match not found - return original sequence - std::copy( begin(Input), end(Input), Output ); + std::copy( ::boost::begin(Input), ::boost::end(Input), Output ); return Output; } // Copy the beginning of the sequence - std::copy( begin(Input), begin(M), Output ); + std::copy( ::boost::begin(Input), ::boost::begin(M), Output ); // Format find result // Copy formated result - std::copy( begin(M.format_result()), end(M.format_result()), Output ); + std::copy( ::boost::begin(M.format_result()), ::boost::end(M.format_result()), Output ); // Copy the rest of the sequence - std::copy( M.end(), end(Input), Output ); + std::copy( M.end(), ::boost::end(Input), Output ); return Output; } @@ -129,11 +129,11 @@ namespace boost { InputT Output; // Copy the beginning of the sequence - insert( Output, end(Output), begin(Input), M.begin() ); + insert( Output, ::boost::end(Output), ::boost::begin(Input), M.begin() ); // Copy formated result - insert( Output, end(Output), M.format_result() ); + insert( Output, ::boost::end(Output), M.format_result() ); // Copy the rest of the sequence - insert( Output, end(Output), M.end(), end(Input) ); + insert( Output, ::boost::end(Output), M.end(), ::boost::end(Input) ); return Output; } diff --git a/include/boost/algorithm/string/detail/find_format_all.hpp b/include/boost/algorithm/string/detail/find_format_all.hpp index 28c60b8..9533be6 100644 --- a/include/boost/algorithm/string/detail/find_format_all.hpp +++ b/include/boost/algorithm/string/detail/find_format_all.hpp @@ -73,7 +73,7 @@ namespace boost { store_type M( FindResult, FormatResult, Formatter ); // Initialize last match - input_iterator_type LastMatch=begin(Input); + input_iterator_type LastMatch=::boost::begin(Input); // Iterate through all matches while( M ) @@ -81,15 +81,15 @@ namespace boost { // Copy the beginning of the sequence std::copy( LastMatch, M.begin(), Output ); // Copy formated result - std::copy( begin(M.format_result()), end(M.format_result()), Output ); + std::copy( ::boost::begin(M.format_result()), ::boost::end(M.format_result()), Output ); // Proceed to the next match LastMatch=M.end(); - M=Finder( LastMatch, end(Input) ); + M=Finder( LastMatch, ::boost::end(Input) ); } // Copy the rest of the sequence - std::copy( LastMatch, end(Input), Output ); + std::copy( LastMatch, ::boost::end(Input), Output ); return Output; } @@ -140,7 +140,7 @@ namespace boost { store_type M( FindResult, FormatResult, Formatter ); // Initialize last match - input_iterator_type LastMatch=begin(Input); + input_iterator_type LastMatch=::boost::begin(Input); // Output temporary InputT Output; @@ -149,17 +149,17 @@ namespace boost { while( M ) { // Copy the beginning of the sequence - insert( Output, end(Output), LastMatch, M.begin() ); + insert( Output, ::boost::end(Output), LastMatch, M.begin() ); // Copy formated result - insert( Output, end(Output), M.format_result() ); + insert( Output, ::boost::end(Output), M.format_result() ); // Proceed to the next match LastMatch=M.end(); - M=Finder( LastMatch, end(Input) ); + M=Finder( LastMatch, ::boost::end(Input) ); } // Copy the rest of the sequence - insert( Output, end(Output), LastMatch, end(Input) ); + insert( Output, ::boost::end(Output), LastMatch, ::boost::end(Input) ); return Output; } @@ -213,8 +213,8 @@ namespace boost { BOOST_STRING_TYPENAME range_value::type> Storage; // Initialize replacement iterators - input_iterator_type InsertIt=begin(Input); - input_iterator_type SearchIt=begin(Input); + input_iterator_type InsertIt=::boost::begin(Input); + input_iterator_type SearchIt=::boost::begin(Input); while( M ) { @@ -233,7 +233,7 @@ namespace boost { copy_to_storage( Storage, M.format_result() ); // Find range for a next match - M=Finder( SearchIt, end(Input) ); + M=Finder( SearchIt, ::boost::end(Input) ); } // process the last segment @@ -242,17 +242,17 @@ namespace boost { Input, InsertIt, SearchIt, - end(Input) ); + ::boost::end(Input) ); if ( Storage.empty() ) { // Truncate input - erase( Input, InsertIt, end(Input) ); + erase( Input, InsertIt, ::boost::end(Input) ); } else { // Copy remaining data to the end of input - insert( Input, end(Input), Storage.begin(), Storage.end() ); + insert( Input, ::boost::end(Input), Storage.begin(), Storage.end() ); } } diff --git a/include/boost/algorithm/string/detail/find_format_store.hpp b/include/boost/algorithm/string/detail/find_format_store.hpp index 6dbbcba..2260fc2 100644 --- a/include/boost/algorithm/string/detail/find_format_store.hpp +++ b/include/boost/algorithm/string/detail/find_format_store.hpp @@ -20,6 +20,10 @@ namespace boost { // temporary format and find result storage --------------------------------// +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(push) +#pragma warning(disable:4512) //assignment operator could not be generated +#endif template< typename ForwardIteratorT, typename FormatterT, @@ -64,6 +68,9 @@ namespace boost { const formatter_type& m_Formatter; }; +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +#pragma warning(pop) +#endif } // namespace detail } // namespace algorithm } // namespace boost diff --git a/include/boost/algorithm/string/detail/finder.hpp b/include/boost/algorithm/string/detail/finder.hpp index 194296e..c6d0752 100644 --- a/include/boost/algorithm/string/detail/finder.hpp +++ b/include/boost/algorithm/string/detail/finder.hpp @@ -41,7 +41,7 @@ namespace boost { // Construction template< typename SearchT > first_finderF( const SearchT& Search, PredicateT Comp ) : - m_Search(begin(Search), end(Search)), m_Comp(Comp) {} + m_Search(::boost::begin(Search), ::boost::end(Search)), m_Comp(Comp) {} first_finderF( search_iterator_type SearchBegin, search_iterator_type SearchEnd, @@ -108,7 +108,7 @@ namespace boost { // Construction template< typename SearchT > last_finderF( const SearchT& Search, PredicateT Comp ) : - m_Search(begin(Search), end(Search)), m_Comp(Comp) {} + m_Search(::boost::begin(Search), ::boost::end(Search)), m_Comp(Comp) {} last_finderF( search_iterator_type SearchBegin, search_iterator_type SearchEnd, @@ -154,7 +154,7 @@ namespace boost { while( M ) { Last=M; - M=first_finder( end(M), End ); + M=first_finder( ::boost::end(M), End ); } return Last; @@ -224,7 +224,7 @@ namespace boost { const SearchT& Search, int Nth, PredicateT Comp) : - m_Search(begin(Search), end(Search)), + m_Search(::boost::begin(Search), ::boost::end(Search)), m_Nth(Nth), m_Comp(Comp) {} nth_finderF( @@ -279,7 +279,7 @@ namespace boost { for( unsigned int n=0; n<=N; ++n ) { // find next match - M=first_finder( end(M), End ); + M=first_finder( ::boost::end(M), End ); if ( !M ) { @@ -314,7 +314,7 @@ namespace boost { for( unsigned int n=1; n<=N; ++n ) { // find next match - M=last_finder( Begin, begin(M) ); + M=last_finder( Begin, ::boost::begin(M) ); if ( !M ) { diff --git a/include/boost/algorithm/string/detail/formatter.hpp b/include/boost/algorithm/string/detail/formatter.hpp index 2af1573..bd6a780 100644 --- a/include/boost/algorithm/string/detail/formatter.hpp +++ b/include/boost/algorithm/string/detail/formatter.hpp @@ -39,7 +39,7 @@ namespace boost { public: // Construction const_formatF(const RangeT& Format) : - m_Format(begin(Format), end(Format)) {} + m_Format(::boost::begin(Format), ::boost::end(Format)) {} // Operation #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) @@ -70,7 +70,7 @@ namespace boost { template< typename Range2T > const RangeT& operator()(const Range2T& Replace) const { - return RangeT(begin(Replace), end(Replace)); + return RangeT(::boost::begin(Replace), ::boost::end(Replace)); } }; diff --git a/include/boost/algorithm/string/detail/replace_storage.hpp b/include/boost/algorithm/string/detail/replace_storage.hpp index 759036e..7aff247 100644 --- a/include/boost/algorithm/string/detail/replace_storage.hpp +++ b/include/boost/algorithm/string/detail/replace_storage.hpp @@ -46,7 +46,7 @@ namespace boost { StorageT& Storage, const WhatT& What ) { - Storage.insert( Storage.end(), begin(What), end(What) ); + Storage.insert( Storage.end(), ::boost::begin(What), ::boost::end(What) ); } diff --git a/include/boost/algorithm/string/detail/sequence.hpp b/include/boost/algorithm/string/detail/sequence.hpp index 87d7eab..de01350 100644 --- a/include/boost/algorithm/string/detail/sequence.hpp +++ b/include/boost/algorithm/string/detail/sequence.hpp @@ -41,7 +41,7 @@ namespace boost { BOOST_STRING_TYPENAME InputT::iterator At, const InsertT& Insert ) { - insert( Input, At, begin(Insert), end(Insert) ); + insert( Input, At, ::boost::begin(Insert), ::boost::end(Insert) ); } // erase helper ---------------------------------------------------// @@ -184,11 +184,11 @@ namespace boost { { if(From!=To) { - replace( Input, From, To, begin(Insert), end(Insert) ); + replace( Input, From, To, ::boost::begin(Insert), ::boost::end(Insert) ); } else { - insert( Input, From, begin(Insert), end(Insert) ); + insert( Input, From, ::boost::begin(Insert), ::boost::end(Insert) ); } } diff --git a/include/boost/algorithm/string/find.hpp b/include/boost/algorithm/string/find.hpp index 1f7202d..4196585 100644 --- a/include/boost/algorithm/string/find.hpp +++ b/include/boost/algorithm/string/find.hpp @@ -55,7 +55,7 @@ namespace boost { { iterator_range::type> lit_input(as_literal(Input)); - return Finder(begin(lit_input),end(lit_input)); + return Finder(::boost::begin(lit_input),::boost::end(lit_input)); } // find_first -----------------------------------------------// diff --git a/include/boost/algorithm/string/find_format.hpp b/include/boost/algorithm/string/find_format.hpp index cb3dd7c..7cbaf34 100644 --- a/include/boost/algorithm/string/find_format.hpp +++ b/include/boost/algorithm/string/find_format.hpp @@ -76,7 +76,7 @@ namespace boost { Output, lit_input, Formatter, - Finder( begin(lit_input), end(lit_input) ) ); + Finder( ::boost::begin(lit_input), ::boost::end(lit_input) ) ); } //! Generic replace algorithm @@ -104,7 +104,7 @@ namespace boost { return detail::find_format_copy_impl( Input, Formatter, - Finder(begin(Input), end(Input))); + Finder(::boost::begin(Input), ::boost::end(Input))); } //! Generic replace algorithm @@ -137,7 +137,7 @@ namespace boost { detail::find_format_impl( Input, Formatter, - Finder(begin(Input), end(Input))); + Finder(::boost::begin(Input), ::boost::end(Input))); } @@ -187,7 +187,7 @@ namespace boost { lit_input, Finder, Formatter, - Finder(begin(lit_input), end(lit_input))); + Finder(::boost::begin(lit_input), ::boost::end(lit_input))); } //! Generic replace all algorithm @@ -216,7 +216,7 @@ namespace boost { Input, Finder, Formatter, - Finder( begin(Input), end(Input) ) ); + Finder( ::boost::begin(Input), ::boost::end(Input) ) ); } //! Generic replace all algorithm @@ -251,7 +251,7 @@ namespace boost { Input, Finder, Formatter, - Finder(begin(Input), end(Input))); + Finder(::boost::begin(Input), ::boost::end(Input))); } diff --git a/include/boost/algorithm/string/find_iterator.hpp b/include/boost/algorithm/string/find_iterator.hpp index aba28d8..211b87c 100644 --- a/include/boost/algorithm/string/find_iterator.hpp +++ b/include/boost/algorithm/string/find_iterator.hpp @@ -24,7 +24,7 @@ #include /*! \file - Defines find iterator classes. Find iterator repeatly applies a Finder + Defines find iterator classes. Find iterator repeatedly applies a Finder to the specified input string to search for matches. Dereferencing the iterator yields the current match or a range between the last and the current match depending on the iterator used. @@ -58,12 +58,6 @@ namespace boost { // facade support friend class ::boost::iterator_core_access; - // base type - typedef iterator_facade< - find_iterator, - const iterator_range, - forward_traversal_tag> facade_type; - private: // typedefs @@ -120,8 +114,8 @@ namespace boost { detail::find_iterator_base(Finder,0) { iterator_range::type> lit_col(as_literal(Col)); - m_Match=make_iterator_range(begin(lit_col), begin(lit_col)); - m_End=end(lit_col); + m_Match=make_iterator_range(::boost::begin(lit_col), ::boost::begin(lit_col)); + m_End=::boost::end(lit_col); increment(); } @@ -220,12 +214,6 @@ namespace boost { // facade support friend class ::boost::iterator_core_access; - // base type - typedef iterator_facade< - find_iterator, - iterator_range, - forward_traversal_tag> facade_type; - private: // typedefs @@ -286,9 +274,9 @@ namespace boost { m_bEof(false) { iterator_range::type> lit_col(as_literal(Col)); - m_Match=make_iterator_range(begin(lit_col), begin(lit_col)); - m_Next=begin(lit_col); - m_End=end(lit_col); + m_Match=make_iterator_range(::boost::begin(lit_col), ::boost::begin(lit_col)); + m_Next=::boost::begin(lit_col); + m_End=::boost::end(lit_col); increment(); } diff --git a/include/boost/algorithm/string/iter_find.hpp b/include/boost/algorithm/string/iter_find.hpp index 73887a8..525109b 100644 --- a/include/boost/algorithm/string/iter_find.hpp +++ b/include/boost/algorithm/string/iter_find.hpp @@ -88,14 +88,14 @@ namespace boost { range_value::type, input_iterator_type> copy_range_type; - input_iterator_type InputEnd=end(lit_input); + input_iterator_type InputEnd=::boost::end(lit_input); typedef transform_iterator transform_iter_type; transform_iter_type itBegin= make_transform_iterator( - find_iterator_type( begin(lit_input), InputEnd, Finder ), + find_iterator_type( ::boost::begin(lit_input), InputEnd, Finder ), copy_range_type()); transform_iter_type itEnd= @@ -157,14 +157,14 @@ namespace boost { range_value::type, input_iterator_type> copy_range_type; - input_iterator_type InputEnd=end(lit_input); + input_iterator_type InputEnd=::boost::end(lit_input); typedef transform_iterator transform_iter_type; transform_iter_type itBegin= make_transform_iterator( - find_iterator_type( begin(lit_input), InputEnd, Finder ), + find_iterator_type( ::boost::begin(lit_input), InputEnd, Finder ), copy_range_type() ); transform_iter_type itEnd= diff --git a/include/boost/algorithm/string/join.hpp b/include/boost/algorithm/string/join.hpp index d2bc382..b215598 100644 --- a/include/boost/algorithm/string/join.hpp +++ b/include/boost/algorithm/string/join.hpp @@ -52,8 +52,8 @@ namespace boost { typedef typename range_const_iterator::type InputIteratorT; // Parse input - InputIteratorT itBegin=begin(Input); - InputIteratorT itEnd=end(Input); + InputIteratorT itBegin=::boost::begin(Input); + InputIteratorT itEnd=::boost::end(Input); // Construct container to hold the result ResultT Result; @@ -61,16 +61,16 @@ namespace boost { // Append first element if(itBegin!=itEnd) { - detail::insert(Result, end(Result), *itBegin); + detail::insert(Result, ::boost::end(Result), *itBegin); ++itBegin; } for(;itBegin!=itEnd; ++itBegin) { // Add separator - detail::insert(Result, end(Result), as_literal(Separator)); + detail::insert(Result, ::boost::end(Result), as_literal(Separator)); // Add element - detail::insert(Result, end(Result), *itBegin); + detail::insert(Result, ::boost::end(Result), *itBegin); } return Result; @@ -103,8 +103,8 @@ namespace boost { typedef typename range_const_iterator::type InputIteratorT; // Parse input - InputIteratorT itBegin=begin(Input); - InputIteratorT itEnd=end(Input); + InputIteratorT itBegin=::boost::begin(Input); + InputIteratorT itEnd=::boost::end(Input); // Construct container to hold the result ResultT Result; @@ -114,7 +114,7 @@ namespace boost { // Add this element if(itBegin!=itEnd) { - detail::insert(Result, end(Result), *itBegin); + detail::insert(Result, ::boost::end(Result), *itBegin); ++itBegin; } @@ -123,9 +123,9 @@ namespace boost { if(Pred(*itBegin)) { // Add separator - detail::insert(Result, end(Result), as_literal(Separator)); + detail::insert(Result, ::boost::end(Result), as_literal(Separator)); // Add element - detail::insert(Result, end(Result), *itBegin); + detail::insert(Result, ::boost::end(Result), *itBegin); } } diff --git a/include/boost/algorithm/string/predicate.hpp b/include/boost/algorithm/string/predicate.hpp index 4edd553..8b62086 100644 --- a/include/boost/algorithm/string/predicate.hpp +++ b/include/boost/algorithm/string/predicate.hpp @@ -67,11 +67,11 @@ namespace boost { typedef BOOST_STRING_TYPENAME range_const_iterator::type Iterator2T; - Iterator1T InputEnd=end(lit_input); - Iterator2T TestEnd=end(lit_test); + Iterator1T InputEnd=::boost::end(lit_input); + Iterator2T TestEnd=::boost::end(lit_test); - Iterator1T it=begin(lit_input); - Iterator2T pit=begin(lit_test); + Iterator1T it=::boost::begin(lit_input); + Iterator2T pit=::boost::begin(lit_test); for(; it!=InputEnd && pit!=TestEnd; ++it,++pit) @@ -151,10 +151,10 @@ namespace boost { return detail:: ends_with_iter_select( - begin(lit_input), - end(lit_input), - begin(lit_test), - end(lit_test), + ::boost::begin(lit_input), + ::boost::end(lit_input), + ::boost::begin(lit_test), + ::boost::end(lit_test), Comp, category()); } @@ -225,7 +225,7 @@ namespace boost { } // Use the temporary variable to make VACPP happy - bool bResult=(first_finder(lit_test,Comp)(begin(lit_input), end(lit_input))); + bool bResult=(first_finder(lit_test,Comp)(::boost::begin(lit_input), ::boost::end(lit_input))); return bResult; } @@ -294,11 +294,11 @@ namespace boost { typedef BOOST_STRING_TYPENAME range_const_iterator::type Iterator2T; - Iterator1T InputEnd=end(lit_input); - Iterator2T TestEnd=end(lit_test); + Iterator1T InputEnd=::boost::end(lit_input); + Iterator2T TestEnd=::boost::end(lit_test); - Iterator1T it=begin(lit_input); - Iterator2T pit=begin(lit_test); + Iterator1T it=::boost::begin(lit_input); + Iterator2T pit=::boost::begin(lit_test); for(; it!=InputEnd && pit!=TestEnd; ++it,++pit) @@ -376,10 +376,10 @@ namespace boost { iterator_range::type> lit_arg2(as_literal(Arg2)); return std::lexicographical_compare( - begin(lit_arg1), - end(lit_arg1), - begin(lit_arg2), - end(lit_arg2), + ::boost::begin(lit_arg1), + ::boost::end(lit_arg1), + ::boost::begin(lit_arg2), + ::boost::end(lit_arg2), Pred); } @@ -444,8 +444,8 @@ namespace boost { typedef BOOST_STRING_TYPENAME range_const_iterator::type Iterator1T; - Iterator1T InputEnd=end(lit_input); - for( Iterator1T It=begin(lit_input); It!=InputEnd; ++It) + Iterator1T InputEnd=::boost::end(lit_input); + for( Iterator1T It=::boost::begin(lit_input); It!=InputEnd; ++It) { if (!Pred(*It)) return false; diff --git a/include/boost/algorithm/string/regex.hpp b/include/boost/algorithm/string/regex.hpp index 98a0dfc..b723204 100644 --- a/include/boost/algorithm/string/regex.hpp +++ b/include/boost/algorithm/string/regex.hpp @@ -63,7 +63,7 @@ namespace boost { iterator_range::type> lit_input(as_literal(Input)); return regex_finder(Rx,Flags)( - begin(lit_input), end(lit_input) ); + ::boost::begin(lit_input), ::boost::end(lit_input) ); } // replace_regex --------------------------------------------------------------------// @@ -515,8 +515,8 @@ namespace boost { typedef typename range_const_iterator::type InputIteratorT; // Parse input - InputIteratorT itBegin=begin(Input); - InputIteratorT itEnd=end(Input); + InputIteratorT itBegin=::boost::begin(Input); + InputIteratorT itEnd=::boost::end(Input); // Construct container to hold the result ResultT Result; @@ -525,23 +525,23 @@ namespace boost { // Roll to the first element that will be added while( itBegin!=itEnd && - !regex_match(begin(*itBegin), end(*itBegin), Rx, Flags)) ++itBegin; + !regex_match(::boost::begin(*itBegin), ::boost::end(*itBegin), Rx, Flags)) ++itBegin; // Add this element if(itBegin!=itEnd) { - detail::insert(Result, end(Result), *itBegin); + detail::insert(Result, ::boost::end(Result), *itBegin); ++itBegin; } for(;itBegin!=itEnd; ++itBegin) { - if(regex_match(begin(*itBegin), end(*itBegin), Rx, Flags)) + if(regex_match(::boost::begin(*itBegin), ::boost::end(*itBegin), Rx, Flags)) { // Add separator - detail::insert(Result, end(Result), as_literal(Separator)); + detail::insert(Result, ::boost::end(Result), as_literal(Separator)); // Add element - detail::insert(Result, end(Result), *itBegin); + detail::insert(Result, ::boost::end(Result), *itBegin); } } @@ -583,8 +583,8 @@ namespace boost { typedef typename range_const_iterator::type InputIteratorT; // Parse input - InputIteratorT itBegin=begin(Input); - InputIteratorT itEnd=end(Input); + InputIteratorT itBegin=::boost::begin(Input); + InputIteratorT itEnd=::boost::end(Input); // Construct container to hold the result ResultT Result; @@ -593,23 +593,23 @@ namespace boost { // Roll to the first element that will be added while( itBegin!=itEnd && - !regex_match(begin(*itBegin), end(*itBegin), Rx, Flags)) ++itBegin; + !regex_match(::boost::begin(*itBegin), ::boost::end(*itBegin), Rx, Flags)) ++itBegin; // Add this element if(itBegin!=itEnd) { - detail::insert(Result, end(Result), *itBegin); + detail::insert(Result, ::boost::end(Result), *itBegin); ++itBegin; } for(;itBegin!=itEnd; ++itBegin) { - if(regex_match(begin(*itBegin), end(*itBegin), Rx, Flags)) + if(regex_match(::boost::begin(*itBegin), ::boost::end(*itBegin), Rx, Flags)) { // Add separator - detail::insert(Result, end(Result), as_literal(Separator)); + detail::insert(Result, ::boost::end(Result), as_literal(Separator)); // Add element - detail::insert(Result, end(Result), *itBegin); + detail::insert(Result, ::boost::end(Result), *itBegin); } } diff --git a/include/boost/algorithm/string/trim.hpp b/include/boost/algorithm/string/trim.hpp index b2bdc04..177ed1b 100644 --- a/include/boost/algorithm/string/trim.hpp +++ b/include/boost/algorithm/string/trim.hpp @@ -67,10 +67,10 @@ namespace boost { std::copy( ::boost::algorithm::detail::trim_begin( - begin(lit_range), - end(lit_range), + ::boost::begin(lit_range), + ::boost::end(lit_range), IsSpace ), - end(lit_range), + ::boost::end(lit_range), Output); return Output; @@ -85,10 +85,10 @@ namespace boost { { return SequenceT( ::boost::algorithm::detail::trim_begin( - begin(Input), - end(Input), + ::boost::begin(Input), + ::boost::end(Input), IsSpace ), - end(Input)); + ::boost::end(Input)); } //! Left trim - parametric @@ -124,10 +124,10 @@ namespace boost { inline void trim_left_if(SequenceT& Input, PredicateT IsSpace) { Input.erase( - begin(Input), + ::boost::begin(Input), ::boost::algorithm::detail::trim_begin( - begin(Input), - end(Input), + ::boost::begin(Input), + ::boost::end(Input), IsSpace)); } @@ -174,10 +174,10 @@ namespace boost { iterator_range::type> lit_range(as_literal(Input)); std::copy( - begin(lit_range), + ::boost::begin(lit_range), ::boost::algorithm::detail::trim_end( - begin(lit_range), - end(lit_range), + ::boost::begin(lit_range), + ::boost::end(lit_range), IsSpace ), Output ); @@ -192,10 +192,10 @@ namespace boost { inline SequenceT trim_right_copy_if(const SequenceT& Input, PredicateT IsSpace) { return SequenceT( - begin(Input), + ::boost::begin(Input), ::boost::algorithm::detail::trim_end( - begin(Input), - end(Input), + ::boost::begin(Input), + ::boost::end(Input), IsSpace) ); } @@ -235,10 +235,10 @@ namespace boost { { Input.erase( ::boost::algorithm::detail::trim_end( - begin(Input), - end(Input), + ::boost::begin(Input), + ::boost::end(Input), IsSpace ), - end(Input) + ::boost::end(Input) ); } @@ -288,13 +288,13 @@ namespace boost { BOOST_STRING_TYPENAME range_const_iterator::type TrimEnd= ::boost::algorithm::detail::trim_end( - begin(lit_range), - end(lit_range), + ::boost::begin(lit_range), + ::boost::end(lit_range), IsSpace); std::copy( detail::trim_begin( - begin(lit_range), TrimEnd, IsSpace), + ::boost::begin(lit_range), TrimEnd, IsSpace), TrimEnd, Output ); @@ -312,13 +312,13 @@ namespace boost { BOOST_STRING_TYPENAME range_const_iterator::type TrimEnd= ::boost::algorithm::detail::trim_end( - begin(Input), - end(Input), + ::boost::begin(Input), + ::boost::end(Input), IsSpace); return SequenceT( detail::trim_begin( - begin(Input), + ::boost::begin(Input), TrimEnd, IsSpace), TrimEnd diff --git a/string/doc/concept.xml b/string/doc/concept.xml index ed43108..fd432c2 100644 --- a/string/doc/concept.xml +++ b/string/doc/concept.xml @@ -102,7 +102,7 @@ struct simple_finder { template<typename ForwardIteratorT> - boost::iterator_range<ForwardIterator> operator()( + boost::iterator_range<ForwardIteratorT> operator()( ForwardIteratorT Begin, ForwardIteratorT End ) { diff --git a/string/example/rle_example.cpp b/string/example/rle_example.cpp index 26ec5b8..9e52b96 100644 --- a/string/example/rle_example.cpp +++ b/string/example/rle_example.cpp @@ -114,10 +114,13 @@ public: result_type operator()( const ReplaceT& Replace ) const { SeqT r; - r.push_back( repeat_mark() ); - r.push_back( *(Replace.begin()) ); - r.push_back( value_type( Replace.size() ) ); - + if(!Replace.empty()) + { + r.push_back( repeat_mark() ); + r.push_back( *(Replace.begin()) ); + r.push_back( value_type( Replace.size() ) ); + } + return r; } }; @@ -183,14 +186,18 @@ public: template< typename ReplaceT > result_type operator()( const ReplaceT& Replace ) const { - // extract info - typename ReplaceT::const_iterator It=Replace.begin(); - - value_type Value=*(++It); - value_type Repeat=*(++It); - SeqT r; - for( value_type Index=0; Index Date: Tue, 7 Oct 2008 21:59:57 +0000 Subject: [PATCH 20/20] Memory management fixes for is_any_of predicate merged from the trunk [SVN r49172] --- .../string/detail/classification.hpp | 101 ++++++++++++------ string/test/predicate_test.cpp | 23 +++- 2 files changed, 92 insertions(+), 32 deletions(-) diff --git a/include/boost/algorithm/string/detail/classification.hpp b/include/boost/algorithm/string/detail/classification.hpp index 2fa3b6d..1db5d29 100644 --- a/include/boost/algorithm/string/detail/classification.hpp +++ b/include/boost/algorithm/string/detail/classification.hpp @@ -28,11 +28,7 @@ namespace boost { // classification functors -----------------------------------------------// -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(push) -#pragma warning(disable:4512) //assignment operator could not be generated -#endif - // is_classified functor + // is_classified functor struct is_classifiedF : public predicate_facade { @@ -42,7 +38,6 @@ namespace boost { // Constructor from a locale is_classifiedF(std::ctype_base::mask Type, std::locale const & Loc = std::locale()) : m_Type(Type), m_Locale(Loc) {} - // Operation template bool operator()( CharT Ch ) const @@ -59,13 +54,10 @@ namespace boost { #endif private: - const std::ctype_base::mask m_Type; - const std::locale m_Locale; + std::ctype_base::mask m_Type; + std::locale m_Locale; }; -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(pop) -#endif // is_any_of functor /* @@ -77,9 +69,7 @@ namespace boost { { private: // set cannot operate on const value-type - typedef typename remove_const::type set_value_type; - // Size of the static storage (size of pointer*2) - static const ::std::size_t FIXED_STORAGE_SIZE = sizeof(set_value_type*)*2; + typedef typename ::boost::remove_const::type set_value_type; public: // Boost.Lambda support @@ -96,7 +86,7 @@ namespace boost { m_Size=Size; set_value_type* Storage=0; - if(m_Size<=FIXED_STORAGE_SIZE) + if(use_fixed_storage(m_Size)) { // Use fixed storage Storage=&m_Storage.m_fixSet[0]; @@ -121,7 +111,7 @@ namespace boost { const set_value_type* SrcStorage=0; set_value_type* DestStorage=0; - if(m_Size<=FIXED_STORAGE_SIZE) + if(use_fixed_storage(m_Size)) { // Use fixed storage DestStorage=&m_Storage.m_fixSet[0]; @@ -142,36 +132,80 @@ namespace boost { // Destructor ~is_any_ofF() { - if(m_Size>FIXED_STORAGE_SIZE && m_Storage.m_dynSet!=0) + if(!use_fixed_storage(m_Size) && m_Storage.m_dynSet!=0) { - delete m_Storage.m_dynSet; + delete [] m_Storage.m_dynSet; } } // Assignment is_any_ofF& operator=(const is_any_ofF& Other) { - // Prepare storage - m_Storage.m_dynSet=0; - m_Size=Other.m_Size; - const set_value_type* SrcStorage=0; - set_value_type* DestStorage=0; + // Handle self assignment + if(this==&Other) return *this; - if(m_Size<=FIXED_STORAGE_SIZE) + // Prepare storage + const set_value_type* SrcStorage; + set_value_type* DestStorage; + + if(use_fixed_storage(Other.m_Size)) { // Use fixed storage DestStorage=&m_Storage.m_fixSet[0]; SrcStorage=&Other.m_Storage.m_fixSet[0]; + + // Delete old storage if was present + if(!use_fixed_storage(m_Size) && m_Storage.m_dynSet!=0) + { + delete [] m_Storage.m_dynSet; + } + + // Set new size + m_Size=Other.m_Size; } else { - // Use dynamic storage - m_Storage.m_dynSet=new set_value_type[m_Size]; - DestStorage=m_Storage.m_dynSet; + // Other uses dynamic storage SrcStorage=Other.m_Storage.m_dynSet; + + // Check what kind of storage are we using right now + if(use_fixed_storage(m_Size)) + { + // Using fixed storage, allocate new + set_value_type* pTemp=new set_value_type[Other.m_Size]; + DestStorage=pTemp; + m_Storage.m_dynSet=pTemp; + m_Size=Other.m_Size; + } + else + { + // Using dynamic storage, check if can reuse + if(m_Storage.m_dynSet!=0 && m_Size>=Other.m_Size && m_Size +void test_pred(const Pred& pred, const Input& input, bool bYes) +{ + // test assignment operator + Pred pred1=pred; + pred1=pred; + pred1=pred1; + if(bYes) + { + BOOST_CHECK( all( input, pred ) ); + BOOST_CHECK( all( input, pred1 ) ); + } + else + { + BOOST_CHECK( !all( input, pred ) ); + BOOST_CHECK( !all( input, pred1 ) ); + } +} + #define TEST_CLASS( Pred, YesInput, NoInput )\ {\ - BOOST_CHECK( all( string(YesInput), Pred ) );\ - BOOST_CHECK( !all( string(NoInput), Pred ) );\ + test_pred(Pred, YesInput, true); \ + test_pred(Pred, NoInput, false); \ } void classification_test()