Compare commits

..

32 Commits

Author SHA1 Message Date
300bb14514 Branch at revision 46530
[SVN r46531]
2008-06-19 18:57:10 +00:00
7299b29bf8 fixind the problems in is_any_ofF spotted by gcc
[SVN r46498]
2008-06-18 22:07:32 +00:00
539c170b9d aditional tests added
[SVN r46497]
2008-06-18 21:55:38 +00:00
c81ee948b7 is_any_ofF performance improvements
tabs removed



[SVN r46496]
2008-06-18 21:54:06 +00:00
ba5e4c30c6 fixed the rle example crash
[SVN r46463]
2008-06-17 21:58:58 +00:00
cd26ed816c patch from ticket #1152 applied
[SVN r46461]
2008-06-17 21:21:33 +00:00
4e15767bed simple_finder example fixed
[SVN r46460]
2008-06-17 21:13:25 +00:00
9fa2f90db4 begin() and end() calls made fully qualified
[SVN r46459]
2008-06-17 21:04:00 +00:00
35f317aeac unnecessary typedefs removed
[SVN r46458]
2008-06-17 20:31:41 +00:00
d0a03fdb4e Added missing include. This was already fixed on the 1.34 branch but never merged to the trunk.
[SVN r45857]
2008-05-28 08:32:12 +00:00
346f032be2 Quote href values - our tools don't support unquoted values.
[SVN r45283]
2008-05-11 13:49:20 +00:00
a389d768c4 Fix broken copyright urls. Fixes #1573.
[SVN r43422]
2008-02-27 18:51:14 +00:00
90fca39906 Point links to the pages that used to be in 'more' to the site.
[SVN r43210]
2008-02-10 15:02:17 +00:00
5b24f31486 merging changes from 1.34
[SVN r40698]
2007-11-02 21:00:08 +00:00
b25d6511b3 merging changes from 1.34
[SVN r40697]
2007-11-02 20:55:26 +00:00
1541a554f5 changed range_result_iterator to range_iterator
[SVN r40518]
2007-10-27 22:52:29 +00:00
7a97b3390e Added missing include.
[SVN r39586]
2007-09-28 07:19:29 +00:00
6e5a7497ae Added missing include.
[SVN r39519]
2007-09-25 08:46:31 +00:00
f0b8b60379 Update
[SVN r38522]
2007-08-08 19:24:04 +00:00
66019abb2f Update
[SVN r38521]
2007-08-08 19:23:38 +00:00
8758222006 Remove V1 Jamfiles
[SVN r38516]
2007-08-08 19:02:26 +00:00
4eef56761a find/split iterator tests added
[SVN r38126]
2007-07-01 22:24:29 +00:00
b94a3fbfba adapting to new range interface
[SVN r38125]
2007-07-01 22:23:55 +00:00
614cc2ebab adapting to new range interface
[SVN r38123]
2007-07-01 13:29:56 +00:00
869660ed14 adapted to the new range interface
[SVN r38122]
2007-07-01 13:12:57 +00:00
777f30780e Fix broken build of docs, it was missing a dependency to the doxygen docs.
[SVN r37466]
2007-04-17 17:19:25 +00:00
26aa37733b Fix a few more references to *.boosbook instead of *.xml generated files.
[SVN r37465]
2007-04-17 17:13:35 +00:00
f1e60579c2 documentation typo fixed
[SVN r36843]
2007-01-30 07:59:28 +00:00
389dd3c863 Add copyright, license
[SVN r35905]
2006-11-07 19:11:57 +00:00
f23f61ae9b License added to the xml doc files
[SVN r34895]
2006-08-16 07:17:49 +00:00
608112b112 boost guidelines (mainly from inspect tool: tabs, license reference text, etc.)
[SVN r34752]
2006-07-27 10:27:37 +00:00
b21b54dc4e Applying patch from Nicola Musatti
[SVN r33709]
2006-04-16 09:46:34 +00:00
8 changed files with 36 additions and 139 deletions

View File

@ -1,20 +0,0 @@
#----------------------------------------------------------------------------
# This file was automatically generated from the original CMakeLists.txt file
# Add a variable to hold the headers for the library
set (lib_headers
algorithm
)
# Add a library target to the build system
boost_library_project(
algorithm
# SRCDIRS
TESTDIRS minmax/test string/test
HEADERS ${lib_headers}
# DOCDIRS
DESCRIPTION "A library of various algorithms."
MODULARIZED
AUTHORS "Pavol Droba <droba -at- topmail.sk>"
"Herve Bronnimann <hbr -at- poly.edu>"
# MAINTAINERS
)

View File

@ -28,6 +28,10 @@ namespace boost {
// classification functors -----------------------------------------------// // 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 : struct is_classifiedF :
public predicate_facade<is_classifiedF> public predicate_facade<is_classifiedF>
@ -38,6 +42,7 @@ namespace boost {
// Constructor from a locale // Constructor from a locale
is_classifiedF(std::ctype_base::mask Type, std::locale const & Loc = std::locale()) : is_classifiedF(std::ctype_base::mask Type, std::locale const & Loc = std::locale()) :
m_Type(Type), m_Locale(Loc) {} m_Type(Type), m_Locale(Loc) {}
// Operation // Operation
template<typename CharT> template<typename CharT>
bool operator()( CharT Ch ) const bool operator()( CharT Ch ) const
@ -54,10 +59,13 @@ namespace boost {
#endif #endif
private: private:
std::ctype_base::mask m_Type; const std::ctype_base::mask m_Type;
std::locale m_Locale; const std::locale m_Locale;
}; };
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
#pragma warning(pop)
#endif
// is_any_of functor // is_any_of functor
/* /*
@ -69,7 +77,9 @@ namespace boost {
{ {
private: private:
// set cannot operate on const value-type // set cannot operate on const value-type
typedef typename ::boost::remove_const<CharT>::type set_value_type; typedef typename remove_const<CharT>::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: public:
// Boost.Lambda support // Boost.Lambda support
@ -86,7 +96,7 @@ namespace boost {
m_Size=Size; m_Size=Size;
set_value_type* Storage=0; set_value_type* Storage=0;
if(use_fixed_storage(m_Size)) if(m_Size<=FIXED_STORAGE_SIZE)
{ {
// Use fixed storage // Use fixed storage
Storage=&m_Storage.m_fixSet[0]; Storage=&m_Storage.m_fixSet[0];
@ -111,7 +121,7 @@ namespace boost {
const set_value_type* SrcStorage=0; const set_value_type* SrcStorage=0;
set_value_type* DestStorage=0; set_value_type* DestStorage=0;
if(use_fixed_storage(m_Size)) if(m_Size<=FIXED_STORAGE_SIZE)
{ {
// Use fixed storage // Use fixed storage
DestStorage=&m_Storage.m_fixSet[0]; DestStorage=&m_Storage.m_fixSet[0];
@ -132,80 +142,36 @@ namespace boost {
// Destructor // Destructor
~is_any_ofF() ~is_any_ofF()
{ {
if(!use_fixed_storage(m_Size) && m_Storage.m_dynSet!=0) if(m_Size>FIXED_STORAGE_SIZE && m_Storage.m_dynSet!=0)
{ {
delete [] m_Storage.m_dynSet; delete m_Storage.m_dynSet;
} }
} }
// Assignment // Assignment
is_any_ofF& operator=(const is_any_ofF& Other) is_any_ofF& operator=(const is_any_ofF& Other)
{ {
// Handle self assignment
if(this==&Other) return *this;
// Prepare storage // Prepare storage
const set_value_type* SrcStorage; m_Storage.m_dynSet=0;
set_value_type* DestStorage; m_Size=Other.m_Size;
const set_value_type* SrcStorage=0;
set_value_type* DestStorage=0;
if(use_fixed_storage(Other.m_Size)) if(m_Size<=FIXED_STORAGE_SIZE)
{ {
// Use fixed storage // Use fixed storage
DestStorage=&m_Storage.m_fixSet[0]; DestStorage=&m_Storage.m_fixSet[0];
SrcStorage=&Other.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 else
{ {
// Other uses dynamic storage // Use dynamic storage
SrcStorage=Other.m_Storage.m_dynSet; m_Storage.m_dynSet=new set_value_type[m_Size];
// 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<Other.m_Size*2)
{
// Reuse the current storage
DestStorage=m_Storage.m_dynSet; DestStorage=m_Storage.m_dynSet;
m_Size=Other.m_Size; SrcStorage=Other.m_Storage.m_dynSet;
}
else
{
// Allocate the new one
set_value_type* pTemp=new set_value_type[Other.m_Size];
DestStorage=pTemp;
// Delete old storage if necessary
if(m_Storage.m_dynSet!=0)
{
delete [] m_Storage.m_dynSet;
}
// Store the new storage
m_Storage.m_dynSet=pTemp;
// Set new size
m_Size=Other.m_Size;
}
}
} }
// Copy the data // Use fixed storage
::memcpy(DestStorage, SrcStorage, sizeof(set_value_type)*m_Size); ::memcpy(DestStorage, SrcStorage, sizeof(set_value_type)*m_Size);
return *this; return *this;
@ -216,19 +182,12 @@ namespace boost {
bool operator()( Char2T Ch ) const bool operator()( Char2T Ch ) const
{ {
const set_value_type* Storage= const set_value_type* Storage=
(use_fixed_storage(m_Size)) (m_Size<=FIXED_STORAGE_SIZE)
? &m_Storage.m_fixSet[0] ? &m_Storage.m_fixSet[0]
: m_Storage.m_dynSet; : m_Storage.m_dynSet;
return ::std::binary_search(Storage, Storage+m_Size, Ch); return ::std::binary_search(Storage, Storage+m_Size, Ch);
} }
private:
// check if the size is eligible for fixed storage
static bool use_fixed_storage(std::size_t size)
{
return size<=sizeof(set_value_type*)*2;
}
private: private:
// storage // storage
@ -236,7 +195,7 @@ namespace boost {
union union
{ {
set_value_type* m_dynSet; set_value_type* m_dynSet;
set_value_type m_fixSet[sizeof(set_value_type*)*2]; set_value_type m_fixSet[FIXED_STORAGE_SIZE];
} }
m_Storage; m_Storage;

View File

@ -158,9 +158,9 @@ identical to
that they return the last instance of the largest element (and not the that they return the last instance of the largest element (and not the
first, as <tt>first_min_element</tt> and <tt>last_max_element</tt> would). first, as <tt>first_min_element</tt> and <tt>last_max_element</tt> would).
<p>The family of algorithms comprising <tt>first_min_first_max_element</tt>, <p>The family of algorithms comprising <tt>first_min_first_max_element</tt>,
<tt>first_min_last_max_element</tt>, <tt>first_min_first_max_element</tt>,
<tt>last_min_first_max_element</tt>, <tt>first_min_first_max_element</tt>,
and <tt>last_min_last_max_element</tt> can be described generically as and <tt>first_min_first_max_element</tt> can be described generically as
follows (using <i><tt>which</tt></i> and follows (using <i><tt>which</tt></i> and
<i><tt>what</tt></i> for <tt>first</tt> <i><tt>what</tt></i> for <tt>first</tt>
or <tt>last</tt>): <tt><i>which</i>_min_<i>what</i>_max_element</tt> finds or <tt>last</tt>): <tt><i>which</i>_min_<i>what</i>_max_element</tt> finds

View File

@ -1,4 +0,0 @@
boost_additional_test_dependencies(algorithm BOOST_DEPENDS test)
boost_test_run(minmax_element_test)
boost_test_run(minmax_test)

View File

@ -1,4 +0,0 @@
boost_module(algorithm DEPENDS regex concept_check range)

View File

@ -10,10 +10,7 @@
import toolset ; import toolset ;
toolset.using doxygen ; toolset.using doxygen ;
boostbook string_algo : string_algo.xml autodoc boostbook string_algo : string_algo.xml autodoc ;
:
<format>pdf:<xsl:param>boost.url.prefix=http://www.boost.org/doc/libs/release/doc/html
;
doxygen autodoc doxygen autodoc
: :

View File

@ -1,12 +0,0 @@
boost_additional_test_dependencies(algorithm BOOST_DEPENDS test)
boost_test_run(trim_test)
boost_test_run(conv_test)
boost_test_run(predicate_test)
boost_test_run(find_test)
boost_test_run(split_test)
boost_test_run(join_test)
boost_test_run(replace_test)
boost_test_run(regex_test DEPENDS boost_regex SHARED)

View File

@ -96,29 +96,10 @@ void predicate_test()
} }
template<typename Pred, typename Input>
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 )\ #define TEST_CLASS( Pred, YesInput, NoInput )\
{\ {\
test_pred(Pred, YesInput, true); \ BOOST_CHECK( all( string(YesInput), Pred ) );\
test_pred(Pred, NoInput, false); \ BOOST_CHECK( !all( string(NoInput), Pred ) );\
} }
void classification_test() void classification_test()