mirror of
https://github.com/boostorg/range.git
synced 2025-07-29 20:37:25 +02:00
bug-fixes from trunk
[SVN r46649]
This commit is contained in:
4
doc/history_ack.html
Executable file → Normal file
4
doc/history_ack.html
Executable file → Normal file
@ -19,9 +19,9 @@
|
||||
<h2 >History and Acknowledgement</h2><a name="History" ></a>
|
||||
<p >
|
||||
The library was under way for a long time. Dietmar K<>hl originally intended
|
||||
to submit an <code>array_traits</code> class template which had most of
|
||||
to submit an <code >array_traits</code> class template which had most of
|
||||
the functionality present now, but only for arrays and standard containers.
|
||||
I believe this was back in 2001 or 2002.
|
||||
I believe this was back in 2001 or 2002.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
2
doc/intro.html
Executable file → Normal file
2
doc/intro.html
Executable file → Normal file
@ -24,7 +24,7 @@
|
||||
to a somewhat clumsy use of the algorithms with redundant specification
|
||||
of container names. Therefore we would like to raise the abstraction level
|
||||
for algorithms so they specify their interface in terms of <a
|
||||
href=range.html>Ranges</a> as much as possible.
|
||||
href="range.html">Ranges</a> as much as possible.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
2
doc/style.html
Executable file → Normal file
2
doc/style.html
Executable file → Normal file
@ -53,7 +53,7 @@
|
||||
<a href="range.html#bidirectional_range">Bidirectional Range</a> <li>
|
||||
<a href="range.html#random_access_range">Random Access Range</a> </ul>
|
||||
</ul>
|
||||
Notice how we have used the categories from the <a href=../../iterator/doc/new-iter-concepts.html>new
|
||||
Notice how we have used the categories from the <a href="../../iterator/doc/new-iter-concepts.html">new
|
||||
style iterators</a>.
|
||||
|
||||
<p>
|
||||
|
@ -27,9 +27,9 @@
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
Class <a href=#iter_range><code>iterator_range</code></a>
|
||||
Class <a href="#iter_range"><code>iterator_range</code></a>
|
||||
<li>
|
||||
Class <a href=#sub_range><code>sub_range</code></a>
|
||||
Class <a href="#sub_range"><code>sub_range</code></a>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
@ -329,7 +329,7 @@ class can propagate constness since it knows what a corresponding
|
||||
<span class=keyword>const </span><span class=identifier>value_type</span><span class=special>& </span><span class=keyword>operator</span><span class=special>[]( </span><span class=identifier>difference_type </span><span class=identifier>at </span><span class=special>) </span><span class=keyword>const</span><span class=special>;</span>
|
||||
|
||||
<span class=keyword>public</span><span class=special>:
|
||||
</span><span class=comment>// rest of interface inherited from <a href=#iter_range><code>iterator_range</code></a>
|
||||
</span><span class=comment>// rest of interface inherited from <a href="#iter_range"><code>iterator_range</code></a>
|
||||
</span><span class=special>};
|
||||
</span>
|
||||
<span class=special>} </span><span class=comment>// namespace 'boost'</span>
|
||||
|
2
index.html
Executable file → Normal file
2
index.html
Executable file → Normal file
@ -22,7 +22,7 @@
|
||||
</p>
|
||||
<p>
|
||||
Use, modification and distribution is subject to the Boost Software License, Version 1.0
|
||||
(see <a href=http://www.boost.org/LICENSE_1_0.txt>
|
||||
(see <a href="http://www.boost.org/LICENSE_1_0.txt">
|
||||
http://www.boost.org/LICENSE_1_0.txt</a>).
|
||||
</p>
|
||||
|
||||
|
@ -12,9 +12,9 @@ rule range-test ( name : includes * )
|
||||
{
|
||||
return [
|
||||
run $(name).cpp /boost/test//boost_unit_test_framework/<link>static
|
||||
:
|
||||
:
|
||||
:
|
||||
: $(includes)
|
||||
: <toolset>gcc:<cxxflags>"-Wall -Wunused "
|
||||
] ;
|
||||
}
|
||||
|
||||
|
8
test/partial_workaround.cpp
Executable file → Normal file
8
test/partial_workaround.cpp
Executable file → Normal file
@ -10,6 +10,8 @@
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <boost/range/detail/implementation_help.hpp>
|
||||
#include <boost/test/test_tools.hpp>
|
||||
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
# pragma warn -8091 // supress warning in Boost.Test
|
||||
@ -30,7 +32,6 @@
|
||||
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/type_traits.hpp>
|
||||
#include <boost/test/test_tools.hpp>
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
@ -91,6 +92,11 @@ void check_partial_workaround()
|
||||
|
||||
void check_partial_workaround()
|
||||
{
|
||||
//
|
||||
// test if warnings are generated
|
||||
//
|
||||
std::size_t s = boost::range_detail::array_size( "foo" );
|
||||
BOOST_CHECK_EQUAL( s, 4u );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
34
test/string.cpp
Executable file → Normal file
34
test/string.cpp
Executable file → Normal file
@ -137,14 +137,7 @@ void check_char()
|
||||
BOOST_CHECK_EQUAL( str_end( char_s ), str_end1 );
|
||||
BOOST_CHECK_EQUAL( str_empty( char_s ), (char_s == 0 || char_s[0] == char()) );
|
||||
BOOST_CHECK_EQUAL( sz, std::char_traits<char>::length( char_s ) );
|
||||
/*
|
||||
BOOST_CHECK_EQUAL( str_begin( char_s2 ), char_s2 );
|
||||
std::size_t sz2 = size( char_s2 );
|
||||
const char* str_end12 = str_begin( char_s2 ) + sz;
|
||||
BOOST_CHECK_EQUAL( str_end( char_s2 ), str_end12 );
|
||||
BOOST_CHECK_EQUAL( empty( char_s2 ), (char_s2 == 0 || char_s2[0] == char()) );
|
||||
BOOST_CHECK_EQUAL( sz2, std::char_traits<char>::length( char_s2 ) );
|
||||
*/
|
||||
|
||||
BOOST_CHECK_EQUAL( str_begin( my_string ), my_string );
|
||||
range_iterator<char_array_t>::type str_end2 = str_begin( my_string ) + str_size(my_string);
|
||||
range_iterator<char_array_t>::type str_end3 = str_end(my_string);
|
||||
@ -165,6 +158,20 @@ void check_char()
|
||||
|
||||
BOOST_CHECK( find_const( as_array( my_string ), to_search ) != str_end(my_string) );
|
||||
BOOST_CHECK( find_const( as_array( my_const_string ), to_search ) != str_end(my_string) );
|
||||
|
||||
//
|
||||
// Test that as_literal() always scan for null terminator
|
||||
//
|
||||
char an_array[] = "foo\0bar";
|
||||
BOOST_CHECK_EQUAL( str_begin( an_array ), an_array );
|
||||
BOOST_CHECK_EQUAL( str_end( an_array ), an_array + 3 );
|
||||
BOOST_CHECK_EQUAL( str_size( an_array ), 3 );
|
||||
|
||||
const char a_const_array[] = "foobar\0doh";
|
||||
BOOST_CHECK_EQUAL( str_begin( a_const_array ), a_const_array );
|
||||
BOOST_CHECK_EQUAL( str_end( a_const_array ), a_const_array + 6 );
|
||||
BOOST_CHECK_EQUAL( str_size( a_const_array ), 6 );
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -172,9 +179,6 @@ void check_char()
|
||||
void check_string()
|
||||
{
|
||||
check_char();
|
||||
// check_char<volatile char>();
|
||||
// check_char<const char>();
|
||||
// check_char<const volatile char>();
|
||||
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
typedef wchar_t* wchar_iterator_t;
|
||||
@ -197,13 +201,7 @@ void check_string()
|
||||
BOOST_CHECK_EQUAL( str_end(char_ws), (str_begin( char_ws ) + sz) );
|
||||
BOOST_CHECK_EQUAL( str_empty( char_ws ), (char_ws == 0 || char_ws[0] == wchar_t()) );
|
||||
BOOST_CHECK_EQUAL( sz, std::char_traits<wchar_t>::length( char_ws ) );
|
||||
/*
|
||||
std::size_t sz2 = size( char_ws2 );
|
||||
BOOST_CHECK_EQUAL( str_begin( char_ws2 ), char_ws2 );
|
||||
BOOST_CHECK_EQUAL( str_end( char_ws2 ), (begin( char_ws2 ) + sz2) );
|
||||
BOOST_CHECK_EQUAL( empty( char_ws2 ), (char_ws2 == 0 || char_ws2[0] == wchar_t()) );
|
||||
BOOST_CHECK_EQUAL( sz2, std::char_traits<wchar_t>::length( char_ws2 ) );
|
||||
*/
|
||||
|
||||
wchar_t to_search = L'n';
|
||||
BOOST_CHECK( find( char_ws, to_search ) != str_end(char_ws) );
|
||||
|
||||
|
Reference in New Issue
Block a user