Compare commits

...

59 Commits

Author SHA1 Message Date
Peter Dimov
12c95c48cf minstd_rand has been moved to Core 2024-04-14 06:10:37 +03:00
Andrey Semashev
e0ecf92764 Merge pull request #107 from LegalizeAdulthood/patch-1
Correct in place factory example code
2024-02-15 19:44:18 +03:00
Richard Thomson
bff26e4fa1 Correct in place factory example code
The example code as given won't work without const qualifiers on the pointer arguments.
2024-02-15 09:32:22 -07:00
Andrey Semashev
9abd1fc78d Added Windows jobs to GHA CI. 2024-02-06 01:17:37 +03:00
Andrey Semashev
3829fcbef4 Replaced actions/checkout usage with manual download commands.
This fixes the deprecation warnings for actions/checkout@v3. actions/checkout@v4
is not functional because of the upstream bug:

https://github.com/actions/checkout/issues/1590
2024-02-06 01:15:54 +03:00
Andrey Semashev
21d6434320 Reduced CI job timeouts. 2024-02-06 01:14:29 +03:00
Andrey Semashev
2ac19511c2 Added gcc-13 and clang-17 GHA CI jobs. 2024-02-06 01:12:48 +03:00
Andrey Semashev
217f7346f6 Removed gcc-4.6 from CI as it lacks C++11 template aliases used in Boost.TypeOf. 2023-11-17 17:52:05 +03:00
Andrey Semashev
85b5594f32 Remove C++03 CI jobs, use gcc-11 libstdc++ for clang-12 through 15.
Clang 12 through 15 does not support libstdc++-13 in C++23 mode.
2023-11-17 13:50:26 +03:00
Andrey Semashev
a95a4f6580 Fixed a link to ResultOf docs. 2023-09-24 23:15:54 +03:00
Andrey Semashev
076f050e9a Updated library descriptions and Utility categories.
Reflect that some pieces of Utility were moved to other libraries, meaning
that Utility no longer provides the components that were previously
mentioned in its description and categories.

Make some other descriptions more clear.
2023-09-24 23:07:14 +03:00
Andrey Semashev
e06b6dd788 Added String category to StringView. 2023-09-24 22:58:56 +03:00
Andrey Semashev
219ee9855d Renamed String Ref to String View and updated link to docs.
The pewvious link to docs was broken, and string_view basically superceded
string_ref, so renaming the library entry is appropriate.

Fixes https://github.com/boostorg/utility/issues/105.
2023-09-24 22:54:36 +03:00
Andrey Semashev
cea4262e62 Trim trailing spaces. 2023-09-03 02:10:47 +03:00
Andrey Semashev
52e3e64a34 Switch to boost::core::invoke_swap.
boost::swap is deprecated and will be removed. Use boost::core::invoke_swap
as a replacement.
2023-09-03 02:10:18 +03:00
Andrey Semashev
eb721609af Fix compilation with MSVC 14.3 in C++20 mode. 2023-07-14 02:22:09 +03:00
Andrey Semashev
b32d95a887 Add clang-16 CI jobs, switch to clang-15 from stock Ubuntu repos. 2023-06-05 03:26:52 +03:00
Andrey Semashev
656b5397c5 Restored docs removed by 703a4bf752.
Some of the HTML docs in the root directory were not converted to QuickBook
by 703a4bf752 and were incorrectly removed.
These docs are referenced by other libraries' docs, so restoring these pages.
2023-03-15 12:20:52 +03:00
Andrey Semashev
65b40cbf99 Fixed incorrect docs redirects. 2023-03-15 12:14:41 +03:00
Andrey Semashev
3aa25c9dd7 Use depinst.py to install dependencies in AppVeyor CI. 2022-11-17 23:47:46 +03:00
Andrey Semashev
46a785e32d Updated to GHA checkout@v3 to avoid deprecation warnings. 2022-10-18 17:59:59 +03:00
Andrey Semashev
a1231d1ff4 GitHub Actions config update.
- Added gcc-12 and clang-13 through 15 jobs.
- Added C++23 testing for gcc and clang on Linux.
- Updated clang version for UBSAN job.
- Updated Ubuntu version for clang jobs to avoid having to use external APT
  repository.
- Updated python package installation for compatibility with Ubuntu 22.04.
2022-09-10 02:09:54 +03:00
Andrey Semashev
3fe40554df Switched gcc-9 to ubuntu-20.04 GHA CI image. 2022-08-14 17:56:22 +03:00
Andrey Semashev
c869f8a9fa Replaced ubuntu-18.04 GHA CI images with containers.
Also use ubuntu-latest image for jobs that are running in a container.
2022-08-14 14:20:34 +03:00
Andrey Semashev
5d39709ef0 Switch to macos-11 GHA image as macos-10.15 is deprecated. 2022-08-12 16:05:19 +03:00
Andrey Semashev
028a90b29d Merge pull request #98 from boostorg/feature/string_view_remove_prefix_suffix_precondition
string_view: Change string_view::remove_prefix/suffix preconditions to use asserts
2022-07-06 03:14:43 +03:00
Andrey Semashev
581654e408 Use assert in string_view::remove_prefix/suffix to enforce preconditions.
This is in line with std::string_view::remove_prefix/suffix definition, where
calling the method with n > size() is UB. We're keeping the check to clamp
n to size() for now for backward compatibility so that it can be eventually
removed.

Closes https://github.com/boostorg/utility/issues/92.
2022-07-05 23:53:47 +03:00
Andrey Semashev
06548cf5fa Added VS2022 job and C++20 and C++latest jobs to AppVeyor CI. 2022-06-06 03:14:01 +03:00
Andrey Semashev
932973fe39 Merge pull request #99 from boostorg/feature/string_view_contains
string_view: Add string_view::contains methods
2022-05-31 11:53:30 +03:00
Andrey Semashev
c63d36cf5b Added string_view::contains methods.
These methods were added in C++23.

Also updated string_view/ref tests:

- Added tests for string_view::contains.
- Added missing includes.
- Added missing std:: qualification.
- Removed tabs.
- Fixed misleading indentation (fixes gcc warnings).
- Fixed decrementing pointer before beginning of the string.

Closes https://github.com/boostorg/utility/issues/93.
2022-05-04 00:32:30 +03:00
Andrey Semashev
0106ffda5f Added string_view/ref::substr overloads taking no arguments.
This effectively adds support for pos=0 default argument value.
The separate overload is better as it avoids instantiating std::min,
boost::throw_exception and removes std::out_of_range construction, which
potentially reduces code size, while maintaining the same behavior.

Fixes https://github.com/boostorg/utility/issues/96.
2022-05-03 00:46:03 +03:00
Andrey Semashev
0c1d01d30a Removed noexcept from string_view::compare that may throw.
One overload of string_view::compare calls substr internally,
which may throw. This makes compare potentially throwing.

Fixes https://github.com/boostorg/utility/issues/94.
2022-05-03 00:42:20 +03:00
Andrey Semashev
7ac95c156c Fixed string_view/ref::max_size() returning incorrect value.
Fixes https://github.com/boostorg/utility/issues/91.
2022-05-03 00:38:15 +03:00
Andrey Semashev
eb29d71245 Corrected argument type in string_view/ref::at(). 2022-05-03 00:23:10 +03:00
Andrey Semashev
fe417f6237 Merge pull request #83 from sdarwin/meta
Update metadata
2022-05-03 00:13:23 +03:00
sdarwin
d5c33889b9 Update metadata 2022-05-02 13:53:04 -05:00
Andrey Semashev
11cff46019 Merge pull request #90 from fanquake/remove_boost_swap
refactor: use core/swap over deprecated swap header
2022-04-29 18:26:16 +03:00
fanquake
f11a56c2a7 refactor: use core/swap over deprecated swap header
In boost/swap.hpp:
```cpp
// The header file at this path is deprecated;
// use boost/core/swap.hpp instead.

```
2022-04-29 16:08:20 +01:00
Andrey Semashev
69f6588d7c Updated comment. 2022-01-17 17:53:42 +03:00
Andrey Semashev
6950023bca Added a link to the ticket with discussion re. MSVC warning 4913. 2022-01-17 17:49:37 +03:00
Andrey Semashev
c3aab6a184 Use #ifdef to test for BOOST_MSVC. 2022-01-17 17:42:45 +03:00
Andrey Semashev
7717dac7bc Merge pull request #89 from Kojoley/patch-1
result_of_callable_class: suppress MSVC C4512
2022-01-17 17:29:33 +03:00
Nikita Kniazev
63aadf3f0f result_of_callable_class: suppress MSVC C4512
`result_of_callable_class` derives from a user provided type which might not be eligible for an implicit assignment operator causing an annoying warning
2022-01-16 22:34:34 +03:00
Andrey Semashev
0feb28b467 Merge pull request #88 from alandefreitas/boost_rel_paths
Adjust `@boost` relative paths
2021-12-28 23:38:13 +03:00
alandefreitas
78f1b38930 Adjust @boost relative paths 2021-12-28 15:24:39 -03:00
Andrey Semashev
e6edd4eb91 Minor formatting improvement. 2021-12-09 15:21:20 +03:00
Andrey Semashev
9d1284ef6d Use paths relative to the point of execution in doxygen rules.
This partly re-applies 5ae025b56a with the
following changes:

- Use path-constant to deduce the path relative to the point of execution
  rather than the Jamfile.
- Use that path only to list source files to be passed to Doxygen.
- Keep the project rule, but remove the duplicate requirements that are
  explicitly specified in standalone_main.

Hopefully, this should work around the problem of Reference generation
in the official docs.
2021-12-09 01:26:44 +03:00
Andrey Semashev
aa0ccfa65e Revert "Use path-constant in Jamfile"
This reverts commit 5ae025b56a.

Reason for revert: This breaks local generation of docs due to broken
links to css and images.
2021-12-09 00:02:37 +03:00
Andrey Semashev
c21d2818c7 Merge pull request #86 from alandefreitas/reference_glob
Use path-constant in Jamfile
2021-12-08 23:57:03 +03:00
Alan de Freitas
5ae025b56a Use path-constant in Jamfile 2021-12-08 17:53:12 -03:00
Glen Fernandes
f3f7c3c041 Merge pull request #85 from alandefreitas/reference_glob
Adjust doxygen relative paths
2021-12-08 10:56:04 -05:00
Alan de Freitas
bdc983b804 Adjust doxygen relative paths 2021-12-08 12:53:59 -03:00
Andrey Semashev
a1583e3072 Updated a couple C++ standard references. 2021-12-08 16:27:46 +03:00
Andrey Semashev
30caa722c1 Nonessential docs formatting. 2021-12-08 16:18:56 +03:00
Andrey Semashev
96169c9fc6 Added a link to the page describing EBO. 2021-12-08 16:15:48 +03:00
Andrey Semashev
b6119df27f Added links to a page describing POD. 2021-12-08 16:12:15 +03:00
Andrey Semashev
9941e831bb Updated references to C++ standard to C++11, added character escaping. 2021-12-08 16:08:36 +03:00
Andrey Semashev
a8cdbe516d Fixed a typo, added character escaping in docs. 2021-12-08 16:07:14 +03:00
Andrey Semashev
485a160dde Updated docs formatting. 2021-12-08 15:17:19 +03:00
44 changed files with 1819 additions and 531 deletions

View File

@@ -1,4 +1,4 @@
# Copyright 2021 Andrey Semashev
# Copyright 2021-2024 Andrey Semashev
#
# 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)
@@ -33,209 +33,260 @@ jobs:
matrix:
include:
# Linux, gcc
- toolset: gcc-4.4
cxxstd: "98,0x"
os: ubuntu-20.04
container: ubuntu:16.04
install:
- g++-4.4
sources:
- "ppa:ubuntu-toolchain-r/test"
- toolset: gcc-4.6
cxxstd: "03,0x"
os: ubuntu-20.04
container: ubuntu:16.04
install:
- g++-4.6
sources:
- "ppa:ubuntu-toolchain-r/test"
- toolset: gcc-4.7
cxxstd: "03,11"
os: ubuntu-20.04
cxxstd: "11"
os: ubuntu-latest
container: ubuntu:16.04
install:
- g++-4.7
- toolset: gcc-4.8
cxxstd: "03,11"
os: ubuntu-18.04
cxxstd: "11"
os: ubuntu-latest
container: ubuntu:18.04
install:
- g++-4.8
- toolset: gcc-4.9
cxxstd: "03,11"
os: ubuntu-20.04
cxxstd: "11"
os: ubuntu-latest
container: ubuntu:16.04
install:
- g++-4.9
- toolset: gcc-5
cxxstd: "03,11,14,1z"
os: ubuntu-20.04
cxxstd: "11,14,1z"
os: ubuntu-latest
container: ubuntu:16.04
install:
- g++-5
- toolset: gcc-6
cxxstd: "03,11,14,1z"
os: ubuntu-18.04
cxxstd: "11,14,1z"
os: ubuntu-latest
container: ubuntu:18.04
install:
- g++-6
- toolset: gcc-7
cxxstd: "03,11,14,17"
os: ubuntu-18.04
cxxstd: "11,14,17"
os: ubuntu-latest
container: ubuntu:18.04
install:
- g++-7
- toolset: gcc-8
cxxstd: "03,11,14,17,2a"
os: ubuntu-18.04
cxxstd: "11,14,17,2a"
os: ubuntu-latest
container: ubuntu:18.04
install:
- g++-8
- toolset: gcc-9
cxxstd: "03,11,14,17,2a"
os: ubuntu-18.04
cxxstd: "11,14,17,2a"
os: ubuntu-20.04
install:
- g++-9
- toolset: gcc-10
cxxstd: "03,11,14,17,20"
cxxstd: "11,14,17,20"
os: ubuntu-20.04
install:
- g++-10
- toolset: gcc-11
cxxstd: "03,11,14,17,20"
os: ubuntu-20.04
cxxstd: "11,14,17,20,23"
os: ubuntu-22.04
install:
- g++-11
sources:
- "ppa:ubuntu-toolchain-r/test"
- toolset: gcc-12
cxxstd: "11,14,17,20,23"
os: ubuntu-22.04
install:
- g++-12
- toolset: gcc-13
cxxstd: "11,14,17,20,23"
os: ubuntu-latest
container: ubuntu:23.04
install:
- g++-13
- name: UBSAN
toolset: gcc-11
cxxstd: "03,11,14,17,20"
cxxstd: "11,14,17,20,23"
ubsan: 1
build_variant: debug
os: ubuntu-20.04
os: ubuntu-22.04
install:
- g++-11
sources:
- "ppa:ubuntu-toolchain-r/test"
# Linux, clang
- toolset: clang
compiler: clang++-3.5
cxxstd: "03,11"
os: ubuntu-20.04
cxxstd: "11"
os: ubuntu-latest
container: ubuntu:16.04
install:
- clang-3.5
- toolset: clang
compiler: clang++-3.6
cxxstd: "03,11,14"
os: ubuntu-20.04
cxxstd: "11,14"
os: ubuntu-latest
container: ubuntu:16.04
install:
- clang-3.6
- toolset: clang
compiler: clang++-3.7
cxxstd: "03,11,14"
os: ubuntu-20.04
cxxstd: "11,14"
os: ubuntu-latest
container: ubuntu:16.04
install:
- clang-3.7
- toolset: clang
compiler: clang++-3.8
cxxstd: "03,11,14"
os: ubuntu-20.04
cxxstd: "11,14"
os: ubuntu-latest
container: ubuntu:16.04
install:
- clang-3.8
- toolset: clang
compiler: clang++-3.9
cxxstd: "03,11,14"
os: ubuntu-18.04
cxxstd: "11,14"
os: ubuntu-latest
container: ubuntu:18.04
install:
- clang-3.9
- toolset: clang
compiler: clang++-4.0
cxxstd: "03,11,14"
os: ubuntu-18.04
cxxstd: "11,14"
os: ubuntu-latest
container: ubuntu:18.04
install:
- clang-4.0
- toolset: clang
compiler: clang++-5.0
cxxstd: "03,11,14,1z"
os: ubuntu-18.04
cxxstd: "11,14,1z"
os: ubuntu-latest
container: ubuntu:18.04
install:
- clang-5.0
- toolset: clang
compiler: clang++-6.0
cxxstd: "03,11,14,17"
os: ubuntu-18.04
cxxstd: "11,14,17"
os: ubuntu-latest
container: ubuntu:18.04
install:
- clang-6.0
- toolset: clang
compiler: clang++-7
cxxstd: "03,11,14,17"
os: ubuntu-18.04
cxxstd: "11,14,17"
os: ubuntu-latest
container: ubuntu:18.04
install:
- clang-7
# Note: clang-8 does not fully support C++20, so it is not compatible with libstdc++-8 in this mode
- toolset: clang
compiler: clang++-8
cxxstd: "03,11,14,17,2a"
os: ubuntu-18.04
cxxstd: "11,14,17,2a"
os: ubuntu-latest
container: ubuntu:18.04
install:
- clang-8
- g++-7
gcc_toolchain: 7
- toolset: clang
compiler: clang++-9
cxxstd: "03,11,14,17,2a"
cxxstd: "11,14,17,2a"
os: ubuntu-20.04
install:
- clang-9
- toolset: clang
compiler: clang++-10
cxxstd: "03,11,14,17,20"
cxxstd: "11,14,17,20"
os: ubuntu-20.04
install:
- clang-10
- toolset: clang
compiler: clang++-11
cxxstd: "03,11,14,17,20"
os: ubuntu-20.04
cxxstd: "11,14,17,20"
os: ubuntu-22.04
install:
- clang-11
- toolset: clang
compiler: clang++-12
cxxstd: "03,11,14,17,20"
os: ubuntu-20.04
cxxstd: "11,14,17,20,2b"
os: ubuntu-22.04
install:
- clang-12
- g++-11
gcc_toolchain: 11
- toolset: clang
compiler: clang++-12
cxxstd: "03,11,14,17,20"
os: ubuntu-20.04
compiler: clang++-13
cxxstd: "11,14,17,20,2b"
os: ubuntu-22.04
install:
- clang-12
- libc++-12-dev
- libc++abi-12-dev
- clang-13
- g++-11
gcc_toolchain: 11
- toolset: clang
compiler: clang++-14
cxxstd: "11,14,17,20,2b"
os: ubuntu-22.04
install:
- clang-14
- g++-11
gcc_toolchain: 11
- toolset: clang
compiler: clang++-15
cxxstd: "11,14,17,20,2b"
os: ubuntu-22.04
install:
- clang-15
- g++-11
gcc_toolchain: 11
- toolset: clang
compiler: clang++-16
cxxstd: "11,14,17,20,2b"
os: ubuntu-22.04
install:
- clang-16
sources:
- "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main"
source_keys:
- "https://apt.llvm.org/llvm-snapshot.gpg.key"
- toolset: clang
compiler: clang++-17
cxxstd: "11,14,17,20,23"
os: ubuntu-22.04
install:
- clang-17
sources:
- "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main"
source_keys:
- "https://apt.llvm.org/llvm-snapshot.gpg.key"
- toolset: clang
compiler: clang++-17
cxxstd: "11,14,17,20,23"
os: ubuntu-22.04
install:
- clang-17
- libc++-17-dev
- libc++abi-17-dev
sources:
- "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main"
source_keys:
- "https://apt.llvm.org/llvm-snapshot.gpg.key"
cxxflags: -stdlib=libc++
linkflags: -stdlib=libc++
- name: UBSAN
toolset: clang
compiler: clang++-12
cxxstd: "03,11,14,17,20"
compiler: clang++-15
cxxstd: "11,14,17,20,2b"
cxxflags: -stdlib=libc++
linkflags: -stdlib=libc++
ubsan: 1
build_variant: debug
os: ubuntu-20.04
os: ubuntu-22.04
install:
- clang-12
- libc++-12-dev
- libc++abi-12-dev
- clang-15
- libc++-15-dev
- libc++abi-15-dev
- toolset: clang
cxxstd: "03,11,14,17,2a"
os: macos-10.15
cxxstd: "11,14,17,2a"
os: macos-11
timeout-minutes: 60
timeout-minutes: 15
runs-on: ${{matrix.os}}
container: ${{matrix.container}}
@@ -253,13 +304,17 @@ jobs:
if [ -f "/etc/debian_version" ]
then
apt-get -o Acquire::Retries=$NET_RETRY_COUNT update
apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y sudo software-properties-common tzdata wget curl apt-transport-https ca-certificates make build-essential g++ python python3 perl git cmake
if [ "$(apt-cache search "^python-is-python3$" | wc -l)" -ne 0 ]
then
PYTHON_PACKAGE="python-is-python3"
else
PYTHON_PACKAGE="python"
fi
apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y sudo software-properties-common tzdata wget curl apt-transport-https ca-certificates make build-essential g++ $PYTHON_PACKAGE python3 perl git cmake
fi
fi
git config --global pack.threads 0
- uses: actions/checkout@v2
- name: Install packages
if: matrix.install
run: |
@@ -374,11 +429,25 @@ jobs:
then
DEPINST_ARGS+=("--git_args" "--jobs $GIT_FETCH_JOBS")
fi
mkdir -p snapshot
cd snapshot
echo "Downloading library snapshot: https://github.com/${GITHUB_REPOSITORY}/archive/${GITHUB_SHA}.tar.gz"
curl -L --retry "$NET_RETRY_COUNT" -o "${LIBRARY}-${GITHUB_SHA}.tar.gz" "https://github.com/${GITHUB_REPOSITORY}/archive/${GITHUB_SHA}.tar.gz"
tar -xf "${LIBRARY}-${GITHUB_SHA}.tar.gz"
if [ ! -d "${LIBRARY}-${GITHUB_SHA}" ]
then
echo "Library snapshot does not contain the library directory ${LIBRARY}-${GITHUB_SHA}:"
ls -la
exit 1
fi
rm -f "${LIBRARY}-${GITHUB_SHA}.tar.gz"
cd ..
git clone -b "$BOOST_BRANCH" --depth 1 "https://github.com/boostorg/boost.git" "boost-root"
cd boost-root
mkdir -p libs/$LIBRARY
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
mkdir -p libs
rm -rf "libs/$LIBRARY"
mv -f "../snapshot/${LIBRARY}-${GITHUB_SHA}" "libs/$LIBRARY"
rm -rf "../snapshot"
git submodule update --init tools/boostdep
DEPINST_ARGS+=("$LIBRARY")
python tools/boostdep/depinst/depinst.py "${DEPINST_ARGS[@]}"
@@ -400,7 +469,7 @@ jobs:
- name: Run tests
if: matrix.cmake_tests == ''
run: |
cd ../boost-root
cd boost-root
B2_ARGS=("-j" "$BUILD_JOBS" "toolset=${{matrix.toolset}}" "cxxstd=${{matrix.cxxstd}}")
if [ -n "${{matrix.build_variant}}" ]
then
@@ -427,3 +496,78 @@ jobs:
fi
B2_ARGS+=("libs/$LIBRARY/test")
./b2 "${B2_ARGS[@]}"
windows:
strategy:
fail-fast: false
matrix:
include:
- toolset: msvc-14.0
cxxstd: "14"
addrmd: 32,64
os: windows-2019
- toolset: msvc-14.2
cxxstd: "14,17,20,latest"
addrmd: 32,64
os: windows-2019
- toolset: msvc-14.3
cxxstd: "14,17,20,latest"
addrmd: 32,64
os: windows-2022
- toolset: clang-win
cxxstd: "14,17,latest"
addrmd: 32,64
os: windows-2022
- toolset: gcc
cxxstd: "11,14,17,2a"
addrmd: 64
os: windows-2019
timeout-minutes: 15
runs-on: ${{matrix.os}}
steps:
- name: Setup Boost
shell: cmd
run: |
echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY%
for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=%%~nxi
echo LIBRARY: %LIBRARY%
echo LIBRARY=%LIBRARY%>>%GITHUB_ENV%
echo GITHUB_BASE_REF: %GITHUB_BASE_REF%
echo GITHUB_REF: %GITHUB_REF%
if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF%
set BOOST_BRANCH=develop
for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master
echo BOOST_BRANCH: %BOOST_BRANCH%
mkdir snapshot
cd snapshot
echo Downloading library snapshot: https://github.com/%GITHUB_REPOSITORY%/archive/%GITHUB_SHA%.zip
curl -L --retry %NET_RETRY_COUNT% -o "%LIBRARY%-%GITHUB_SHA%.zip" "https://github.com/%GITHUB_REPOSITORY%/archive/%GITHUB_SHA%.zip"
tar -xf "%LIBRARY%-%GITHUB_SHA%.zip"
if not exist "%LIBRARY%-%GITHUB_SHA%\" (
echo Library snapshot does not contain the library directory %LIBRARY%-%GITHUB_SHA%:
dir
exit /b 1
)
del /f "%LIBRARY%-%GITHUB_SHA%.zip"
cd ..
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
if not exist "libs\" mkdir libs
if exist "libs\%LIBRARY%\" rmdir /s /q "libs\%LIBRARY%"
move /Y "..\snapshot\%LIBRARY%-%GITHUB_SHA%" "libs\%LIBRARY%"
rmdir /s /q "..\snapshot"
git submodule update --init tools/boostdep
python tools/boostdep/depinst/depinst.py --git_args "--jobs %GIT_FETCH_JOBS%" %LIBRARY%
cmd /c bootstrap
b2 -d0 headers
- name: Run tests
shell: cmd
run: |
cd boost-root
if not "${{matrix.cxxstd}}" == "" set CXXSTD=cxxstd=${{matrix.cxxstd}}
if not "${{matrix.addrmd}}" == "" set ADDRMD=address-model=${{matrix.addrmd}}
if not "${{matrix.build_variant}}" == "" (set BUILD_VARIANT=variant=${{matrix.build_variant}}) else (set BUILD_VARIANT=variant=%DEFAULT_BUILD_VARIANT%)
b2 -j %NUMBER_OF_PROCESSORS% libs/%LIBRARY%/test toolset=${{matrix.toolset}} %CXXSTD% %ADDRMD% %BUILD_VARIANT% embed-manifest-via=linker

View File

@@ -1,19 +1,109 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Boost.Utility</title>
<meta http-equiv="refresh" content="0; URL=./doc/html/index.html">
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<title>Assignable</title>
</head>
<body>
Automatic redirection failed, please go to
<a href="./doc/html/index.html">./doc/html/index.html</a>
<hr>
<tt>
Boost.Utility<br>
<br>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
<a href=http://www.boost.org/LICENSE_1_0.txt>http://www.boost.org/LICENSE_1_0.txt</a>) <br>
<br>
</tt>
<body bgcolor="#FFFFFF" link="#0000EE" text="#000000" vlink="#551A8B" alink=
"#FF0000">
<img src="../../boost.png" alt="C++ Boost" width="277" height=
"86"><br clear="none">
<h1>Assignable</h1>
<h3>Description</h3>
<p>A type is Assignable if it is possible to assign one object of the type
to another object of that type.</p>
<h3>Notation</h3>
<table summary="">
<tr>
<td valign="top"><tt>T</tt></td>
<td valign="top">is type that is a model of Assignable</td>
</tr>
<tr>
<td valign="top"><tt>t</tt></td>
<td valign="top">is an object of type <tt>T</tt></td>
</tr>
<tr>
<td valign="top"><tt>u</tt></td>
<td valign="top">is an object of type <tt>T</tt> or possibly <tt>const
T</tt></td>
</tr>
</table>
<h3>Definitions</h3>
<h3>Valid expressions</h3>
<table border summary="">
<tr>
<th>Name</th>
<th>Expression</th>
<th>Return type</th>
<th>Semantics</th>
</tr>
<tr>
<td valign="top">Assignment</td>
<td valign="top"><tt>t = u</tt></td>
<td valign="top"><tt>T&amp;</tt></td>
<td valign="top"><tt>t</tt> is equivalent to <tt>u</tt></td>
</tr>
</table>
<h3>Models</h3>
<ul>
<li><tt>int</tt></li>
<li><tt>std::pair</tt></li>
</ul>
<h3>See also</h3>
<p><a href=
"http://www.sgi.com/tech/stl/DefaultConstructible.html">DefaultConstructible</a>
and <a href="./CopyConstructible.html">CopyConstructible</a><br></p>
<hr>
<p><a href="http://validator.w3.org/check?uri=referer"><img border="0" src=
"../../doc/images/valid-html401.png" alt="Valid HTML 4.01 Transitional"
height="31" width="88"></a></p>
<p>Revised
<!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B, %Y" startspan -->05 December, 2006<!--webbot bot="Timestamp" endspan i-checksum="38516" --></p>
<table summary="">
<tr valign="top">
<td nowrap><i>Copyright &copy; 2000</i></td>
<td><i><a href="http://www.lsc.nd.edu/~jsiek">Jeremy Siek</a>, Univ.of
Notre Dame (<a href=
"mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</a>)</i></td>
</tr>
</table>
<p><i>Distributed under the Boost Software License, Version 1.0. (See
accompanying file <a href="../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or
copy at <a href=
"http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</a>)</i></p>
</body>
</html>

View File

@@ -1,19 +1,534 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Boost.Utility</title>
<meta http-equiv="refresh" content="0; URL=./doc/html/index.html">
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<title>Collection</title>
</head>
<body>
Automatic redirection failed, please go to
<a href="./doc/html/index.html">./doc/html/index.html</a>
<hr>
<tt>
Boost.Utility<br>
<br>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
<a href=http://www.boost.org/LICENSE_1_0.txt>http://www.boost.org/LICENSE_1_0.txt</a>) <br>
<br>
</tt>
<body bgcolor="#FFFFFF" link="#0000EE" text="#000000" vlink="#551A8B" alink=
"#FF0000">
<h1><img src="../../boost.png" alt="boost logo" width="277" align="middle"
height="86"><br>
Collection</h1>
<h3>Description</h3>
<p>A Collection is a <i>concept</i> similar to the STL <a href=
"http://www.sgi.com/tech/stl/Container.html">Container</a> concept. A
Collection provides iterators for accessing a range of elements and
provides information about the number of elements in the Collection.
However, a Collection has fewer requirements than a Container. The
motivation for the Collection concept is that there are many useful
Container-like types that do not meet the full requirements of Container,
and many algorithms that can be written with this reduced set of
requirements. To summarize the reduction in requirements:</p>
<ul>
<li>It is not required to "own" its elements: the lifetime of an element
in a Collection does not have to match the lifetime of the Collection
object, though the lifetime of the element should cover the lifetime of
the Collection object.</li>
<li>The semantics of copying a Collection object is not defined (it could
be a deep or shallow copy or not even support copying).</li>
<li>The associated reference type of a Collection does not have to be a
real C++ reference.</li>
</ul>Because of the reduced requirements, some care must be taken when
writing code that is meant to be generic for all Collection types. In
particular, a Collection object should be passed by-reference since
assumptions can not be made about the behaviour of the copy constructor.
<h3>Associated types</h3>
<table border summary="">
<tr>
<td valign="top">Value type</td>
<td valign="top"><tt>X::value_type</tt></td>
<td valign="top">The type of the object stored in a Collection. If the
Collection is <i>mutable</i> then the value type must be <a href=
"http://www.sgi.com/tech/stl/Assignable.html">Assignable</a>. Otherwise
the value type must be <a href=
"./CopyConstructible.html">CopyConstructible</a>.</td>
</tr>
<tr>
<td valign="top">Iterator type</td>
<td valign="top"><tt>X::iterator</tt></td>
<td valign="top">The type of iterator used to iterate through a
Collection's elements. The iterator's value type is expected to be the
Collection's value type. A conversion from the iterator type to the
const iterator type must exist. The iterator type must be an <a href=
"http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>.</td>
</tr>
<tr>
<td valign="top">Const iterator type</td>
<td valign="top"><tt>X::const_iterator</tt></td>
<td valign="top">A type of iterator that may be used to examine, but
not to modify, a Collection's elements.</td>
</tr>
<tr>
<td valign="top">Reference type</td>
<td valign="top"><tt>X::reference</tt></td>
<td valign="top">A type that behaves like a reference to the
Collection's value type. <a href="#n1">[1]</a></td>
</tr>
<tr>
<td valign="top">Const reference type</td>
<td valign="top"><tt>X::const_reference</tt></td>
<td valign="top">A type that behaves like a const reference to the
Collection's value type.</td>
</tr>
<tr>
<td valign="top">Pointer type</td>
<td valign="top"><tt>X::pointer</tt></td>
<td valign="top">A type that behaves as a pointer to the Collection's
value type.</td>
</tr>
<tr>
<td valign="top">Distance type</td>
<td valign="top"><tt>X::difference_type</tt></td>
<td valign="top">A signed integral type used to represent the distance
between two of the Collection's iterators. This type must be the same
as the iterator's distance type.</td>
</tr>
<tr>
<td valign="top">Size type</td>
<td valign="top"><tt>X::size_type</tt></td>
<td valign="top">An unsigned integral type that can represent any
nonnegative value of the Collection's distance type.</td>
</tr>
</table>
<h3>Notation</h3>
<table summary="">
<tr>
<td valign="top"><tt>X</tt></td>
<td valign="top">A type that is a model of Collection.</td>
</tr>
<tr>
<td valign="top"><tt>a</tt>, <tt>b</tt></td>
<td valign="top">Object of type <tt>X</tt>.</td>
</tr>
<tr>
<td valign="top"><tt>T</tt></td>
<td valign="top">The value type of <tt>X</tt>.</td>
</tr>
</table>
<h3>Valid expressions</h3>
<p>The following expressions must be valid.</p>
<table border summary="">
<tr>
<th>Name</th>
<th>Expression</th>
<th>Return type</th>
</tr>
<tr>
<td valign="top">Beginning of range</td>
<td valign="top"><tt>a.begin()</tt></td>
<td valign="top"><tt>iterator</tt> if <tt>a</tt> is mutable,
<tt>const_iterator</tt> otherwise</td>
</tr>
<tr>
<td valign="top">End of range</td>
<td valign="top"><tt>a.end()</tt></td>
<td valign="top"><tt>iterator</tt> if <tt>a</tt> is mutable,
<tt>const_iterator</tt> otherwise</td>
</tr>
<tr>
<td valign="top">Size</td>
<td valign="top"><tt>a.size()</tt></td>
<td valign="top"><tt>size_type</tt></td>
</tr><!--
<TR>
<TD VAlign=top>
Maximum size
</TD>
<TD VAlign=top>
<tt>a.max_size()</tt>
</TD>
<TD VAlign=top>
<tt>size_type</tt>
</TD>
</TR>
-->
<tr>
<td valign="top">Empty Collection</td>
<td valign="top"><tt>a.empty()</tt></td>
<td valign="top">Convertible to <tt>bool</tt></td>
</tr>
<tr>
<td valign="top">Swap</td>
<td valign="top"><tt>a.swap(b)</tt></td>
<td valign="top"><tt>void</tt></td>
</tr>
</table>
<h3>Expression semantics</h3>
<table border summary="">
<tr>
<th>Name</th>
<th>Expression</th>
<th>Semantics</th>
<th>Postcondition</th>
</tr>
<tr>
<td valign="top">Beginning of range</td>
<td valign="top"><tt>a.begin()</tt></td>
<td valign="top">Returns an iterator pointing to the first element in
the Collection.</td>
<td valign="top"><tt>a.begin()</tt> is either dereferenceable or
past-the-end. It is past-the-end if and only if <tt>a.size() ==
0</tt>.</td>
</tr>
<tr>
<td valign="top">End of range</td>
<td valign="top"><tt>a.end()</tt></td>
<td valign="top">Returns an iterator pointing one past the last element
in the Collection.</td>
<td valign="top"><tt>a.end()</tt> is past-the-end.</td>
</tr>
<tr>
<td valign="top">Size</td>
<td valign="top"><tt>a.size()</tt></td>
<td valign="top">Returns the size of the Collection, that is, its
number of elements.</td>
<td valign="top"><tt>a.size() &gt;= 0</tt></td>
</tr><!--
<TR>
<TD VAlign=top>
Maximum size
</TD>
<TD VAlign=top>
<tt>a.max_size()</tt>
</TD>
<TD VAlign=top>
&nbsp;
</TD>
<TD VAlign=top>
Returns the largest size that this Collection can ever have. <A href="#8">[8]</A>
</TD>
<TD VAlign=top>
<tt>a.max_size() &gt;= 0 &amp;&amp; a.max_size() &gt;= a.size()</tt>
</TD>
</TR>
-->
<tr>
<td valign="top">Empty Collection</td>
<td valign="top"><tt>a.empty()</tt></td>
<td valign="top">Equivalent to <tt>a.size() == 0</tt>. (But possibly
faster.)</td>
<td valign="top">&nbsp;</td>
</tr>
<tr>
<td valign="top">Swap</td>
<td valign="top"><tt>a.swap(b)</tt></td>
<td valign="top">Equivalent to <tt>swap(a,b)</tt></td>
<td valign="top">&nbsp;</td>
</tr>
</table>
<h3>Complexity guarantees</h3>
<p><tt>begin()</tt> and <tt>end()</tt> are amortized constant time.</p>
<p><tt>size()</tt> is at most linear in the Collection's size.
<tt>empty()</tt> is amortized constant time.</p>
<p><tt>swap()</tt> is at most linear in the size of the two
collections.</p>
<h3>Invariants</h3>
<table border summary="">
<tr>
<td valign="top">Valid range</td>
<td valign="top">For any Collection <tt>a</tt>, <tt>[a.begin(),
a.end())</tt> is a valid range.</td>
</tr>
<tr>
<td valign="top">Range size</td>
<td valign="top"><tt>a.size()</tt> is equal to the distance from
<tt>a.begin()</tt> to <tt>a.end()</tt>.</td>
</tr>
<tr>
<td valign="top">Completeness</td>
<td valign="top">An algorithm that iterates through the range
<tt>[a.begin(), a.end())</tt> will pass through every element of
<tt>a</tt>.</td>
</tr>
</table>
<h3>Models</h3>
<ul>
<li><tt>array</tt></li>
<li><tt>array_ptr</tt></li>
<li><tt>vector&lt;bool&gt;</tt></li>
</ul>
<h3>Collection Refinements</h3>
<p>There are quite a few concepts that refine the Collection concept,
similar to the concepts that refine the Container concept. Here is a brief
overview of the refining concepts.</p>
<h4>ForwardCollection</h4>
<p>The elements are arranged in some order that does not change
spontaneously from one iteration to the next. As a result, a
ForwardCollection is <a href=
"http://www.sgi.com/tech/stl/EqualityComparable.html">EqualityComparable</a>
and <a href=
"http://www.sgi.com/tech/stl/LessThanComparable.html">LessThanComparable</a>.
In addition, the iterator type of a ForwardCollection is a
MultiPassInputIterator which is just an InputIterator with the added
requirements that the iterator can be used to make multiple passes through
a range, and that if <tt>it1 == it2</tt> and <tt>it1</tt> is
dereferenceable then <tt>++it1 == ++it2</tt>. The ForwardCollection also
has a <tt>front()</tt> method.</p>
<table border summary="">
<tr>
<th>Name</th>
<th>Expression</th>
<th>Return type</th>
<th>Semantics</th>
</tr>
<tr>
<td valign="top">Front</td>
<td valign="top"><tt>a.front()</tt></td>
<td valign="top"><tt>reference</tt> if <tt>a</tt> is mutable,<br>
<tt>const_reference</tt> otherwise.</td>
<td valign="top">Equivalent to <tt>*(a.begin())</tt>.</td>
</tr>
</table>
<h4>ReversibleCollection</h4>
<p>The container provides access to iterators that traverse in both
directions (forward and reverse). The iterator type must meet all of the
requirements of <a href=
"http://www.sgi.com/tech/stl/BidirectionalIterator.html">BidirectionalIterator</a>
except that the reference type does not have to be a real C++ reference.
The ReversibleCollection adds the following requirements to those of
ForwardCollection.</p>
<table border summary="">
<tr>
<th>Name</th>
<th>Expression</th>
<th>Return type</th>
<th>Semantics</th>
</tr>
<tr>
<td valign="top">Beginning of range</td>
<td valign="top"><tt>a.rbegin()</tt></td>
<td valign="top"><tt>reverse_iterator</tt> if <tt>a</tt> is mutable,
<tt>const_reverse_iterator</tt> otherwise.</td>
<td valign="top">Equivalent to
<tt>X::reverse_iterator(a.end())</tt>.</td>
</tr>
<tr>
<td valign="top">End of range</td>
<td valign="top"><tt>a.rend()</tt></td>
<td valign="top"><tt>reverse_iterator</tt> if <tt>a</tt> is mutable,
<tt>const_reverse_iterator</tt> otherwise.</td>
<td valign="top">Equivalent to
<tt>X::reverse_iterator(a.begin())</tt>.</td>
</tr>
<tr>
<td valign="top">Back</td>
<td valign="top"><tt>a.back()</tt></td>
<td valign="top"><tt>reference</tt> if <tt>a</tt> is mutable,<br>
<tt>const_reference</tt> otherwise.</td>
<td valign="top">Equivalent to <tt>*(--a.end())</tt>.</td>
</tr>
</table>
<h4>SequentialCollection</h4>
<p>The elements are arranged in a strict linear order. No extra methods are
required.</p>
<h4>RandomAccessCollection</h4>
<p>The iterators of a RandomAccessCollection satisfy all of the
requirements of <a href=
"http://www.sgi.com/tech/stl/RandomAccessIterator.html">RandomAccessIterator</a>
except that the reference type does not have to be a real C++ reference. In
addition, a RandomAccessCollection provides an element access operator.</p>
<table border summary="">
<tr>
<th>Name</th>
<th>Expression</th>
<th>Return type</th>
<th>Semantics</th>
</tr>
<tr>
<td valign="top">Element Access</td>
<td valign="top"><tt>a[n]</tt></td>
<td valign="top"><tt>reference</tt> if <tt>a</tt> is mutable,
<tt>const_reference</tt> otherwise.</td>
<td valign="top">Returns the nth element of the Collection. <tt>n</tt>
must be convertible to <tt>size_type</tt>. Precondition: <tt>0 &lt;= n
&lt; a.size()</tt>.</td>
</tr>
</table>
<h3>Notes</h3>
<p><a name="n1" id="n1">[1]</a> The reference type does not have to be a
real C++ reference. The requirements of the reference type depend on the
context within which the Collection is being used. Specifically it depends
on the requirements the context places on the value type of the Collection.
The reference type of the Collection must meet the same requirements as the
value type. In addition, the reference objects must be equivalent to the
value type objects in the collection (which is trivially true if they are
the same object). Also, in a mutable Collection, an assignment to the
reference object must result in an assignment to the object in the
Collection (again, which is trivially true if they are the same object, but
non-trivial if the reference type is a proxy class).</p>
<h3>See also</h3>
<p><a href=
"http://www.sgi.com/tech/stl/Container.html">Container</a><br></p>
<hr>
<p><a href="http://validator.w3.org/check?uri=referer"><img border="0" src=
"../../doc/images/valid-html401.png" alt="Valid HTML 4.01 Transitional"
height="31" width="88"></a></p>
<p>Revised
<!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B, %Y" startspan -->05
December, 2006<!--webbot bot="Timestamp" endspan i-checksum="38516" --></p>
<table summary="">
<tr valign="top">
<td nowrap><i>Copyright &copy; 2000</i></td>
<td><i><a href="http://www.boost.org/people/jeremy_siek.htm">Jeremy
Siek</a>, Univ.of Notre Dame and C++ Library &amp; Compiler Group/SGI
(<a href="mailto:jsiek@engr.sgi.com">jsiek@engr.sgi.com</a>)</i></td>
</tr>
</table>
<p><i>Distributed under the Boost Software License, Version 1.0. (See
accompanying file <a href="../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or
copy at <a href=
"http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</a>)</i></p>
</body>
</html>

View File

@@ -1,19 +1,185 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Boost.Utility</title>
<meta http-equiv="refresh" content="0; URL=./doc/html/index.html">
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<title>Copy Constructible</title>
</head>
<body>
Automatic redirection failed, please go to
<a href="./doc/html/index.html">./doc/html/index.html</a>
<hr>
<tt>
Boost.Utility<br>
<br>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
<a href=http://www.boost.org/LICENSE_1_0.txt>http://www.boost.org/LICENSE_1_0.txt</a>) <br>
<br>
</tt>
<body bgcolor="#FFFFFF" link="#0000EE" text="#000000" vlink="#551A8B" alink=
"#FF0000">
<img src="../../boost.png" alt="C++ Boost" width="277" height=
"86"><br clear="none">
<h1>Copy Constructible</h1>
<h3>Description</h3>
<p>A type is Copy Constructible if it is possible to copy objects of that
type.</p>
<h3>Notation</h3>
<table summary="">
<tr>
<td valign="top"><tt>T</tt></td>
<td valign="top">is type that is a model of Copy Constructible</td>
</tr>
<tr>
<td valign="top"><tt>t</tt></td>
<td valign="top">is an object of type <tt>T</tt></td>
</tr>
<tr>
<td valign="top"><tt>u</tt></td>
<td valign="top">is an object of type <tt>const T</tt></td>
</tr>
</table>
<h3>Definitions</h3>
<h3>Valid expressions</h3>
<table border summary="">
<tr>
<th>Name</th>
<th>Expression</th>
<th>Return type</th>
<th>Semantics</th>
</tr>
<tr>
<td valign="top">Copy constructor</td>
<td valign="top"><tt>T(t)</tt></td>
<td valign="top"><tt>T</tt></td>
<td valign="top"><tt>t</tt> is equivalent to <tt>T(t)</tt></td>
</tr>
<tr>
<td valign="top">Copy constructor</td>
<td valign="top">
<pre>
T(u)
</pre>
</td>
<td valign="top"><tt>T</tt></td>
<td valign="top"><tt>u</tt> is equivalent to <tt>T(u)</tt></td>
</tr>
<tr>
<td valign="top">Destructor</td>
<td valign="top">
<pre>
t.~T()
</pre>
</td>
<td valign="top"><tt>T</tt></td>
<td valign="top">&nbsp;</td>
</tr>
<tr>
<td valign="top">Address Operator</td>
<td valign="top">
<pre>
&amp;t
</pre>
</td>
<td valign="top"><tt>T*</tt></td>
<td valign="top">denotes the address of <tt>t</tt></td>
</tr>
<tr>
<td valign="top">Address Operator</td>
<td valign="top">
<pre>
&amp;u
</pre>
</td>
<td valign="top"><tt>T*</tt></td>
<td valign="top">denotes the address of <tt>u</tt></td>
</tr>
</table>
<h3>Models</h3>
<ul>
<li><tt>int</tt></li>
<li><tt>std::pair</tt></li>
</ul>
<h3>Concept Checking Class</h3>
<pre>
template &lt;class T&gt;
struct CopyConstructibleConcept
{
void constraints() {
T a(b); // require copy constructor
T* ptr = &amp;a; // require address of operator
const_constraints(a);
ignore_unused_variable_warning(ptr);
}
void const_constraints(const T&amp; a) {
T c(a); // require const copy constructor
const T* ptr = &amp;a; // require const address of operator
ignore_unused_variable_warning(c);
ignore_unused_variable_warning(ptr);
}
T b;
};
</pre>
<h3>See also</h3>
<p><a href="http://www.sgi.com/tech/stl/DefaultConstructible.html">Default
Constructible</a> and <a href="./Assignable.html">Assignable</a><br></p>
<hr>
<p><a href="http://validator.w3.org/check?uri=referer"><img border="0" src=
"../../doc/images/valid-html401.png" alt="Valid HTML 4.01 Transitional"
height="31" width="88"></a></p>
<p>Revised
<!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B, %Y" startspan -->05
December, 2006<!--webbot bot="Timestamp" endspan i-checksum="38516" --></p>
<table summary="">
<tr valign="top">
<td nowrap><i>Copyright &copy; 2000</i></td>
<td><i><a href="http://www.lsc.nd.edu/~jsiek">Jeremy Siek</a>, Univ.of
Notre Dame (<a href=
"mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</a>)</i></td>
</tr>
</table>
<p><i>Distributed under the Boost Software License, Version 1.0. (See
accompanying file <a href="../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or
copy at <a href=
"http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</a>)</i></p>
</body>
</html>

View File

@@ -1,19 +1,210 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<!--
== Copyright (c) 1996-1999
== Silicon Graphics Computer Systems, Inc.
==
== Permission to use, copy, modify, distribute and sell this software
== and its documentation for any purpose is hereby granted without fee,
== provided that the above copyright notice appears in all copies and
== that both that copyright notice and this permission notice appear
== in supporting documentation. Silicon Graphics makes no
== representations about the suitability of this software for any
== purpose. It is provided "as is" without express or implied warranty.
==
== Copyright (c) 1994
== Hewlett-Packard Company
==
== Permission to use, copy, modify, distribute and sell this software
== and its documentation for any purpose is hereby granted without fee,
== provided that the above copyright notice appears in all copies and
== that both that copyright notice and this permission notice appear
== in supporting documentation. Hewlett-Packard Company makes no
== representations about the suitability of this software for any
== purpose. It is provided "as is" without express or implied warranty.
==
-->
<head>
<title>Boost.Utility</title>
<meta http-equiv="refresh" content="0; URL=./doc/html/index.html">
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<title>LessThanComparable</title>
</head>
<body>
Automatic redirection failed, please go to
<a href="./doc/html/index.html">./doc/html/index.html</a>
<hr>
<tt>
Boost.Utility<br>
<br>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
<a href=http://www.boost.org/LICENSE_1_0.txt>http://www.boost.org/LICENSE_1_0.txt</a>) <br>
<br>
</tt>
<body bgcolor="#FFFFFF" link="#0000EE" text="#000000" vlink="#551A8B" alink=
"#FF0000">
<img src="../../boost.png" alt="C++ Boost" width="277" height=
"86"><br clear="none">
<h1>LessThanComparable</h1>
<h3>Description</h3>
<p>A type is LessThanComparable if it is ordered: it must be possible to
compare two objects of that type using <tt>operator&lt;</tt>, and
<tt>operator&lt;</tt> must be a strict weak ordering relation.</p>
<h3>Refinement of</h3>
<h3>Associated types</h3>
<h3>Notation</h3>
<table summary="">
<tr>
<td valign="top"><tt>X</tt></td>
<td valign="top">A type that is a model of LessThanComparable</td>
</tr>
<tr>
<td valign="top"><tt>x</tt>, <tt>y</tt>, <tt>z</tt></td>
<td valign="top">Object of type <tt>X</tt></td>
</tr>
</table>
<h3>Definitions</h3>
<p>Consider the relation <tt>!(x &lt; y) &amp;&amp; !(y &lt; x)</tt>. If
this relation is transitive (that is, if <tt>!(x &lt; y) &amp;&amp; !(y
&lt; x) &amp;&amp; !(y &lt; z) &amp;&amp; !(z &lt; y)</tt> implies <tt>!(x
&lt; z) &amp;&amp; !(z &lt; x)</tt>), then it satisfies the mathematical
definition of an equivalence relation. In this case, <tt>operator&lt;</tt>
is a <i>strict weak ordering</i>.</p>
<p>If <tt>operator&lt;</tt> is a strict weak ordering, and if each
equivalence class has only a single element, then <tt>operator&lt;</tt> is
a <i>total ordering</i>.</p>
<h3>Valid expressions</h3>
<table border summary="">
<tr>
<th>Name</th>
<th>Expression</th>
<th>Type requirements</th>
<th>Return type</th>
</tr>
<tr>
<td valign="top">Less</td>
<td valign="top"><tt>x &lt; y</tt></td>
<td valign="top">&nbsp;</td>
<td valign="top">Convertible to <tt>bool</tt></td>
</tr>
</table>
<h3>Expression semantics</h3>
<table border summary="">
<tr>
<th>Name</th>
<th>Expression</th>
<th>Precondition</th>
<th>Semantics</th>
<th>Postcondition</th>
</tr>
<tr>
<td valign="top">Less</td>
<td valign="top"><tt>x &lt; y</tt></td>
<td valign="top"><tt>x</tt> and <tt>y</tt> are in the domain of
<tt>&lt;</tt></td>
<td valign="top">&nbsp;</td>
</tr>
</table>
<h3>Complexity guarantees</h3>
<h3>Invariants</h3>
<table border summary="">
<tr>
<td valign="top">Irreflexivity</td>
<td valign="top"><tt>x &lt; x</tt> must be false.</td>
</tr>
<tr>
<td valign="top">Antisymmetry</td>
<td valign="top"><tt>x &lt; y</tt> implies !(y &lt; x) <a href=
"#n2">[2]</a></td>
</tr>
<tr>
<td valign="top">Transitivity</td>
<td valign="top"><tt>x &lt; y</tt> and <tt>y &lt; z</tt> implies <tt>x
&lt; z</tt> <a href="#n3">[3]</a></td>
</tr>
</table>
<h3>Models</h3>
<ul>
<li>int</li>
</ul>
<h3>Notes</h3>
<p><a name="n1" id="n1">[1]</a> Only <tt>operator&lt;</tt> is fundamental;
the other inequality operators are essentially syntactic sugar.</p>
<p><a name="n2" id="n2">[2]</a> Antisymmetry is a theorem, not an axiom: it
follows from irreflexivity and transitivity.</p>
<p><a name="n3" id="n3">[3]</a> Because of irreflexivity and transitivity,
<tt>operator&lt;</tt> always satisfies the definition of a <i>partial
ordering</i>. The definition of a <i>strict weak ordering</i> is stricter,
and the definition of a <i>total ordering</i> is stricter still.</p>
<h3>See also</h3>
<p><a href=
"http://www.sgi.com/tech/stl/EqualityComparable.html">EqualityComparable</a>,
<a href=
"http://www.sgi.com/tech/stl/StrictWeakOrdering.html">StrictWeakOrdering</a><br>
</p>
<hr>
<p><a href="http://validator.w3.org/check?uri=referer"><img border="0" src=
"../../doc/images/valid-html401.png" alt="Valid HTML 4.01 Transitional"
height="31" width="88"></a></p>
<p>Revised
<!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B, %Y" startspan -->05
December, 2006<!--webbot bot="Timestamp" endspan i-checksum="38516" --></p>
<table summary="">
<tr valign="top">
<td nowrap><i>Copyright &copy; 2000</i></td>
<td><i><a href="http://www.lsc.nd.edu/~jsiek">Jeremy Siek</a>, Univ.of
Notre Dame (<a href=
"mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</a>)</i></td>
</tr>
</table>
<p><i>Distributed under the Boost Software License, Version 1.0. (See
accompanying file <a href="../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or
copy at <a href=
"http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</a>)</i></p>
</body>
</html>

View File

@@ -1,19 +1,95 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Boost.Utility</title>
<meta http-equiv="refresh" content="0; URL=./doc/html/index.html">
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<title>MultiPassInputIterator</title>
</head>
<body>
Automatic redirection failed, please go to
<a href="./doc/html/index.html">./doc/html/index.html</a>
<hr>
<tt>
Boost.Utility<br>
<br>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
<a href=http://www.boost.org/LICENSE_1_0.txt>http://www.boost.org/LICENSE_1_0.txt</a>) <br>
<br>
</tt>
<body bgcolor="#FFFFFF" link="#0000EE" text="#000000" vlink="#551A8B" alink=
"#FF0000">
<img src="../../boost.png" alt="C++ Boost" width="277" height=
"86"><br clear="none">
<h2><a name="concept:MultiPassInputIterator" id=
"concept:MultiPassInputIterator"></a> Multi-Pass Input Iterator</h2>
<p>This concept is a refinement of <a href=
"http://www.sgi.com/tech/stl/InputIterator.html">Input Iterator</a>, adding
the requirements that the iterator can be used to make multiple passes
through a range, and that if <tt>it1 == it2</tt> and <tt>it1</tt> is
dereferenceable then <tt>++it1 == ++it2</tt>. The Multi-Pass Input Iterator
is very similar to the <a href=
"http://www.sgi.com/tech/stl/ForwardIterator.html">Forward Iterator</a>.
The only difference is that a <a href=
"http://www.sgi.com/tech/stl/ForwardIterator.html">Forward Iterator</a>
requires the <tt>reference</tt> type to be <tt>value_type&amp;</tt>,
whereas MultiPassInputIterator is like <a href=
"http://www.sgi.com/tech/stl/InputIterator.html">Input Iterator</a> in that
the <tt>reference</tt> type merely has to be convertible to
<tt>value_type</tt>.</p>
<h3>Design Notes</h3>
<p>comments by Valentin Bonnard:</p>
<p>I think that introducing Multi-Pass Input Iterator isn't the right
solution. Do you also want to define Multi-Pass Bidirectionnal Iterator and
Multi-Pass Random Access Iterator ? I don't, definitly. It only confuses
the issue. The problem lies into the existing hierarchy of iterators, which
mixes movabillity, modifiabillity and lvalue-ness, and these are clearly
independant.</p>
<p>The terms Forward, Bidirectionnal and Random Access are about
movabillity and shouldn't be used to mean anything else. In a completly
orthogonal way, iterators can be immutable, mutable, or neither. Lvalueness
of iterators is also orthogonal with immutabillity. With these clean
concepts, your Multi-Pass Input Iterator is just called a Forward
Iterator.</p>
<p>Other translations are:<br>
std::Forward Iterator -&gt; ForwardIterator &amp; Lvalue Iterator<br>
std::Bidirectionnal Iterator -&gt; Bidirectionnal Iterator &amp; Lvalue
Iterator<br>
std::Random Access Iterator -&gt; Random Access Iterator &amp; Lvalue
Iterator<br></p>
<p>Note that in practice the only operation not allowed on my Forward
Iterator which is allowed on std::Forward Iterator is <tt>&amp;*it</tt>. I
think that <tt>&amp;*</tt> is rarely needed in generic code.</p>
<p>reply by Jeremy Siek:</p>
<p>The above analysis by Valentin is right on. Of course, there is the
problem with backward compatibility. The current STL implementations are
based on the old definition of Forward Iterator. The right course of action
is to get Forward Iterator, etc. changed in the C++ standard. Once that is
done we can drop Multi-Pass Input Iterator.<br></p>
<hr>
<p><a href="http://validator.w3.org/check?uri=referer"><img border="0" src=
"../../doc/images/valid-html401.png" alt="Valid HTML 4.01 Transitional"
height="31" width="88"></a></p>
<p>Revised
<!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B, %Y" startspan -->05
December, 2006<!--webbot bot="Timestamp" endspan i-checksum="38516" --></p>
<table summary="">
<tr valign="top">
<td nowrap><i>Copyright &copy; 2000</i></td>
<td><i><a href="http://www.lsc.nd.edu/~jsiek">Jeremy Siek</a>, Univ.of
Notre Dame (<a href=
"mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</a>)</i></td>
</tr>
</table>
<p><i>Distributed under the Boost Software License, Version 1.0. (See
accompanying file <a href="../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or
copy at <a href=
"http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</a>)</i></p>
</body>
</html>

View File

@@ -1,19 +1,159 @@
<html>
<head>
<title>Boost.Utility</title>
<meta http-equiv="refresh" content="0; URL=./doc/html/index.html">
</head>
<body>
Automatic redirection failed, please go to
<a href="./doc/html/index.html">./doc/html/index.html</a>
<hr>
<tt>
Boost.Utility<br>
<br>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
<a href=http://www.boost.org/LICENSE_1_0.txt>http://www.boost.org/LICENSE_1_0.txt</a>) <br>
<br>
</tt>
</body>
</html>
<HTML>
<Head>
<Title>OptionalPointee Concept</Title>
</HEAD>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../boost.png"
ALT="C++ Boost" width="277" height="86">
<!--end header-->
<BR Clear>
<H1>Concept: OptionalPointee</H1>
<h3>Description</h3>
A type is a model of <i>OptionalPointee</i> if it points to (or refers to) a value
that may not exist. That is, if it has a <b>pointee</b> which might be <b>valid</b>
(existent) or <b>invalid</b> (inexistent); and it is possible to test whether the
pointee is valid or not.
This model does <u>not</u> imply pointer semantics: i.e., it does not imply shallow copy nor
aliasing.
<h3>Notation</h3>
<Table>
<TR>
<TD VAlign=top> <tt>T</tt> </TD>
<TD VAlign=top> is a type that is a model of OptionalPointee</TD>
</TR>
<TR>
<TD VAlign=top> <tt>t</tt> </TD>
<TD VAlign=top> is an object of type <tt>T</tt> or possibly <tt>const T</tt></TD>
</tr>
</table>
<h3>Definitions</h3>
<h3>Valid expressions</h3>
<Table border>
<TR>
<TH> Name </TH>
<TH> Expression </TH>
<TH> Return type </TH>
<TH> Semantics </TH>
</TR>
<TR>
<TD VAlign=top>Value Access</TD>
<TD VAlign=top>&nbsp;<tt>*t</tt></TD>
<TD VAlign=top>&nbsp;<tt>T&amp;</tt></TD>
<TD VAlign=top>If the pointee is valid returns a reference to
the pointee.<br>
If the pointee is invalid the result is <i>undefined</i>.</TD>
<TD VAlign=top> </TD>
</TR>
<TR>
<TD VAlign=top>Value Access</TD>
<TD VAlign=top>&nbsp;<tt>t-><i>xyz</i></tt></TD>
<TD VAlign=top>&nbsp;<tt>T*</tt></TD>
<TD VAlign=top>If the pointee is valid returns a builtin pointer to the pointee.<br>
If the pointee is invalid the result is <i>undefined</i> (It might not even return NULL).<br>
</TD>
<TD VAlign=top> </TD>
</TR>
<TR>
<TD VAlign=top>Validity Test</TD>
<TD VAlign=top>&nbsp;<tt>bool(t)</tt></TD>
<TD VAlign=top>&nbsp;bool </TD>
<TD VAlign=top>If the pointee is valid returns true.<br>
If the pointee is invalid returns false.</TD>
<TD VAlign=top></TD>
</TR>
<TR>
<TD VAlign=top>Invalidity Test</TD>
<TD VAlign=top>&nbsp;<tt>!t</tt></TD>
<TD VAlign=top>&nbsp;bool </TD>
<TD VAlign=top>If the pointee is valid returns false.<br>
If the pointee is invalid returns true.</TD>
<TD VAlign=top></TD>
</TR>
</table>
<h3>Models</h3>
<UL>
<LI><tt>pointers, both builtin and smart.</tt>
<LI><tt>boost::optional&lt;&gt;</tt>
</UL>
<HR>
<h3>OptionalPointee and relational operations</h3>
<p>This concept does not define any particular semantic for relational operations, therefore,
a type which models this concept might have either shallow or deep relational semantics.<br>
For instance, pointers, which are models of OptionalPointee, have shallow relational operators:
comparisons of pointers do not involve comparisons of pointees.
This makes sense for pointers because they have shallow copy semantics.<br>
But boost::optional&lt;T&gt;, on the other hand, which is also a model of OptionalPointee, has
deep-copy and deep-relational semantics.<br>
If generic code is written for this concept, it is important not to use relational
operators directly because the semantics might be different depending on the actual type.<br>
Still, the concept itsef can be used to define <i>deep</i> relational tests that can
be used in generic code with any type which models OptionalPointee:</p>
<a name="equal"></a>
<p><u>Equivalence relation:</u></p>
<pre>template&lt;class OptionalPointee&gt;
inline
bool equal_pointees ( OptionalPointee const&amp; x, OptionalPointee const&amp; y )
{
return (!x) != (!y) ? false : ( !x ? true : (*x) == (*y) ) ;
}
template&lt;class OptionalPointee&gt;
struct equal_pointees_t : std::binary_function&lt;OptionalPointee,OptionalPointee,bool&gt;
{
bool operator() ( OptionalPointee const& x, OptionalPointee const& y ) const
{ return equal_pointees(x,y) ; }
} ;
</pre>
<p>The preceding generic function and function object have the following semantics:<br>
If both <b>x</b> and <b>y</b> have valid pointees, it compares values via <code>(*x == *y)</code>.<br>
If only one has a valid pointee, returns <code>false</code>.<br>
If both have invalid pointees, returns <code>true</code>.</p>
<a name="less"></a>
<p><u>Less-than relation:</u></p>
<pre>template&lt;class OptionalPointee&gt;
inline
bool less_pointees ( OptionalPointee const&amp; x, OptionalPointee const&amp; y )
{
return !y ? false : ( !x ? true : (*x) < (*y) ) ;
}
template&lt;class OptionalPointee&gt;
struct less_pointees_t : std::binary_function&lt;OptionalPointee,OptionalPointee,bool&gt;
{
bool operator() ( OptionalPointee const& x, OptionalPointee const& y ) const
{ return less_pointees(x,y) ; }
} ;
</pre>
<p>The preceding generic function and function object have the following semantics:<br>
If <b>y</b> has an invalid pointee, returns <code>false</code>.<br>
Else, if <b>x</b> has an invalid pointee, returns <code>true</code>.<br>
Else, ( <b>x</b> and <b>y</b> have valid pointees), compares values via <code>(*x &lt;
*y).</code></p>
<p><br>
All these functions and function
objects are is implemented in <a href="../../boost/utility/compare_pointees.hpp">compare_pointees.hpp</a></p>
<p>Notice that OptionalPointee does not imply aliasing (and optional&lt;&gt; for instance does not alias);
so direct usage of relational operators with the implied aliasing of shallow semantics
-as with pointers- should not be used with generic code written for this concept.</p>
<h3>Acknowledgements</h3>
<p>Based on the original concept developed by Augustus Saunders.
<br>
</p>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy 2003</TD><TD>
<A HREF="mailto:fernando_cacciola@hotmail.com">Fernando Cacciola</A>
</TD></TR></TABLE>
<p>Distributed under the Boost Software License, Version 1.0. See
<a href="http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a></p>
</BODY>
</HTML>

View File

@@ -1,5 +1,5 @@
# Copyright 2016-2019 Peter Dimov
# Copyright 2019 Andrey Semashev
# Copyright 2019, 2022 Andrey Semashev
# 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)
@@ -15,52 +15,53 @@ branches:
environment:
matrix:
- TOOLSET: msvc-9.0,msvc-10.0,msvc-11.0
ADDRMD: 32
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- TOOLSET: msvc-12.0,msvc-14.0
- TOOLSET: msvc-14.0
ADDRMD: 32,64
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- TOOLSET: msvc-14.1
CXXSTD: 14,17
CXXSTD: 14,17,latest
ADDRMD: 32,64
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
- TOOLSET: msvc-14.2
ADDRMD: 32,64
CXXSTD: 14,17
CXXSTD: 14,17,20,latest
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
- TOOLSET: msvc-14.3
ADDRMD: 32,64
CXXSTD: 14,17,20,latest
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
- TOOLSET: clang-win
ADDRMD: 32
CXXSTD: 14,17
CXXSTD: 14,17,latest
ENV_SCRIPT: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars32.bat
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
- TOOLSET: clang-win
ADDRMD: 64
CXXSTD: 14,17
CXXSTD: 14,17,latest
ENV_SCRIPT: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
- TOOLSET: gcc
CXXSTD: 03,11,14,1z
CXXSTD: 11,14,1z
ADDPATH: C:\cygwin\bin;
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- TOOLSET: gcc
CXXSTD: 03,11,14,1z
CXXSTD: 11,14,1z
ADDPATH: C:\cygwin64\bin;
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- TOOLSET: gcc
CXXSTD: 03,11,14,1z
CXXSTD: 11,14,1z
ADDPATH: C:\mingw\bin;
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- TOOLSET: gcc
CXXSTD: 03,11,14,1z
CXXSTD: 11,14,1z
ADDPATH: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin;
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- TOOLSET: gcc
CXXSTD: 03,11,14,17
CXXSTD: 11,14,17
ADDPATH: C:\mingw-w64\x86_64-7.3.0-posix-seh-rt_v5-rev0\mingw64\bin;
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- TOOLSET: gcc
CXXSTD: 03,11,14,17,2a
CXXSTD: 11,14,17,2a
ADDPATH: C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
@@ -71,24 +72,11 @@ install:
- cd ..
- git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
- cd boost-root
- git submodule init tools/build
- git submodule init tools/boost_install
- git submodule init libs/headers
- git submodule init libs/assert
- git submodule init libs/config
- git submodule init libs/core
- git submodule init libs/io
- git submodule init libs/preprocessor
- git submodule init libs/static_assert
- git submodule init libs/throw_exception
- git submodule init libs/type_traits
- git submodule init libs/container_hash
- git submodule init libs/integer
- git submodule init libs/detail
- git submodule update --jobs %GIT_FETCH_JOBS%
- xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\utility\
- git submodule update --init tools/boostdep
- xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\utility
- python tools/boostdep/depinst/depinst.py %DEPINST_ARG_INCLUDE_EXAMPLES% --git_args "--jobs %GIT_FETCH_JOBS%" utility
- cmd /c bootstrap
- b2 -d0 headers
- b2 headers
build: off

View File

@@ -1,14 +1,14 @@
<html>
<head>
<title>Boost.Utility</title>
<meta http-equiv="refresh" content="0; URL=./doc/html/index.html">
<title>Boost.CallTraits</title>
<meta http-equiv="refresh" content="0; URL=./doc/html/utility/utilities/call_traits.html">
</head>
<body>
Automatic redirection failed, please go to
<a href="./doc/html/utility/utilities/call_traits.html">./doc/html/utility/utilities/call_traits.html</a>
<hr>
<tt>
Boost.Utility<br>
Boost.CallTraits<br>
<br>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at

View File

@@ -1,7 +1,7 @@
<html>
<head>
<title>Boost.Utility</title>
<meta http-equiv="refresh" content="0; URL=./doc/html/index.html">
<meta http-equiv="refresh" content="0; URL=../core/doc/html/core/checked_delete.html">
</head>
<body>
Automatic redirection failed, please go to

View File

@@ -1,7 +1,7 @@
<html>
<head>
<title>Boost.Utility</title>
<meta http-equiv="refresh" content="0; URL=./doc/html/index.html">
<meta http-equiv="refresh" content="0; URL=./doc/html/utility/utilities/compressed_pair.html">
</head>
<body>
Automatic redirection failed, please go to

View File

@@ -35,7 +35,7 @@ In addition, LL and ULL suffixes may be used for representing
them as an extension.
The `BOOST_BINARY` family of macros resides in the header
[@../../../include/boost/utility/binary.hpp <boost/utility/binary.hpp>].
[@../../../../boost/utility/binary.hpp <boost/utility/binary.hpp>].
[endsect]
@@ -79,7 +79,3 @@ Contributed by Matt Calabrese.
[endsect]
[endsect]

View File

@@ -2,50 +2,19 @@
# subject to the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
import project ;
import doxygen ;
import quickbook ;
project : requirements
# Path for links to Boost:
<xsl:param>boost.root=../../../..
# Some general style settings:
<xsl:param>table.footnote.number.format=1
<xsl:param>footnote.number.format=1
# HTML options first:
# Use graphics not text for navigation:
<xsl:param>navig.graphics=1
# PDF Options:
# TOC Generation: this is needed for FOP-0.9 and later:
<xsl:param>fop1.extensions=0
<xsl:param>xep.extensions=1
# TOC generation: this is needed for FOP 0.2, but must not be set to zero for FOP-0.9!
<xsl:param>fop.extensions=0
# No indent on body text:
<xsl:param>body.start.indent=0pt
# Margin size:
<xsl:param>page.margin.inner=0.5in
# Margin size:
<xsl:param>page.margin.outer=0.5in
# Paper type = A4
<xsl:param>paper.type=A4
# Yes, we want graphics for admonishments:
<xsl:param>admon.graphics=1
# Set this one for PDF generation *only*:
# default pnd graphics are awful in PDF form,
# better use SVG's instead:
<format>pdf:<xsl:param>admon.graphics.extension=".svg"
<format>pdf:<xsl:param>"admon.graphics.path=$(boost-images)/"
<format>pdf:<xsl:param>"boost.url.prefix=http://www.boost.org/doc/libs/release/libs/utility/doc/html"
;
project boost/libs/utility/doc ;
path-constant INCLUDES : ../../.. ;
path-constant boost-images : ../../../doc/src/images ;
# Generate XML doxygen reference for base_from_member component in base_from_member_reference.xml
doxygen base_from_member_reference
:
../include/boost/utility/base_from_member.hpp
$(INCLUDES)/boost/utility/base_from_member.hpp
:
<location>tmp
<doxygen:param>ENABLE_PREPROCESSING=YES
@@ -89,7 +58,7 @@ doxygen base_from_member_reference
# Generate XML doxygen reference for boost_binary component in boost_binary_reference.xml
doxygen boost_binary_reference
:
../include/boost/utility/binary.hpp
$(INCLUDES)/boost/utility/binary.hpp
:
<location>tmp
<doxygen:param>ENABLE_PREPROCESSING=YES
@@ -133,8 +102,8 @@ doxygen boost_binary_reference
# Generate XML doxygen reference for call_traits component in call_traits_reference.xml
doxygen call_traits_reference
:
../include/boost/call_traits.hpp
../include/boost/detail/call_traits.hpp
$(INCLUDES)/boost/call_traits.hpp
$(INCLUDES)/boost/detail/call_traits.hpp
:
<location>tmp
<doxygen:param>ENABLE_PREPROCESSING=YES
@@ -178,8 +147,8 @@ doxygen call_traits_reference
# Generate XML doxygen reference for compressed_pair component in compressed_pair_reference.xml
doxygen compressed_pair_reference
:
../include/boost/compressed_pair.hpp
../include/boost/detail/compressed_pair.hpp
$(INCLUDES)/boost/compressed_pair.hpp
$(INCLUDES)/boost/detail/compressed_pair.hpp
:
<location>tmp
<doxygen:param>ENABLE_PREPROCESSING=YES
@@ -223,8 +192,8 @@ doxygen compressed_pair_reference
# Generate XML doxygen reference for in_place_factory component in in_place_factory_reference.xml
doxygen in_place_factory_reference
:
../include/boost/utility/in_place_factory.hpp
../include/boost/utility/typed_in_place_factory.hpp
$(INCLUDES)/boost/utility/in_place_factory.hpp
$(INCLUDES)/boost/utility/typed_in_place_factory.hpp
:
<location>tmp
<doxygen:param>ENABLE_PREPROCESSING=YES
@@ -271,7 +240,7 @@ doxygen in_place_factory_reference
# Generate XML doxygen reference for result_of component in result_of_reference.xml
doxygen result_of_reference
:
../include/boost/utility/result_of.hpp
$(INCLUDES)/boost/utility/result_of.hpp
:
<location>tmp
<doxygen:param>ENABLE_PREPROCESSING=YES
@@ -315,7 +284,7 @@ doxygen result_of_reference
# Generate XML doxygen reference for string_view component in string_view_reference.xml
doxygen string_view_reference
:
../include/boost/utility/string_view.hpp
$(INCLUDES)/boost/utility/string_view.hpp
:
<location>tmp
<doxygen:param>ENABLE_PREPROCESSING=YES
@@ -359,7 +328,7 @@ doxygen string_view_reference
# Generate XML doxygen reference for value_init component in value_init_reference.xml
doxygen value_init_reference
:
../include/boost/utility/value_init.hpp
$(INCLUDES)/boost/utility/value_init.hpp
:
<location>tmp
<doxygen:param>ENABLE_PREPROCESSING=YES
@@ -440,6 +409,5 @@ boostbook standalone_main
alias boostdoc ;
explicit boostdoc ;
alias boostrelease :
standalone_main ;
alias boostrelease : standalone_main ;
explicit boostrelease ;

View File

@@ -112,7 +112,7 @@ type does not need to concern itself with the integer.
#endif
template < typename MemberType, int UniqueID = 0 >
class __boost_base_from_member__
class __base_from_member__
{
protected:
MemberType member;
@@ -192,7 +192,6 @@ maintain the same maximum size. (Example code would be a class that uses
this class template as a base class for a member with a flexible set of
constructors.) This constant is ignored when C++11 features are present.
[endsect]
[section Basic Usage]
@@ -237,7 +236,6 @@ safe to use in the latter sub-object's construction. Since the `fdoutbuf`
sub-object of the final type is the only sub-object with the name `member`
that name can be used unqualified within the final class.
[endsect]
[section Multiple Sub-Objects]
@@ -322,8 +320,8 @@ type. Using `typedef`s ease mentioning the base types.
However, the fix introduces a new problem when a pointer is needed. Using the
address operator with a sub-object qualified with its class's name results in a
pointer-to-member (here, having a type of `an_int __boost_base_from_member__<an_int, 0>:: *`)
instead of a pointer to the member (having a type of `an_int *`).
pointer-to-member (here, having a type of `an_int __boost_base_from_member__<an_int, 0>::*`)
instead of a pointer to the member (having a type of `an_int*`).
The new problem is fixed by qualifying the sub-object with `this->` and is needed
just for pointers, and not for references or values.
@@ -338,9 +336,9 @@ C++ always interprets such code as an integer when it has overloads that can
take either an integer or a pointer.
The last conversion is necessary for the compiler to call a constructor form
with the exact pointer type used in `switcher`'s constructor. (If C++11's
__nullptr__ is used, it still needs a conversion if multiple pointer types can
be accepted in a constructor call but `__std_nullptr_t__` cannot.)
with the exact pointer type used in `switcher`'s constructor. (If C++11's
__nullptr__ is used, it still needs a conversion if multiple pointer types can
be accepted in a constructor call but `__std_nullptr_t__` cannot.)
[endsect]
@@ -355,25 +353,24 @@ Author: Walker, Daryle
Copyright 2001, 2003, 2004, 2012 Daryle Walker
* [@http://www.boost.org/people/ed_brey.htm Ed Brey] suggested some interface
changes.
changes.
* [@http://www.moocat.org R. Samuel Klatchko] ([@mailto:rsk@moocat.org
rsk@moocat.org], [@mailto:rsk@brightmail.com rsk@brightmail.com]) invented
the idiom of how to use a class member for initializing a base class.
rsk@moocat.org], [@mailto:rsk@brightmail.com rsk@brightmail.com]) invented
the idiom of how to use a class member for initializing a base class.
* [@http://www.boost.org/people/dietmar_kuehl.htm Dietmar Kuehl] popularized the
base-from-member idiom in his [@http://www.informatik.uni-konstanz.de/~kuehl/c++/iostream/
base-from-member idiom in his [@http://www.informatik.uni-konstanz.de/~kuehl/c++/iostream/
IOStream example classes].
* Jonathan Turkanis supplied an implementation of generating the constructor
templates that can be controlled and automated with macros. The
implementation uses the [@boost:/doc/html/preprocessor/index.html Preprocessor library].
templates that can be controlled and automated with macros. The
implementation uses the [@boost:/libs/preprocessor/index.html Preprocessor library].
* [@http://www.boost.org/people/daryle_walker.html">Daryle Walker] started the
library. Contributed the test file [@../../../test/base_from_member_test.cpp
base_from_member_test.cpp].
library. Contributed the test file [@../../../test/base_from_member_test.cpp
base_from_member_test.cpp].
[endsect]
[endsect]

View File

@@ -12,7 +12,7 @@
[section Introduction]
All of the contents of [@../../../include/boost/call_traits.hpp `<boost/call_traits.hpp>`] are
All of the contents of [@../../../../boost/call_traits.hpp `<boost/call_traits.hpp>`] are
defined inside `namespace boost`.
The template class __call_traits_T__ encapsulates the
@@ -159,7 +159,7 @@ various types.
[[From `int&`] [`int&`] [`int&`] [`const int&`] [`int&`] [All reference types]]
[[From `const int&`] [`const int&`] [`const int&`] [`const int&`] [`const int&`] [All constant reference types]]
[[From `int[3]`] [`const int*`] [`int(&)[3]`] [`const int(&)[3]`] [`const int* const`] [All array types]]
[[From `const int[3]`] [`const int*`] [`const int(&)[3]`] [`const int(&)[3]`] [`const int *const`] [All constant array types]]
[[From `const int[3]`] [`const int*`] [`const int(&)[3]`] [`const int(&)[3]`] [`const int* const`] [All constant array types]]
]
The table assumes the compiler supports partial
@@ -284,7 +284,7 @@ The __call_traits__ template will "optimize" the passing
of a small built-in type as a function parameter. This mainly has
an effect when the parameter is used within a loop body.
In the following example (see [@boost:/doc/html/type_traits/examples/fill_example.cpp `fill_example.cpp`]),
In the following example (see [@boost:/libs/type_traits/examples/fill_example.cpp `fill_example.cpp`]),
a version of __std_fill__ is optimized in two ways: if the type
passed is a single byte built-in type then __std_memset__ is used to
effect the fill, otherwise a conventional C++ implementation is
@@ -441,8 +441,3 @@ specialisation.
[/===============]
[endsect]

View File

@@ -12,7 +12,7 @@
[section Introduction]
All of the contents of [@../../../include/boost/compressed_pair.hpp `<boost/compressed_pair.hpp>`] are defined inside
All of the contents of [@../../../../boost/compressed_pair.hpp `<boost/compressed_pair.hpp>`] are defined inside
`namespace boost`.
The class __compressed_pair__ is very similar to __std_pair__. However, if either of
@@ -71,8 +71,8 @@ a default value.
Note that __compressed_pair__ can not be instantiated if either of the
template arguments is a union type, unless there is compiler support for
[@boost:/doc/html/type_traits/index.html `boost::is_union`], or
if [@boost:/doc/html/type_traits/index.html `boost::is_union`] is
[@boost:/libs/type_traits/index.html `boost::is_union`], or
if [@boost:/libs/type_traits/index.html `boost::is_union`] is
specialised for the union type.
Finally, a word of caution for Visual C++ 6 users: if either argument is an

View File

@@ -18,7 +18,7 @@ Suppose we have a class
```
struct X
{
X ( int, _std__string_ ) ;
X ( int, __std_string__ ) ;
};
```
@@ -70,7 +70,7 @@ struct C
{
C() : contained_(0) {}
C ( X const& v ) : contained_ ( new X(v) ) {}
C ( int a0, std::string a1 ) : contained_ ( new X(a0,a1) ) {}
C ( int a0, __std_string__ a1 ) : contained_ ( new X(a0,a1) ) {}
~C() { delete contained_ ; }
X* contained_ ;
};
@@ -100,8 +100,8 @@ correctly aligned and sized. Naturally, the container will typically support uni
in-place construction to override a fully-constructed object, as this would defeat the purpose of in-place construction.
For this purpose, the framework provides two concepts called: InPlaceFactories and TypedInPlaceFactories.
Helpers to declare these classes are declared in [@../../../include/boost/utility/in_place_factory.hpp `<boost/utility/in_place_factory.hpp>`]
and [@../../../include/boost/utility/typed_in_place_factory.hpp `<boost/utility/typed_in_place_factory.hpp>`].
Helpers to declare these classes are declared in [@../../../../boost/utility/in_place_factory.hpp `<boost/utility/in_place_factory.hpp>`]
and [@../../../../boost/utility/typed_in_place_factory.hpp `<boost/utility/typed_in_place_factory.hpp>`].
Essentially, these classes hold a sequence of actual parameters and a method to construct an object in place using these parameters.
Each member of the family differs only in the number and type of the parameter list. The first family
@@ -214,11 +214,11 @@ As you can see, the `in_place_factory` and `typed_in_place_factory` template cla
the target type: in the first family, the type is given as a template argument to the apply member function while in the
second it is given directly as part of the factory class.
When the container holds a unique non-polymorphic type, such as the case of [@boost:/doc/html/optional/index.html Boost.Optional],
When the container holds a unique non-polymorphic type, such as the case of [@boost:/libs/optional/index.html Boost.Optional],
it knows the exact dynamic-type of the contained object and can pass it to the `apply()` method of a non-typed factory.
In this case, end users can use an `in_place_factory` instance which can be constructed without the type of the object to construct.
However, if the container holds heterogeneous or polymorphic objects, such as the case of [@boost:/doc/html/variant/index.html Boost.Variant],
However, if the container holds heterogeneous or polymorphic objects, such as the case of [@boost:/libs/variant/index.html Boost.Variant],
the dynamic-type of the object to be constructed must be known by the factory. In this case, end users must use a `typed_in_place_factory`
instead.
@@ -236,7 +236,7 @@ The correct function overload must be based on the only distinctive and common
characteristic of all the classes in each family: the base class.
Depending on the container class, you can use `enable_if` to generate the right overload, or use the following
dispatch technique, which is used in the [@boost:/doc/html/optional/index.html Boost.Optional] class:
dispatch technique, which is used in the [@boost:/libs/optional/index.html Boost.Optional] class:
```
@@ -256,13 +256,13 @@ struct C
~C() { delete contained_ ; }
template<class InPlaceFactory>
void construct ( InPlaceFactory const& aFactory, boost::__in_place_factory_base__* )
void construct ( InPlaceFactory const& aFactory, const boost::__in_place_factory_base__* )
{
aFactory.template apply<X>(contained_);
}
template<class TypedInPlaceFactory>
void construct ( TypedInPlaceFactory const& aFactory, boost::__typed_in_place_factory_base__* )
void construct ( TypedInPlaceFactory const& aFactory, const boost::__typed_in_place_factory_base__* )
{
aFactory.apply(contained_);
}
@@ -306,7 +306,3 @@ Copyright Fernando Luis Cacciola Carballal, 2004
[endsect]
[endsect]

View File

@@ -26,12 +26,16 @@
[category generic]
]
[template mdash[] '''&mdash; ''']
[template indexterm1[term1] '''<indexterm><primary>'''[term1]'''</primary></indexterm>''']
[template indexterm2[term1 term2] '''<indexterm><primary>'''[term1]'''</primary><secondary>'''[term2]'''</secondary></indexterm>''']
[template mdash[]'''&mdash;''']
[template ndash[]'''&ndash;''']
[template sect[]'''&sect;''']
[template hellip[]'''&hellip;''']
[template indexterm1[term1]'''<indexterm><primary>'''[term1]'''</primary></indexterm>''']
[template indexterm2[term1 term2]'''<indexterm><primary>'''[term1]'''</primary><secondary>'''[term2]'''</secondary></indexterm>''']
[template include_file[path][^<'''<ulink url="https://github.com/boostorg/utility/blob/master/include/'''[path]'''">'''[path]'''</ulink>'''>]]
[template issue[n] '''<ulink url="https://github.com/boostorg/utility/issues/'''[n]'''">#'''[n]'''</ulink>''']
[template issue[n]'''<ulink url="https://github.com/boostorg/utility/issues/'''[n]'''">#'''[n]'''</ulink>''']
[/ Named Requirements ]

View File

@@ -13,7 +13,7 @@
[section Introduction]
The header [@../../../include/boost/operators.hpp `<boost/operators.hpp>`] supplies
The header [@../../../../boost/operators.hpp `<boost/operators.hpp>`] supplies
several sets of class templates in `namespace boost`. These templates define
operators at namespace scope in terms of a minimal number of fundamental
operators provided by the class.
@@ -32,7 +32,7 @@ related operators can be defined in terms of others (e.g. `x >= y`
is equivalent to `!(x < y)`).
Replicating this boilerplate for multiple classes is both tedious and
error-prone. The [@../../../include/boost/operators.hpp `<boost/operators.hpp>`] templates
error-prone. The [@../../../../boost/operators.hpp `<boost/operators.hpp>`] templates
help by generating operators for you at namespace scope based on other
operators you have defined in your class.
@@ -291,11 +291,12 @@ are:
* [link table:indexable `indexable<>`]
* Any composite operator template that includes at least one of the above
As Daniel Krugler pointed out, this technique violates 14.6.5/2 and is thus
non-portable. The reasoning is, that the operators injected by the instantiation
As Daniel Krugler pointed out, this technique violates C++11 [sect]14.6.5/2 \[temp.inject\]
and is thus non-portable. The reasoning is, that the operators injected by the instantiation
of e.g. `less_than_comparable<my_class>` can not be found by ADL according to the
rules given by 3.4.2/2, since `my_class` is not an associated class of
`less_than_comparable<my_class>`. Thus only use this technique if all else fails.
rules given by C++11 [sect]3.4.2/2 \[basic.lookup.argdep\], since `my_class` is not
an associated class of `less_than_comparable<my_class>`. Thus only use this technique
if all else fails.
[#sec:portability]
[h5 Requirement Portability]
@@ -1098,22 +1099,26 @@ function return value (which is another unnamed object of type
`T`). The standard doesn't generally allow the intermediate
object to be optimized away:
["3.7.2/2: Automatic storage duration: If a named automatic object has initialization or a destructor with
side effects, it shall not be destroyed before the end of its block,
nor shall it be eliminated as an optimization even if it appears to be
unused, except that a class object or its copy may be eliminated as
specified in 12.8.]
[:['C++11 [sect]3.7.3/3 \[basic.stc.auto\]: Automatic storage duration:] If a variable with automatic storage
duration has initialization or a destructor with side effects, it shall not be destroyed before the end of
its block, nor shall it be eliminated as an optimization even if it appears to be unused, except that a class
object or its copy/move may be eliminated as specified in 12.8.]
The reference to 12.8 is important for us:
The reference to [sect]12.8 is important for us:
["12.8/15: Copying class objects: (...) For a function with a class return type, if the expression in the
return statement is the name of a local object, and the cv-unqualified
type of the local object is the same as the function return type, an
implementation is permitted to omit creating the temporary object to
hold the function return value, even if the class copy constructor or
destructor has side effects.]
[:['C++11 [sect]12.8/31 \[class.copy\]: Copying and moving class objects:] When certain criteria are met, an implementation is allowed to omit the copy/move construction of a class
object, even if the copy/move constructor and/or destructor for the object have side effects. ([hellip]) This elision of copy/move
operations, called ['copy elision], is permitted in the following circumstances (which may be combined to
eliminate multiple copies):
This optimization is known as the named return value optimization (NRVO),
[mdash] in a `return` statement in a function with a class return type, when the expression is the name of a
non-volatile automatic object (other than a function or catch-clause parameter) with the same cv-
unqualified type as the function return type, the copy/move operation can be omitted by constructing
the automatic object directly into the function's return value
([hellip])]
This optimization is known as the named return value optimization ([@https://en.cppreference.com/w/cpp/language/copy_elision#Non-mandatory_elision_of_copy.2Fmove_.28since_C.2B.2B11.29_operations NRVO]),
which leads us to the following implementation for `operator+`:
```
@@ -1142,14 +1147,15 @@ T operator+( T lhs, const T& rhs )
The difference to the first implementation is that `lhs` is
not taken as a constant reference used to create a copy; instead,
`lhs` is a by-value parameter, thus it is already the copy
needed. This allows another optimization (12.2/2) for some cases.
needed. This allows another optimization (C++11 [sect]12.2/2 \[class.temporary\])
for some cases.
Consider `a + b + c` where the result of `a + b` is not copied when
used as `lhs` when adding `c`. This is more efficient than the original
code, but not as efficient as a compiler using the NRVO. For most people,
it is still preferable for compilers that don't implement the NRVO, but
the `operator+` now has a different function signature. Also,
the number of objects created differs for `(a + b ) + c` and `a + ( b + c )`.
the number of objects created differs for `(a + b) + c` and `a + (b + c)`.
Most probably, this won't be a problem for you, but if your code relies on the function
signature or a strict symmetric behaviour, you should set
@@ -1835,16 +1841,16 @@ such as `iterator_category` and `value_type`.
# [#note:1] Unlike other iterator helpers templates, __output_iterator_helper__ takes only one template parameter -
the type of its target class. Although to some it might seem like an unnecessary restriction, the standard requires
`difference_type` and `value_type` of any output iterator to be `void` (24.3.1 [lib.iterator.traits]), and
`difference_type` and `value_type` of any output iterator to be `void` (C++11 [sect]24.4.1 \[lib.iterator.traits\]), and
__output_iterator_helper__ template respects this requirement. Also, output iterators in the standard have void `pointer` and
`reference` types, so the __output_iterator_helper__ does the same.
# [#note:2] As self-proxying is the easiest and most common way to implement output iterators (see,
for example, insert [24.4.2] and stream iterators [24.5] in the standard library),
for example, insert (C++11 [sect]24.5.2 \[insert.iterators\]) and stream iterators (C++11 [sect]24.6 \[stream.iterators\]) in the standard library),
__output_iterator_helper__ supports the idiom by defining `operator*` and `operator++` member functions which
just return a non-const reference to the iterator itself. Support for self-proxying allows us, in many cases,
to reduce the task of writing an output iterator to writing just two member functions - an appropriate
constructor and a copy-assignment operator. For example, here is a possible implementation of
[@boost:/doc/html/iterator/doc/function_output_iterator.html `boost::function_output_iterator`] adaptor:
[@boost:/libs/iterator/doc/function_output_iterator.html `boost::function_output_iterator`] adaptor:
```
template<class UnaryFunction>
@@ -1936,11 +1942,11 @@ classes themselves have no state. For instance, the size of
above was 12-24 bytes on various compilers for the Win32 platform,
instead of the expected 8 bytes.
Strictly speaking, it was not the library's fault -- the language rules
allow the compiler to apply the empty base class optimization in that
situation. In principle an arbitrary number of empty base classes can be
allocated at the same offset, provided that none of them have a common
ancestor (see section 10.5 [class.derived] paragraph 5 of the standard).
Strictly speaking, it was not the library's fault [ndash] the language rules
allow the compiler to apply the [@https://en.cppreference.com/w/cpp/language/ebo empty base class optimization]
in that situation. In principle an arbitrary number of empty base classes can
be allocated at the same offset, provided that none of them have a common
ancestor (see [sect]10 \[class.derived\] paragraph 8 of the C++11 standard).
But the language definition also does not ['require] implementations
to do the optimization, and few if any of today's compilers implement it
@@ -1949,7 +1955,7 @@ that implementors will adopt it as a future enhancement to existing
compilers, because it would break binary compatibility between code
generated by two different versions of the same compiler. As Matt Austern
said, "One of the few times when you have the freedom to do this sort of
thing is when you are targeting a new architecture...". On the other hand,
thing is when you are targeting a new architecture[hellip]". On the other hand,
many common compilers will use the empty base optimization for single
inheritance hierarchies.
@@ -1971,11 +1977,11 @@ library to remain backward-compatible.
* [@http://www.boost.org/people/dave_abrahams.htm Dave Abrahams]:
Started the library and contributed the arithmetic operators in
[@../../../include/boost/operators.hpp `boost/operators.hpp`].
[@../../../../boost/operators.hpp `boost/operators.hpp`].
* [@http://www.boost.org/people/jeremy_siek.htm Jeremy Siek]:
Contributed the [link sec:deref dereference operators and iterator
helpers] in [@../../../include/boost/operators.hpp boost/operators.hpp].
helpers] in [@../../../../boost/operators.hpp boost/operators.hpp].
Also contributed [@../../../test/iterators_test.cpp iterators_test.cpp].
* [@http://www.boost.org/people/aleksey_gurtovoy.htm Aleksey Gurtovoy]:

View File

@@ -11,20 +11,19 @@
Some utilities have been moved from Boost.Utilities to more appropriate Boost libraries:
# Moved to [@boost:/doc/html/core/index.html Boost.Core]
# [@boost:/doc/html/core/doc/html/core/addressof.html addressof]
# [@boost:/doc/html/core/doc/html/core/checked_delete.html checked_delete]
# [@boost:/doc/html/core/doc/html/core/enable_if.html enable_if]
# [@boost:/doc/html/core/doc/html/core/noncopyable.html noncopyable]
# Moved to [@boost:/doc/html/type_traits/index.html Boost.TypeTraits]
# [@boost:/doc/html/type_traits/doc/html/boost_typetraits/reference/declval.html declval]
# Moved to [@boost:/doc/html/iterator/index.html Boost.Iterator]
# [@boost:/doc/html/iterator/doc/generator_iterator.htm generator iterator adaptors]
# [@boost:/doc/html/iterator/doc/html/iterator/algorithms/next_prior.html next/prior]
# Moved to [@boost:/doc/html/io/index.html Boost.IO]
# [@boost:/doc/html/io/doc/html/io.html ostream_string]
# Moved to [@boost:/doc/html/throw_exception/index.html Boost.ThrowException]
# [@boost:/doc/html/throw_exception/doc/html/throw_exception.html#using_boost_throw_exception throw_exception]
# Moved to [@boost:/libs/core/index.html Boost.Core]
# [@boost:/libs/core/doc/html/core/addressof.html addressof]
# [@boost:/libs/core/doc/html/core/checked_delete.html checked_delete]
# [@boost:/libs/core/doc/html/core/enable_if.html enable_if]
# [@boost:/libs/core/doc/html/core/noncopyable.html noncopyable]
# Moved to [@boost:/libs/type_traits/index.html Boost.TypeTraits]
# [@boost:/libs/type_traits/doc/html/boost_typetraits/reference/declval.html declval]
# Moved to [@boost:/libs/iterator/index.html Boost.Iterator]
# [@boost:/libs/iterator/doc/generator_iterator.htm generator iterator adaptors]
# [@boost:/libs/iterator/doc/html/iterator/algorithms/next_prior.html next/prior]
# Moved to [@boost:/libs/io/index.html Boost.IO]
# [@boost:/libs/io/doc/html/io.html ostream_string]
# Moved to [@boost:/libs/throw_exception/index.html Boost.ThrowException]
# [@boost:/libs/throw_exception/doc/html/throw_exception.html#using_boost_throw_exception throw_exception]
[endsect]

View File

@@ -22,24 +22,24 @@ in other libraries.
[table:id Components
[[Boost.Utility] [Moved to Boost] [C++ Standard variant]]
[[[@boost:/doc/html/core/doc/html/core/addressof.html `addressof`]] [[@boost:/doc/html/core/index.html Boost.Core]] [C++11 __std_addressof__]]
[[[@boost:/libs/core/doc/html/core/addressof.html `addressof`]] [[@boost:/libs/core/index.html Boost.Core]] [C++11 __std_addressof__]]
[[__base_from_member__] [] []]
[[__BOOST_BINARY__] [] [C++14 [@https://en.cppreference.com/w/cpp/language/integer_literal Binary integer literal]]]
[[__call_traits__] [] []]
[[[@boost:/doc/html/core/doc/html/core/checked_delete.html `checked_delete`]] [[@boost:/doc/html/core/index.html Boost.Core]] []]
[[[@boost:/libs/core/doc/html/core/checked_delete.html `checked_delete`]] [[@boost:/libs/core/index.html Boost.Core]] []]
[[__compressed_pair__] [] []]
[[[@boost:/doc/html/type_traits/doc/html/boost_typetraits/reference/declval.html `declval`]] [[@boost:/doc/html/type_traits/index.html Boost.TypeTraits]] [C++11 __std_declval__]]
[[[@boost:/doc/html/core/doc/html/core/enable_if.html `enable_if`]] [[@boost:/doc/html/core/index.html Boost.Core]] [C++11 __std_enable_if__]]
[[[@boost:/doc/html/iterator/doc/generator_iterator.htm generator iterator adaptors]] [[@boost:/doc/html/iterator/index.html Boost.Iterator]] []]
[[[@boost:/libs/type_traits/doc/html/boost_typetraits/reference/declval.html `declval`]] [[@boost:/libs/type_traits/index.html Boost.TypeTraits]] [C++11 __std_declval__]]
[[[@boost:/libs/core/doc/html/core/enable_if.html `enable_if`]] [[@boost:/libs/core/index.html Boost.Core]] [C++11 __std_enable_if__]]
[[[@boost:/libs/iterator/doc/generator_iterator.htm generator iterator adaptors]] [[@boost:/libs/iterator/index.html Boost.Iterator]] []]
[[__in_place_factory__] [] []]
[[[@boost:/doc/html/iterator/index.html `iterator_adaptors`]] [[@boost:/doc/html/iterator/index.html Boost.Iterator]] []]
[[[@boost:/doc/html/iterator/doc/html/iterator/algorithms/next_prior.html `next` / `prior`]] [[@boost:/doc/html/iterator/index.html Boost.Iterator]] [C++11 __std_next__ / __std_prev__]]
[[[@boost:/doc/html/core/doc/html/core/noncopyable.html `noncopyable`]] [[@boost:/doc/html/core/index.html Boost.Core]] []]
[[[@boost:/libs/iterator/index.html `iterator_adaptors`]] [[@boost:/libs/iterator/index.html Boost.Iterator]] []]
[[[@boost:/libs/iterator/doc/html/iterator/algorithms/next_prior.html `next` / `prior`]] [[@boost:/libs/iterator/index.html Boost.Iterator]] [C++11 __std_next__ / __std_prev__]]
[[[@boost:/libs/core/doc/html/core/noncopyable.html `noncopyable`]] [[@boost:/libs/core/index.html Boost.Core]] []]
[[[link sec:operators `operators`]] [] []]
[[[@boost:/doc/html/io/doc/html/io.html `ostream_string`]] [[@boost:/doc/html/io/index.html Boost.IO]] []]
[[[@boost:/libs/io/doc/html/io.html `ostream_string`]] [[@boost:/libs/io/index.html Boost.IO]] []]
[[__result_of__] [] [C++11 __std_result_of__]]
[[__string_view__] [] [C++17 __std_string_view__]]
[[[@boost:/doc/html/throw_exception/doc/html/throw_exception.html#using_boost_throw_exception `throw_exception`]] [[@boost:/doc/html/throw_exception/index.html Boost.ThrowException]] []]
[[[@boost:/libs/throw_exception/doc/html/throw_exception.html#using_boost_throw_exception `throw_exception`]] [[@boost:/libs/throw_exception/index.html Boost.ThrowException]] []]
[[[link sec:value_init `value_init`]] [] [C++11 [@https://en.cppreference.com/w/cpp/language/list_initialization List initialization]]]
]

View File

@@ -23,7 +23,7 @@ function reference, member function pointer, or class type. By default,
N may be any value between 0 and 16. To change the upper limit, define
the macro `BOOST_RESULT_OF_NUM_ARGS` to the maximum value for N. Class
template __result_of__ resides in the header
[@../../../include/boost/utility/result_of.hpp `<boost/utility/result_of.hpp>`].
[@../../../../boost/utility/result_of.hpp `<boost/utility/result_of.hpp>`].
If your compiler's support for __decltype__ is adequate, __result_of__
automatically uses it to deduce the type of the call expression, in
@@ -419,5 +419,3 @@ Created by Doug Gregor. Contributions from Daniel Walker, Eric Niebler, Michel M
[endsect]
[endsect]

View File

@@ -37,17 +37,17 @@ Boost.Utility also includes the class __string_ref__:
- __string_ref__ is the initial implementation of Jeffrey Yaskin's [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3442.html N3442:
string_ref: a non-owning reference to a string].
- __string_view__ is an updated implementation to reflect the Library Fundamentals TS [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4480.html N4480: \[string.view\]]
- __string_view__ is an updated implementation to reflect the Library Fundamentals TS [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4480.html N4480: \[string.view\]].
Please prefer __string_view__ / __basic_string_view__ over __string_ref__ / __basic_string_ref__:
- The __basic_string_view__ class better matches __std_basic_string_view__
- The __basic_string_view__ class better matches __std_basic_string_view__.
- __basic_string_view__ has WAY more constexpr support.
- Code that uses __basic_string_ref__ should continue to work.
- No much code depends on __basic_string_ref__ anymore
- Not much code depends on __basic_string_ref__ anymore.
]
@@ -93,7 +93,7 @@ No memory allocations. No copying of character data. No changes to the code othe
[section:reference Synopsis]
[/=================]
The header file [@../../../include/boost/utility/string_view.hpp `<boost/utility/string_view.hpp>`] defines a template __boost_basic_string_view__, and four specializations __string_view__, __wstring_view__, __u16string_view__, __u32string_view__ - for `char` / `wchar_t` / `char16_t` / `char32_t`.
The header file [@../../../../boost/utility/string_view.hpp `<boost/utility/string_view.hpp>`] defines a template __boost_basic_string_view__, and four specializations __string_view__, __wstring_view__, __u16string_view__, __u32string_view__ - for `char` / `wchar_t` / `char16_t` / `char32_t`.
`#include <boost/utility/string_view.hpp>`
@@ -207,4 +207,3 @@ Copyright 2012 Marshall Clow
[endsect]
[endsect]

View File

@@ -13,14 +13,12 @@ The entire contents of Boost.Utility are in `namespace boost`.
[warning
Direct use of the header [@../../../include/boost/utility.hpp `<boost/utility.hpp>`] is discouraged and it will be deprecated.
Direct use of the header [@../../../../boost/utility.hpp `<boost/utility.hpp>`] is discouraged and it will be deprecated.
Please include the headers relative to individual components instead.
]
[include base_from_member.qbk]
[include BOOST_BINARY.qbk]
[include call_traits.qbk]
@@ -32,4 +30,3 @@ Please include the headers relative to individual components instead.
[include value_init.qbk]
[endsect]

View File

@@ -109,14 +109,14 @@ but robust against the aforementioned compiler issues.
The C++ standard \[[link sec:references 3]\] contains the definitions
of `zero-initialization` and `default-initialization`. Informally, zero-initialization
means that the object is given the initial value `0` converted to the type and
default-initialization means that POD \[[link sec:references 4]\] types are zero-initialized,
default-initialization means that [@https://en.cppreference.com/w/cpp/named_req/PODType POD] \[[link sec:references 4]\] types are zero-initialized,
while non-POD class types are initialized with their corresponding default constructors.
A ['declaration] can contain an ['initializer], which specifies the
object's initial value. The initializer can be just '()', which states that
the object shall be value-initialized (but see below). However, if a ['declaration]
has no ['initializer] and it is of a non-`const`, non-`static` POD type, the
initial value is indeterminate: (see &sect;8.5, [dcl.init], for the
initial value is indeterminate: (see [sect]8.5, \[dcl.init\], for the
accurate definitions).
```
@@ -262,7 +262,7 @@ is fixed.
New versions of __value_initialized__ (Boost release version 1.35 or higher) offer a workaround to these
issues: __value_initialized__ may now clear its internal data, prior to constructing the object that it
contains. It will do so for those compilers that need to have such a workaround, based on the
[@boost:/doc/html/config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_defects
[@boost:/libs/config/doc/html/boost_config/boost_macro_reference.html#boost_config.boost_macro_reference.macros_that_describe_defects
compiler defect macro] `BOOST_NO_COMPLETE_VALUE_INITIALIZATION`.
[endsect]
@@ -553,7 +553,7 @@ compiler-generated functions you do not want], [@http://www.aristeia.com/books.h
# The C++ Standard, Second edition (2003), ISO/IEC 14882:2003
# POD stands for "Plain Old Data"
# POD stands for [@https://en.cppreference.com/w/cpp/named_req/PODType "Plain Old Data"]
[endsect]

View File

@@ -1,14 +1,14 @@
<html>
<head>
<title>Boost.Utility</title>
<meta http-equiv="refresh" content="0; URL=./doc/html/index.html">
<title>Boost.EnableIf</title>
<meta http-equiv="refresh" content="0; URL=../core/doc/html/core/enable_if.html">
</head>
<body>
Automatic redirection failed, please go to
<a href="../core/doc/html/core/enable_if.html">../core/doc/html/core/enable_if.html</a>
<hr>
<tt>
Boost.Utility<br>
Boost.EnableIf<br>
<br>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at

View File

@@ -1,14 +1,14 @@
<html>
<head>
<title>Boost.Utility</title>
<meta http-equiv="refresh" content="0; URL=./doc/html/index.html">
<title>Boost.InPlaceFactory</title>
<meta http-equiv="refresh" content="0; URL=./doc/html/utility/utilities/in_place_factory.html">
</head>
<body>
Automatic redirection failed, please go to
<a href="./doc/html/utility/utilities/in_place_factory.html">./doc/html/utility/utilities/in_place_factory.html</a>
<hr>
<tt>
Boost.Utility<br>
Boost.InPlaceFactory<br>
<br>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at

View File

@@ -11,48 +11,6 @@
// An implementation of minstd_rand that does not require
// the Random library
#include <boost/cstdint.hpp>
namespace boost
{
namespace detail
{
class minstd_rand
{
private:
boost::uint_least32_t x_;
enum { a = 48271, m = 2147483647 };
public:
minstd_rand(): x_( 1 )
{
}
explicit minstd_rand( boost::uint_least32_t x ): x_( x % m )
{
if( x_ == 0 )
{
x_ = 1;
}
}
boost::uint_least32_t operator()()
{
boost::uint_least64_t y = x_;
y = ( a * y ) % m;
x_ = static_cast<boost::uint_least32_t>( y );
return x_;
}
};
} // namespace detail
} // namespace boost
#include <boost/core/detail/minstd_rand.hpp>
#endif // #ifndef BOOST_UTILITY_DETAIL_MINSTD_RAND_HPP_INCLUDED

View File

@@ -119,8 +119,8 @@ template<typename F> struct cpp0x_result_of;
// There doesn't seem to be any other way to turn this off such that the presence of
// the user-defined operator,() below doesn't cause spurious warning all over the place,
// so unconditionally turn it off.
#if BOOST_MSVC
// so unconditionally and globally turn it off. (https://svn.boost.org/trac10/ticket/7663)
#ifdef BOOST_MSVC
# pragma warning(disable: 4913) // user defined binary operator ',' exists but no overload could convert all operands, default built-in binary operator ',' used
#endif
@@ -134,12 +134,19 @@ template<typename T>
result_of_no_type result_of_is_private_type(T const &);
result_of_yes_type result_of_is_private_type(result_of_private_type);
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
template<typename C>
struct result_of_callable_class : C {
result_of_callable_class();
typedef result_of_private_type const &(*pfn_t)(...);
operator pfn_t() const volatile;
};
#ifdef BOOST_MSVC
# pragma warning(pop)
#endif
template<typename C>
struct result_of_wrap_callable_class {

View File

@@ -128,13 +128,13 @@ namespace boost {
// capacity
BOOST_CONSTEXPR size_type size() const { return len_; }
BOOST_CONSTEXPR size_type length() const { return len_; }
BOOST_CONSTEXPR size_type max_size() const { return len_; }
BOOST_CONSTEXPR size_type max_size() const { return ~static_cast<size_type>(0) / (sizeof(value_type) * 2u); }
BOOST_CONSTEXPR bool empty() const { return len_ == 0; }
// element access
BOOST_CONSTEXPR const charT& operator[](size_type pos) const { return ptr_[pos]; }
const charT& at(size_t pos) const {
const charT& at(size_type pos) const {
if ( pos >= len_ )
BOOST_THROW_EXCEPTION( std::out_of_range ( "boost::string_ref::at" ) );
return ptr_[pos];
@@ -161,6 +161,10 @@ namespace boost {
// basic_string_ref string operations
basic_string_ref substr() const {
return basic_string_ref(data(), size());
}
basic_string_ref substr(size_type pos, size_type n=npos) const {
if ( pos > size())
BOOST_THROW_EXCEPTION( std::out_of_range ( "string_ref::substr" ) );

View File

@@ -23,6 +23,7 @@
#include <boost/io/ostream_put.hpp>
#include <boost/utility/string_view_fwd.hpp>
#include <boost/throw_exception.hpp>
#include <boost/assert.hpp>
#include <cstddef>
#include <stdexcept>
@@ -122,13 +123,13 @@ namespace boost {
// capacity
BOOST_CONSTEXPR size_type size() const BOOST_NOEXCEPT { return len_; }
BOOST_CONSTEXPR size_type length() const BOOST_NOEXCEPT { return len_; }
BOOST_CONSTEXPR size_type max_size() const BOOST_NOEXCEPT { return len_; }
BOOST_CONSTEXPR size_type max_size() const BOOST_NOEXCEPT { return ~static_cast<size_type>(0) / (sizeof(value_type) * 2u); }
BOOST_CONSTEXPR bool empty() const BOOST_NOEXCEPT { return len_ == 0; }
// element access
BOOST_CONSTEXPR const_reference operator[](size_type pos) const BOOST_NOEXCEPT { return ptr_[pos]; }
BOOST_CONSTEXPR const_reference at(size_t pos) const {
BOOST_CONSTEXPR const_reference at(size_type pos) const {
return pos >= len_ ? BOOST_THROW_EXCEPTION(std::out_of_range("boost::string_view::at")), ptr_[0] : ptr_[pos];
}
@@ -140,6 +141,8 @@ namespace boost {
void clear() BOOST_NOEXCEPT { len_ = 0; } // Boost extension
BOOST_CXX14_CONSTEXPR void remove_prefix(size_type n) {
BOOST_ASSERT(n <= size());
// This check is deprecated and is left for backward compatibility. It will be removed in the future.
if ( n > len_ )
n = len_;
ptr_ += n;
@@ -147,6 +150,8 @@ namespace boost {
}
BOOST_CXX14_CONSTEXPR void remove_suffix(size_type n) {
BOOST_ASSERT(n <= size());
// This check is deprecated and is left for backward compatibility. It will be removed in the future.
if ( n > len_ )
n = len_;
len_ -= n;
@@ -189,6 +194,10 @@ namespace boost {
return rlen;
}
BOOST_CXX14_CONSTEXPR basic_string_view substr() const {
return basic_string_view(data(), size());
}
BOOST_CXX14_CONSTEXPR basic_string_view substr(size_type pos, size_type n=npos) const {
if ( pos > size())
BOOST_THROW_EXCEPTION( std::out_of_range ( "string_view::substr" ) );
@@ -201,7 +210,7 @@ namespace boost {
}
BOOST_CXX14_CONSTEXPR int compare(size_type pos1, size_type n1, basic_string_view x)
const BOOST_NOEXCEPT {
const {
return substr(pos1, n1).compare(x);
}
@@ -241,6 +250,18 @@ namespace boost {
traits::compare(ptr_ + len_ - x.len_, x.ptr_, x.len_) == 0;
}
BOOST_CXX14_CONSTEXPR bool contains(basic_string_view s) const BOOST_NOEXCEPT {
return find(s) != npos;
}
BOOST_CXX14_CONSTEXPR bool contains(charT c) const BOOST_NOEXCEPT {
return find(c) != npos;
}
BOOST_CXX14_CONSTEXPR bool contains(const charT* s) const BOOST_NOEXCEPT {
return find(s) != npos;
}
// find
BOOST_CXX14_CONSTEXPR size_type find(basic_string_view s, size_type pos = 0) const BOOST_NOEXCEPT {
if (pos > size())

View File

@@ -23,7 +23,7 @@
// contains. More details on these issues are at libs/utility/value_init.htm
#include <boost/config.hpp> // For BOOST_NO_COMPLETE_VALUE_INITIALIZATION.
#include <boost/swap.hpp>
#include <boost/core/invoke_swap.hpp>
#include <cstring>
#include <cstddef>
@@ -32,7 +32,7 @@
// It is safe to ignore the following warning from MSVC 7.1 or higher:
// "warning C4351: new behavior: elements of array will be default initialized"
#pragma warning(disable: 4351)
// It is safe to ignore the following MSVC warning, which may pop up when T is
// It is safe to ignore the following MSVC warning, which may pop up when T is
// a const type: "warning C4512: assignment operator could not be generated".
#pragma warning(disable: 4512)
#endif
@@ -40,8 +40,8 @@
#ifndef BOOST_UTILITY_DOCS
#ifdef BOOST_NO_COMPLETE_VALUE_INITIALIZATION
// Implementation detail: The macro BOOST_DETAIL_VALUE_INIT_WORKAROUND_SUGGESTED
// suggests that a workaround should be applied, because of compiler issues
// Implementation detail: The macro BOOST_DETAIL_VALUE_INIT_WORKAROUND_SUGGESTED
// suggests that a workaround should be applied, because of compiler issues
// regarding value-initialization.
#define BOOST_DETAIL_VALUE_INIT_WORKAROUND_SUGGESTED
#endif
@@ -117,7 +117,7 @@ class initialized
BOOST_GPU_ENABLED
void swap(initialized & arg)
{
::boost::swap( this->data(), arg.data() );
::boost::core::invoke_swap( this->data(), arg.data() );
}
BOOST_GPU_ENABLED
@@ -164,13 +164,13 @@ class value_initialized
initialized<T> m_data;
public :
BOOST_GPU_ENABLED
value_initialized()
:
m_data()
{ }
BOOST_GPU_ENABLED
T const & data() const
{
@@ -228,7 +228,7 @@ void swap ( value_initialized<T> & lhs, value_initialized<T> & rhs )
class initialized_value_t
{
public :
template <class T> BOOST_GPU_ENABLED operator T() const
{
return initialized<T>().data();

View File

@@ -1,14 +1,14 @@
<html>
<head>
<title>Boost.Utility</title>
<meta http-equiv="refresh" content="0; URL=./doc/html/index.html">
<title>Boost.Iterator</title>
<meta http-equiv="refresh" content="0; URL=../iterator/doc/index.html">
</head>
<body>
Automatic redirection failed, please go to
<a href="../iterator/doc/generator_iterator.htm">../iterator/doc/generator_iterator.htm</a>
<a href="../iterator/doc/index.html">../iterator/doc/index.html</a>
<hr>
<tt>
Boost.Utility<br>
Boost.Iterator<br>
<br>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at

View File

@@ -5,12 +5,9 @@
"authors": [
"Dave Abrahams and others"
],
"description": "Class noncopyable plus checked_delete(), checked_array_delete(), next(), prior() function templates, plus base-from-member idiom.",
"description": "Various utilities, such as base-from-member idiom and binary literals in C++03.",
"documentation": "utility.htm",
"category": [
"Algorithms",
"Function-objects",
"Memory",
"Miscellaneous",
"Patterns"
],
@@ -35,7 +32,7 @@
"authors": [
"John Maddock, Howard Hinnant, et al"
],
"description": "Empty member optimization.",
"description": "A pair class with empty member optimization.",
"documentation": "compressed_pair.htm",
"category": [
"Data",
@@ -79,7 +76,7 @@
"Dave Abrahams",
"Jeremy Siek"
],
"description": "Templates ease arithmetic classes and iterators.",
"description": "Templates to simplify operator definition in arithmetic classes and iterators.",
"documentation": "operators.htm",
"category": [
"Generic",
@@ -95,7 +92,7 @@
"key": "utility/result_of",
"name": "Result Of",
"description": "Determines the type of a function call expression.",
"documentation": "utility.htm#result_of",
"documentation": "doc/html/utility/utilities/result_of.html",
"category": [
"Function-objects"
],
@@ -106,12 +103,13 @@
"cxxstd": "03"
},
{
"key": "utility/string_ref",
"name": "string_ref",
"key": "utility/string_view",
"name": "String View",
"description": "String view templates.",
"documentation": "doc/html/string_ref.html",
"documentation": "doc/html/utility/utilities/string_view.html",
"category": [
"Containers"
"Containers",
"String"
],
"authors": "Marshall Clow",
"maintainers": [

View File

@@ -1,14 +1,14 @@
<html>
<head>
<title>Boost.Utility</title>
<meta http-equiv="refresh" content="0; URL=./doc/html/index.html">
<title>Boost.Operators</title>
<meta http-equiv="refresh" content="0; URL=./doc/html/utility/utilities/operators.html">
</head>
<body>
Automatic redirection failed, please go to
<a href="./doc/html/utility/utilities/operators.html">./doc/html/utility/utilities/operators.html</a>
<hr>
<tt>
Boost.Utility<br>
Boost.Operators<br>
<br>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at

View File

@@ -1,6 +1,6 @@
// boost::compressed_pair test program
// (C) Copyright John Maddock 2000.
// boost::compressed_pair test program
// (C) Copyright John Maddock 2000.
// Use, modification and distribution are subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt).
@@ -45,7 +45,7 @@ struct contained
// stored value:
value_type v_;
// constructors:
contained() {}
contained(param_type p) : v_(p){}
@@ -197,11 +197,11 @@ struct comparible_UDT
comparible_UDT() : i_(2){}
comparible_UDT(const comparible_UDT& other) : i_(other.i_){}
comparible_UDT& operator=(const comparible_UDT& other)
{
{
i_ = other.i_;
return *this;
}
bool operator == (const comparible_UDT& v){ return v.i_ == i_; }
bool operator == (const comparible_UDT& v) const { return v.i_ == i_; }
};
int main()
@@ -339,7 +339,7 @@ void call_traits_test<T, isarray>::assert_construct(typename call_traits_test<T,
param_type p2(v);
param_type p3(r);
param_type p4(p);
unused_variable(v2);
unused_variable(v3);
unused_variable(v4);
@@ -388,7 +388,7 @@ void call_traits_test<T, true>::assert_construct(typename boost::call_traits<T>:
param_type p2(v);
param_type p3(r);
param_type p4(p);
unused_variable(v2);
unused_variable(v3);
unused_variable(v4);

View File

@@ -7,6 +7,7 @@
For more information, see http://www.boost.org
*/
#include <cstddef>
#include <iostream>
#include <algorithm>
#include <string>
@@ -41,30 +42,30 @@ void null_tests ( const char *p ) {
// make sure that substrings work just like strings
void test_substr ( const std::string &str ) {
const size_t sz = str.size ();
const std::size_t sz = str.size ();
string_ref ref ( str );
// Substrings at the end
for ( size_t i = 0; i <= sz; ++ i )
for ( std::size_t i = 0; i <= sz; ++ i )
interop ( str.substr ( i ), ref.substr ( i ));
// Substrings at the beginning
for ( size_t i = 0; i <= sz; ++ i )
for ( std::size_t i = 0; i <= sz; ++ i )
interop ( str.substr ( 0, i ), ref.substr ( 0, i ));
// All possible substrings
for ( size_t i = 0; i < sz; ++i )
for ( size_t j = i; j < sz; ++j )
for ( std::size_t i = 0; i < sz; ++i )
for ( std::size_t j = i; j < sz; ++j )
interop ( str.substr ( i, j ), ref.substr ( i, j ));
}
// make sure that removing prefixes and suffixes work just like strings
void test_remove ( const std::string &str ) {
const size_t sz = str.size ();
const std::size_t sz = str.size ();
std::string work;
string_ref ref;
for ( size_t i = 1; i <= sz; ++i ) {
for ( std::size_t i = 1; i <= sz; ++i ) {
work = str;
ref = str;
while ( ref.size () >= i ) {
@@ -74,7 +75,7 @@ void test_remove ( const std::string &str ) {
}
}
for ( size_t i = 1; i < sz; ++ i ) {
for ( std::size_t i = 1; i < sz; ++ i ) {
work = str;
ref = str;
while ( ref.size () >= i ) {

View File

@@ -7,8 +7,11 @@
For more information, see http://www.boost.org
*/
#include <cstddef>
#include <iostream>
#include <cstring> // for std::strchr
#include <string>
#include <algorithm>
#include <boost/utility/string_ref.hpp>
@@ -17,7 +20,7 @@
typedef boost::string_ref string_ref;
void ends_with ( const char *arg ) {
const size_t sz = std::strlen ( arg );
const std::size_t sz = std::strlen ( arg );
string_ref sr ( arg );
string_ref sr2 ( arg );
const char *p = arg;
@@ -41,20 +44,19 @@ void ends_with ( const char *arg ) {
char ch = sz == 0 ? '\0' : arg [ sz - 1 ];
sr2 = arg;
if ( sz > 0 )
BOOST_TEST ( sr2.ends_with ( ch ));
BOOST_TEST ( sr2.ends_with ( ch ));
BOOST_TEST ( !sr2.ends_with ( ++ch ));
BOOST_TEST ( sr2.ends_with ( string_ref ()));
}
void starts_with ( const char *arg ) {
const size_t sz = std::strlen ( arg );
const std::size_t sz = std::strlen ( arg );
string_ref sr ( arg );
string_ref sr2 ( arg );
const char *p = arg + std::strlen ( arg ) - 1;
while ( p >= arg ) {
std::string foo ( arg, p + 1 );
std::string foo ( arg );
while ( !foo.empty ()) {
BOOST_TEST ( sr.starts_with ( foo ));
--p;
foo.erase ( foo.end () - 1 );
}
while ( !sr2.empty ()) {
@@ -64,8 +66,8 @@ void starts_with ( const char *arg ) {
char ch = *arg;
sr2 = arg;
if ( sz > 0 )
BOOST_TEST ( sr2.starts_with ( ch ));
if ( sz > 0 )
BOOST_TEST ( sr2.starts_with ( ch ));
BOOST_TEST ( !sr2.starts_with ( ++ch ));
BOOST_TEST ( sr2.starts_with ( string_ref ()));
}
@@ -93,7 +95,7 @@ void find ( const char *arg ) {
string_ref sr2;
const char *p;
// When we search for the empty string, we find it at position 0
// When we search for the empty string, we find it at position 0
BOOST_TEST ( sr1.find (sr2) == 0 );
BOOST_TEST ( sr1.rfind(sr2) == 0 );
@@ -207,7 +209,7 @@ void find ( const char *arg ) {
string_ref::size_type pos2 = sr1.find_first_not_of(*p);
BOOST_TEST ( pos1 != string_ref::npos && pos1 < sr1.size () && pos1 <= ptr_diff ( p, arg ));
if ( pos2 != string_ref::npos ) {
for ( size_t i = 0 ; i < pos2; ++i )
for ( std::size_t i = 0 ; i < pos2; ++i )
BOOST_TEST ( sr1[i] == *p );
BOOST_TEST ( sr1 [ pos2 ] != *p );
}
@@ -233,7 +235,7 @@ void find ( const char *arg ) {
BOOST_TEST ( pos1 != string_ref::npos && pos1 < sr1.size () && pos1 >= ptr_diff ( p, arg ));
BOOST_TEST ( pos2 == string_ref::npos || pos1 < sr1.size ());
if ( pos2 != string_ref::npos ) {
for ( size_t i = sr1.size () -1 ; i > pos2; --i )
for ( std::size_t i = sr1.size () -1 ; i > pos2; --i )
BOOST_TEST ( sr1[i] == *p );
BOOST_TEST ( sr1 [ pos2 ] != *p );
}

View File

@@ -30,12 +30,12 @@ struct constexpr_char_traits
static constexpr bool eq(char_type c1, char_type c2) noexcept { return c1 == c2; }
static constexpr bool lt(char_type c1, char_type c2) noexcept { return c1 < c2; }
static constexpr int compare(const char_type* s1, const char_type* s2, size_t n) noexcept;
static constexpr size_t length(const char_type* s) noexcept;
static constexpr const char_type* find(const char_type* s, size_t n, const char_type& a) noexcept;
static constexpr char_type* move(char_type* s1, const char_type* s2, size_t n) noexcept;
static constexpr char_type* copy(char_type* s1, const char_type* s2, size_t n) noexcept;
static constexpr char_type* assign(char_type* s, size_t n, char_type a) noexcept;
static constexpr int compare(const char_type* s1, const char_type* s2, std::size_t n) noexcept;
static constexpr std::size_t length(const char_type* s) noexcept;
static constexpr const char_type* find(const char_type* s, std::size_t n, const char_type& a) noexcept;
static constexpr char_type* move(char_type* s1, const char_type* s2, std::size_t n) noexcept;
static constexpr char_type* copy(char_type* s1, const char_type* s2, std::size_t n) noexcept;
static constexpr char_type* assign(char_type* s, std::size_t n, char_type a) noexcept;
static constexpr int_type not_eof(int_type c) noexcept { return eq_int_type(c, eof()) ? ~eof() : c; }
static constexpr char_type to_char_type(int_type c) noexcept { return char_type(c); }
@@ -49,7 +49,7 @@ struct constexpr_char_traits
// else, a negative value if, for some j in [0,n), X::lt(s1[j],s2[j]) is true and
// for each i in [0,j) X::eq(s2[i],s2[i]) is true;
// else a positive value.
constexpr int constexpr_char_traits::compare(const char_type* s1, const char_type* s2, size_t n) noexcept
constexpr int constexpr_char_traits::compare(const char_type* s1, const char_type* s2, std::size_t n) noexcept
{
for (; n != 0; --n, ++s1, ++s2)
{
@@ -61,10 +61,10 @@ constexpr int constexpr_char_traits::compare(const char_type* s1, const char_typ
return 0;
}
// yields: the smallest i such that X::eq(s[i],charT()) is true.
constexpr size_t constexpr_char_traits::length(const char_type* s) noexcept
// yields: the smallest i such that X::eq(s[i],charT()) is true.
constexpr std::size_t constexpr_char_traits::length(const char_type* s) noexcept
{
size_t len = 0;
std::size_t len = 0;
for (; !eq(*s, char_type(0)); ++s)
++len;
return len;
@@ -76,7 +76,7 @@ int main()
{
constexpr string_view sv1;
constexpr string_view sv2{"abc", 3}; // ptr, len
constexpr string_view sv3{"def"}; // ptr
constexpr string_view sv3{"def"}; // ptr
constexpr const char *s1 = "";
constexpr const char *s2 = "abc";

View File

@@ -7,6 +7,7 @@
For more information, see http://www.boost.org
*/
#include <cstddef>
#include <iostream>
#include <algorithm>
#include <string>
@@ -42,30 +43,30 @@ void null_tests ( const char *p ) {
// make sure that substrings work just like strings
void test_substr ( const std::string &str ) {
const size_t sz = str.size ();
const std::size_t sz = str.size ();
string_view ref ( str );
// Substrings at the end
for ( size_t i = 0; i <= sz; ++ i )
for ( std::size_t i = 0; i <= sz; ++ i )
interop ( str.substr ( i ), ref.substr ( i ));
// Substrings at the beginning
for ( size_t i = 0; i <= sz; ++ i )
for ( std::size_t i = 0; i <= sz; ++ i )
interop ( str.substr ( 0, i ), ref.substr ( 0, i ));
// All possible substrings
for ( size_t i = 0; i < sz; ++i )
for ( size_t j = i; j < sz; ++j )
for ( std::size_t i = 0; i < sz; ++i )
for ( std::size_t j = i; j < sz; ++j )
interop ( str.substr ( i, j ), ref.substr ( i, j ));
}
// make sure that removing prefixes and suffixes work just like strings
void test_remove ( const std::string &str ) {
const size_t sz = str.size ();
const std::size_t sz = str.size ();
std::string work;
string_view ref;
for ( size_t i = 1; i <= sz; ++i ) {
for ( std::size_t i = 1; i <= sz; ++i ) {
work = str;
ref = str;
while ( ref.size () >= i ) {
@@ -75,7 +76,7 @@ void test_remove ( const std::string &str ) {
}
}
for ( size_t i = 1; i < sz; ++ i ) {
for ( std::size_t i = 1; i < sz; ++ i ) {
work = str;
ref = str;
while ( ref.size () >= i ) {

View File

@@ -8,9 +8,11 @@
*/
#include <new> // for placement new
#include <string>
#include <iostream>
#include <algorithm> // for std::equal
#include <cstddef> // for NULL, std::size_t, std::ptrdiff_t
#include <cstring> // for std::strchr and std::strcmp
#include <cstring> // for std::strlen, std::strchr and std::strcmp
#include <cstdlib> // for std::malloc and std::free
#include <boost/utility/string_view.hpp>
@@ -21,7 +23,7 @@
typedef boost::string_view string_view;
void ends_with ( const char *arg ) {
const size_t sz = std::strlen ( arg );
const std::size_t sz = std::strlen ( arg );
string_view sr ( arg );
string_view sr2 ( arg );
const char *p = arg;
@@ -45,20 +47,19 @@ void ends_with ( const char *arg ) {
char ch = sz == 0 ? '\0' : arg [ sz - 1 ];
sr2 = arg;
if ( sz > 0 )
BOOST_TEST ( sr2.ends_with ( ch ));
BOOST_TEST ( sr2.ends_with ( ch ));
BOOST_TEST ( !sr2.ends_with ( ++ch ));
BOOST_TEST ( sr2.ends_with ( string_view()));
}
void starts_with ( const char *arg ) {
const size_t sz = std::strlen ( arg );
const std::size_t sz = std::strlen ( arg );
string_view sr ( arg );
string_view sr2 ( arg );
const char *p = arg + std::strlen ( arg ) - 1;
while ( p >= arg ) {
std::string foo ( arg, p + 1 );
std::string foo ( arg );
while ( !foo.empty ()) {
BOOST_TEST ( sr.starts_with ( foo ));
--p;
foo.erase ( foo.end () - 1 );
}
while ( !sr2.empty ()) {
@@ -68,12 +69,40 @@ void starts_with ( const char *arg ) {
char ch = *arg;
sr2 = arg;
if ( sz > 0 )
BOOST_TEST ( sr2.starts_with ( ch ));
if ( sz > 0 )
BOOST_TEST ( sr2.starts_with ( ch ));
BOOST_TEST ( !sr2.starts_with ( ++ch ));
BOOST_TEST ( sr2.starts_with ( string_view ()));
}
void contains ( const char *arg ) {
const std::size_t sz = std::strlen ( arg );
string_view sr ( arg );
string_view sr2 ( arg );
std::string foo ( arg );
while ( !foo.empty ()) {
BOOST_TEST ( sr.contains ( foo ));
if ( ( foo.size () & 1u ) != 0u )
foo.erase ( foo.end () - 1 );
else
foo.erase ( foo.begin () );
}
while ( !sr2.empty ()) {
BOOST_TEST ( sr.contains ( sr2 ));
if ( ( sr2.size () & 1u ) != 0u )
sr2.remove_suffix (1);
else
sr2.remove_prefix (1);
}
sr2 = arg;
for ( std::size_t i = 0; i < sz; ++i )
BOOST_TEST ( sr2.contains ( arg[i] ));
BOOST_TEST ( !sr2.contains ( '\a' ));
BOOST_TEST ( sr2.contains ( string_view ()));
}
void reverse ( const char *arg ) {
// Round trip
string_view sr1 ( arg );
@@ -97,7 +126,7 @@ void find ( const char *arg ) {
string_view sr2;
const char *p;
// When we search for the empty string, we find it at position 0
// When we search for the empty string, we find it at position 0
BOOST_TEST ( sr1.find (sr2) == 0 );
BOOST_TEST ( sr1.rfind(sr2) == 0 );
@@ -211,7 +240,7 @@ void find ( const char *arg ) {
string_view::size_type pos2 = sr1.find_first_not_of(*p);
BOOST_TEST ( pos1 != string_view::npos && pos1 < sr1.size () && pos1 <= ptr_diff ( p, arg ));
if ( pos2 != string_view::npos ) {
for ( size_t i = 0 ; i < pos2; ++i )
for ( string_view::size_type i = 0 ; i < pos2; ++i )
BOOST_TEST ( sr1[i] == *p );
BOOST_TEST ( sr1 [ pos2 ] != *p );
}
@@ -237,7 +266,7 @@ void find ( const char *arg ) {
BOOST_TEST ( pos1 != string_view::npos && pos1 < sr1.size () && pos1 >= ptr_diff ( p, arg ));
BOOST_TEST ( pos2 == string_view::npos || pos1 < sr1.size ());
if ( pos2 != string_view::npos ) {
for ( size_t i = sr1.size () -1 ; i > pos2; --i )
for ( string_view::size_type i = sr1.size () -1 ; i > pos2; --i )
BOOST_TEST ( sr1[i] == *p );
BOOST_TEST ( sr1 [ pos2 ] != *p );
}
@@ -398,12 +427,13 @@ int main()
while ( *p != NULL ) {
starts_with ( *p );
ends_with ( *p );
contains ( *p );
reverse ( *p );
find ( *p );
to_string ( *p );
compare ( *p );
p++;
++p;
}
return boost::report_errors();

View File

@@ -21,6 +21,7 @@
#pragma hdrstop
#endif
#include <boost/core/invoke_swap.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/config/workaround.hpp>
@@ -360,7 +361,7 @@ int main()
boost::value_initialized<SwapFunctionCallTester> swapFunctionCallTester2;
get(swapFunctionCallTester1).data = 1;
get(swapFunctionCallTester2).data = 2;
boost::swap(swapFunctionCallTester1, swapFunctionCallTester2);
boost::core::invoke_swap(swapFunctionCallTester1, swapFunctionCallTester2);
BOOST_TEST( get(swapFunctionCallTester1).data == 2 );
BOOST_TEST( get(swapFunctionCallTester2).data == 1 );
BOOST_TEST( get(swapFunctionCallTester1).is_custom_swap_called );

View File

@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv=refresh content="0; URL=../exception/doc/throw_exception.html">
<meta http-equiv=refresh content="0; URL=../throw_exception/doc/html/throw_exception.html#using_boost_throw_exception">
<title>Automatic redirection</title>
</head>
<body>

View File

@@ -1,7 +1,7 @@
<html>
<head>
<title>Boost.Utility</title>
<meta http-equiv="refresh" content="0; URL=./doc/html/index.html">
<meta http-equiv="refresh" content="0; URL=./doc/html/utility/utilities/value_init.html">
</head>
<body>
Automatic redirection failed, please go to