Compare commits

..

19 Commits

Author SHA1 Message Date
b91cb90dca Make min/max engine members constexpr in random_shuffle.hpp 2018-09-24 02:26:50 +03:00
7efe3c68f6 Fix msvc-10.0, msvc-11.0 failures in ref_unwrapped tests 2018-09-24 02:21:55 +03:00
357bf3b980 Merge pull request #75 from morinmorin/add_adl_barrier_to_distance
Add ADL guard namespace for boost::distance(rng)
2018-09-23 20:08:55 +03:00
9192996a93 Add ADL guard namespace for boost::distance(rng). 2018-09-23 21:45:30 +09:00
70d1727ed3 Merge pull request #71 from boostorg/pr/concepts-msvc-permissive-2
Change RandomAccessIteratorConcept to BidirectionalIteratorConcept to…
2018-07-10 12:02:41 +01:00
406226eccd Change RandomAccessIteratorConcept to BidirectionalIteratorConcept to work around a MSVC bug 2018-07-10 13:12:55 +03:00
05532829bd Merge pull request #70 from boostorg/pr/concepts-msvc-permissive-
Remove ill-formed MSVC-specific code that doesn't compile with /permi…
2018-07-09 20:19:38 +01:00
c24661a636 Remove ill-formed MSVC-specific code that doesn't compile with /permissive- 2018-07-09 20:41:33 +03:00
4dd5ad0f64 Merge pull request #65 from VeroSoftware/develop
Fix Error C4596: 'difference_type': illegal qualified name in member declaration
2018-04-06 14:58:20 +01:00
f1906e914e use _MSC_VER to guard fix for C4596 when compiling with MSVC141 2018-02-28 13:43:34 +00:00
795046f8fc Fix Error C4596: 'difference_type': illegal qualified name in member declaration when compiling with VS 2017 Professional 15.5.6 2018-02-28 10:55:24 +00:00
2aaa802e6a Merge pull request #64 from boostorg/revert-54-push_back_move_support
Revert "push_back: added support for not-copyable but moveable value-types li…"
2018-01-03 14:39:46 +00:00
5b2500872d Revert "push_back: added support for not-copyable but moveable value-types li…" 2018-01-03 14:36:50 +00:00
5408f220dd Split Travis jobs to avoid timeout 2017-12-03 03:16:30 +02:00
937a411c3f Add .travis.yml 2017-12-02 19:17:02 +02:00
1dac6a796e Add quick test target (for CI) 2017-12-02 19:10:56 +02:00
1234c59a39 Merge pull request #61 from danieljames/develop
Include boost/next_prior.hpp where needed
2017-12-02 16:00:35 +02:00
e0d2e492a1 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-02 10:40:16 +00:00
619c074146 Merge pull request #58 from boostorg/revert-45-develop
Revert "Update irange.hpp"
2017-11-15 23:22:00 +00:00
13 changed files with 158 additions and 131 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

@ -32,7 +32,7 @@ namespace boost
typedef BOOST_DEDUCED_TYPENAME
range_reference<SinglePassRange>::type argument_type;
using result_type = decltype(std::declval<argument_type>().get() );
typedef decltype(std::declval<argument_type>().get() ) result_type;
result_type operator()( argument_type &&r ) const
{
@ -46,11 +46,11 @@ namespace boost
: public transformed_range<unwrap_ref<SinglePassRange>,
SinglePassRange>
{
using base = transformed_range<unwrap_ref<SinglePassRange>,
SinglePassRange>;
typedef transformed_range<unwrap_ref<SinglePassRange>,
SinglePassRange> base;
public:
using transform_fn_type = unwrap_ref<SinglePassRange>;
using source_range_type = SinglePassRange;
typedef unwrap_ref<SinglePassRange> transform_fn_type;
typedef SinglePassRange source_range_type;
unwrap_ref_range(transform_fn_type fn, source_range_type &rng)
: base(fn, rng)

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

@ -32,12 +32,12 @@ struct wrap_rand
{
typedef unsigned int result_type;
static result_type (min)()
static BOOST_CONSTEXPR result_type (min)()
{
return 0;
}
static result_type (max)()
static BOOST_CONSTEXPR result_type (max)()
{
return RAND_MAX;
}
@ -64,12 +64,12 @@ struct wrap_generator
wrap_generator(Generator& gen) : g(gen) {}
static result_type (min)()
static BOOST_CONSTEXPR result_type (min)()
{
return 0;
}
static result_type (max)()
static BOOST_CONSTEXPR result_type (max)()
{
return max_arg - 1;
}

View File

@ -20,37 +20,9 @@
namespace boost
{
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
namespace range_detail
namespace range
{
template < class Container, class Range >
inline Container& push_back_impl( Container& on, Range&& from, std::false_type)
{
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<Range> ));
BOOST_ASSERT_MSG(!range_detail::is_same_object(on, from),
"cannot move from a container to itself");
on.insert( on.end(),
std::make_move_iterator(boost::begin(from)),
std::make_move_iterator(boost::end(from)));
return on;
}
template < class Container, class Range >
inline Container& push_back_impl( Container& on, const Range& from, std::true_type)
{
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const Range> ));
BOOST_ASSERT_MSG(!range_detail::is_same_object(on, from),
"cannot copy from a container to itself");
on.insert( on.end(), boost::begin(from), boost::end(from));
return on;
}
} //namespace range_detail
#endif
namespace range {
#if defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
template< class Container, class Range >
inline Container& push_back( Container& on, const Range& from )
{
@ -62,19 +34,6 @@ inline Container& push_back( Container& on, const Range& from )
return on;
}
#else
template< class Container, class Range >
inline Container& push_back( Container& on, Range&& from )
{
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<Container> ));
range_detail::push_back_impl(on,
std::forward<Range>(from),
std::is_lvalue_reference<Range>() );
return on;
}
#endif
} // namespace range
using range::push_back;
} // namespace boost

View File

@ -252,7 +252,7 @@ namespace boost {
n = i - j;
}
private:
BOOST_DEDUCED_TYPENAME RandomAccessIteratorConcept::difference_type n;
BOOST_DEDUCED_TYPENAME BidirectionalIteratorConcept<Iterator>::difference_type n;
Iterator i;
Iterator j;
#endif

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

@ -23,13 +23,18 @@
namespace boost
{
template< class T >
inline BOOST_CXX14_CONSTEXPR BOOST_DEDUCED_TYPENAME range_difference<T>::type
distance( const T& r )
namespace range_distance_adl_barrier
{
return boost::distance( boost::begin( r ), boost::end( r ) );
template< class T >
inline BOOST_CXX14_CONSTEXPR BOOST_DEDUCED_TYPENAME range_difference<T>::type
distance( const T& r )
{
return boost::iterators::distance( boost::begin( r ), boost::end( r ) );
}
}
using namespace range_distance_adl_barrier;
} // namespace 'boost'
#endif

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

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

View File

@ -17,7 +17,7 @@
#include <vector>
#if !defined(BOOST_NO_CXX11_AUTO_DECLARATIONS) && !defined(BOOST_NO_CXX11_RANGE_BASED_FOR)
#if !defined(BOOST_NO_CXX11_AUTO_DECLARATIONS) && !defined(BOOST_NO_CXX11_RANGE_BASED_FOR) && !defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX)
namespace boost
{

View File

@ -19,7 +19,6 @@
#include <list>
#include <vector>
namespace
{
template< class Container >
@ -59,76 +58,6 @@ namespace
test_push_back_impl< std::vector<std::size_t> >();
test_push_back_impl< std::list<std::size_t> >();
}
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
// test type which is not copyable by moveable.
class noncopyable_int : boost::noncopyable {
private:
int i;
public:
noncopyable_int(int x) : i(x) {}
noncopyable_int(const noncopyable_int&) = delete;
noncopyable_int& operator=(const noncopyable_int&) = delete;
noncopyable_int(noncopyable_int&& o) : i(o.i) {}
noncopyable_int& operator=(noncopyable_int&& o) { return o; }
bool operator!=(const noncopyable_int &rhs) { return i != rhs.i; }
friend std::ostream &operator<<(std::ostream &os, const noncopyable_int& x);
};
std::ostream & operator<<(std::ostream &os, const noncopyable_int& x)
{
return os << x.i;
}
template< class Container >
void test_push_back_move_impl(std::size_t n)
{
Container test;
Container reference;
for (std::size_t i = 0; i < n; ++i)
reference.push_back(noncopyable_int(i));
{
Container to_push_back;
for (std::size_t i = 0; i < n; ++i)
to_push_back.push_back(noncopyable_int(i));
boost::push_back(test, std::move(to_push_back));
BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(),
test.begin(), test.end() );
}
// Do it again to push onto non-empty container
for (std::size_t i = 0; i < n; ++i)
reference.push_back(noncopyable_int(i));
{
Container to_push_back;
for (std::size_t i = 0; i < n; ++i)
to_push_back.push_back(noncopyable_int(i));
boost::push_back(test, std::move(to_push_back));
BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(),
test.begin(), test.end() );
}
}
template< class Container >
void test_push_back_move_impl()
{
test_push_back_move_impl< Container >(0);
test_push_back_move_impl< Container >(1);
test_push_back_move_impl< Container >(2);
test_push_back_move_impl< Container >(100);
}
void test_push_back_move()
{
test_push_back_move_impl< std::vector<noncopyable_int> >();
test_push_back_move_impl< std::list<noncopyable_int> >();
}
#endif
}
boost::unit_test::test_suite*
@ -138,9 +67,6 @@ init_unit_test_suite(int argc, char* argv[])
= BOOST_TEST_SUITE( "RangeTestSuite.algorithm_ext.push_back" );
test->add( BOOST_TEST_CASE( &test_push_back ) );
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
test->add( BOOST_TEST_CASE( &test_push_back_move ) );
#endif
return test;
}