Ticket #7827: indexed.cpp.patch

File indexed.cpp.patch, 1.5 KB (added by Akira Takahashi <faithandbrave@…>, 10 years ago)

add test

  • .cpp"

    diff --git "a/D:\\GitHub\\Boost\\boost-svn\\libs\\range\\test\\adaptor_test\\indexed_origin.cpp" "b/D:\\GitHub\\Boost\\boost-svn\\libs\\range\\test\\adaptor_test\\indexed.cpp"
    index 2a9c45d..19b358e 100644
    old new  
    1515
    1616#include <boost/assign.hpp>
    1717#include <boost/range/algorithm_ext.hpp>
     18#include <boost/concept_check.hpp>
     19#include <boost/range/concepts.hpp>
    1820
    1921#include <algorithm>
    2022#include <list>
    namespace boost  
    7981            indexed_test_impl(c);
    8082        }
    8183
     84        template <class RandomAccessRng>
     85        void check_random_access_range_concept(const RandomAccessRng& rng)
     86        {
     87            BOOST_RANGE_CONCEPT_ASSERT((boost::RandomAccessRangeConcept<RandomAccessRng>));
     88        }
     89
     90        template <class BidirectionalRng>
     91        void check_bidirectional_range_concept(const BidirectionalRng& rng)
     92        {
     93            BOOST_RANGE_CONCEPT_ASSERT((boost::BidirectionalRangeConcept<BidirectionalRng>));
     94        }
     95
    8296        void indexed_test()
    8397        {
    8498            indexed_test_impl< std::vector< int > >();
    8599            indexed_test_impl< std::list< int > >();
     100
     101            check_random_access_range_concept(std::vector<int>() | boost::adaptors::indexed(0));
     102            check_bidirectional_range_concept(std::list<int>() | boost::adaptors::indexed(0));
    86103        }
    87104    }
    88105}