From 3a452b498fb7d135243a9884d0d6f136d6df03ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorsten=20J=C3=B8rgen=20Ottosen?= Date: Fri, 23 Jul 2004 12:38:56 +0000 Subject: [PATCH] *** empty log message *** [SVN r23986] --- test/Jamfile | 21 +++++++++++++- test/compat1.cpp | 74 ++++++++++++++++++++++++++++++++++++++++++++++++ test/compat2.cpp | 74 ++++++++++++++++++++++++++++++++++++++++++++++++ test/compat3.cpp | 74 ++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 242 insertions(+), 1 deletion(-) create mode 100755 test/compat1.cpp create mode 100755 test/compat2.cpp create mode 100755 test/compat3.cpp diff --git a/test/Jamfile b/test/Jamfile index 6c15362..1b89dc6 100755 --- a/test/Jamfile +++ b/test/Jamfile @@ -55,5 +55,24 @@ test-suite range : : : : reversible_range_test - ] ; + ] + [ run + compat1.cpp + : : + : + : compat1_test + ] + [ run + compat2.cpp + : : + : + : compat2_test + ] + [ run + compat3.cpp + : : + : + : compat3_test + ] + ; } diff --git a/test/compat1.cpp b/test/compat1.cpp new file mode 100755 index 0000000..1365da2 --- /dev/null +++ b/test/compat1.cpp @@ -0,0 +1,74 @@ +// 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 +#include +#include +#include + +enum Container {}; +enum String {}; + +template< typename T > +struct range_iterator; + +template<> +struct range_iterator +{ + template< typename C > + struct pts + { + typedef BOOST_DEDUCED_TYPENAME C::iterator type; + }; +}; + +template<> +struct range_iterator +{ + template< typename C > + struct pts + { + typedef C type; + }; +}; + +template< typename C > +class iterator_of +{ +public: + typedef BOOST_DEDUCED_TYPENAME range_iterator::BOOST_NESTED_TEMPLATE pts::type type; +}; + +#include + +void compat1() +{ + std::vector v; + iterator_of< std::vector >::type i = v.begin(); +} + +#include + +using boost::unit_test_framework::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( &compat1 ) ); + + return test; +} + + + + + + diff --git a/test/compat2.cpp b/test/compat2.cpp new file mode 100755 index 0000000..498da6b --- /dev/null +++ b/test/compat2.cpp @@ -0,0 +1,74 @@ +// 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 +#include +#include +#include + +enum Container {}; +enum String {}; + +template< typename T > +struct range_iterator; + +template<> +struct range_iterator +{ + template< typename C > + struct pts + { + typedef BOOST_DEDUCED_TYPENAME C::iterator type; + }; +}; + +template<> +struct range_iterator +{ + template< typename C > + struct pts + { + typedef C type; + }; +}; + +template< typename C > +class iterator_of +{ +public: + typedef range_iterator::BOOST_NESTED_TEMPLATE pts::type type; +}; + +#include + +void compat1() +{ + std::vector v; + iterator_of< std::vector >::type i = v.begin(); +} + +#include + +using boost::unit_test_framework::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( &compat1 ) ); + + return test; +} + + + + + + diff --git a/test/compat3.cpp b/test/compat3.cpp new file mode 100755 index 0000000..e7271cd --- /dev/null +++ b/test/compat3.cpp @@ -0,0 +1,74 @@ +// 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 +#include +#include +#include + +enum Container {}; +enum String {}; + +template< typename T > +struct range_iterator; + +template<> +struct range_iterator +{ + template< typename C > + struct pts + { + typedef BOOST_DEDUCED_TYPENAME C::iterator type; + }; +}; + +template<> +struct range_iterator +{ + template< typename C > + struct pts + { + typedef C type; + }; +}; + +template< typename C > +class iterator_of +{ +public: + typedef BOOST_DEDUCED_TYPENAME range_iterator:: template pts::type type; +}; + +#include + +void compat1() +{ + std::vector v; + iterator_of< std::vector >::type i = v.begin(); +} + +#include + +using boost::unit_test_framework::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( &compat1 ) ); + + return test; +} + + + + + +