mirror of
https://github.com/boostorg/range.git
synced 2025-07-20 08:02:12 +02:00
eliminate unused local typedef and signed/unsigned comparison warnings.
This commit is contained in:
@ -107,12 +107,15 @@ template<typename Rng>
|
|||||||
void test_random_algorithms(Rng & rng, std::random_access_iterator_tag)
|
void test_random_algorithms(Rng & rng, std::random_access_iterator_tag)
|
||||||
{
|
{
|
||||||
typedef BOOST_DEDUCED_TYPENAME boost::range_iterator<Rng>::type iterator;
|
typedef BOOST_DEDUCED_TYPENAME boost::range_iterator<Rng>::type iterator;
|
||||||
typedef BOOST_DEDUCED_TYPENAME boost::range_value<Rng>::type value_type;
|
|
||||||
typedef BOOST_DEDUCED_TYPENAME boost::range_size<Rng>::type size_type BOOST_RANGE_UNUSED;
|
|
||||||
typedef BOOST_DEDUCED_TYPENAME boost::iterator_category<iterator>::type iterator_category;
|
|
||||||
|
|
||||||
|
typedef BOOST_DEDUCED_TYPENAME boost::range_value<Rng>::type value_type;
|
||||||
|
|
||||||
|
typedef BOOST_DEDUCED_TYPENAME boost::range_size<Rng>::type
|
||||||
|
size_type BOOST_RANGE_UNUSED;
|
||||||
|
|
||||||
|
typedef BOOST_DEDUCED_TYPENAME boost::iterator_category<iterator>::type
|
||||||
|
iterator_category BOOST_RANGE_UNUSED;
|
||||||
|
|
||||||
// just make sure these compile (for now)
|
// just make sure these compile (for now)
|
||||||
if(0)
|
if(0)
|
||||||
{
|
{
|
||||||
|
@ -28,7 +28,9 @@ namespace boost
|
|||||||
void test(Container1& cont1, Container2& cont2)
|
void test(Container1& cont1, Container2& cont2)
|
||||||
{
|
{
|
||||||
typedef BOOST_DEDUCED_TYPENAME Container1::value_type value_t;
|
typedef BOOST_DEDUCED_TYPENAME Container1::value_type value_t;
|
||||||
typedef BOOST_DEDUCED_TYPENAME std::vector<value_t>::iterator iterator_t;
|
|
||||||
|
typedef BOOST_DEDUCED_TYPENAME std::vector<value_t>::iterator
|
||||||
|
iterator_t BOOST_RANGE_UNUSED;
|
||||||
|
|
||||||
std::vector<value_t> reference_target(cont1.begin(), cont1.end());
|
std::vector<value_t> reference_target(cont1.begin(), cont1.end());
|
||||||
reference_target.insert(reference_target.end(),
|
reference_target.insert(reference_target.end(),
|
||||||
@ -74,7 +76,8 @@ namespace boost
|
|||||||
void test_pred(Container1 cont1, Container2 cont2, BinaryPredicate pred)
|
void test_pred(Container1 cont1, Container2 cont2, BinaryPredicate pred)
|
||||||
{
|
{
|
||||||
typedef BOOST_DEDUCED_TYPENAME Container1::value_type value_t;
|
typedef BOOST_DEDUCED_TYPENAME Container1::value_type value_t;
|
||||||
typedef BOOST_DEDUCED_TYPENAME std::vector<value_t>::iterator iterator_t;
|
typedef BOOST_DEDUCED_TYPENAME std::vector<value_t>::iterator
|
||||||
|
iterator_t BOOST_RANGE_UNUSED;
|
||||||
|
|
||||||
sort_container(cont1, pred);
|
sort_container(cont1, pred);
|
||||||
sort_container(cont2, pred);
|
sort_container(cont2, pred);
|
||||||
|
@ -106,8 +106,11 @@ namespace boost_range_test_algorithm_max_element
|
|||||||
{
|
{
|
||||||
using namespace boost::assign;
|
using namespace boost::assign;
|
||||||
|
|
||||||
typedef BOOST_DEDUCED_TYPENAME Container::value_type value_t;
|
typedef BOOST_DEDUCED_TYPENAME Container::value_type
|
||||||
typedef BOOST_DEDUCED_TYPENAME boost::remove_const<Container>::type container_t;
|
value_t BOOST_RANGE_UNUSED;
|
||||||
|
|
||||||
|
typedef BOOST_DEDUCED_TYPENAME boost::remove_const<Container>::type
|
||||||
|
container_t;
|
||||||
|
|
||||||
boost::range_test::range_return_test_driver test_driver;
|
boost::range_test::range_return_test_driver test_driver;
|
||||||
|
|
||||||
|
@ -104,8 +104,11 @@ namespace boost_range_test_algorithm_min_element
|
|||||||
{
|
{
|
||||||
using namespace boost::assign;
|
using namespace boost::assign;
|
||||||
|
|
||||||
typedef BOOST_DEDUCED_TYPENAME Container::value_type value_t;
|
typedef BOOST_DEDUCED_TYPENAME Container::value_type
|
||||||
typedef BOOST_DEDUCED_TYPENAME boost::remove_const<Container>::type container_t;
|
value_t BOOST_RANGE_UNUSED;
|
||||||
|
|
||||||
|
typedef BOOST_DEDUCED_TYPENAME boost::remove_const<Container>::type
|
||||||
|
container_t;
|
||||||
|
|
||||||
boost::range_test::range_return_test_driver test_driver;
|
boost::range_test::range_return_test_driver test_driver;
|
||||||
|
|
||||||
|
@ -160,15 +160,17 @@ namespace boost
|
|||||||
MutableContainer2 cont2;
|
MutableContainer2 cont2;
|
||||||
const Container2& cref_cont2 = cont2;
|
const Container2& cref_cont2 = cont2;
|
||||||
|
|
||||||
typedef BOOST_DEDUCED_TYPENAME Container1::iterator iterator1_t;
|
typedef BOOST_DEDUCED_TYPENAME Container1::iterator
|
||||||
typedef BOOST_DEDUCED_TYPENAME Container1::const_iterator const_iterator1_t;
|
iterator1_t BOOST_RANGE_UNUSED;
|
||||||
typedef BOOST_DEDUCED_TYPENAME Container2::iterator iterator2_t;
|
|
||||||
typedef BOOST_DEDUCED_TYPENAME Container2::const_iterator const_iterator2_t;
|
|
||||||
|
|
||||||
typedef std::pair<iterator1_t, iterator2_t> pair_mmit_t;
|
typedef BOOST_DEDUCED_TYPENAME Container1::const_iterator
|
||||||
typedef std::pair<const_iterator1_t, iterator2_t> pair_cmit_t;
|
const_iterator1_t BOOST_RANGE_UNUSED;
|
||||||
typedef std::pair<iterator1_t, const_iterator2_t> pair_mcit_t;
|
|
||||||
typedef std::pair<const_iterator1_t, const_iterator2_t> pair_ccit_t;
|
typedef BOOST_DEDUCED_TYPENAME Container2::iterator
|
||||||
|
iterator2_t BOOST_RANGE_UNUSED;
|
||||||
|
|
||||||
|
typedef BOOST_DEDUCED_TYPENAME Container2::const_iterator
|
||||||
|
const_iterator2_t BOOST_RANGE_UNUSED;
|
||||||
|
|
||||||
eval_mismatch(cont1, cont2, cont1.end(), cont2.end());
|
eval_mismatch(cont1, cont2, cont1.end(), cont2.end());
|
||||||
eval_mismatch(cont1, cont2, std::equal_to<int>(), cont1.end(), cont2.end());
|
eval_mismatch(cont1, cont2, std::equal_to<int>(), cont1.end(), cont2.end());
|
||||||
|
@ -90,7 +90,8 @@ namespace boost
|
|||||||
template<class Container>
|
template<class Container>
|
||||||
void test_random_shuffle_nogen_impl(Container& cont)
|
void test_random_shuffle_nogen_impl(Container& cont)
|
||||||
{
|
{
|
||||||
typedef BOOST_DEDUCED_TYPENAME range_iterator<Container>::type iterator_t;
|
typedef BOOST_DEDUCED_TYPENAME range_iterator<Container>::type
|
||||||
|
iterator_t BOOST_RANGE_UNUSED;
|
||||||
|
|
||||||
const int MAX_RETRIES = 10000;
|
const int MAX_RETRIES = 10000;
|
||||||
|
|
||||||
|
@ -36,7 +36,8 @@ namespace
|
|||||||
typedef typename boost::range_value<Container>::type value_type;
|
typedef typename boost::range_value<Container>::type value_type;
|
||||||
std::vector<value_type> reference;
|
std::vector<value_type> reference;
|
||||||
|
|
||||||
typedef BOOST_DEDUCED_TYPENAME std::vector<value_type>::iterator iterator_t;
|
typedef BOOST_DEDUCED_TYPENAME std::vector<value_type>::iterator
|
||||||
|
iterator_t BOOST_RANGE_UNUSED;
|
||||||
|
|
||||||
test_append(
|
test_append(
|
||||||
std::remove_copy(c.begin(), c.end(),
|
std::remove_copy(c.begin(), c.end(),
|
||||||
|
@ -38,7 +38,8 @@ namespace
|
|||||||
typedef typename boost::range_value<Container>::type value_type;
|
typedef typename boost::range_value<Container>::type value_type;
|
||||||
std::vector<value_type> reference;
|
std::vector<value_type> reference;
|
||||||
|
|
||||||
typedef BOOST_DEDUCED_TYPENAME std::vector<value_type>::iterator iterator_t;
|
typedef BOOST_DEDUCED_TYPENAME std::vector<value_type>::iterator
|
||||||
|
iterator_t BOOST_RANGE_UNUSED;
|
||||||
|
|
||||||
test_append(
|
test_append(
|
||||||
std::replace_copy(c.begin(), c.end(),
|
std::replace_copy(c.begin(), c.end(),
|
||||||
|
@ -31,11 +31,14 @@ namespace
|
|||||||
template<class Container, class Iterator>
|
template<class Container, class Iterator>
|
||||||
void test_rotate_copy_impl(Container& cont, Iterator where_it)
|
void test_rotate_copy_impl(Container& cont, Iterator where_it)
|
||||||
{
|
{
|
||||||
typedef BOOST_DEDUCED_TYPENAME boost::range_value<Container>::type value_type;
|
typedef BOOST_DEDUCED_TYPENAME boost::range_value<Container>::type
|
||||||
|
value_type;
|
||||||
|
|
||||||
std::vector<value_type> reference;
|
std::vector<value_type> reference;
|
||||||
std::vector<value_type> test;
|
std::vector<value_type> test;
|
||||||
|
|
||||||
typedef BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type iterator_t;
|
typedef BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type
|
||||||
|
iterator_t BOOST_RANGE_UNUSED;
|
||||||
|
|
||||||
test_append(
|
test_append(
|
||||||
std::rotate_copy(cont.begin(), where_it, cont.end(),
|
std::rotate_copy(cont.begin(), where_it, cont.end(),
|
||||||
|
@ -60,7 +60,9 @@ namespace
|
|||||||
Integer count, const Value& value,
|
Integer count, const Value& value,
|
||||||
BinaryPredicate pred)
|
BinaryPredicate pred)
|
||||||
{
|
{
|
||||||
typedef typename std::iterator_traits<ForwardIterator>::iterator_category cat_t;
|
typedef typename std::iterator_traits<
|
||||||
|
ForwardIterator
|
||||||
|
>::iterator_category cat_t BOOST_RANGE_UNUSED;
|
||||||
|
|
||||||
if (count <= 0)
|
if (count <= 0)
|
||||||
return first;
|
return first;
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
#include <boost/static_assert.hpp>
|
#include <boost/static_assert.hpp>
|
||||||
#include <boost/type_traits.hpp>
|
#include <boost/type_traits.hpp>
|
||||||
|
#include <boost/concept_check.hpp>
|
||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
|
|
||||||
enum Container {};
|
enum Container {};
|
||||||
@ -51,6 +52,7 @@ void compat1()
|
|||||||
{
|
{
|
||||||
std::vector<int> v;
|
std::vector<int> v;
|
||||||
iterator_of< std::vector<int> >::type i = v.begin();
|
iterator_of< std::vector<int> >::type i = v.begin();
|
||||||
|
boost::ignore_unused_variable_warning(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <boost/test/included/unit_test.hpp>
|
#include <boost/test/included/unit_test.hpp>
|
||||||
|
@ -63,18 +63,24 @@ void check_iterator_pair()
|
|||||||
BOOST_CHECK( boost::begin( pair ) == pair.first );
|
BOOST_CHECK( boost::begin( pair ) == pair.first );
|
||||||
BOOST_CHECK( boost::end( pair ) == pair.second );
|
BOOST_CHECK( boost::end( pair ) == pair.second );
|
||||||
BOOST_CHECK( boost::empty( pair ) == (pair.first == pair.second) );
|
BOOST_CHECK( boost::empty( pair ) == (pair.first == pair.second) );
|
||||||
BOOST_CHECK( boost::size( pair ) == std::distance( pair.first, pair.second ) );
|
BOOST_CHECK( boost::size( pair ) ==
|
||||||
|
static_cast<std::size_t>(
|
||||||
|
std::distance(pair.first, pair.second)) );
|
||||||
|
|
||||||
BOOST_CHECK( boost::begin( const_pair ) == const_pair.first );
|
BOOST_CHECK( boost::begin( const_pair ) == const_pair.first );
|
||||||
BOOST_CHECK( boost::end( const_pair ) == const_pair.second );
|
BOOST_CHECK( boost::end( const_pair ) == const_pair.second );
|
||||||
BOOST_CHECK( boost::empty( const_pair ) == (const_pair.first == const_pair.second) );
|
BOOST_CHECK( boost::empty( const_pair ) == (const_pair.first == const_pair.second) );
|
||||||
BOOST_CHECK( boost::size( const_pair ) == std::distance( const_pair.first, const_pair.second ) );
|
BOOST_CHECK( boost::size( const_pair ) ==
|
||||||
|
static_cast<std::size_t>(
|
||||||
|
std::distance(const_pair.first, const_pair.second)) );
|
||||||
|
|
||||||
BOOST_CHECK( boost::begin( constness_pair ) == constness_pair.first );
|
BOOST_CHECK( boost::begin( constness_pair ) == constness_pair.first );
|
||||||
BOOST_CHECK( boost::end( constness_pair ) == constness_pair.second );
|
BOOST_CHECK( boost::end( constness_pair ) == constness_pair.second );
|
||||||
BOOST_CHECK( boost::empty( constness_pair ) == (constness_pair.first == const_pair.second) );
|
BOOST_CHECK( boost::empty( constness_pair ) == (constness_pair.first == const_pair.second) );
|
||||||
BOOST_CHECK( boost::size( constness_pair ) == std::distance( constness_pair.first, constness_pair.second ) );
|
BOOST_CHECK( boost::size( constness_pair ) ==
|
||||||
|
static_cast<std::size_t>(
|
||||||
|
std::distance(constness_pair.first,
|
||||||
|
constness_pair.second)) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user