forked from boostorg/range
Compare commits
18 Commits
svn-branch
...
svn-branch
Author | SHA1 | Date | |
---|---|---|---|
a4c9c3eb65 | |||
15a697f86b | |||
dbef3564c4 | |||
b948d9af17 | |||
95d424012b | |||
36a99eb0a0 | |||
f117011b60 | |||
7c0d73b8cf | |||
405ebd8cca | |||
94b45ef51e | |||
e115ac1006 | |||
8b712359a2 | |||
428e72ed22 | |||
73db2a05b6 | |||
507d1e8075 | |||
d31787daae | |||
14a9a1906b | |||
f65c137e73 |
@ -1,3 +1,13 @@
|
||||
#// Boost.Range library
|
||||
#//
|
||||
#// Copyright Thorsten Ottosen 2003-2008. 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)
|
||||
#//
|
||||
#// For more information, see http://www.boost.org/libs/range/
|
||||
#//
|
||||
|
||||
|
||||
use-project boost : $(BOOST_ROOT) ;
|
||||
|
||||
|
@ -493,7 +493,7 @@ class=identifier>T</span><span class=special>& </span><span class=identifier
|
||||
</p>
|
||||
<p>
|
||||
<code>as_literal()</code> can be used <i>internally</i> in string
|
||||
algorithm librararies to such that arrays of characters are
|
||||
algorithm librararies such that arrays of characters are
|
||||
handled correctly.
|
||||
</p>
|
||||
<p>
|
||||
@ -745,7 +745,13 @@ class=identifier>T</span><span class=special>& </span><span class=identifier
|
||||
|
||||
<hr>
|
||||
<p>
|
||||
(C) Copyright Thorsten Ottosen 2003-2007
|
||||
© <a name="Copyright" id="Copyright">Copyright</a> Thorsten Ottosen 2008.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See
|
||||
accompanying file LICENSE_1_0.txt or copy at <a href=
|
||||
"http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
<br>
|
||||
<br>
|
||||
|
@ -1,3 +1,13 @@
|
||||
// Boost.Range library
|
||||
//
|
||||
// Copyright Thorsten Ottosen 2003-2008. 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)
|
||||
//
|
||||
// For more information, see http://www.boost.org/libs/range/
|
||||
//
|
||||
|
||||
#include <boost/range.hpp>
|
||||
#include <iterator> // for std::iterator_traits, std::distance()
|
||||
|
||||
|
9
doc/examples.html
Executable file → Normal file
9
doc/examples.html
Executable file → Normal file
@ -41,9 +41,16 @@
|
||||
<li> <a href="../test/array.cpp">array.cpp</a>
|
||||
</ul>
|
||||
|
||||
|
||||
<hr>
|
||||
<p>
|
||||
(C) Copyright Thorsten Ottosen 2003-2004
|
||||
© <a name="Copyright" id="Copyright">Copyright</a> Thorsten Ottosen 2008.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See
|
||||
accompanying file LICENSE_1_0.txt or copy at <a href=
|
||||
"http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
|
||||
<br>
|
||||
|
11
doc/faq.html
Executable file → Normal file
11
doc/faq.html
Executable file → Normal file
@ -114,9 +114,16 @@ Cool indeed!
|
||||
</ol>
|
||||
|
||||
|
||||
<hr>
|
||||
<hr>
|
||||
<p>
|
||||
(C) Copyright Thorsten Ottosen 2003-2004
|
||||
© <a name="Copyright" id="Copyright">Copyright</a> Thorsten Ottosen 2008.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See
|
||||
accompanying file LICENSE_1_0.txt or copy
|
||||
at <a href=
|
||||
"http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
|
||||
<br>
|
||||
|
9
doc/headers.html
Executable file → Normal file
9
doc/headers.html
Executable file → Normal file
@ -173,7 +173,14 @@
|
||||
|
||||
<hr>
|
||||
<p>
|
||||
(C) Copyright Thorsten Ottosen 2003-2007
|
||||
© <a name="Copyright" id="Copyright">Copyright</a> Thorsten Ottosen 2008.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See
|
||||
accompanying file LICENSE_1_0.txt or copy
|
||||
at <a href=
|
||||
"http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
|
||||
<br>
|
||||
|
17
doc/history_ack.html
Executable file → Normal file
17
doc/history_ack.html
Executable file → Normal file
@ -18,10 +18,10 @@
|
||||
|
||||
<h2 >History and Acknowledgement</h2><a name="History" ></a>
|
||||
<p >
|
||||
The library have been under way for a long time. Dietmar K<>hl originally
|
||||
intended to submit an <code >array_traits</code> class template which
|
||||
had most of the functionality present now, but only for arrays and standard
|
||||
containers.
|
||||
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
|
||||
the functionality present now, but only for arrays and standard containers.
|
||||
I believe this was back in 2001 or 2002.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@ -61,7 +61,14 @@ C++ standard: <blockquote>
|
||||
|
||||
<hr>
|
||||
<p>
|
||||
(C) Copyright Thorsten Ottosen 2003-2006
|
||||
© <a name="Copyright" id="Copyright">Copyright</a> Thorsten Ottosen 2008.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See
|
||||
accompanying file LICENSE_1_0.txt or copy
|
||||
at <a href=
|
||||
"http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
|
||||
<br>
|
||||
|
14
doc/intro.html
Executable file → Normal file
14
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>
|
||||
@ -63,8 +63,7 @@ free-standing functions so syntactic and/or semantic differences can be removed.
|
||||
|
||||
</ul>
|
||||
</p>
|
||||
<p >
|
||||
Below are given a small example (the complete example can be found <a
|
||||
<p > Below is given a small example (the complete example can be found <a
|
||||
href="../test/algorithm_example.cpp" target="_self" >here</a>): <blockquote>
|
||||
<pre >
|
||||
<span class=comment>
|
||||
@ -136,7 +135,14 @@ Notice that we have to
|
||||
|
||||
<hr>
|
||||
<p>
|
||||
(C) Copyright Thorsten Ottosen 2003-2007
|
||||
© <a name="Copyright" id="Copyright">Copyright</a> Thorsten Ottosen 2008.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See
|
||||
accompanying file LICENSE_1_0.txt or copy
|
||||
at <a href=
|
||||
"http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
|
||||
<br>
|
||||
|
13
doc/portability.html
Executable file → Normal file
13
doc/portability.html
Executable file → Normal file
@ -35,7 +35,7 @@ href="http://boost.sourceforge.net/regression-logs/developer/range.html">here</a
|
||||
</p>
|
||||
<p >
|
||||
Notice also that some compilers cannot do function template ordering properly.
|
||||
In that case one must rely of <a
|
||||
In that case one must rely on <a
|
||||
href="boost_range.html#range_iterator"><code >range_iterator</code></a>
|
||||
and a single function definition instead of overloaded versions for const and
|
||||
non-const arguments.
|
||||
@ -73,11 +73,18 @@ href="http://boost.sourceforge.net/regression-logs/developer/range.html">here</a
|
||||
</ol>
|
||||
</p>
|
||||
|
||||
<hr>
|
||||
<hr>
|
||||
<p>
|
||||
(C) Copyright Thorsten Ottosen 2003-2004
|
||||
© <a name="Copyright" id="Copyright">Copyright</a> Thorsten Ottosen 2008.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See
|
||||
accompanying file LICENSE_1_0.txt or copy
|
||||
at <a href=
|
||||
"http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>>
|
||||
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
|
36
doc/range.html
Executable file → Normal file
36
doc/range.html
Executable file → Normal file
@ -352,34 +352,16 @@ href="../../iterator/doc/new-iter-concepts.html#random-access-traversal-iterator
|
||||
<p> <a href="../../concept_check/concept_check.htm">Boost Concept Check library</a></p>
|
||||
|
||||
<hr>
|
||||
<p>
|
||||
© <a name="Copyright" id="Copyright">Copyright</a> Thorsten Ottosen 2008.
|
||||
</p>
|
||||
|
||||
<!--
|
||||
<h3>Notes</h3>
|
||||
|
||||
|
||||
<P>
|
||||
<A name="1">[1]</A>
|
||||
|
||||
The reference type does not have to be a real C++ reference. The requirements of
|
||||
the reference type is that it <i>behaves</i> like a real reference. Hence the
|
||||
reference type must be convertible to the value_type and assignment through
|
||||
|
||||
<br>
|
||||
<br>
|
||||
<HR>
|
||||
<br>
|
||||
-->
|
||||
|
||||
<TABLE>
|
||||
<TR valign="top">
|
||||
<TD nowrap>Copyright © 2000</TD>
|
||||
<TD><A HREF=http://www.boost.org/people/jeremy_siek.htm>Jeremy Siek</A>
|
||||
</TR>
|
||||
<tr >
|
||||
<TD nowrap>Copyright © 2004-2007</TD>
|
||||
<TD>Thorsten Ottosen.
|
||||
</TABLE>
|
||||
|
||||
<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See
|
||||
accompanying file LICENSE_1_0.txt or copy
|
||||
at <a href=
|
||||
"http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
|
11
doc/style.css
Executable file → Normal file
11
doc/style.css
Executable file → Normal file
@ -1,3 +1,14 @@
|
||||
/*
|
||||
// Boost.Range library
|
||||
//
|
||||
// Copyright Thorsten Ottosen 2003-2008. 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)
|
||||
//
|
||||
// For more information, see http://www.boost.org/libs/range/
|
||||
//
|
||||
*/
|
||||
pre{
|
||||
BORDER-RIGHT: gray 1pt solid;
|
||||
PADDING-RIGHT: 2pt;
|
||||
|
10
doc/style.html
Executable file → Normal file
10
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>
|
||||
@ -104,9 +104,15 @@
|
||||
|
||||
<hr>
|
||||
<p>
|
||||
(C) Copyright Thorsten Ottosen 2003-2004
|
||||
© <a name="Copyright" id="Copyright">Copyright</a> Thorsten Ottosen 2008.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See
|
||||
accompanying file LICENSE_1_0.txt or copy
|
||||
at <a href=
|
||||
"http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
|
@ -27,17 +27,18 @@
|
||||
|
||||
<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>
|
||||
|
||||
The <code>iterator_range</code> class is templated on an
|
||||
<a href="../../iterator/doc/new-iter-concepts.html#forward-traversal-iterators-lib-forward-traversal-iterators">Forward
|
||||
The <code>iterator_range</code> class is templated on a <a
|
||||
href="../../iterator/doc/new-iter-concepts.html#forward-traversal-iterators-lib-forward-traversal-iterators">Forward
|
||||
Traversal Iterator</a> and should be used whenever fairly general code is needed.
|
||||
The <code>sub_range</code> class is templated on an <a href="range.html#forward_range">Forward
|
||||
Range</a> and it is less general, but a bit easier to use since its template
|
||||
The <code>sub_range</code> class is templated on a <a
|
||||
href="range.html#forward_range">Forward Range</a> and it is less general,
|
||||
but a bit easier to use since its template
|
||||
argument is easier to specify. The biggest difference is, however, that a
|
||||
<code>sub_range</code> can propagate constness because it knows what a
|
||||
corresponding <code>const_iterator</code> is. </p>
|
||||
@ -328,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>
|
||||
@ -349,10 +350,17 @@ store the result
|
||||
</pre>
|
||||
</p>
|
||||
|
||||
<hr>
|
||||
<p>
|
||||
(C) Copyright Thorsten Ottosen 2003-2007
|
||||
</p>
|
||||
<hr>
|
||||
<p>
|
||||
© <a name="Copyright" id="Copyright">Copyright</a> Thorsten Ottosen 2008.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See
|
||||
accompanying file LICENSE_1_0.txt or copy
|
||||
at <a href=
|
||||
"http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)
|
||||
</p>
|
||||
|
||||
<br>
|
||||
<br>
|
||||
|
0
include/boost/range.hpp
Executable file → Normal file
0
include/boost/range.hpp
Executable file → Normal file
0
include/boost/range/as_array.hpp
Executable file → Normal file
0
include/boost/range/as_array.hpp
Executable file → Normal file
30
include/boost/range/as_literal.hpp
Executable file → Normal file
30
include/boost/range/as_literal.hpp
Executable file → Normal file
@ -8,14 +8,14 @@
|
||||
// For more information, see http://www.boost.org/libs/range/
|
||||
//
|
||||
|
||||
#ifndef BOOST_RANGE_DETAIL_AS_LITERAL_HPP
|
||||
#define BOOST_RANGE_DETAIL_AS_LITERAL_HPP
|
||||
#ifndef BOOST_RANGE_AS_LITERAL_HPP
|
||||
#define BOOST_RANGE_AS_LITERAL_HPP
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
#if BOOST_NO_FUNCTION_TEMPLATE_ORDERING
|
||||
#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
|
||||
#include <boost/range/detail/as_literal.hpp>
|
||||
#else
|
||||
|
||||
@ -25,7 +25,9 @@
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
#include <cstring>
|
||||
#ifndef BOOST_NO_CWCHAR
|
||||
#include <cwchar>
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
@ -36,10 +38,12 @@ namespace boost
|
||||
return strlen( s );
|
||||
}
|
||||
|
||||
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
|
||||
inline std::size_t length( const wchar_t* s )
|
||||
{
|
||||
return wcslen( s );
|
||||
}
|
||||
#endif
|
||||
|
||||
//
|
||||
// Remark: the compiler cannot choose between T* and T[sz]
|
||||
@ -57,7 +61,7 @@ namespace boost
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
|
||||
inline bool is_char_ptr( wchar_t* )
|
||||
{
|
||||
return true;
|
||||
@ -67,6 +71,7 @@ namespace boost
|
||||
{
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
template< class T >
|
||||
inline long is_char_ptr( T /* r */ )
|
||||
@ -107,23 +112,14 @@ namespace boost
|
||||
template< class Char, std::size_t sz >
|
||||
inline iterator_range<Char*> as_literal( Char (&arr)[sz] )
|
||||
{
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x590)) && __BORLANDC__ >= 0x590
|
||||
return boost::make_iterator_range<Char*>( arr, arr + sz - 1 );
|
||||
#else
|
||||
return boost::make_iterator_range( arr, arr + sz - 1 );
|
||||
#endif
|
||||
return range_detail::make_range( arr, range_detail::is_char_ptr(arr) );
|
||||
}
|
||||
|
||||
|
||||
template< class Char, std::size_t sz >
|
||||
inline iterator_range<const Char*> as_literal( const Char (&arr)[sz] )
|
||||
inline iterator_range<const Char*> as_literal( const Char (&arr)[sz] )
|
||||
{
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x590)) && __BORLANDC__ >= 0x590
|
||||
return boost::make_iterator_range<const Char*>( arr, arr + sz - 1 );
|
||||
#else
|
||||
return boost::make_iterator_range( arr, arr + sz - 1 );
|
||||
#endif
|
||||
}
|
||||
return range_detail::make_range( arr, range_detail::is_char_ptr(arr) );
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING
|
||||
|
8
include/boost/range/begin.hpp
Executable file → Normal file
8
include/boost/range/begin.hpp
Executable file → Normal file
@ -73,15 +73,15 @@ namespace range_detail
|
||||
// May this be discarded? Or is it needed for bad compilers?
|
||||
//
|
||||
template< typename T, std::size_t sz >
|
||||
inline const T* range_begin( const T (&array)[sz] )
|
||||
inline const T* range_begin( const T (&a)[sz] )
|
||||
{
|
||||
return array;
|
||||
return a;
|
||||
}
|
||||
|
||||
template< typename T, std::size_t sz >
|
||||
inline T* range_begin( T (&array)[sz] )
|
||||
inline T* range_begin( T (&a)[sz] )
|
||||
{
|
||||
return array;
|
||||
return a;
|
||||
}
|
||||
|
||||
|
||||
|
0
include/boost/range/category.hpp
Executable file → Normal file
0
include/boost/range/category.hpp
Executable file → Normal file
0
include/boost/range/concepts.hpp
Executable file → Normal file
0
include/boost/range/concepts.hpp
Executable file → Normal file
0
include/boost/range/config.hpp
Executable file → Normal file
0
include/boost/range/config.hpp
Executable file → Normal file
0
include/boost/range/const_iterator.hpp
Executable file → Normal file
0
include/boost/range/const_iterator.hpp
Executable file → Normal file
0
include/boost/range/const_reverse_iterator.hpp
Executable file → Normal file
0
include/boost/range/const_reverse_iterator.hpp
Executable file → Normal file
4
include/boost/range/detail/as_literal.hpp
Executable file → Normal file
4
include/boost/range/detail/as_literal.hpp
Executable file → Normal file
@ -8,8 +8,8 @@
|
||||
// For more information, see http://www.boost.org/libs/range/
|
||||
//
|
||||
|
||||
#ifndef BOOST_RANGE_AS_LITERAL_HPP
|
||||
#define BOOST_RANGE_AS_LITERAL_HPP
|
||||
#ifndef BOOST_RANGE_DETAIL_AS_LITERAL_HPP
|
||||
#define BOOST_RANGE_DETAIL_AS_LITERAL_HPP
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
|
||||
# pragma once
|
||||
|
0
include/boost/range/detail/begin.hpp
Executable file → Normal file
0
include/boost/range/detail/begin.hpp
Executable file → Normal file
0
include/boost/range/detail/collection_traits.hpp
Executable file → Normal file
0
include/boost/range/detail/collection_traits.hpp
Executable file → Normal file
0
include/boost/range/detail/collection_traits_detail.hpp
Executable file → Normal file
0
include/boost/range/detail/collection_traits_detail.hpp
Executable file → Normal file
0
include/boost/range/detail/common.hpp
Executable file → Normal file
0
include/boost/range/detail/common.hpp
Executable file → Normal file
0
include/boost/range/detail/const_iterator.hpp
Executable file → Normal file
0
include/boost/range/detail/const_iterator.hpp
Executable file → Normal file
0
include/boost/range/detail/detail_str.hpp
Executable file → Normal file
0
include/boost/range/detail/detail_str.hpp
Executable file → Normal file
0
include/boost/range/detail/difference_type.hpp
Executable file → Normal file
0
include/boost/range/detail/difference_type.hpp
Executable file → Normal file
0
include/boost/range/detail/empty.hpp
Executable file → Normal file
0
include/boost/range/detail/empty.hpp
Executable file → Normal file
0
include/boost/range/detail/end.hpp
Executable file → Normal file
0
include/boost/range/detail/end.hpp
Executable file → Normal file
4
include/boost/range/detail/implementation_help.hpp
Executable file → Normal file
4
include/boost/range/detail/implementation_help.hpp
Executable file → Normal file
@ -25,6 +25,8 @@ namespace boost
|
||||
{
|
||||
namespace range_detail
|
||||
{
|
||||
template <typename T>
|
||||
inline void boost_range_silence_warning( const T& ) { }
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
// end() help
|
||||
@ -82,12 +84,14 @@ namespace boost
|
||||
template< class T, std::size_t sz >
|
||||
inline std::size_t array_size( T BOOST_RANGE_ARRAY_REF()[sz] )
|
||||
{
|
||||
boost_range_silence_warning( boost_range_array );
|
||||
return sz;
|
||||
}
|
||||
|
||||
template< class T, std::size_t sz >
|
||||
inline std::size_t array_size( const T BOOST_RANGE_ARRAY_REF()[sz] )
|
||||
{
|
||||
boost_range_silence_warning( boost_range_array );
|
||||
return sz;
|
||||
}
|
||||
|
||||
|
0
include/boost/range/detail/iterator.hpp
Executable file → Normal file
0
include/boost/range/detail/iterator.hpp
Executable file → Normal file
0
include/boost/range/detail/remove_extent.hpp
Executable file → Normal file
0
include/boost/range/detail/remove_extent.hpp
Executable file → Normal file
0
include/boost/range/detail/sfinae.hpp
Executable file → Normal file
0
include/boost/range/detail/sfinae.hpp
Executable file → Normal file
0
include/boost/range/detail/size.hpp
Executable file → Normal file
0
include/boost/range/detail/size.hpp
Executable file → Normal file
0
include/boost/range/detail/size_type.hpp
Executable file → Normal file
0
include/boost/range/detail/size_type.hpp
Executable file → Normal file
6
include/boost/range/detail/sizer.hpp
Executable file → Normal file
6
include/boost/range/detail/sizer.hpp
Executable file → Normal file
@ -25,12 +25,10 @@ namespace boost
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
template< typename T, std::size_t sz >
|
||||
char&
|
||||
sizer( const T BOOST_RANGE_ARRAY_REF()[sz] )[sz];
|
||||
char (& sizer( const T BOOST_RANGE_ARRAY_REF()[sz] ) )[sz];
|
||||
|
||||
template< typename T, std::size_t sz >
|
||||
char&
|
||||
sizer( T BOOST_RANGE_ARRAY_REF()[sz] )[sz];
|
||||
char (& sizer( T BOOST_RANGE_ARRAY_REF()[sz] ) )[sz];
|
||||
|
||||
} // namespace 'boost'
|
||||
|
||||
|
0
include/boost/range/detail/str_types.hpp
Executable file → Normal file
0
include/boost/range/detail/str_types.hpp
Executable file → Normal file
0
include/boost/range/detail/value_type.hpp
Executable file → Normal file
0
include/boost/range/detail/value_type.hpp
Executable file → Normal file
0
include/boost/range/detail/vc6/end.hpp
Executable file → Normal file
0
include/boost/range/detail/vc6/end.hpp
Executable file → Normal file
0
include/boost/range/detail/vc6/size.hpp
Executable file → Normal file
0
include/boost/range/detail/vc6/size.hpp
Executable file → Normal file
0
include/boost/range/difference_type.hpp
Executable file → Normal file
0
include/boost/range/difference_type.hpp
Executable file → Normal file
0
include/boost/range/distance.hpp
Executable file → Normal file
0
include/boost/range/distance.hpp
Executable file → Normal file
0
include/boost/range/empty.hpp
Executable file → Normal file
0
include/boost/range/empty.hpp
Executable file → Normal file
8
include/boost/range/end.hpp
Executable file → Normal file
8
include/boost/range/end.hpp
Executable file → Normal file
@ -71,15 +71,15 @@ namespace range_detail
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
template< typename T, std::size_t sz >
|
||||
inline const T* range_end( const T (&array)[sz] )
|
||||
inline const T* range_end( const T (&a)[sz] )
|
||||
{
|
||||
return range_detail::array_end<T,sz>( array );
|
||||
return range_detail::array_end<T,sz>( a );
|
||||
}
|
||||
|
||||
template< typename T, std::size_t sz >
|
||||
inline T* range_end( T (&array)[sz] )
|
||||
inline T* range_end( T (&a)[sz] )
|
||||
{
|
||||
return range_detail::array_end<T,sz>( array );
|
||||
return range_detail::array_end<T,sz>( a );
|
||||
}
|
||||
|
||||
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) && \
|
||||
|
0
include/boost/range/functions.hpp
Executable file → Normal file
0
include/boost/range/functions.hpp
Executable file → Normal file
0
include/boost/range/iterator.hpp
Executable file → Normal file
0
include/boost/range/iterator.hpp
Executable file → Normal file
46
include/boost/range/iterator_range.hpp
Executable file → Normal file
46
include/boost/range/iterator_range.hpp
Executable file → Normal file
@ -11,8 +11,15 @@
|
||||
#ifndef BOOST_RANGE_ITERATOR_RANGE_HPP
|
||||
#define BOOST_RANGE_ITERATOR_RANGE_HPP
|
||||
|
||||
// From boost/dynamic_bitset.hpp; thanks to Matthias Troyer for Cray X1 patch.
|
||||
#include <boost/config.hpp> // Define __STL_CONFIG_H, if appropriate.
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500))
|
||||
#pragma warning( push )
|
||||
#pragma warning( disable : 4996 )
|
||||
#endif
|
||||
|
||||
// From boost/dynamic_bitset.hpp; thanks to Matthias Troyer for Cray X1 patch.
|
||||
#ifndef BOOST_OLD_IOSTREAMS
|
||||
# if defined(__STL_CONFIG_H) && \
|
||||
!defined (__STL_USE_NEW_IOSTREAMS) && !defined(__crayx1) \
|
||||
@ -21,12 +28,13 @@
|
||||
# endif
|
||||
#endif // #ifndef BOOST_OLD_IOSTREAMS
|
||||
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/iterator/iterator_traits.hpp>
|
||||
#include <boost/type_traits/is_abstract.hpp>
|
||||
#include <boost/range/functions.hpp>
|
||||
#include <boost/range/iterator.hpp>
|
||||
#include <boost/range/difference_type.hpp>
|
||||
#include <boost/iterator/iterator_traits.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
#include <iterator>
|
||||
#include <algorithm>
|
||||
#ifndef _STLP_NO_IOSTREAMS
|
||||
@ -38,10 +46,6 @@
|
||||
#endif // _STLP_NO_IOSTREAMS
|
||||
#include <cstddef>
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, == 1310) || BOOST_WORKAROUND(BOOST_MSVC, == 1400)
|
||||
#pragma warning( disable : 4996 )
|
||||
#endif
|
||||
|
||||
/*! \file
|
||||
Defines the \c iterator_class and related functions.
|
||||
\c iterator_range is a simple wrapper of iterator pair idiom. It provides
|
||||
@ -163,6 +167,12 @@ namespace boost
|
||||
//! iterator type
|
||||
typedef IteratorT iterator;
|
||||
|
||||
private: // for return value of operator()()
|
||||
typedef BOOST_DEDUCED_TYPENAME
|
||||
boost::mpl::if_< boost::is_abstract<value_type>,
|
||||
reference, value_type >::type abstract_value_type;
|
||||
|
||||
public:
|
||||
iterator_range() : m_Begin( iterator() ), m_End( iterator() )
|
||||
#ifndef NDEBUG
|
||||
, singular( true )
|
||||
@ -175,7 +185,7 @@ namespace boost
|
||||
m_Begin(Begin), m_End(End)
|
||||
#ifndef NDEBUG
|
||||
, singular(false)
|
||||
#endif
|
||||
#endif
|
||||
{}
|
||||
|
||||
//! Constructor from a Range
|
||||
@ -200,7 +210,7 @@ namespace boost
|
||||
template< class Range >
|
||||
iterator_range( const Range& r, iterator_range_detail::const_range_tag ) :
|
||||
m_Begin( impl::adl_begin( r ) ), m_End( impl::adl_end( r ) )
|
||||
#ifndef NDEBUG
|
||||
#ifndef NDEBUG
|
||||
, singular(false)
|
||||
#endif
|
||||
{}
|
||||
@ -209,7 +219,7 @@ namespace boost
|
||||
template< class Range >
|
||||
iterator_range( Range& r, iterator_range_detail::range_tag ) :
|
||||
m_Begin( impl::adl_begin( r ) ), m_End( impl::adl_end( r ) )
|
||||
#ifndef NDEBUG
|
||||
#ifndef NDEBUG
|
||||
, singular(false)
|
||||
#endif
|
||||
{}
|
||||
@ -350,8 +360,8 @@ namespace boost
|
||||
// When storing transform iterators, operator[]()
|
||||
// fails because it returns by reference. Therefore
|
||||
// operator()() is provided for these cases.
|
||||
//
|
||||
value_type operator()( difference_type at ) const
|
||||
//
|
||||
abstract_value_type operator()( difference_type at ) const
|
||||
{
|
||||
BOOST_ASSERT( at >= 0 && at < size() );
|
||||
return m_Begin[at];
|
||||
@ -380,13 +390,15 @@ namespace boost
|
||||
bool singular;
|
||||
#endif
|
||||
|
||||
#ifndef NDEBUG
|
||||
public:
|
||||
bool is_singular() const
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
return singular;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
protected:
|
||||
//
|
||||
@ -639,5 +651,9 @@ namespace boost
|
||||
|
||||
#undef BOOST_OLD_IOSTREAMS
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500))
|
||||
#pragma warning( pop )
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
0
include/boost/range/metafunctions.hpp
Executable file → Normal file
0
include/boost/range/metafunctions.hpp
Executable file → Normal file
0
include/boost/range/mutable_iterator.hpp
Executable file → Normal file
0
include/boost/range/mutable_iterator.hpp
Executable file → Normal file
0
include/boost/range/pointer.hpp
Executable file → Normal file
0
include/boost/range/pointer.hpp
Executable file → Normal file
0
include/boost/range/rbegin.hpp
Executable file → Normal file
0
include/boost/range/rbegin.hpp
Executable file → Normal file
0
include/boost/range/reference.hpp
Executable file → Normal file
0
include/boost/range/reference.hpp
Executable file → Normal file
0
include/boost/range/rend.hpp
Executable file → Normal file
0
include/boost/range/rend.hpp
Executable file → Normal file
0
include/boost/range/result_iterator.hpp
Executable file → Normal file
0
include/boost/range/result_iterator.hpp
Executable file → Normal file
0
include/boost/range/reverse_iterator.hpp
Executable file → Normal file
0
include/boost/range/reverse_iterator.hpp
Executable file → Normal file
0
include/boost/range/reverse_result_iterator.hpp
Executable file → Normal file
0
include/boost/range/reverse_result_iterator.hpp
Executable file → Normal file
0
include/boost/range/size.hpp
Executable file → Normal file
0
include/boost/range/size.hpp
Executable file → Normal file
0
include/boost/range/size_type.hpp
Executable file → Normal file
0
include/boost/range/size_type.hpp
Executable file → Normal file
24
include/boost/range/sub_range.hpp
Executable file → Normal file
24
include/boost/range/sub_range.hpp
Executable file → Normal file
@ -11,16 +11,20 @@
|
||||
#ifndef BOOST_RANGE_SUB_RANGE_HPP
|
||||
#define BOOST_RANGE_SUB_RANGE_HPP
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, == 1310) || BOOST_WORKAROUND(BOOST_MSVC, == 1400)
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500))
|
||||
#pragma warning( push )
|
||||
#pragma warning( disable : 4996 )
|
||||
#endif
|
||||
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <boost/range/config.hpp>
|
||||
#include <boost/range/iterator_range.hpp>
|
||||
#include <boost/range/value_type.hpp>
|
||||
#include <boost/range/size_type.hpp>
|
||||
#include <boost/range/difference_type.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/type_traits/is_reference.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
@ -39,12 +43,18 @@ namespace boost
|
||||
typedef BOOST_DEDUCED_TYPENAME range_difference<ForwardRange>::type difference_type;
|
||||
typedef BOOST_DEDUCED_TYPENAME range_size<ForwardRange>::type size_type;
|
||||
typedef BOOST_DEDUCED_TYPENAME base::reference reference;
|
||||
|
||||
public: // for return value of front/back
|
||||
typedef BOOST_DEDUCED_TYPENAME
|
||||
boost::mpl::if_< boost::is_reference<reference>,
|
||||
const BOOST_DEDUCED_TYPENAME boost::remove_reference<reference>::type&,
|
||||
reference >::type const_reference;
|
||||
|
||||
public:
|
||||
sub_range() : base()
|
||||
{ }
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, == 1310) || BOOST_WORKAROUND(BOOST_MSVC, == 1400)
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500) )
|
||||
sub_range( const sub_range& r )
|
||||
: base( static_cast<const base&>( r ) )
|
||||
{ }
|
||||
@ -110,7 +120,7 @@ namespace boost
|
||||
return base::front();
|
||||
}
|
||||
|
||||
const value_type& front() const
|
||||
const_reference front() const
|
||||
{
|
||||
return base::front();
|
||||
}
|
||||
@ -120,7 +130,7 @@ namespace boost
|
||||
return base::back();
|
||||
}
|
||||
|
||||
const value_type& back() const
|
||||
const_reference back() const
|
||||
{
|
||||
return base::back();
|
||||
}
|
||||
@ -130,7 +140,7 @@ namespace boost
|
||||
return base::operator[](sz);
|
||||
}
|
||||
|
||||
const value_type& operator[]( difference_type sz ) const
|
||||
const_reference operator[]( difference_type sz ) const
|
||||
{
|
||||
return base::operator[](sz);
|
||||
}
|
||||
@ -161,5 +171,9 @@ namespace boost
|
||||
|
||||
} // namespace 'boost'
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500))
|
||||
#pragma warning( pop )
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
0
include/boost/range/value_type.hpp
Executable file → Normal file
0
include/boost/range/value_type.hpp
Executable file → Normal file
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 "
|
||||
] ;
|
||||
}
|
||||
|
||||
|
0
test/adl_conformance.cpp
Executable file → Normal file
0
test/adl_conformance.cpp
Executable file → Normal file
0
test/adl_conformance_no_using.cpp
Executable file → Normal file
0
test/adl_conformance_no_using.cpp
Executable file → Normal file
0
test/algorithm_example.cpp
Executable file → Normal file
0
test/algorithm_example.cpp
Executable file → Normal file
0
test/array.cpp
Executable file → Normal file
0
test/array.cpp
Executable file → Normal file
0
test/compat2.cpp
Executable file → Normal file
0
test/compat2.cpp
Executable file → Normal file
0
test/compat3.cpp
Executable file → Normal file
0
test/compat3.cpp
Executable file → Normal file
0
test/const_ranges.cpp
Executable file → Normal file
0
test/const_ranges.cpp
Executable file → Normal file
0
test/extension_mechanism.cpp
Executable file → Normal file
0
test/extension_mechanism.cpp
Executable file → Normal file
0
test/iterator_pair.cpp
Executable file → Normal file
0
test/iterator_pair.cpp
Executable file → Normal file
0
test/iterator_range.cpp
Executable file → Normal file
0
test/iterator_range.cpp
Executable file → Normal file
0
test/mfc.cpp
Executable file → Normal file
0
test/mfc.cpp
Executable file → Normal file
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
|
||||
|
0
test/reversible_range.cpp
Executable file → Normal file
0
test/reversible_range.cpp
Executable file → Normal file
0
test/std_container.cpp
Executable file → Normal file
0
test/std_container.cpp
Executable file → Normal file
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) );
|
||||
|
||||
|
0
test/sub_range.cpp
Executable file → Normal file
0
test/sub_range.cpp
Executable file → Normal file
Reference in New Issue
Block a user