Compare commits

...

7 Commits

Author SHA1 Message Date
b1d5d23514 Add quick test target (for CI) 2017-12-18 21:14:16 +02:00
aaebfa5b20 Include boost/next_prior.hpp where needed
A recent change to boost/utility.hpp removed the include of this header,
so now it's needed for boost::prior and boost::next.

b74f49f1e5
2017-12-18 21:14:06 +02:00
95a62a3b3a Split Travis jobs to avoid timeout 2017-12-03 15:16:45 +02:00
67929cd7df Add .travis.yml 2017-12-03 15:16:25 +02:00
efdd98332b Qualify boost::search in test/algorithm to avoid ambiguity with C++17's std::search 2017-09-10 03:03:16 +03:00
97951d2a8b Fix test compilation
boost::detail::iterator_traits was used without including the necessary header
file. It's deprecated anyway and only maps to std::iterator_traits. Also,
utility was missing for std::pair.
2017-09-10 02:21:53 +03:00
efa2dc71f9 Fix compilation
boost::detail::iterator_traits was used without including the necessary header file. It's deprecated anyway and only maps to std::iterator_traits.
2017-09-09 23:37:16 +03:00
9 changed files with 150 additions and 9 deletions

131
.travis.yml Normal file
View File

@ -0,0 +1,131 @@
# Copyright 2016, 2017 Peter Dimov
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
language: cpp
sudo: false
python: "2.7"
branches:
only:
- master
- develop
- /feature\/.*/
env:
matrix:
- BOGUS_JOB=true
matrix:
exclude:
- env: BOGUS_JOB=true
include:
- os: linux
compiler: g++
env: TOOLSET=gcc CXXSTD=03,11
- os: linux
compiler: g++-5
env: TOOLSET=gcc-5 CXXSTD=03,11
addons:
apt:
packages:
- g++-5
sources:
- ubuntu-toolchain-r-test
- os: linux
compiler: g++-5
env: TOOLSET=gcc-5 CXXSTD=14,1z
addons:
apt:
packages:
- g++-5
sources:
- ubuntu-toolchain-r-test
- os: linux
compiler: g++-6
env: TOOLSET=gcc-6 CXXSTD=03,11
addons:
apt:
packages:
- g++-6
sources:
- ubuntu-toolchain-r-test
- os: linux
compiler: g++-6
env: TOOLSET=gcc-6 CXXSTD=14,1z
addons:
apt:
packages:
- g++-6
sources:
- ubuntu-toolchain-r-test
- os: linux
compiler: g++-7
env: TOOLSET=gcc-7 CXXSTD=03,11
addons:
apt:
packages:
- g++-7
sources:
- ubuntu-toolchain-r-test
- os: linux
compiler: g++-7
env: TOOLSET=gcc-7 CXXSTD=14,17
addons:
apt:
packages:
- g++-7
sources:
- ubuntu-toolchain-r-test
- os: linux
compiler: clang++
env: TOOLSET=clang CXXSTD=03,11
- os: linux
compiler: clang++
env: TOOLSET=clang CXXSTD=14,1z
addons:
apt:
packages:
- libstdc++-4.9-dev
sources:
- ubuntu-toolchain-r-test
- os: osx
compiler: clang++
env: TOOLSET=clang CXXSTD=03,11
- os: osx
compiler: clang++
env: TOOLSET=clang CXXSTD=14,1z
install:
- BOOST_BRANCH=develop && [ "$TRAVIS_BRANCH" == "master" ] && BOOST_BRANCH=master || true
- cd ..
- git clone -b $BOOST_BRANCH https://github.com/boostorg/boost.git boost-root
- cd boost-root
- git submodule update --init tools/build
- git submodule update --init libs/config
- git submodule update --init tools/boostdep
- cp -r $TRAVIS_BUILD_DIR/* libs/range
- python tools/boostdep/depinst/depinst.py range
- ./bootstrap.sh
- ./b2 headers
script:
- ./b2 -j 3 libs/range/test toolset=$TOOLSET cxxstd=$CXXSTD
notifications:
email:
on_success: always

View File

@ -15,6 +15,7 @@
#include <boost/range/size_type.hpp>
#include <boost/range/iterator_range.hpp>
#include <boost/range/concepts.hpp>
#include <boost/next_prior.hpp>
namespace boost
{

View File

@ -25,6 +25,8 @@
#include <boost/range/detail/misc_concept.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <iterator>
/*!
* \file
* \brief Concept checks for the Boost Range library.
@ -164,10 +166,10 @@ namespace boost {
// work
(void)(i++);
BOOST_DEDUCED_TYPENAME boost::detail::iterator_traits<Iterator>::reference r1(*i);
BOOST_DEDUCED_TYPENAME std::iterator_traits<Iterator>::reference r1(*i);
boost::ignore_unused_variable_warning(r1);
BOOST_DEDUCED_TYPENAME boost::detail::iterator_traits<Iterator>::reference r2(*(++i));
BOOST_DEDUCED_TYPENAME std::iterator_traits<Iterator>::reference r2(*(++i));
boost::ignore_unused_variable_warning(r2);
}
private:
@ -181,7 +183,7 @@ namespace boost {
, DefaultConstructible<Iterator>
{
#if BOOST_RANGE_ENABLE_CONCEPT_ASSERT
typedef BOOST_DEDUCED_TYPENAME boost::detail::iterator_traits<Iterator>::difference_type difference_type;
typedef BOOST_DEDUCED_TYPENAME std::iterator_traits<Iterator>::difference_type difference_type;
BOOST_MPL_ASSERT((is_integral<difference_type>));
BOOST_MPL_ASSERT_RELATION(std::numeric_limits<difference_type>::is_signed, ==, true);
@ -200,7 +202,7 @@ namespace boost {
// is convertible to reference.
Iterator i2(i++);
boost::ignore_unused_variable_warning(i2);
BOOST_DEDUCED_TYPENAME boost::detail::iterator_traits<Iterator>::reference r(*(i++));
BOOST_DEDUCED_TYPENAME std::iterator_traits<Iterator>::reference r(*(i++));
boost::ignore_unused_variable_warning(r);
}
private:

View File

@ -58,6 +58,7 @@
#include <boost/type_traits/remove_cv.hpp>
#include <boost/utility/addressof.hpp>
#include <boost/utility/enable_if.hpp> // disable_if
#include <boost/next_prior.hpp>
#if !defined(BOOST_RANGE_DETAIL_MICROSOFT_RANGE_VERSION_1)
#include <boost/range/mutable_iterator.hpp>

View File

@ -12,6 +12,7 @@
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/range/iterator_range.hpp>
#include <boost/next_prior.hpp>
namespace boost
{

View File

@ -42,6 +42,7 @@
#include <boost/range/algorithm/equal.hpp>
#include <boost/range/detail/safe_bool.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/next_prior.hpp>
#include <iterator>
#include <algorithm>
#include <cstddef>

View File

@ -219,3 +219,5 @@ test-suite range :
[ range-test value_type ]
;
# `quick` target (for CI)
alias quick : std_container ;

View File

@ -457,7 +457,7 @@ void simple_compile_test()
BOOST_RANGE_RETURNS_TEST2( find_end, v, std::less<int>() );
BOOST_RANGE_RETURNS_TEST2( find_first_of, v, std::less<int>() );
BOOST_RANGE_RETURNS_TEST2( search, v, std::less<int>() );
BOOST_RANGE_RETURNS_TEST2( boost::search, v, std::less<int>() );
BOOST_RANGE_RETURNS_TEST2( lower_bound, 0, std::less<int>() );
BOOST_RANGE_RETURNS_TEST2( upper_bound, 0, std::less<int>() );

View File

@ -22,6 +22,8 @@
#include <boost/type_traits.hpp>
#include <boost/test/test_tools.hpp>
#include <vector>
#include <iterator>
#include <utility>
void check_iterator_pair()
{
@ -39,23 +41,23 @@ void check_iterator_pair()
BOOST_STATIC_ASSERT(( boost::is_same< boost::range_value<pair_t>::type,
boost::detail::iterator_traits<pair_t::first_type>::value_type>::value ));
std::iterator_traits<pair_t::first_type>::value_type>::value ));
BOOST_STATIC_ASSERT(( boost::is_same< boost::range_iterator<pair_t>::type, pair_t::first_type >::value ));
BOOST_STATIC_ASSERT(( boost::is_same< boost::range_const_iterator<pair_t>::type, pair_t::first_type >::value ));
BOOST_STATIC_ASSERT(( boost::is_same< boost::range_difference<pair_t>::type,
boost::detail::iterator_traits<pair_t::first_type>::difference_type >::value ));
std::iterator_traits<pair_t::first_type>::difference_type >::value ));
BOOST_STATIC_ASSERT(( boost::is_same< boost::range_size<pair_t>::type, std::size_t >::value ));
BOOST_STATIC_ASSERT(( boost::is_same< boost::range_iterator<pair_t>::type, pair_t::first_type >::value ));
BOOST_STATIC_ASSERT(( boost::is_same< boost::range_iterator<const_pair_t>::type, const_pair_t::first_type >::value ));
BOOST_STATIC_ASSERT(( boost::is_same< boost::range_value<const_pair_tt>::type,
boost::detail::iterator_traits<const_pair_t::first_type>::value_type>::value ));
std::iterator_traits<const_pair_t::first_type>::value_type>::value ));
BOOST_STATIC_ASSERT(( boost::is_same< boost::range_iterator<const_pair_tt>::type, const_pair_tt::first_type >::value ));
//
// This behavior is not supported with v2.
//BOOST_STATIC_ASSERT(( is_same< range_const_iterator<const_pair_tt>::type, const_pair_tt::first_type >::value ));
BOOST_STATIC_ASSERT(( boost::is_same< boost::range_difference<const_pair_tt>::type,
boost::detail::iterator_traits<const_pair_tt::first_type>::difference_type >::value ));
std::iterator_traits<const_pair_tt::first_type>::difference_type >::value ));
BOOST_STATIC_ASSERT(( boost::is_same< boost::range_size<const_pair_tt>::type, std::size_t >::value ));
BOOST_STATIC_ASSERT(( boost::is_same< boost::range_iterator<const_pair_tt>::type, const_pair_tt::first_type >::value ));
BOOST_STATIC_ASSERT(( boost::is_same< boost::range_iterator<const_pair_tt>::type, const_pair_tt::first_type >::value ));