Skip to content

Commit 4f9afb0

Browse files
committed
Merge for the 1.68.0 beta
2 parents 6d0126d + 3659b18 commit 4f9afb0

12 files changed

+1381
-1
lines changed

.travis.yml

+171
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
# Copyright 2016, 2017, 2018 Peter Dimov
2+
# Copyright 2018 T. Zachary Laine
3+
# Distributed under the Boost Software License, Version 1.0.
4+
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
5+
6+
language: cpp
7+
8+
sudo: false
9+
10+
branches:
11+
only:
12+
- master
13+
- develop
14+
- /feature\/.*/
15+
16+
env:
17+
matrix:
18+
- BOGUS_JOB=true
19+
20+
matrix:
21+
22+
exclude:
23+
- env: BOGUS_JOB=true
24+
25+
include:
26+
- os: linux
27+
env: TOOLSET=gcc COMPILER=g++ CXXSTD=11
28+
29+
- os: linux
30+
env: TOOLSET=gcc COMPILER=g++-4.7 CXXSTD=11
31+
addons:
32+
apt:
33+
packages:
34+
- g++-4.7
35+
sources:
36+
- ubuntu-toolchain-r-test
37+
38+
- os: linux
39+
env: TOOLSET=gcc COMPILER=g++-4.8 CXXSTD=11
40+
addons:
41+
apt:
42+
packages:
43+
- g++-4.8
44+
sources:
45+
- ubuntu-toolchain-r-test
46+
47+
- os: linux
48+
env: TOOLSET=gcc COMPILER=g++-4.9 CXXSTD=11
49+
addons:
50+
apt:
51+
packages:
52+
- g++-4.9
53+
sources:
54+
- ubuntu-toolchain-r-test
55+
56+
- os: linux
57+
env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=11,14,1z
58+
addons:
59+
apt:
60+
packages:
61+
- g++-5
62+
sources:
63+
- ubuntu-toolchain-r-test
64+
65+
- os: linux
66+
env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=11,14,1z
67+
addons:
68+
apt:
69+
packages:
70+
- g++-6
71+
sources:
72+
- ubuntu-toolchain-r-test
73+
74+
- os: linux
75+
env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=11,14,1z CXXSTD_DIALECT=cxxstd-dialect=gnu
76+
addons:
77+
apt:
78+
packages:
79+
- g++-6
80+
sources:
81+
- ubuntu-toolchain-r-test
82+
83+
- os: linux
84+
env: TOOLSET=gcc COMPILER=g++-7 CXXSTD=11,14,17
85+
addons:
86+
apt:
87+
packages:
88+
- g++-7
89+
sources:
90+
- ubuntu-toolchain-r-test
91+
92+
- os: linux
93+
env: TOOLSET=clang COMPILER=clang++ CXXSTD=11
94+
95+
- os: linux
96+
compiler: clang++-libc++
97+
env: TOOLSET=clang COMPILER=clang++-libc++ CXXSTD=11,14,1z
98+
addons:
99+
apt:
100+
packages:
101+
- libc++-dev
102+
103+
- os: osx
104+
env: TOOLSET=clang COMPILER=clang++ CXXSTD=11,14,1z
105+
osx_image: xcode9.1
106+
107+
- os: osx
108+
env: TOOLSET=clang COMPILER=clang++ CXXSTD=11,14,1z
109+
osx_image: xcode9
110+
111+
- os: osx
112+
env: TOOLSET=clang COMPILER=clang++ CXXSTD=11,14,1z
113+
osx_image: xcode8.3
114+
115+
- os: osx
116+
env: TOOLSET=clang COMPILER=clang++ CXXSTD=11,14,1z
117+
osx_image: xcode8
118+
119+
- os: osx
120+
env: TOOLSET=clang COMPILER=clang++ CXXSTD=11,14,1z
121+
osx_image: xcode7.3
122+
123+
- os: osx
124+
env: TOOLSET=clang COMPILER=clang++ CXXSTD=11,14,1z
125+
osx_image: xcode6.4
126+
127+
install:
128+
- BOOST_BRANCH=develop && [ "$TRAVIS_BRANCH" == "master" ] && BOOST_BRANCH=master || true
129+
- cd ..
130+
- git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
131+
- cd boost-root
132+
- git submodule update --init tools/build
133+
- git submodule update --init libs/config
134+
- git submodule update --init libs/predef
135+
- git submodule update --init libs/core
136+
- git submodule update --init libs/detail
137+
- git submodule update --init libs/range
138+
- git submodule update --init libs/assert
139+
- git submodule update --init libs/array
140+
- git submodule update --init libs/type_traits
141+
- git submodule update --init libs/static_assert
142+
- git submodule update --init libs/iterator
143+
- git submodule update --init libs/preprocessor
144+
- git submodule update --init libs/mpl
145+
- git submodule update --init libs/smart_ptr
146+
- git submodule update --init libs/callable_traits
147+
- git submodule update --init libs/type_index
148+
- git submodule update --init libs/exception
149+
- git submodule update --init libs/throw_exception
150+
- git submodule update --init libs/utility
151+
- git submodule update --init libs/bind
152+
- git submodule update --init libs/ratio
153+
- git submodule update --init libs/function
154+
- git submodule update --init libs/integer
155+
- git submodule update --init libs/numeric
156+
- git submodule update --init libs/move
157+
- git submodule update --init libs/container_hash
158+
- git submodule update --init libs/io
159+
- git submodule update --init libs/concept_check
160+
- git submodule update --init libs/test
161+
- git submodule update --init libs/timer
162+
- git submodule update --init libs/chrono
163+
- git submodule update --init libs/system
164+
- cp -r $TRAVIS_BUILD_DIR/* libs/algorithm
165+
- ./bootstrap.sh
166+
- ./b2 headers
167+
168+
script:
169+
- |-
170+
echo "using $TOOLSET : : $COMPILER ;" > ~/user-config.jam
171+
- ./b2 -j3 libs/algorithm/test toolset=$TOOLSET cxxstd=$CXXSTD $CXXSTD_DIALECT

appveyor.yml

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Copyright 2016 Peter Dimov
2+
# Distributed under the Boost Software License, Version 1.0.
3+
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
4+
5+
version: 1.0.{build}-{branch}
6+
7+
shallow_clone: true
8+
9+
branches:
10+
only:
11+
- master
12+
- develop
13+
14+
platform:
15+
- x64
16+
17+
environment:
18+
matrix:
19+
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
20+
ARGS: --toolset=msvc-14.1 address-model=64
21+
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
22+
ARGS: --toolset=msvc-14.1 address-model=32
23+
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
24+
ARGS: --toolset=msvc-14.1 address-model=64 cxxflags=-std:c++latest cxxflags=-permissive-
25+
- ARGS: --toolset=msvc-9.0 address-model=32
26+
- ARGS: --toolset=msvc-10.0 address-model=32
27+
- ARGS: --toolset=msvc-11.0 address-model=32
28+
- ARGS: --toolset=msvc-12.0 address-model=32
29+
- ARGS: --toolset=msvc-14.0 address-model=32
30+
- ARGS: --toolset=msvc-12.0 address-model=64
31+
- ARGS: --toolset=msvc-14.0 address-model=64
32+
- ARGS: --toolset=msvc-14.0 address-model=64 cxxflags=-std:c++latest
33+
- ARGS: --toolset=gcc address-model=64
34+
CXXSTD: 03,11,14,1z
35+
PATH: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin;%PATH%
36+
- ARGS: --toolset=gcc address-model=64
37+
CXXSTD: 03,11,14,1z
38+
PATH: C:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\bin;%PATH%
39+
- ARGS: --toolset=gcc address-model=32 linkflags=-Wl,-allow-multiple-definition
40+
CXXSTD: 03,11,14,1z
41+
PATH: C:\MinGW\bin;%PATH%
42+
- ARGS: --toolset=gcc address-model=64
43+
CXXSTD: 03,11,14,1z
44+
PATH: C:\cygwin64\bin;%PATH%
45+
- ARGS: --toolset=gcc address-model=32
46+
CXXSTD: 03,11,14,1z
47+
PATH: C:\cygwin\bin;%PATH%
48+
49+
install:
50+
- cd ..
51+
- git clone -b %APPVEYOR_REPO_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
52+
- cd boost-root
53+
- xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\algorithm
54+
- git submodule update --init tools/build
55+
- git submodule update --init libs/config
56+
- git submodule update --init libs/predef
57+
- git submodule update --init libs/core
58+
- git submodule update --init libs/detail
59+
- git submodule update --init libs/range
60+
- git submodule update --init libs/assert
61+
- git submodule update --init libs/array
62+
- git submodule update --init libs/type_traits
63+
- git submodule update --init libs/static_assert
64+
- git submodule update --init libs/iterator
65+
- git submodule update --init libs/preprocessor
66+
- git submodule update --init libs/mpl
67+
- git submodule update --init libs/smart_ptr
68+
- git submodule update --init libs/callable_traits
69+
- git submodule update --init libs/type_index
70+
- git submodule update --init libs/exception
71+
- git submodule update --init libs/throw_exception
72+
- git submodule update --init libs/utility
73+
- git submodule update --init libs/bind
74+
- git submodule update --init libs/ratio
75+
- git submodule update --init libs/function
76+
- git submodule update --init libs/integer
77+
- git submodule update --init libs/numeric
78+
- git submodule update --init libs/move
79+
- git submodule update --init libs/container_hash
80+
- git submodule update --init libs/io
81+
- git submodule update --init libs/concept_check
82+
- git submodule update --init libs/test
83+
- git submodule update --init libs/timer
84+
- git submodule update --init libs/chrono
85+
- git submodule update --init libs/system
86+
- bootstrap
87+
- b2 headers
88+
89+
build: off
90+
91+
test_script:
92+
- cd libs\config\test
93+
- ..\..\..\b2 -j3 %ARGS% cxxstd=%CXXSTD%

doc/algorithm.qbk

+2
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ Thanks to all the people who have reviewed this library and made suggestions for
6464

6565
[section:Misc Other Algorithms]
6666
[include clamp-hpp.qbk]
67+
[include find_not.qbk]
68+
[include find_backward.qbk]
6769
[include gather.qbk]
6870
[include hex.qbk]
6971
[include is_palindrome.qbk]

doc/find_backward.qbk

+116
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
[/ File find_backward.qbk]
2+
3+
[section:find_backward find_backward ]
4+
5+
[/license
6+
Copyright (c) 2018 T. Zachary Laine
7+
8+
Distributed under the Boost Software License, Version 1.0.
9+
(See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
10+
]
11+
12+
The header file 'find_backward.hpp' contains variants of the stl algorithm
13+
`find`. These variants are like `find`, except that the evaluate the elements
14+
of the given sequence in reverse order.
15+
16+
Consider how finding the last element that is equal to `x` in a range is
17+
typically done:
18+
19+
// Assume a valid range if elements delimited by [first, last).
20+
while (last-- != first) {
21+
if (*last == x) {
22+
// Use last here...
23+
}
24+
}
25+
26+
Raw loops are icky though. Perhaps we should do a bit of extra work to allow
27+
the use of `std::find()`:
28+
29+
auto rfirst = std::make_reverse_iterator(last);
30+
auto rlast = std::make_reverse_iterator(first);
31+
auto it = std::find(rfirst, rlast);
32+
// Use it here...
33+
34+
That seems nicer in that there is no raw loop, but it has two major drawbacks.
35+
First, it requires an unpleasant amount of typing. Second, it is less
36+
efficient than forward-iterator `find` , since `std::reverse_iterator` calls
37+
its base-iterator's `operator--()` in most of its member functions before
38+
doing the work that the member function requires.
39+
40+
[heading interface]
41+
42+
template<typename BidiIter, typename T>
43+
BidiIter find_backward(BidiIter first, BidiIter last, const T & x);
44+
45+
template<typename Range, typename T>
46+
boost::range_iterator<Range> find_backward(Range & range, const T & x);
47+
48+
These overloads of `find_backward` return an iterator to the last element that
49+
is equal to `x` in `[first, last)` or `r`, respectively.
50+
51+
template<typename BidiIter, typename T>
52+
BidiIter find_not_backward(BidiIter first, BidiIter last, const T & x);
53+
54+
template<typename Range, typename T>
55+
boost::range_iterator<Range> find_not_backward(Range & range, const T & x);
56+
57+
These overloads of `find_not_backward` return an iterator to the last element
58+
that is not equal to `x` in `[first, last)` or `r`, respectively.
59+
60+
template<typename BidiIter, typename Pred>
61+
BidiIter find_if_backward(BidiIter first, BidiIter last, Pred p);
62+
63+
template<typename Range, typename Pred>
64+
boost::range_iterator<Range> find_if_backward(Range & range, Pred p);
65+
66+
These overloads of `find_if_backward` return an iterator to the last element
67+
for which `pred` returns `true` in `[first, last)` or `r`, respectively.
68+
69+
template<typename BidiIter, typename Pred>
70+
BidiIter find_if_not_backward(BidiIter first, BidiIter last, Pred p);
71+
72+
template<typename Range, typename Pred>
73+
boost::range_iterator<Range> find_if_not_backward(Range & range, Pred p);
74+
75+
These overloads of `find_if_not_backward` return an iterator to the last
76+
element for which `pred` returns `false` in `[first, last)` or `r`,
77+
respectively.
78+
79+
[heading Examples]
80+
81+
Given the container `c1` containing `{ 2, 1, 2 }`, then
82+
83+
find_backward ( c1.begin(), c1.end(), 2 ) --> --c1.end()
84+
find_backward ( c1.begin(), c1.end(), 3 ) --> c1.end()
85+
find_if_backward ( c1.begin(), c1.end(), [](int i) {return i == 2;} ) --> --c1.end()
86+
find_if_backward ( c1.begin(), c1.end(), [](int i) {return i == 3;} ) --> c1.end()
87+
find_not_backward ( c1.begin(), c1.end(), 2 ) --> std::prev(c1.end(), 2)
88+
find_not_backward ( c1.begin(), c1.end(), 1 ) --> c1.end()
89+
find_if_not_backward ( c1.begin(), c1.end(), [](int i) {return i == 2;} ) --> std::prev(c1.end(), 2)
90+
find_if_not_backward ( c1.begin(), c1.end(), [](int i) {return i == 1;} ) --> c1.end()
91+
92+
[heading Iterator Requirements]
93+
94+
All variants work on bidirectional iterators.
95+
96+
[heading Complexity]
97+
98+
Linear.
99+
100+
[heading Exception Safety]
101+
102+
All of the variants take their parameters by value and do not depend upon any
103+
global state. Therefore, all the routines in this file provide the strong
104+
exception guarantee.
105+
106+
[heading Notes]
107+
108+
All variants are `constexpr` in C++14 or later.
109+
110+
[endsect]
111+
112+
[/ File equal.qbk
113+
Copyright 2018 T. Zachary Laine
114+
Distributed under the Boost Software License, Version 1.0.
115+
(See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt).
116+
]

0 commit comments

Comments
 (0)