forked from boostorg/range
Boost.Range fixed C++0x problem due to accidental argument dependent lookup in the const_ranges unit test.
[SVN r61025]
This commit is contained in:
31
test/const_ranges.cpp
Executable file → Normal file
31
test/const_ranges.cpp
Executable file → Normal file
@ -21,9 +21,6 @@
|
||||
#include <boost/test/unit_test.hpp>
|
||||
#include <string>
|
||||
|
||||
using namespace boost;
|
||||
using namespace std;
|
||||
|
||||
template< class T >
|
||||
const T& as_const( const T& r )
|
||||
{
|
||||
@ -33,27 +30,23 @@ const T& as_const( const T& r )
|
||||
void check_const_ranges()
|
||||
{
|
||||
std::string foo( "foo" );
|
||||
const std::string bar( "bar" );
|
||||
|
||||
BOOST_CHECK( const_begin( foo ) == begin( as_const( foo ) ) );
|
||||
BOOST_CHECK( const_end( foo ) == end( as_const( foo ) ) );
|
||||
BOOST_CHECK( const_rbegin( foo ) == rbegin( as_const( foo ) ) );
|
||||
BOOST_CHECK( const_rend( foo ) == rend( as_const( foo ) ) );
|
||||
const std::string bar( "bar" );
|
||||
|
||||
BOOST_CHECK( const_begin( bar ) == begin( as_const( bar ) ) );
|
||||
BOOST_CHECK( const_end( bar ) == end( as_const( bar ) ) );
|
||||
BOOST_CHECK( const_rbegin( bar ) == rbegin( as_const( bar ) ) );
|
||||
BOOST_CHECK( const_rend( bar ) == rend( as_const( bar ) ) );
|
||||
BOOST_CHECK( boost::const_begin( foo ) == boost::begin( as_const( foo ) ) );
|
||||
BOOST_CHECK( boost::const_end( foo ) == boost::end( as_const( foo ) ) );
|
||||
BOOST_CHECK( boost::const_rbegin( foo ) == boost::rbegin( as_const( foo ) ) );
|
||||
BOOST_CHECK( boost::const_rend( foo ) == boost::rend( as_const( foo ) ) );
|
||||
|
||||
BOOST_CHECK( boost::const_begin( bar ) == boost::begin( as_const( bar ) ) );
|
||||
BOOST_CHECK( boost::const_end( bar ) == boost::end( as_const( bar ) ) );
|
||||
BOOST_CHECK( boost::const_rbegin( bar ) == boost::rbegin( as_const( bar ) ) );
|
||||
BOOST_CHECK( boost::const_rend( bar ) == boost::rend( as_const( bar ) ) );
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
using boost::unit_test::test_suite;
|
||||
|
||||
test_suite* init_unit_test_suite( int argc, char* argv[] )
|
||||
boost::unit_test::test_suite* init_unit_test_suite( int argc, char* argv[] )
|
||||
{
|
||||
test_suite* test = BOOST_TEST_SUITE( "Range Test Suite" );
|
||||
boost::unit_test::test_suite* test = BOOST_TEST_SUITE( "Range Test Suite" );
|
||||
|
||||
test->add( BOOST_TEST_CASE( &check_const_ranges ) );
|
||||
|
||||
|
Reference in New Issue
Block a user