mirror of
https://github.com/boostorg/range.git
synced 2026-02-05 14:45:10 +01:00
https://svn.boost.org/svn/boost/trunk ........ r40923 | eric_niebler | 2007-11-07 22:48:08 -0800 (Wed, 07 Nov 2007) | 1 line fix errors and warnings on msvc-9 ........ r40924 | chris_kohlhoff | 2007-11-07 23:52:49 -0800 (Wed, 07 Nov 2007) | 2 lines Fix timer stalls. ........ r40925 | johnmaddock | 2007-11-08 01:38:22 -0800 (Thu, 08 Nov 2007) | 1 line Fixed license text. ........ r40926 | bemandawes | 2007-11-08 04:35:50 -0800 (Thu, 08 Nov 2007) | 1 line Borland appends newline, so just check text ........ r40927 | johnmaddock | 2007-11-08 04:39:58 -0800 (Thu, 08 Nov 2007) | 1 line Removed non-BSL files, updated and regenerated docs accordingly. ........ r40928 | bemandawes | 2007-11-08 05:01:23 -0800 (Thu, 08 Nov 2007) | 1 line Markup older Borland compilers that don't support enable_if ........ r40932 | bemandawes | 2007-11-08 06:25:09 -0800 (Thu, 08 Nov 2007) | 1 line Clarify comment ........ r40934 | joaquin | 2007-11-08 07:46:57 -0800 (Thu, 08 Nov 2007) | 1 line removed markup for a fixed failure of multi_index on vacpp ........ r40935 | nikiml | 2007-11-08 08:28:44 -0800 (Thu, 08 Nov 2007) | 1 line changed handle cast to downcast ........ r40936 | hljin | 2007-11-08 09:31:56 -0800 (Thu, 08 Nov 2007) | 1 line GIL: added missing standard C++ header files ........ r40937 | hljin | 2007-11-08 09:35:37 -0800 (Thu, 08 Nov 2007) | 1 line GIL: added namespace prefix to avoid confusion ........ r40938 | danieljames | 2007-11-08 10:04:12 -0800 (Thu, 08 Nov 2007) | 3 lines Remove the <small> from the copyright footer, because it was causing the markup to be invalid. ........ r40939 | johnmaddock | 2007-11-08 10:05:28 -0800 (Thu, 08 Nov 2007) | 1 line Applied fix from http://svn.boost.org/trac/boost/ticket/1023. ........ r40956 | vladimir_prus | 2007-11-09 00:26:47 -0800 (Fri, 09 Nov 2007) | 1 line Don't use toolset.register ........ r40957 | vladimir_prus | 2007-11-09 00:30:27 -0800 (Fri, 09 Nov 2007) | 2 lines Remove toolset.register. ........ r40958 | speedsnail | 2007-11-09 00:31:45 -0800 (Fri, 09 Nov 2007) | 2 lines Force static linking for toolsets mingw and boorland. ........ r40959 | speedsnail | 2007-11-09 01:28:29 -0800 (Fri, 09 Nov 2007) | 1 line Reverted the previous commit, until I find a better solution... ........ r40960 | johnmaddock | 2007-11-09 01:54:43 -0800 (Fri, 09 Nov 2007) | 1 line Still trying to get the Solaris error rates correct.... ........ r40961 | johnmaddock | 2007-11-09 01:59:37 -0800 (Fri, 09 Nov 2007) | 1 line Trivial fix for issue #647. ........ r40962 | nesotto | 2007-11-09 02:27:42 -0800 (Fri, 09 Nov 2007) | 1 line major update wrt. new range concepts ........ r40963 | johnmaddock | 2007-11-09 03:01:45 -0800 (Fri, 09 Nov 2007) | 1 line Improved error messages and added tentative fixes for HP Tru64: the compiler appears to store constants that should underflow to zero as a small non-zero values which messes up the logic used in the test cases. ........ r40964 | nesotto | 2007-11-09 05:13:06 -0800 (Fri, 09 Nov 2007) | 1 line minor editorial issue ........ r40965 | nesotto | 2007-11-09 05:30:57 -0800 (Fri, 09 Nov 2007) | 1 line update of new concepts, and replacement of range_size<T>::type with range_difference<T>::type throughut the library ........ r40966 | nesotto | 2007-11-09 05:31:43 -0800 (Fri, 09 Nov 2007) | 1 line minor tweaks to avoid warnings ... extension mechanism updated to follow new protocol ........ r40967 | schoepflin | 2007-11-09 06:25:44 -0800 (Fri, 09 Nov 2007) | 1 line Added memory barriers to Tru64 atomic ops. ........ r40968 | nesotto | 2007-11-09 07:15:28 -0800 (Fri, 09 Nov 2007) | 1 line improved reference ........ r40969 | johnmaddock | 2007-11-09 08:57:42 -0800 (Fri, 09 Nov 2007) | 1 line Added needed macro suppression to use of isfinite. ........ [SVN r40970]
84 lines
2.9 KiB
C++
Executable File
84 lines
2.9 KiB
C++
Executable File
// Boost.Range library
|
|
//
|
|
// Copyright Thorsten Ottosen 2003-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)
|
|
//
|
|
// For more information, see http://www.boost.org/libs/range/
|
|
//
|
|
|
|
|
|
#include <boost/detail/workaround.hpp>
|
|
|
|
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
|
# pragma warn -8091 // supress warning in Boost.Test
|
|
# pragma warn -8057 // unused argument argc/argv in Boost.Test
|
|
#endif
|
|
|
|
#include <boost/range.hpp>
|
|
#include <boost/static_assert.hpp>
|
|
#include <boost/type_traits.hpp>
|
|
#include <boost/test/test_tools.hpp>
|
|
#include <boost/test/unit_test.hpp>
|
|
#include <iostream>
|
|
|
|
using namespace boost;
|
|
using namespace std;
|
|
|
|
void check_array()
|
|
{
|
|
const int sz = 9;
|
|
typedef int array_t[sz];
|
|
int my_array[sz] = { 1,2,3,4,5,6,7,8,9 };
|
|
const array_t ca = { 1,2,3,4,5,6,7,8,10 };
|
|
|
|
|
|
// BOOST_RANGE_NO_STATIC_ASSERT
|
|
#if !defined( __BORLANDC__ )
|
|
#else
|
|
BOOST_STATIC_ASSERT(( is_same< range_value<array_t>::type, int >::value ));
|
|
BOOST_STATIC_ASSERT(( is_same< range_iterator<array_t>::type, int* >::value ));
|
|
BOOST_STATIC_ASSERT(( is_same< range_const_iterator<array_t>::type, const int* >::value ));
|
|
BOOST_STATIC_ASSERT(( is_same< range_difference<array_t>::type, std::ptrdiff_t >::value ));
|
|
BOOST_STATIC_ASSERT(( is_same< range_size<array_t>::type, std::size_t >::value ));
|
|
BOOST_STATIC_ASSERT(( is_same< range_iterator<array_t>::type, int* >::value ));
|
|
BOOST_STATIC_ASSERT(( is_same< range_iterator<const array_t>::type, const int* >::value ));
|
|
|
|
BOOST_STATIC_ASSERT(( is_same< range_value<const array_t>::type, const int >::value ));
|
|
BOOST_STATIC_ASSERT(( is_same< range_iterator<const array_t>::type, const int* >::value ));
|
|
BOOST_STATIC_ASSERT(( is_same< range_const_iterator<const array_t>::type, const int* >::value ));
|
|
BOOST_STATIC_ASSERT(( is_same< range_difference<const array_t>::type, std::ptrdiff_t >::value ));
|
|
BOOST_STATIC_ASSERT(( is_same< range_size<const array_t>::type, std::size_t >::value ));
|
|
BOOST_STATIC_ASSERT(( is_same< range_iterator<const array_t>::type, const int* >::value ));
|
|
BOOST_STATIC_ASSERT(( is_same< range_iterator<const array_t>::type, const int* >::value ));
|
|
#endif
|
|
|
|
BOOST_CHECK_EQUAL( begin( my_array ), my_array );
|
|
BOOST_CHECK_EQUAL( end( my_array ), my_array + size( my_array ) );
|
|
BOOST_CHECK_EQUAL( empty( my_array ), false );
|
|
|
|
BOOST_CHECK_EQUAL( begin( ca ), ca );
|
|
BOOST_CHECK_EQUAL( end( ca ), ca + size( ca ) );
|
|
BOOST_CHECK_EQUAL( empty( ca ),false );
|
|
|
|
const char A[] = "\0A";
|
|
BOOST_CHECK_EQUAL( boost::size(A), 3 );
|
|
}
|
|
|
|
using boost::unit_test::test_suite;
|
|
|
|
test_suite* init_unit_test_suite( int argc, char* argv[] )
|
|
{
|
|
test_suite* test = BOOST_TEST_SUITE( "Range Test Suite" );
|
|
|
|
test->add( BOOST_TEST_CASE( &check_array ) );
|
|
|
|
return test;
|
|
}
|
|
|
|
|
|
|
|
|
|
|