Compare commits

...

62 Commits

Author SHA1 Message Date
a119c02c03 glob headers 2022-07-05 10:48:26 +02:00
5188c31f9d Rework as esp-idf component 2022-07-04 20:17:21 +02:00
938806c876 relnotes: info about breaking change 2022-06-22 22:56:45 +02:00
85ebe0a2ed fix hash spec for C++17 2022-06-19 23:57:15 +02:00
ce5834add2 further docs fixes 2022-05-23 22:42:04 +02:00
a514ce627d fix docs build 2022-05-23 22:32:36 +02:00
ec677383dc Added docs for std::hash
But I do not know if they copile with QuickBook.
2022-05-23 21:00:00 +02:00
52abe4842e Add std::hash specialization 2022-05-21 01:13:10 +02:00
6117d08d79 Merge pull request #102 from glywk/develop
Update typography
2022-03-07 14:49:23 +01:00
916ca23572 Update typography 2022-03-07 13:55:57 +01:00
c300a8c517 Merge pull request #100 from boostorg/pr/aligned-storage-fix
Change aligned_storage::dummy::data to unsigned char[]
2022-03-01 16:17:09 -03:00
4f713acdf8 Merge pull request #101 from boostorg/pr/unqualified-value-type
Construct the unqualified value_type with placement new
2022-03-01 16:07:44 -03:00
1e6f838a90 added missing license info in one file 2022-02-26 14:15:28 +01:00
51b7053abf Construct the unqualified value_type with placement new 2022-02-18 22:03:05 +02:00
ec96129e9e Change aligned_storage::dummy::data to unsigned char[] 2022-02-18 21:55:13 +02:00
8e86559103 Fix convert-assign tests for C++98 2021-12-22 10:36:40 +01:00
56568445b9 Fix tests on C++03 2021-12-09 22:22:05 +01:00
7dd512a019 Fix issue #98 2021-11-20 02:00:30 +01:00
21253ea63a Merge pull request #93 from sdarwin/feature/gha_fix_1
Update GitHub Actions CI file
2021-08-03 16:07:09 +02:00
14d43d2e6e Update GitHub Actions CI file 2021-07-30 16:10:11 +00:00
0b159febf8 Update CMakeLists.txt 2021-06-10 00:53:07 +03:00
d0ab8004c0 Add support for BOOST_NO_IOSTREAM 2021-05-19 23:29:10 +02:00
a70c51eed1 Merge pull request #91 from sdarwin/githubactions
GitHub Actions config
2021-03-03 16:13:06 +01:00
9c9ff5e376 Add GitHub Actions config [ci skip] 2021-03-03 14:56:21 +00:00
708db7fe9a Merge pull request #88 from sdarwin/drone
Drone config
2021-01-21 21:18:22 +01:00
27971d8b11 add drone config [ci skip] 2021-01-21 19:42:29 +00:00
97da91f665 Merge pull request #89 from eldiener/develop
[skip ci] Add "cxxstd" json field
2021-01-21 19:50:03 +01:00
4a1a9c9cdd [skip ci] Add "cxxstd" json field. The "cxxstd" json field is being added to each Boost library's meta json information for libraries in order to specify the minumum C++ standard compilation level. The value of this field matches one of the values for 'cxxstd' in Boost.Build. The purpose of doing this is to provide information for the Boost website documentation for each library which will specify the minimum C++ standard compilation that an end-user must employ in order to use the particular library. This will aid end-users who want to know if they can successfully use a Boost library based on their C++ compiler's compilation level, without having to search the library's documentation to find this out. 2021-01-20 23:02:52 -05:00
71feb7961b Merge branch 'gieseanw-patch-1' into develop 2020-12-19 00:00:58 +01:00
ead529af54 Address unreachable code warning
In MSVC optional<T&>::value() emits a warning C4702: unreachable code because throw_exception is marked BOOST_RETURN.
Otherwise the ternary code might have been preferable.
This change addresses the warning while preserving the functionality. It replicates optional<T>::value() for consistency.
2020-12-19 00:00:18 +01:00
a7f49cbec8 Merge branch 'citrusmoose-make_none_t_literal_type' into develop 2020-10-24 17:18:22 +02:00
7e0b8145b5 boost::none is constexpr-declared 2020-10-24 17:17:10 +02:00
2b08711ec6 Merge branch 'make_none_t_literal_type' of https://github.com/citrusmoose/optional into citrusmoose-make_none_t_literal_type 2020-10-24 17:05:51 +02:00
88e7d55bbc Merge pull request #85 from giomasce-throwaway/develop
Fix funny mistake in copyright headers.
2020-10-09 16:28:33 +02:00
9de55e6ffd Fix funny mistake in copyright headers. 2020-10-09 15:35:58 +02:00
409a225afe Merge pull request #84 from mbs-c/develop
Add explicit <string> include to make tests compile with MSVC
2020-08-11 16:11:59 +02:00
db5e156ebc Add explicit <string> include to make tests compile with MSVC 2020-08-11 10:36:12 +02:00
aeac95857e Merge branch 'eldiener-develop' into develop 2020-05-07 18:06:07 +02:00
d5b7791710 Merge branch 'develop' of https://github.com/eldiener/optional into cppbuilder 2020-04-17 05:55:24 -04:00
19b94c01f3 added release notes 2020-04-09 01:12:22 +02:00
404f40bcc1 Merge branch 'RobertLeahy-develop' into develop 2020-04-06 00:43:05 +02:00
9b1f8033eb Merge branch 'develop' of https://github.com/RobertLeahy/optional-2 into RobertLeahy-develop 2020-04-06 00:42:05 +02:00
e52d7d4a9e Merge branch 'Kojoley-suppress-weak-vtables-warning' into develop 2020-04-05 23:47:19 +02:00
ed9edd54e4 Merge branch 'suppress-weak-vtables-warning' of https://github.com/Kojoley/optional into Kojoley-suppress-weak-vtables-warning 2020-04-05 23:30:40 +02:00
78d6563bce Change __BORLANDC__ to BOOST_BORLANDC, which is defined in Boost config for the Embarcadero non-clang-based compilers. 2020-03-30 14:04:35 -04:00
d4a4a5b6ad fixed C++98-incompatible unit test 2020-01-16 22:31:23 +01:00
9581804efa GCC 4.4.7: boost::in_place & Assignment
Assigning a boost::in_place_factory to a boost::optional templated on a
type which was trivially copyable failed to compile under GCC 4.4.7.
2019-12-23 11:24:39 -05:00
d07ae78901 Tests Pass in GCC 4.4.7
Several tests either did not compile or failed upon running when using
GCC 4.4.7.
2019-12-23 11:24:39 -05:00
683dbe2412 .travis.yml: Specify Trusty for Trusty Addons
Previously .travis.yml didn't specify dist: trusty when using addons
which were specifically for Trusty. This led to the Clang 5 build
failing when trying to install Clang 5.
2019-12-23 11:24:39 -05:00
010ee00604 Update release notes 2019-12-20 00:30:37 +01:00
13bc27698e Add test case for fix to issue #78 2019-12-20 00:18:52 +01:00
0481b05d1f Merge branch 'cxx20_fix' of https://github.com/CaseyCarter/optional into CaseyCarter-cxx20_fix 2019-12-19 20:56:34 +01:00
4c863f5bf8 Merge branch 'master' into develop 2019-12-19 20:52:53 +01:00
9ed20cb085 Marked none instances as inline variables.
This should avoid duplicating none instances in all translation units.

Closes https://github.com/boostorg/optional/issues/33.
2019-12-19 20:22:16 +01:00
4fbb7582e1 Don't instantiate is_convertible_to_T_or_factory when is_optional_related
Fixes #78.
2019-12-18 17:51:51 -08:00
29dfc173c6 Merge pull request #71 from Mike-Devel/min_cmake
[CMake] Add minimal cmake support
2019-03-04 10:43:45 +01:00
f4d1107e86 [CMake] Add minimal cmake support
- CMake file only supports add_subdirectory workflow.
- Provides Boost::optional target,
  but no installation and no unit tests
2019-03-02 17:12:29 +01:00
324272fc0e Merge pull request #70 from Kojoley/patch-1
Fix unused argument warning
2019-02-27 21:22:08 -10:00
ee575b34c5 Fix unused argument warning
boost/optional/optional.hpp:970:5: warning: unused parameter 'rhs' [-Wunused-parameter]
2019-02-28 00:13:00 +03:00
b709447922 r #12967 use BOOST_CONSTEXPR on none_t ctor 2017-08-16 13:52:46 -04:00
cd4e44f3dc r #12967 make none_t constructor constexpr 2017-04-13 09:13:26 -04:00
c3abf83426 Suppress weak vtables warning 2016-08-31 17:37:50 +03:00
111 changed files with 1280 additions and 257 deletions

36
.drone.star Normal file
View File

@ -0,0 +1,36 @@
# Use, modification, and distribution are
# subject to the Boost Software License, Version 1.0. (See accompanying
# file LICENSE.txt)
#
# Copyright Rene Rivera 2020.
# For Drone CI we use the Starlark scripting language to reduce duplication.
# As the yaml syntax for Drone CI is rather limited.
#
#
globalenv={}
linuxglobalimage="cppalliance/droneubuntu1604:1"
windowsglobalimage="cppalliance/dronevs2019"
def main(ctx):
return [
linux_cxx("TOOLSET=gcc COMPILER=g++ CXXSTD=03,11 Job 0", "g++", packages="", buildtype="boost", buildscript="drone", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++', 'CXXSTD': '03,11', 'DRONE_JOB_UUID': 'b6589fc6ab'}, globalenv=globalenv),
linux_cxx("TOOLSET=gcc COMPILER=g++-4.7 CXXSTD=03,11 Job 1", "g++-4.7", packages="g++-4.7", buildtype="boost", buildscript="drone", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-4.7', 'CXXSTD': '03,11', 'DRONE_JOB_UUID': '356a192b79'}, globalenv=globalenv),
linux_cxx("TOOLSET=gcc COMPILER=g++-4.8 CXXSTD=03,11 Job 2", "g++-4.8", packages="g++-4.8", buildtype="boost", buildscript="drone", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-4.8', 'CXXSTD': '03,11', 'DRONE_JOB_UUID': 'da4b9237ba'}, globalenv=globalenv),
linux_cxx("TOOLSET=gcc COMPILER=g++-4.9 CXXSTD=03,11 Job 3", "g++-4.9", packages="g++-4.9", buildtype="boost", buildscript="drone", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-4.9', 'CXXSTD': '03,11', 'DRONE_JOB_UUID': '77de68daec'}, globalenv=globalenv),
linux_cxx("TOOLSET=gcc COMPILER=g++-5 CXXSTD=03,11,14,1z Job 4", "g++-5", packages="g++-5", buildtype="boost", buildscript="drone", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-5', 'CXXSTD': '03,11,14,1z', 'DRONE_JOB_UUID': '1b64538924'}, globalenv=globalenv),
linux_cxx("TOOLSET=gcc COMPILER=g++-6 CXXSTD=03,11,14,1z Job 5", "g++-6", packages="g++-6", buildtype="boost", buildscript="drone", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-6', 'CXXSTD': '03,11,14,1z', 'DRONE_JOB_UUID': 'ac3478d69a'}, globalenv=globalenv),
linux_cxx("TOOLSET=gcc COMPILER=g++-7 CXXSTD=03,11,14,17 Job 6", "g++-7", packages="g++-7", buildtype="boost", buildscript="drone", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-7', 'CXXSTD': '03,11,14,17', 'DRONE_JOB_UUID': 'c1dfd96eea'}, globalenv=globalenv),
linux_cxx("TOOLSET=clang COMPILER=clang++ CXXSTD=03,11 Job 7", "clang++", packages="", buildtype="boost", buildscript="drone", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '03,11', 'DRONE_JOB_UUID': '902ba3cda1'}, globalenv=globalenv),
linux_cxx("TOOLSET=clang COMPILER=clang++-3.5 CXXSTD=03, Job 8", "clang++-3.5", packages="clang-3.5 libstdc++-4.9-dev", llvm_os="precise", llvm_ver="3.5", buildtype="boost", buildscript="drone", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-3.5', 'CXXSTD': '03,11,14,1z', 'DRONE_JOB_UUID': 'fe5dbbcea5'}, globalenv=globalenv),
linux_cxx("TOOLSET=clang COMPILER=clang++-3.6 CXXSTD=03, Job 9", "clang++-3.6", packages="clang-3.6", llvm_os="precise", llvm_ver="3.6", buildtype="boost", buildscript="drone", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-3.6', 'CXXSTD': '03,11,14,1z', 'DRONE_JOB_UUID': '0ade7c2cf9'}, globalenv=globalenv),
linux_cxx("TOOLSET=clang COMPILER=clang++-3.7 CXXSTD=03, Job 10", "clang++-3.7", packages="clang-3.7", llvm_os="precise", llvm_ver="3.7", buildtype="boost", buildscript="drone", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-3.7', 'CXXSTD': '03,11,14,1z', 'DRONE_JOB_UUID': 'b1d5781111'}, globalenv=globalenv),
linux_cxx("TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=03, Job 11", "clang++-3.8", packages="clang-3.8 libstdc++-4.9-dev", llvm_os="precise", llvm_ver="3.8", buildtype="boost", buildscript="drone", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-3.8', 'CXXSTD': '03,11,14,1z', 'DRONE_JOB_UUID': '17ba079149'}, globalenv=globalenv),
linux_cxx("TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=03, Job 12", "clang++-3.9", packages="clang-3.9 libstdc++-4.9-dev", llvm_os="precise", llvm_ver="3.9", buildtype="boost", buildscript="drone", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-3.9', 'CXXSTD': '03,11,14,1z', 'DRONE_JOB_UUID': '7b52009b64'}, globalenv=globalenv),
linux_cxx("TOOLSET=clang COMPILER=clang++-4.0 CXXSTD=03, Job 13", "clang++-4.0", packages="clang-4.0", llvm_os="trusty", llvm_ver="4.0", buildtype="boost", buildscript="drone", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-4.0', 'CXXSTD': '03,11,14,1z', 'DRONE_JOB_UUID': 'bd307a3ec3'}, globalenv=globalenv),
linux_cxx("TOOLSET=clang COMPILER=clang++-5.0 CXXSTD=03, Job 14", "clang++-5.0", packages="clang-5.0", llvm_os="trusty", llvm_ver="5.0", buildtype="boost", buildscript="drone", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-5.0', 'CXXSTD': '03,11,14,1z', 'DRONE_JOB_UUID': 'fa35e19212'}, globalenv=globalenv),
osx_cxx("TOOLSET=clang COMPILER=clang++ CXXSTD=03,11,1 Job 15", "clang++", packages="", buildtype="boost", buildscript="drone", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '03,11,14,1z', 'DRONE_JOB_UUID': 'f1abd67035'}, globalenv=globalenv),
]
# from https://github.com/boostorg/boost-ci
load("@boost_ci//ci/drone/:functions.star", "linux_cxx","windows_cxx","osx_cxx","freebsd_cxx")

37
.drone/drone.sh Executable file
View File

@ -0,0 +1,37 @@
#!/bin/bash
# Copyright 2020 Rene Rivera, Sam Darwin
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE.txt or copy at http://boost.org/LICENSE_1_0.txt)
set -e
export TRAVIS_BUILD_DIR=$(pwd)
export DRONE_BUILD_DIR=$(pwd)
export TRAVIS_BRANCH=$DRONE_BRANCH
export VCS_COMMIT_ID=$DRONE_COMMIT
export GIT_COMMIT=$DRONE_COMMIT
export REPO_NAME=$DRONE_REPO
export PATH=~/.local/bin:/usr/local/bin:$PATH
if [ "$DRONE_JOB_BUILDTYPE" == "boost" ]; then
echo '==================================> INSTALL'
BOOST_BRANCH=develop && [ "$TRAVIS_BRANCH" == "master" ] && BOOST_BRANCH=master || true
cd ..
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
git submodule update --init tools/build
git submodule update --init libs/config
git submodule update --init tools/boostdep
cp -r $TRAVIS_BUILD_DIR/* libs/optional
python tools/boostdep/depinst/depinst.py optional
./bootstrap.sh
./b2 headers
echo '==================================> SCRIPT'
echo "using $TOOLSET : : $COMPILER ;" > ~/user-config.jam
./b2 libs/optional/test toolset=$TOOLSET cxxstd=$CXXSTD
fi

391
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,391 @@
name: GitHub Actions CI
on:
pull_request:
push:
branches:
- master
- develop
- githubactions*
- feature/**
- fix/**
- pr/**
jobs:
posix:
strategy:
fail-fast: false
matrix:
include:
- name: "TOOLSET=gcc COMPILER=g++ CXXSTD=03,11 Job 0"
buildtype: "boost"
packages: ""
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:16.04"
cxx: "g++"
sources: ""
llvm_os: ""
llvm_ver: ""
toolset: "gcc"
compiler: "g++"
cxxstd: "03,11"
- name: "TOOLSET=gcc COMPILER=g++-4.7 CXXSTD=03,11 Job 1"
buildtype: "boost"
packages: "g++-4.7"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:16.04"
cxx: "g++-4.7"
sources: ""
llvm_os: ""
llvm_ver: ""
toolset: "gcc"
compiler: "g++-4.7"
cxxstd: "03,11"
- name: "TOOLSET=gcc COMPILER=g++-4.8 CXXSTD=03,11 Job 2"
buildtype: "boost"
packages: "g++-4.8"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:16.04"
cxx: "g++-4.8"
sources: ""
llvm_os: ""
llvm_ver: ""
toolset: "gcc"
compiler: "g++-4.8"
cxxstd: "03,11"
- name: "TOOLSET=gcc COMPILER=g++-4.9 CXXSTD=03,11 Job 3"
buildtype: "boost"
packages: "g++-4.9"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:16.04"
cxx: "g++-4.9"
sources: ""
llvm_os: ""
llvm_ver: ""
toolset: "gcc"
compiler: "g++-4.9"
cxxstd: "03,11"
- name: "TOOLSET=gcc COMPILER=g++-5 CXXSTD=03,11,14,1z Job 4"
buildtype: "boost"
packages: "g++-5"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:16.04"
cxx: "g++-5"
sources: ""
llvm_os: ""
llvm_ver: ""
toolset: "gcc"
compiler: "g++-5"
cxxstd: "03,11,14,1z"
- name: "TOOLSET=gcc COMPILER=g++-6 CXXSTD=03,11,14,1z Job 5"
buildtype: "boost"
packages: "g++-6"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:16.04"
cxx: "g++-6"
sources: ""
llvm_os: ""
llvm_ver: ""
toolset: "gcc"
compiler: "g++-6"
cxxstd: "03,11,14,1z"
- name: "TOOLSET=gcc COMPILER=g++-7 CXXSTD=03,11,14,17 Job 6"
buildtype: "boost"
packages: "g++-7"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:16.04"
cxx: "g++-7"
sources: ""
llvm_os: ""
llvm_ver: ""
toolset: "gcc"
compiler: "g++-7"
cxxstd: "03,11,14,17"
- name: "TOOLSET=clang COMPILER=clang++ CXXSTD=03,11 Job 7"
buildtype: "boost"
packages: ""
packages_to_remove: ""
os: "ubuntu-18.04"
cxx: "clang++"
sources: ""
llvm_os: ""
llvm_ver: ""
toolset: "clang"
compiler: "clang++"
cxxstd: "03,11"
- name: "TOOLSET=clang COMPILER=clang++-3.5 CXXSTD=03, Job 8"
buildtype: "boost"
packages: "clang-3.5 libstdc++-4.9-dev"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:16.04"
cxx: "clang++-3.5"
sources: ""
llvm_os: "precise"
llvm_ver: "3.5"
toolset: "clang"
compiler: "clang++-3.5"
cxxstd: "03,11,14"
- name: "TOOLSET=clang COMPILER=clang++-3.6 CXXSTD=03, Job 9"
buildtype: "boost"
packages: "clang-3.6"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:16.04"
cxx: "clang++-3.6"
sources: ""
llvm_os: "precise"
llvm_ver: "3.6"
toolset: "clang"
compiler: "clang++-3.6"
cxxstd: "03,11,14"
- name: "TOOLSET=clang COMPILER=clang++-3.7 CXXSTD=03, Job 10"
buildtype: "boost"
packages: "clang-3.7"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:16.04"
cxx: "clang++-3.7"
sources: ""
llvm_os: "precise"
llvm_ver: "3.7"
toolset: "clang"
compiler: "clang++-3.7"
cxxstd: "03,11,14"
- name: "TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=03, Job 11"
buildtype: "boost"
packages: "clang-3.8 libstdc++-4.9-dev"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:16.04"
cxx: "clang++-3.8"
sources: ""
llvm_os: "precise"
llvm_ver: "3.8"
toolset: "clang"
compiler: "clang++-3.8"
cxxstd: "03,11,14"
- name: "TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=03, Job 12"
buildtype: "boost"
packages: "clang-3.9 libstdc++-4.9-dev"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:16.04"
cxx: "clang++-3.9"
sources: ""
llvm_os: "precise"
llvm_ver: "3.9"
toolset: "clang"
compiler: "clang++-3.9"
cxxstd: "03,11,14"
- name: "TOOLSET=clang COMPILER=clang++-4.0 CXXSTD=03, Job 13"
buildtype: "boost"
packages: "clang-4.0"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:14.04"
cxx: "clang++-4.0"
sources: ""
llvm_os: "trusty"
llvm_ver: "4.0"
toolset: "clang"
compiler: "clang++-4.0"
cxxstd: "03,11,14"
- name: "TOOLSET=clang COMPILER=clang++-5.0 CXXSTD=03, Job 14"
buildtype: "boost"
packages: "clang-5.0"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:14.04"
cxx: "clang++-5.0"
sources: ""
llvm_os: "trusty"
llvm_ver: "5.0"
toolset: "clang"
compiler: "clang++-5.0"
cxxstd: "03,11,14,1z"
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
steps:
- name: Check if running in container
if: matrix.container != ''
run: echo "GHA_CONTAINER=${{ matrix.container }}" >> $GITHUB_ENV
- name: If running in container, upgrade packages
if: matrix.container != ''
run: |
apt-get -o Acquire::Retries=3 update && DEBIAN_FRONTEND=noninteractive apt-get -y install tzdata && apt-get -o Acquire::Retries=3 install -y sudo software-properties-common wget curl apt-transport-https make apt-file sudo unzip libssl-dev build-essential autotools-dev autoconf automake g++ libc++-helpers python ruby cpio gcc-multilib g++-multilib pkgconf python3 ccache libpython-dev
sudo apt-add-repository ppa:git-core/ppa
sudo apt-get -o Acquire::Retries=3 update && apt-get -o Acquire::Retries=3 -y install git
python_version=$(python3 -c 'import sys; print("{0.major}.{0.minor}".format(sys.version_info))')
sudo wget https://bootstrap.pypa.io/pip/$python_version/get-pip.py
sudo python3 get-pip.py
sudo /usr/local/bin/pip install cmake
- uses: actions/checkout@v2
- name: linux
shell: bash
env:
CXX: ${{ matrix.cxx }}
SOURCES: ${{ matrix.sources }}
LLVM_OS: ${{ matrix.llvm_os }}
LLVM_VER: ${{ matrix.llvm_ver }}
PACKAGES: ${{ matrix.packages }}
PACKAGES_TO_REMOVE: ${{ matrix.packages_to_remove }}
JOB_BUILDTYPE: ${{ matrix.buildtype }}
TOOLSET: ${{ matrix.toolset }}
COMPILER: ${{ matrix.compiler }}
CXXSTD: ${{ matrix.cxxstd }}
TRAVIS_BRANCH: ${{ github.base_ref }}
TRAVIS_OS_NAME: "linux"
run: |
echo '==================================> SETUP'
echo '==================================> PACKAGES'
set -e
if [ -n "$PACKAGES_TO_REMOVE" ]; then sudo apt-get purge -y $PACKAGES_TO_REMOVE; fi
echo ">>>>> APT: REPO.."
for i in {1..3}; do sudo -E apt-add-repository -y "ppa:ubuntu-toolchain-r/test" && break || sleep 2; done
if test -n "${LLVM_OS}" ; then
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
if test -n "${LLVM_VER}" ; then
sudo -E apt-add-repository "deb http://apt.llvm.org/${LLVM_OS}/ llvm-toolchain-${LLVM_OS}-${LLVM_VER} main"
else
# Snapshot (i.e. trunk) build of clang
sudo -E apt-add-repository "deb http://apt.llvm.org/${LLVM_OS}/ llvm-toolchain-${LLVM_OS} main"
fi
fi
echo ">>>>> APT: UPDATE.."
sudo -E apt-get -o Acquire::Retries=3 update
if test -n "${SOURCES}" ; then
echo ">>>>> APT: INSTALL SOURCES.."
for SOURCE in $SOURCES; do
sudo -E apt-add-repository ppa:$SOURCE
done
fi
echo ">>>>> APT: INSTALL ${PACKAGES}.."
sudo -E DEBIAN_FRONTEND=noninteractive apt-get -o Acquire::Retries=3 -y --no-install-suggests --no-install-recommends install ${PACKAGES}
echo '==================================> INSTALL AND COMPILE'
set -e
export TRAVIS_BUILD_DIR=$(pwd)
export TRAVIS_BRANCH=${TRAVIS_BRANCH:-$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')}
export VCS_COMMIT_ID=$GITHUB_SHA
export GIT_COMMIT=$GITHUB_SHA
export REPO_NAME=$(basename $GITHUB_REPOSITORY)
export USER=$(whoami)
export CC=${CC:-gcc}
export PATH=~/.local/bin:/usr/local/bin:$PATH
if [ "$JOB_BUILDTYPE" == "boost" ]; then
echo '==================================> INSTALL'
BOOST_BRANCH=develop && [ "$TRAVIS_BRANCH" == "master" ] && BOOST_BRANCH=master || true
cd ..
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
git submodule update --init tools/build
git submodule update --init libs/config
git submodule update --init tools/boostdep
cp -r $TRAVIS_BUILD_DIR/* libs/optional
python tools/boostdep/depinst/depinst.py optional
./bootstrap.sh
./b2 headers
echo '==================================> SCRIPT'
echo "using $TOOLSET : : $COMPILER ;" > ~/user-config.jam
./b2 libs/optional/test toolset=$TOOLSET cxxstd=$CXXSTD
fi
osx:
strategy:
fail-fast: false
matrix:
include:
- name: "TOOLSET=clang COMPILER=clang++ CXXSTD=03,11,1 Job 15"
buildtype: "boost"
packages: ""
os: "macos-10.15"
cxx: "clang++"
sources: ""
llvm_os: ""
llvm_ver: ""
xcode_version: 11.7
toolset: "clang"
compiler: "clang++"
cxxstd: "03,11,14,1z"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Set DEVELOPER_DIR
if: matrix.xcode_version != ''
run: echo "DEVELOPER_DIR=/Applications/Xcode_${{ matrix.xcode_version }}.app/Contents/Developer" >> $GITHUB_ENV
- name: Test DEVELOPER_DIR
run: echo $DEVELOPER_DIR
- name: "osx"
shell: bash
env:
CXX: ${{ matrix.cxx }}
SOURCES: ${{ matrix.sources }}
LLVM_OS: ${{ matrix.llvm_os }}
LLVM_VER: ${{ matrix.llvm_ver }}
PACKAGES: ${{ matrix.packages }}
JOB_BUILDTYPE: ${{ matrix.buildtype }}
TOOLSET: ${{ matrix.toolset }}
COMPILER: ${{ matrix.compiler }}
CXXSTD: ${{ matrix.cxxstd }}
TRAVIS_BRANCH: ${{ github.base_ref }}
TRAVIS_OS_NAME: "osx"
run: |
echo '==================================> SETUP'
set -e
sudo mv /Library/Developer/CommandLineTools /Library/Developer/CommandLineTools.bck
echo '==================================> PACKAGES'
echo '==================================> INSTALL AND COMPILE'
set -e
export TRAVIS_BUILD_DIR=$(pwd)
export TRAVIS_BRANCH=${TRAVIS_BRANCH:-$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')}
export VCS_COMMIT_ID=$GITHUB_SHA
export GIT_COMMIT=$GITHUB_SHA
export REPO_NAME=$(basename $GITHUB_REPOSITORY)
export USER=$(whoami)
export CC=${CC:-gcc}
export PATH=~/.local/bin:/usr/local/bin:$PATH
if [ "$JOB_BUILDTYPE" == "boost" ]; then
echo '==================================> INSTALL'
BOOST_BRANCH=develop && [ "$TRAVIS_BRANCH" == "master" ] && BOOST_BRANCH=master || true
cd ..
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
git submodule update --init tools/build
git submodule update --init libs/config
git submodule update --init tools/boostdep
cp -r $TRAVIS_BUILD_DIR/* libs/optional
python tools/boostdep/depinst/depinst.py optional
./bootstrap.sh
./b2 headers
echo '==================================> SCRIPT'
echo "using $TOOLSET : : $COMPILER ;" > ~/user-config.jam
./b2 libs/optional/test toolset=$TOOLSET cxxstd=$CXXSTD
fi

View File

@ -151,6 +151,7 @@ matrix:
- llvm-toolchain-precise-3.9
- os: linux
dist: trusty
compiler: clang++-4.0
env: TOOLSET=clang COMPILER=clang++-4.0 CXXSTD=03,11,14,1z
addons:
@ -162,6 +163,7 @@ matrix:
- llvm-toolchain-trusty-4.0
- os: linux
dist: trusty
compiler: clang++-5.0
env: TOOLSET=clang COMPILER=clang++-5.0 CXXSTD=03,11,14,1z
addons:

52
CMakeLists.txt Normal file
View File

@ -0,0 +1,52 @@
# Copyright 2019 Mike Dev
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt
if(NOT DEFINED IDF_TARGET)
cmake_minimum_required( VERSION 3.5...3.20 )
project( boost_optional VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX )
add_library( boost_optional INTERFACE )
add_library( Boost::optional ALIAS boost_optional )
target_include_directories( boost_optional INTERFACE include )
target_link_libraries( boost_optional
INTERFACE
Boost::assert
Boost::config
Boost::core
Boost::detail
Boost::move
Boost::predef
Boost::static_assert
Boost::throw_exception
Boost::type_traits
Boost::utility
)
else()
FILE(GLOB_RECURSE headers include/*.h include/*.hpp)
idf_component_register(
SRCS
${headers}
INCLUDE_DIRS
include
REQUIRES
boost_assert
boost_config
boost_core
boost_detail
boost_move
boost_predef
boost_static_assert
boost_throw_exception
boost_type_traits
boost_utility
)
endif()

View File

@ -2,7 +2,7 @@
[quickbook 1.4]
[authors [Cacciola Carballal, Fernando Luis]]
[copyright 2003-2007 Fernando Luis Cacciola Carballal]
[copyright 2014-2018 Andrzej Krzemie&#324;ski]
[copyright 2014-2022 Andrzej Krzemie&#324;ski]
[category miscellaneous]
[id optional]
[dirname optional]
@ -61,7 +61,7 @@ Suppose we want to read a parameter form a config file which represents some int
This is how you solve it with `boost::optional`:
#include <boost/optional.hpp>
boost::optional<int> getConfigParam(std::string name); // return either an int or a `not-an-int`
int main()
@ -71,7 +71,7 @@ This is how you solve it with `boost::optional`:
else
runWithNoMax();
}
[endsect]
[include 01_quick_start.qbk]
@ -102,5 +102,3 @@ This is how you solve it with `boost::optional`:
[include 90_dependencies.qbk]
[include 91_relnotes.qbk]
[include 92_acknowledgments.qbk]

View File

@ -61,12 +61,12 @@ When an optional object that contains a value is moved from (is a source of move
assert (opi);
assert (*opi == nullptr);
Quite a lot of people expect that when an object that contains a value is moved from, its contained value should be destroyed. This is not so, for performance reasons. Current semantics allow the implementation of `boost::opiotnal<T>` to be trivially copyable when `T` is trivial.
Quite a lot of people expect that when an object that contains a value is moved from, its contained value should be destroyed. This is not so, for performance reasons. Current semantics allow the implementation of `boost::optional<T>` to be trivially copyable when `T` is trivial.
[endsect]
[section Mixed relational comparisons]
Because `T` is convertible to `optional<T>` and because `opiotnal<T>` is __SGI_LESS_THAN_COMPARABLE__ when `T` is __SGI_LESS_THAN_COMPARABLE__,
Because `T` is convertible to `optional<T>` and because `optional<T>` is __SGI_LESS_THAN_COMPARABLE__ when `T` is __SGI_LESS_THAN_COMPARABLE__,
you can sometimes get an unexpected runtime result where you would rather expect a compiler error:
optional<double> Flight_plan::weight(); // sometimes no weight can be returned
@ -108,4 +108,4 @@ This is obviously redundant, but makes the warning disappear.
[endsect]
[endsect]
[endsect]

View File

@ -17,8 +17,8 @@ namespace boost {
class none_t {/* see below */};
const none_t none (/* see below */);
inline constexpr none_t none (/* see below */);
} // namespace boost
```

View File

@ -26,11 +26,11 @@ template <class CharType, class CharTrait, class T>
template <class CharType, class CharTrait>
std::basic_ostream<CharType, CharTrait>&
operator<<(std::basic_ostream<CharType, CharTrait>& out, none_t const&); ``[link reference_operator_ostream_none __GO_TO__]``
template<class CharType, class CharTrait, class T>
std::basic_istream<CharType, CharTrait>&
operator>>(std::basic_istream<CharType, CharTrait>& in, optional<T>& v); ``[link reference_operator_istream __GO_TO__]``
} // namespace boost
```
@ -43,8 +43,8 @@ template<class CharType, class CharTrait, class T>
`template <class CharType, class CharTrait, class T>` [br]
\u00A0\u00A0\u00A0\u00A0`std::basic_ostream<CharType, CharTrait>&` [br]
\u00A0\u00A0\u00A0\u00A0`operator<<(std::basic_ostream<CharType, CharTrait>& out, optional<T> const& v);`
std::basic_ostream<CharType, CharTrait>&` [br]
operator<<(std::basic_ostream<CharType, CharTrait>& out, optional<T> const& v);`
* [*Effect:] Outputs an implementation-defined string. The output contains the information about whether the optional object contains a value or not. If `v` contains a value, the output contains result of calling `out << *v`.
* [*Returns:] `out`.
@ -53,8 +53,8 @@ __SPACE__
[#reference_operator_ostream_none]
`template <class CharType, class CharTrait, class T>` [br]
\u00A0\u00A0\u00A0\u00A0`std::basic_ostream<CharType, CharTrait>&` [br]
\u00A0\u00A0\u00A0\u00A0`operator<<(std::basic_ostream<CharType, CharTrait>& out, none_t);`
std::basic_ostream<CharType, CharTrait>&` [br]
operator<<(std::basic_ostream<CharType, CharTrait>& out, none_t);`
* [*Effect:] Outputs an implementation-defined string.
* [*Returns:] `out`.
@ -63,11 +63,11 @@ __SPACE__
[#reference_operator_istream]
`template <class CharType, class CharTrait, class T>` [br]
\u00A0\u00A0\u00A0\u00A0`std::basic_ostream<CharType, CharTrait>&` [br]
\u00A0\u00A0\u00A0\u00A0`operator>>(std::basic_istream<CharType, CharTrait>& in, optional<T>& v);`
std::basic_ostream<CharType, CharTrait>&` [br]
operator>>(std::basic_istream<CharType, CharTrait>& in, optional<T>& v);`
* [*Requires:] `T` is __SGI_DEFAULT_CONSTRUCTIBLE__ and __MOVE_CONSTRUCTIBLE__.
* [*Effect:] Reads the value of optional object from `in`. If the string representation indicates that the optional object should contain a value, `v` contains a value and its contained value is obtained as if by default-constructing an object `o` of type `T` and then calling `in >> o`; otherwise `v` does not contain a value, and the previously contained value (if any) has been destroyed.
* [*Effect:] Reads the value of optional object from `in`. If the string representation indicates that the optional object should contain a value, `v` contains a value and its contained value is obtained as if by default-constructing an object `o` of type `T` and then calling `in >> o`; otherwise `v` does not contain a value, and the previously contained value (if any) has been destroyed.
* [*Returns:] `out`.
[endsect]

View File

@ -73,6 +73,16 @@
} // namespace boost
namespace std {
template <typename T>
struct hash<boost::optional<T> > ; ``[link reference_std_hash_spec __GO_TO__]``
template <typename T>
struct hash<boost::optional<T&> > ; ``[link reference_std_hash_spec __GO_TO__]``
} // namespace std
[endsect]

View File

@ -1408,3 +1408,37 @@ assert (addressof(*opt0) == addressof(y));
``
[endsect]
[section Detailed Semantics - std::hash Specializations]
__SPACE__
[#reference_std_hash_spec]
``
namespace std {
template <typename T>
struct hash<boost::optional<T> > ;
template <typename T>
struct hash<boost::optional<T&> > ;
} // namespace std
``
The specialization `hash<optional<T>>` is enabled if and only if
`hash<remove_­const_­t<T>>` is enabled. When enabled, for an object `o`
of type `optional<T>`, if `o.has_­value() == true`, then `hash<optional<T>>()(o)`
evaluates to the same value as `hash<remove_­const_­t<T>>()(*o)`; otherwise it
evaluates to an unspecified value.
The member functions are not guaranteed to be `noexcept`.
[caution
You may get compiler errors when your program provides specializations for
`std::hash<boost::optional<T>>`. If this happens, define macro
`BOOST_OPTIONAL_CONFIG_DO_NOT_SPECIALIZE_STD_HASH` to suppress the specializations
of `std::hash` in this library.
]
[endsect]

View File

@ -1,7 +1,7 @@
[/
Boost.Optional
Copyright (c) 2015 - 2018 Andrzej Krzemienski
Copyright (c) 2015 - 2022 Andrzej Krzemienski
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
@ -11,11 +11,40 @@
[section:relnotes Release Notes]
[heading Boost Release 1.80]
* [*Breaking change:] Added specializations for `std::hash<boost::opitonal<T>>`. This fixes [@https://github.com/boostorg/optional/issues/55 issue #55]. You may get compiler errors when your program provides specializations for `std::hash<boost::optional<T>>`. If this happens, define macro `BOOST_OPTIONAL_CONFIG_DO_NOT_SPECIALIZE_STD_HASH` to suppress the specializations of `std::hash` in this library.
[heading Boost Release 1.79]
* Fixed [@https://github.com/boostorg/optional/issues/98 issue #98].
[heading Boost Release 1.77]
* Fixed [@https://github.com/boostorg/optional/issues/92 issue #92].
[heading Boost Release 1.76]
* Fixed MSVC warning C4702.
[heading Boost Release 1.75]
* `boost::none` is `constexpr`-declared.
* Fixed [@https://github.com/boostorg/optional/issues/78 issue #78].
[heading Boost Release 1.73]
* Fixed [@https://github.com/boostorg/optional/issues/78 issue #78].
* `boost::none` is now declared as an inline variable (on compilers taht support it): there is only one instance of `boost::none` across all translation units.
* Fixed a number of compilation errors in GCC 4.4.7 in `optional<T>` for trivial `T`s. Thanks to Robert Leahy for the fix. For details see [@https://github.com/boostorg/optional/pull/80 pr #78].
* Now surpressing warning `-Wweak-vtables`.
[heading Boost Release 1.69]
* Remove deprecation mark from `reset()` method (without arguments).
* Fixed [@https://github.com/boostorg/optional/issues/59 issue #59].
* Fixed bug with initialization of certain wrapper types in clang with -std=c++03. See [@https://github.com/boostorg/optional/pull/64 pr #64].
* Fixed bug with initialization of certain wrapper types in clang with -std=c++03. See [@https://github.com/boostorg/optional/pull/64 pr #64].
[heading Boost Release 1.68]

View File

@ -1,6 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Acknowledgements</title>
<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
@ -116,7 +116,7 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright &#169; 2014-2018 Andrzej Krzemie&#324;ski<p>
<td align="right"><div class="copyright-footer">Copyright © 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright © 2014-2021 Andrzej Krzemieński<p>
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" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -1,6 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Dependencies and Portability</title>
<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
@ -77,7 +77,7 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright &#169; 2014-2018 Andrzej Krzemie&#324;ski<p>
<td align="right"><div class="copyright-footer">Copyright © 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright © 2014-2021 Andrzej Krzemieński<p>
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" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -1,6 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Emplace operations in older compilers</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
@ -76,7 +76,7 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright &#169; 2014-2018 Andrzej Krzemie&#324;ski<p>
<td align="right"><div class="copyright-footer">Copyright © 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright © 2014-2021 Andrzej Krzemieński<p>
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" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -1,6 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Optional Reference Binding</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
@ -93,7 +93,7 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright &#169; 2014-2018 Andrzej Krzemie&#324;ski<p>
<td align="right"><div class="copyright-footer">Copyright © 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright © 2014-2021 Andrzej Krzemieński<p>
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" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -1,6 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Quick Start</title>
<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
@ -155,7 +155,7 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright &#169; 2014-2018 Andrzej Krzemie&#324;ski<p>
<td align="right"><div class="copyright-footer">Copyright © 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright © 2014-2021 Andrzej Krzemieński<p>
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" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -1,6 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Bypassing unnecessary default construction</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
@ -61,7 +61,7 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright &#169; 2014-2018 Andrzej Krzemie&#324;ski<p>
<td align="right"><div class="copyright-footer">Copyright © 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright © 2014-2021 Andrzej Krzemieński<p>
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" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -1,6 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Optional automatic variables</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
@ -61,7 +61,7 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright &#169; 2014-2018 Andrzej Krzemie&#324;ski<p>
<td align="right"><div class="copyright-footer">Copyright © 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright © 2014-2021 Andrzej Krzemieński<p>
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" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -1,6 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Optional data members</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
@ -80,7 +80,7 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright &#169; 2014-2018 Andrzej Krzemie&#324;ski<p>
<td align="right"><div class="copyright-footer">Copyright © 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright © 2014-2021 Andrzej Krzemieński<p>
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" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -1,6 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Storage in containers</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
@ -50,7 +50,7 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright &#169; 2014-2018 Andrzej Krzemie&#324;ski<p>
<td align="right"><div class="copyright-footer">Copyright © 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright © 2014-2021 Andrzej Krzemieński<p>
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" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -1,6 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Header &lt;boost/optional/bad_optional_access.hpp&gt;</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
@ -49,7 +49,7 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright &#169; 2014-2018 Andrzej Krzemie&#324;ski<p>
<td align="right"><div class="copyright-footer">Copyright © 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright © 2014-2021 Andrzej Krzemieński<p>
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" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -1,6 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Detailed semantics</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
@ -46,7 +46,7 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright &#169; 2014-2018 Andrzej Krzemie&#324;ski<p>
<td align="right"><div class="copyright-footer">Copyright © 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright © 2014-2021 Andrzej Krzemieński<p>
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" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -1,6 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Header &lt;boost/optional.hpp&gt;</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
@ -33,7 +33,7 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright &#169; 2014-2018 Andrzej Krzemie&#324;ski<p>
<td align="right"><div class="copyright-footer">Copyright © 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright © 2014-2021 Andrzej Krzemieński<p>
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" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -1,6 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Header &lt;boost/optional/optional_fwd.hpp&gt;</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
@ -52,7 +52,7 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright &#169; 2014-2018 Andrzej Krzemie&#324;ski<p>
<td align="right"><div class="copyright-footer">Copyright © 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright © 2014-2021 Andrzej Krzemieński<p>
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" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -1,6 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Detailed Semantics - Free Functions</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
@ -507,7 +507,7 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright &#169; 2014-2018 Andrzej Krzemie&#324;ski<p>
<td align="right"><div class="copyright-footer">Copyright © 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright © 2014-2021 Andrzej Krzemieński<p>
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" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -1,6 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Detailed Semantics - Optional References</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
@ -538,7 +538,7 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright &#169; 2014-2018 Andrzej Krzemie&#324;ski<p>
<td align="right"><div class="copyright-footer">Copyright © 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright © 2014-2021 Andrzej Krzemieński<p>
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" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -1,6 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Detailed Semantics - Optional Values</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
@ -1774,7 +1774,7 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright &#169; 2014-2018 Andrzej Krzemie&#324;ski<p>
<td align="right"><div class="copyright-footer">Copyright © 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright © 2014-2021 Andrzej Krzemieński<p>
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" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -1,6 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Initialization tags</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
@ -47,7 +47,7 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright &#169; 2014-2018 Andrzej Krzemie&#324;ski<p>
<td align="right"><div class="copyright-footer">Copyright © 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright © 2014-2021 Andrzej Krzemieński<p>
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" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -1,6 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Optional References</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
@ -104,7 +104,7 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright &#169; 2014-2018 Andrzej Krzemie&#324;ski<p>
<td align="right"><div class="copyright-footer">Copyright © 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright © 2014-2021 Andrzej Krzemieński<p>
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" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -1,6 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Optional Values</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
@ -139,7 +139,7 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright &#169; 2014-2018 Andrzej Krzemie&#324;ski<p>
<td align="right"><div class="copyright-footer">Copyright © 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright © 2014-2021 Andrzej Krzemieński<p>
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" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -1,6 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Header &lt;boost/optional/optional_io.hpp&gt;</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
@ -58,7 +58,7 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright &#169; 2014-2018 Andrzej Krzemie&#324;ski<p>
<td align="right"><div class="copyright-footer">Copyright © 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright © 2014-2021 Andrzej Krzemieński<p>
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" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -1,6 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Detailed semantics</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
@ -32,7 +32,7 @@
<span class="special">&lt;</span><span class="keyword">class</span>
<span class="identifier">CharType</span><span class="special">,</span>
<span class="keyword">class</span> <span class="identifier">CharTrait</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span></code>
<br> &#160;&#160;&#160;&#160;<code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special">&lt;</span><span class="identifier">CharType</span><span class="special">,</span> <span class="identifier">CharTrait</span><span class="special">&gt;&amp;</span></code> <br> &#160;&#160;&#160;&#160;<code class="computeroutput"><span class="keyword">operator</span><span class="special">&lt;&lt;(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special">&lt;</span><span class="identifier">CharType</span><span class="special">,</span> <span class="identifier">CharTrait</span><span class="special">&gt;&amp;</span>
<br>     <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special">&lt;</span><span class="identifier">CharType</span><span class="special">,</span> <span class="identifier">CharTrait</span><span class="special">&gt;&amp;</span></code> <br>     <code class="computeroutput"><span class="keyword">operator</span><span class="special">&lt;&lt;(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special">&lt;</span><span class="identifier">CharType</span><span class="special">,</span> <span class="identifier">CharTrait</span><span class="special">&gt;&amp;</span>
<span class="identifier">out</span><span class="special">,</span>
<span class="identifier">optional</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">v</span><span class="special">);</span></code>
</p>
@ -53,8 +53,8 @@
</p>
<p>
<code class="computeroutput"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">CharType</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">CharTrait</span><span class="special">,</span>
<span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span></code> <br> &#160;&#160;&#160;&#160;<code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special">&lt;</span><span class="identifier">CharType</span><span class="special">,</span> <span class="identifier">CharTrait</span><span class="special">&gt;&amp;</span></code>
<br> &#160;&#160;&#160;&#160;<code class="computeroutput"><span class="keyword">operator</span><span class="special">&lt;&lt;(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special">&lt;</span><span class="identifier">CharType</span><span class="special">,</span> <span class="identifier">CharTrait</span><span class="special">&gt;&amp;</span> <span class="identifier">out</span><span class="special">,</span> <span class="identifier">none_t</span><span class="special">);</span></code>
<span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span></code> <br>     <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special">&lt;</span><span class="identifier">CharType</span><span class="special">,</span> <span class="identifier">CharTrait</span><span class="special">&gt;&amp;</span></code>
<br>     <code class="computeroutput"><span class="keyword">operator</span><span class="special">&lt;&lt;(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special">&lt;</span><span class="identifier">CharType</span><span class="special">,</span> <span class="identifier">CharTrait</span><span class="special">&gt;&amp;</span> <span class="identifier">out</span><span class="special">,</span> <span class="identifier">none_t</span><span class="special">);</span></code>
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
@ -70,8 +70,8 @@
</p>
<p>
<code class="computeroutput"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">CharType</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">CharTrait</span><span class="special">,</span>
<span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span></code> <br> &#160;&#160;&#160;&#160;<code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special">&lt;</span><span class="identifier">CharType</span><span class="special">,</span> <span class="identifier">CharTrait</span><span class="special">&gt;&amp;</span></code>
<br> &#160;&#160;&#160;&#160;<code class="computeroutput"><span class="keyword">operator</span><span class="special">&gt;&gt;(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_istream</span><span class="special">&lt;</span><span class="identifier">CharType</span><span class="special">,</span> <span class="identifier">CharTrait</span><span class="special">&gt;&amp;</span> <span class="identifier">in</span><span class="special">,</span> <span class="identifier">optional</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;&amp;</span> <span class="identifier">v</span><span class="special">);</span></code>
<span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span></code> <br>     <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special">&lt;</span><span class="identifier">CharType</span><span class="special">,</span> <span class="identifier">CharTrait</span><span class="special">&gt;&amp;</span></code>
<br>     <code class="computeroutput"><span class="keyword">operator</span><span class="special">&gt;&gt;(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_istream</span><span class="special">&lt;</span><span class="identifier">CharType</span><span class="special">,</span> <span class="identifier">CharTrait</span><span class="special">&gt;&amp;</span> <span class="identifier">in</span><span class="special">,</span> <span class="identifier">optional</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;&amp;</span> <span class="identifier">v</span><span class="special">);</span></code>
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
@ -98,7 +98,7 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright &#169; 2014-2018 Andrzej Krzemie&#324;ski<p>
<td align="right"><div class="copyright-footer">Copyright © 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright © 2014-2021 Andrzej Krzemieński<p>
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" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -1,6 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Release Notes</title>
<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
@ -28,6 +28,69 @@
</h2></div></div></div>
<h4>
<a name="boost_optional.relnotes.h0"></a>
<span class="phrase"><a name="boost_optional.relnotes.boost_release_1_79"></a></span><a class="link" href="relnotes.html#boost_optional.relnotes.boost_release_1_79">Boost
Release 1.79</a>
</h4>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
Fixed <a href="https://github.com/boostorg/optional/issues/98" target="_top">issue
#98</a>.
</li></ul></div>
<h4>
<a name="boost_optional.relnotes.h1"></a>
<span class="phrase"><a name="boost_optional.relnotes.boost_release_1_77"></a></span><a class="link" href="relnotes.html#boost_optional.relnotes.boost_release_1_77">Boost
Release 1.77</a>
</h4>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
Fixed <a href="https://github.com/boostorg/optional/issues/92" target="_top">issue
#92</a>.
</li></ul></div>
<h4>
<a name="boost_optional.relnotes.h2"></a>
<span class="phrase"><a name="boost_optional.relnotes.boost_release_1_76"></a></span><a class="link" href="relnotes.html#boost_optional.relnotes.boost_release_1_76">Boost
Release 1.76</a>
</h4>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
Fixed MSVC warning C4702.
</li></ul></div>
<h4>
<a name="boost_optional.relnotes.h3"></a>
<span class="phrase"><a name="boost_optional.relnotes.boost_release_1_75"></a></span><a class="link" href="relnotes.html#boost_optional.relnotes.boost_release_1_75">Boost
Release 1.75</a>
</h4>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">none</span></code> is <code class="computeroutput"><span class="keyword">constexpr</span></code>-declared.
</li>
<li class="listitem">
Fixed <a href="https://github.com/boostorg/optional/issues/78" target="_top">issue
#78</a>.
</li>
</ul></div>
<h4>
<a name="boost_optional.relnotes.h4"></a>
<span class="phrase"><a name="boost_optional.relnotes.boost_release_1_73"></a></span><a class="link" href="relnotes.html#boost_optional.relnotes.boost_release_1_73">Boost
Release 1.73</a>
</h4>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
Fixed <a href="https://github.com/boostorg/optional/issues/78" target="_top">issue
#78</a>.
</li>
<li class="listitem">
<code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">none</span></code> is now declared as an inline variable
(on compilers taht support it): there is only one instance of <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">none</span></code> across all translation units.
</li>
<li class="listitem">
Fixed a number of compilation errors in GCC 4.4.7 in <code class="computeroutput"><span class="identifier">optional</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span></code> for trivial <code class="computeroutput"><span class="identifier">T</span></code>s.
Thanks to Robert Leahy for the fix. For details see <a href="https://github.com/boostorg/optional/pull/80" target="_top">pr
#78</a>.
</li>
<li class="listitem">
Now surpressing warning <code class="computeroutput"><span class="special">-</span><span class="identifier">Wweak</span><span class="special">-</span><span class="identifier">vtables</span></code>.
</li>
</ul></div>
<h4>
<a name="boost_optional.relnotes.h5"></a>
<span class="phrase"><a name="boost_optional.relnotes.boost_release_1_69"></a></span><a class="link" href="relnotes.html#boost_optional.relnotes.boost_release_1_69">Boost
Release 1.69</a>
</h4>
@ -45,7 +108,7 @@
</li>
</ul></div>
<h4>
<a name="boost_optional.relnotes.h1"></a>
<a name="boost_optional.relnotes.h6"></a>
<span class="phrase"><a name="boost_optional.relnotes.boost_release_1_68"></a></span><a class="link" href="relnotes.html#boost_optional.relnotes.boost_release_1_68">Boost
Release 1.68</a>
</h4>
@ -62,7 +125,7 @@
</li>
</ul></div>
<h4>
<a name="boost_optional.relnotes.h2"></a>
<a name="boost_optional.relnotes.h7"></a>
<span class="phrase"><a name="boost_optional.relnotes.boost_release_1_67"></a></span><a class="link" href="relnotes.html#boost_optional.relnotes.boost_release_1_67">Boost
Release 1.67</a>
</h4>
@ -76,7 +139,7 @@
</li>
</ul></div>
<h4>
<a name="boost_optional.relnotes.h3"></a>
<a name="boost_optional.relnotes.h8"></a>
<span class="phrase"><a name="boost_optional.relnotes.boost_release_1_66"></a></span><a class="link" href="relnotes.html#boost_optional.relnotes.boost_release_1_66">Boost
Release 1.66</a>
</h4>
@ -94,7 +157,7 @@
</li>
</ul></div>
<h4>
<a name="boost_optional.relnotes.h4"></a>
<a name="boost_optional.relnotes.h9"></a>
<span class="phrase"><a name="boost_optional.relnotes.boost_release_1_63"></a></span><a class="link" href="relnotes.html#boost_optional.relnotes.boost_release_1_63">Boost
Release 1.63</a>
</h4>
@ -118,7 +181,7 @@
</li>
</ul></div>
<h4>
<a name="boost_optional.relnotes.h5"></a>
<a name="boost_optional.relnotes.h10"></a>
<span class="phrase"><a name="boost_optional.relnotes.boost_release_1_62"></a></span><a class="link" href="relnotes.html#boost_optional.relnotes.boost_release_1_62">Boost
Release 1.62</a>
</h4>
@ -126,7 +189,7 @@
Fixed <a href="https://svn.boost.org/trac/boost/ticket/12179" target="_top">Trac #12179</a>.
</li></ul></div>
<h4>
<a name="boost_optional.relnotes.h6"></a>
<a name="boost_optional.relnotes.h11"></a>
<span class="phrase"><a name="boost_optional.relnotes.boost_release_1_61"></a></span><a class="link" href="relnotes.html#boost_optional.relnotes.boost_release_1_61">Boost
Release 1.61</a>
</h4>
@ -169,7 +232,7 @@
</li>
</ul></div>
<h4>
<a name="boost_optional.relnotes.h7"></a>
<a name="boost_optional.relnotes.h12"></a>
<span class="phrase"><a name="boost_optional.relnotes.boost_release_1_60"></a></span><a class="link" href="relnotes.html#boost_optional.relnotes.boost_release_1_60">Boost
Release 1.60</a>
</h4>
@ -180,7 +243,7 @@
#11203</a>.
</li></ul></div>
<h4>
<a name="boost_optional.relnotes.h8"></a>
<a name="boost_optional.relnotes.h13"></a>
<span class="phrase"><a name="boost_optional.relnotes.boost_release_1_59"></a></span><a class="link" href="relnotes.html#boost_optional.relnotes.boost_release_1_59">Boost
Release 1.59</a>
</h4>
@ -194,7 +257,7 @@
</li>
</ul></div>
<h4>
<a name="boost_optional.relnotes.h9"></a>
<a name="boost_optional.relnotes.h14"></a>
<span class="phrase"><a name="boost_optional.relnotes.boost_release_1_58"></a></span><a class="link" href="relnotes.html#boost_optional.relnotes.boost_release_1_58">Boost
Release 1.58</a>
</h4>
@ -230,7 +293,7 @@
</li>
</ul></div>
<h4>
<a name="boost_optional.relnotes.h10"></a>
<a name="boost_optional.relnotes.h15"></a>
<span class="phrase"><a name="boost_optional.relnotes.boost_release_1_57"></a></span><a class="link" href="relnotes.html#boost_optional.relnotes.boost_release_1_57">Boost
Release 1.57</a>
</h4>
@ -240,7 +303,7 @@
to fix C++03 compile error on <code class="computeroutput"><span class="identifier">logic_error</span><span class="special">(</span><span class="string">"..."</span><span class="special">)</span></code>"</em></span>.
</li></ul></div>
<h4>
<a name="boost_optional.relnotes.h11"></a>
<a name="boost_optional.relnotes.h16"></a>
<span class="phrase"><a name="boost_optional.relnotes.boost_release_1_56"></a></span><a class="link" href="relnotes.html#boost_optional.relnotes.boost_release_1_56">Boost
Release 1.56</a>
</h4>
@ -297,7 +360,7 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright &#169; 2014-2018 Andrzej Krzemie&#324;ski<p>
<td align="right"><div class="copyright-footer">Copyright © 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright © 2014-2021 Andrzej Krzemieński<p>
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" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -1,6 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Design Overview</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
@ -65,8 +65,8 @@
<code class="computeroutput"><span class="identifier">npos</span></code>, -1, etc... This is
equivalent to adding the special value to the set of possible values of
a given type. This super set of <code class="computeroutput"><span class="identifier">T</span></code>
plus some <span class="emphasis"><em>nil_t</em></span>&#8212;where <code class="computeroutput"><span class="identifier">nil_t</span></code>
is some stateless POD&#8212;can be modeled in modern languages as a <span class="bold"><strong>discriminated union</strong></span> of T and nil_t. Discriminated
plus some <span class="emphasis"><em>nil_t</em></span>where <code class="computeroutput"><span class="identifier">nil_t</span></code>
is some stateless PODcan be modeled in modern languages as a <span class="bold"><strong>discriminated union</strong></span> of T and nil_t. Discriminated
unions are often called <span class="emphasis"><em>variants</em></span>. A variant has a
<span class="emphasis"><em>current type</em></span>, which in our case is either <code class="computeroutput"><span class="identifier">T</span></code> or <code class="computeroutput"><span class="identifier">nil_t</span></code>.
Using the <a href="../../../../../variant/index.html" target="_top">Boost.Variant</a>
@ -100,8 +100,8 @@
</p>
<p>
In any event, both the discriminated-union or the single-element container
models serve as a conceptual ground for a class representing optional&#8212;i.e.
possibly uninitialized&#8212;objects. For instance, these models show the
models serve as a conceptual ground for a class representing optionali.e.
possibly uninitializedobjects. For instance, these models show the
<span class="emphasis"><em>exact</em></span> semantics required for a wrapper of optional
values:
</p>
@ -170,7 +170,7 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright &#169; 2014-2018 Andrzej Krzemie&#324;ski<p>
<td align="right"><div class="copyright-footer">Copyright © 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright © 2014-2021 Andrzej Krzemieński<p>
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" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -1,6 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>The Interface</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
@ -79,7 +79,7 @@
facto</em></span> standard for handling optional objects because all you
have to do to refer to a value which you don't really have is to use a
null pointer value of the appropriate type. Pointers have been used for
decades&#8212;from the days of C APIs to modern C++ libraries&#8212;to <span class="emphasis"><em>refer</em></span>
decadesfrom the days of C APIs to modern C++ librariesto <span class="emphasis"><em>refer</em></span>
to optional (that is, possibly nonexistent) objects; particularly as optional
arguments to a function, but also quite often as optional data members.
</p>
@ -93,7 +93,7 @@
and this information is tied to the <span class="emphasis"><em>syntax</em></span> of the
expressions. That is, the presence of operators <code class="computeroutput"><span class="special">*</span></code>
and <code class="computeroutput"><span class="special">-&gt;</span></code> tell by themselves
&#8212;without any additional context&#8212; that the expression will be undefined
without any additional context that the expression will be undefined
unless the implied pointee actually exist.
</p>
<p>
@ -173,7 +173,7 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright &#169; 2014-2018 Andrzej Krzemie&#324;ski<p>
<td align="right"><div class="copyright-footer">Copyright © 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright © 2014-2021 Andrzej Krzemieński<p>
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" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -1,6 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>The semantics</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
@ -107,7 +107,7 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright &#169; 2014-2018 Andrzej Krzemie&#324;ski<p>
<td align="right"><div class="copyright-footer">Copyright © 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright © 2014-2021 Andrzej Krzemieński<p>
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" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -1,6 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Exception Safety Guarantees</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
@ -161,7 +161,7 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright &#169; 2014-2018 Andrzej Krzemie&#324;ski<p>
<td align="right"><div class="copyright-footer">Copyright © 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright © 2014-2021 Andrzej Krzemieński<p>
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" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -1,6 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Gotchas</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
@ -37,7 +37,7 @@
</p>
<p>
First, it is functionally similar to a tristate boolean (false, maybe,
true) &#8212;such as <a href="../../../../../../doc/html/tribool.html" target="_top">boost::tribool</a>&#8212;
true) such as <a href="../../../../../../doc/html/tribool.html" target="_top">boost::tribool</a>
except that in a tristate boolean, the maybe state <span class="underline">represents
a valid value</span>, unlike the corresponding state of an uninitialized
<code class="computeroutput"><span class="identifier">optional</span><span class="special">&lt;</span><span class="keyword">bool</span><span class="special">&gt;</span></code>.
@ -98,7 +98,7 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright &#169; 2014-2018 Andrzej Krzemie&#324;ski<p>
<td align="right"><div class="copyright-footer">Copyright © 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright © 2014-2021 Andrzej Krzemieński<p>
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" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -1,6 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>False positive with -Wmaybe-uninitialized</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
@ -63,7 +63,7 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright &#169; 2014-2018 Andrzej Krzemie&#324;ski<p>
<td align="right"><div class="copyright-footer">Copyright © 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright © 2014-2021 Andrzej Krzemieński<p>
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" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -1,6 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Mixed relational comparisons</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
@ -45,7 +45,7 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright &#169; 2014-2018 Andrzej Krzemie&#324;ski<p>
<td align="right"><div class="copyright-footer">Copyright © 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright © 2014-2021 Andrzej Krzemieński<p>
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" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -1,6 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Moved-from optional</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
@ -49,7 +49,7 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright &#169; 2014-2018 Andrzej Krzemie&#324;ski<p>
<td align="right"><div class="copyright-footer">Copyright © 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright © 2014-2021 Andrzej Krzemieński<p>
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" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -1,6 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>In-Place Factories</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
@ -183,7 +183,7 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright &#169; 2014-2018 Andrzej Krzemie&#324;ski<p>
<td align="right"><div class="copyright-footer">Copyright © 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright © 2014-2021 Andrzej Krzemieński<p>
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" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -1,6 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>IO operators</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
@ -73,7 +73,7 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright &#169; 2014-2018 Andrzej Krzemie&#324;ski<p>
<td align="right"><div class="copyright-footer">Copyright © 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright © 2014-2021 Andrzej Krzemieński<p>
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" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -1,6 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Optional references</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
@ -103,7 +103,7 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright &#169; 2014-2018 Andrzej Krzemie&#324;ski<p>
<td align="right"><div class="copyright-footer">Copyright © 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright © 2014-2021 Andrzej Krzemieński<p>
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" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -1,6 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Rebinding semantics for assignment of optional references</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
@ -133,7 +133,7 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright &#169; 2014-2018 Andrzej Krzemie&#324;ski<p>
<td align="right"><div class="copyright-footer">Copyright © 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright © 2014-2021 Andrzej Krzemieński<p>
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" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -1,6 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Performance considerations</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
@ -251,7 +251,7 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright &#169; 2014-2018 Andrzej Krzemie&#324;ski<p>
<td align="right"><div class="copyright-footer">Copyright © 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright © 2014-2021 Andrzej Krzemieński<p>
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" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -1,6 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Relational operators</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
@ -99,7 +99,7 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright &#169; 2014-2018 Andrzej Krzemie&#324;ski<p>
<td align="right"><div class="copyright-footer">Copyright © 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright © 2014-2021 Andrzej Krzemieński<p>
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" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -1,6 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Type requirements</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
@ -95,7 +95,7 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright &#169; 2014-2018 Andrzej Krzemie&#324;ski<p>
<td align="right"><div class="copyright-footer">Copyright © 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright © 2014-2021 Andrzej Krzemieński<p>
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" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -1,6 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>When to use Optional</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
@ -128,7 +128,7 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright &#169; 2014-2018 Andrzej Krzemie&#324;ski<p>
<td align="right"><div class="copyright-footer">Copyright © 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright © 2014-2021 Andrzej Krzemieński<p>
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" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -1,6 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Boost.Optional</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
@ -25,8 +25,8 @@
<div><div class="author"><h3 class="author">
<span class="firstname">Fernando Luis</span> <span class="surname">Cacciola Carballal</span>
</h3></div></div>
<div><p class="copyright">Copyright &#169; 2003-2007 Fernando Luis Cacciola Carballal</p></div>
<div><p class="copyright">Copyright &#169; 2014-2018 Andrzej Krzemie&#324;ski</p></div>
<div><p class="copyright">Copyright © 2003-2007 Fernando Luis Cacciola Carballal</p></div>
<div><p class="copyright">Copyright © 2014-2021 Andrzej Krzemieński</p></div>
<div><div class="legalnotice">
<a name="optional.legal"></a><p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
@ -145,7 +145,7 @@
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"><p><small>Last revised: November 08, 2018 at 17:44:53 GMT</small></p></td>
<td align="left"><p><small>Last revised: November 20, 2021 at 00:57:52 GMT</small></p></td>
<td align="right"><div class="copyright-footer"></div></td>
</tr></table>
<hr>

View File

@ -1,6 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Reference</title>
<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
@ -54,7 +54,7 @@
<span class="keyword">class</span> <span class="identifier">none_t</span> <span class="special">{/*</span> <span class="identifier">see</span> <span class="identifier">below</span> <span class="special">*/};</span>
<span class="keyword">const</span> <span class="identifier">none_t</span> <span class="identifier">none</span> <span class="special">(/*</span> <span class="identifier">see</span> <span class="identifier">below</span> <span class="special">*/);</span>
<span class="keyword">inline</span> <span class="keyword">constexpr</span> <span class="identifier">none_t</span> <span class="identifier">none</span> <span class="special">(/*</span> <span class="identifier">see</span> <span class="identifier">below</span> <span class="special">*/);</span>
<span class="special">}</span> <span class="comment">// namespace boost</span>
</pre>
@ -75,7 +75,7 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright &#169; 2014-2018 Andrzej Krzemie&#324;ski<p>
<td align="right"><div class="copyright-footer">Copyright © 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright © 2014-2021 Andrzej Krzemieński<p>
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" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -1,6 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Header &lt;boost/optional/optional.hpp&gt;</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
@ -97,7 +97,7 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright &#169; 2014-2018 Andrzej Krzemie&#324;ski<p>
<td align="right"><div class="copyright-footer">Copyright © 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright © 2014-2021 Andrzej Krzemieński<p>
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" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -1,6 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Tutorial</title>
<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
@ -139,7 +139,7 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright &#169; 2014-2018 Andrzej Krzemie&#324;ski<p>
<td align="right"><div class="copyright-footer">Copyright © 2003-2007 Fernando Luis Cacciola Carballal<br>Copyright © 2014-2021 Andrzej Krzemieński<p>
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" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@ -13,6 +13,7 @@
#ifndef BOOST_NONE_17SEP2003_HPP
#define BOOST_NONE_17SEP2003_HPP
#include "boost/config.hpp"
#include "boost/none_t.hpp"
// NOTE: Borland users have to include this header outside any precompiled headers
@ -23,7 +24,7 @@ namespace boost {
#ifdef BOOST_OPTIONAL_USE_OLD_DEFINITION_OF_NONE
none_t const none = (static_cast<none_t>(0)) ;
BOOST_INLINE_VARIABLE none_t BOOST_CONSTEXPR_OR_CONST none = (static_cast<none_t>(0)) ;
#elif defined BOOST_OPTIONAL_USE_SINGLETON_DEFINITION_OF_NONE
@ -35,7 +36,7 @@ namespace detail { namespace optional_detail {
{
static const T instance;
};
template <typename T>
const T none_instance<T>::instance = T(); // global, but because 'tis a template, no cpp file required
@ -44,16 +45,15 @@ namespace detail { namespace optional_detail {
namespace {
// TU-local
const none_t& none = detail::optional_detail::none_instance<none_t>::instance;
const none_t& none = detail::optional_detail::none_instance<none_t>::instance;
}
#else
const none_t none ((none_t::init_tag()));
BOOST_INLINE_VARIABLE BOOST_CONSTEXPR_OR_CONST none_t none ((none_t::init_tag()));
#endif // older definitions
} // namespace boost
#endif // header guard

View File

@ -13,6 +13,8 @@
#ifndef BOOST_NONE_T_17SEP2003_HPP
#define BOOST_NONE_T_17SEP2003_HPP
#include <boost/config.hpp>
namespace boost {
#ifdef BOOST_OPTIONAL_USE_OLD_DEFINITION_OF_NONE
@ -29,7 +31,7 @@ class none_t {};
struct none_t
{
struct init_tag{};
explicit none_t(init_tag){} // to disable default constructor
explicit BOOST_CONSTEXPR none_t(init_tag){} // to disable default constructor
};
#endif // old implementation workarounds

View File

@ -19,6 +19,11 @@
namespace boost {
#if defined(__clang__)
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wweak-vtables"
#endif
class bad_optional_access : public std::logic_error
{
public:
@ -27,6 +32,10 @@ public:
{}
};
#if defined(__clang__)
# pragma clang diagnostic pop
#endif
} // namespace boost
#endif

View File

@ -79,7 +79,7 @@ class optional_base : public optional_tag
private :
typedef
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
#if !BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
BOOST_DEDUCED_TYPENAME
#endif
::boost::detail::make_reference_content<T>::type internal_type ;
@ -619,7 +619,7 @@ class optional_base : public optional_tag
reference_const_type dereference( internal_type const* p, is_reference_tag ) const { return p->get() ; }
reference_type dereference( internal_type* p, is_reference_tag ) { return p->get() ; }
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x581))
#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x581))
void destroy_impl ( is_not_reference_tag ) { get_ptr_impl()->internal_type::~internal_type() ; m_initialized = false ; }
#else
void destroy_impl ( is_not_reference_tag ) { get_ptr_impl()->~T() ; m_initialized = false ; }

View File

@ -28,7 +28,7 @@ class aligned_storage
// BOOST_MAY_ALIAS works around GCC warnings about breaking strict aliasing rules when casting storage address to T*
union BOOST_MAY_ALIAS dummy_u
{
char data[ sizeof(T) ];
unsigned char data[ sizeof(T) ];
BOOST_DEDUCED_TYPENAME type_with_alignment<
::boost::alignment_of<T>::value >::type aligner_;
} dummy_ ;

View File

@ -28,7 +28,7 @@
# define BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT
#endif
#if BOOST_WORKAROUND(__BORLANDC__, <= 0x551)
#if BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x551)
// BCB (5.5.1) cannot parse the nested template struct in an inplace factory.
# define BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT
#endif

View File

@ -0,0 +1,49 @@
// Copyright (C) 2022 Andrzej Krzemienski.
//
// Use, modification, and distribution is 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)
//
// See http://www.boost.org/libs/optional for documentation.
//
// You are welcome to contact the author at:
// akrzemi1@gmail.com
#ifndef BOOST_OPTIONAL_DETAIL_OPTIONAL_HASH_AJK_20MAY2022_HPP
#define BOOST_OPTIONAL_DETAIL_OPTIONAL_HASH_AJK_20MAY2022_HPP
#include <boost/optional/optional_fwd.hpp>
#include <boost/config.hpp>
#if !defined(BOOST_OPTIONAL_CONFIG_DO_NOT_SPECIALIZE_STD_HASH) && !defined(BOOST_NO_CXX11_HDR_FUNCTIONAL)
#include <functional>
namespace std
{
template <typename T>
struct hash<boost::optional<T> >
{
typedef std::size_t result_type;
typedef boost::optional<T> argument_type;
BOOST_CONSTEXPR result_type operator()(const argument_type& arg) const {
return arg ? std::hash<T>()(*arg) : result_type();
}
};
template <typename T>
struct hash<boost::optional<T&> >
{
typedef std::size_t result_type;
typedef boost::optional<T&> argument_type;
BOOST_CONSTEXPR result_type operator()(const argument_type& arg) const {
return arg ? std::hash<T>()(*arg) : result_type();
}
};
}
#endif // !defined(BOOST_OPTIONAL_CONFIG_DO_NOT_SPECIALIZE_STD_HASH) && !defined(BOOST_NO_CXX11_HDR_FUNCTIONAL)
#endif // header guard

View File

@ -151,7 +151,14 @@ public:
T* get_ptr() const BOOST_NOEXCEPT { return ptr_; }
T* operator->() const { BOOST_ASSERT(ptr_); return ptr_; }
T& operator*() const { BOOST_ASSERT(ptr_); return *ptr_; }
T& value() const { return ptr_ ? *ptr_ : (throw_exception(bad_optional_access()), *ptr_); }
T& value() const
{
if (this->is_initialized())
return this->get();
else
throw_exception(bad_optional_access());
}
bool operator!() const BOOST_NOEXCEPT { return ptr_ == 0; }
BOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT()

View File

@ -1,3 +1,14 @@
// Copyright (C) 2017 Andrzej Krzemienski.
//
// Use, modification, and distribution is 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)
//
// See http://www.boost.org/libs/optional for documentation.
//
// You are welcome to contact the author at:
// akrzemi1@gmail.com
// trivilally-copyable version of the storage
template<class T>
@ -69,7 +80,7 @@ class tc_optional_base : public optional_tag
// ~tc_optional_base() = default;
// Assigns from another optional<T> (deep-copies the rhs value)
void assign ( tc_optional_base const& rhs )
void assign ( tc_optional_base const& rhs )
{
*this = rhs;
}
@ -84,7 +95,7 @@ class tc_optional_base : public optional_tag
#else
m_storage = static_cast<value_type>(rhs.get());
#endif
m_initialized = rhs.is_initialized();
}
@ -99,7 +110,7 @@ class tc_optional_base : public optional_tag
m_initialized = rhs.is_initialized();
}
#endif
void assign ( argument_type val )
{
construct(val);
@ -166,7 +177,7 @@ class tc_optional_base : public optional_tag
{
construct(in_place_init, boost::forward<Args>(args)...);
}
template<class... Args>
explicit tc_optional_base ( in_place_init_t, Args&&... args )
:
@ -174,7 +185,7 @@ class tc_optional_base : public optional_tag
{
construct(in_place_init, boost::forward<Args>(args)...);
}
template<class... Args>
explicit tc_optional_base ( in_place_init_if_t, bool cond, Args&&... args )
:
@ -190,24 +201,24 @@ class tc_optional_base : public optional_tag
m_storage = value_type( boost::forward<Arg>(arg) );
m_initialized = true ;
}
void construct ( in_place_init_t )
{
m_storage = value_type();
m_initialized = true ;
}
template<class Arg>
void emplace_assign ( Arg&& arg )
{
construct(in_place_init, boost::forward<Arg>(arg)) ;
}
void emplace_assign ()
{
construct(in_place_init) ;
}
template<class Arg>
explicit tc_optional_base ( in_place_init_t, Arg&& arg )
:
@ -215,11 +226,11 @@ class tc_optional_base : public optional_tag
{
construct(in_place_init, boost::forward<Arg>(arg));
}
explicit tc_optional_base ( in_place_init_t )
:
m_initialized(false), m_storage() {}
template<class Arg>
explicit tc_optional_base ( in_place_init_if_t, bool cond, Arg&& arg )
:
@ -228,7 +239,7 @@ class tc_optional_base : public optional_tag
if ( cond )
construct(in_place_init, boost::forward<Arg>(arg));
}
explicit tc_optional_base ( in_place_init_if_t, bool cond )
:
m_initialized(false)
@ -238,21 +249,21 @@ class tc_optional_base : public optional_tag
}
#else
template<class Arg>
void construct ( in_place_init_t, const Arg& arg )
{
m_storage = value_type( arg );
m_initialized = true ;
}
template<class Arg>
void construct ( in_place_init_t, Arg& arg )
{
m_storage = value_type( arg );
m_initialized = true ;
}
void construct ( in_place_init_t )
{
m_storage = value_type();
@ -264,18 +275,18 @@ class tc_optional_base : public optional_tag
{
construct(in_place_init, arg);
}
template<class Arg>
void emplace_assign ( Arg& arg )
{
construct(in_place_init, arg);
}
void emplace_assign ()
{
construct(in_place_init);
}
template<class Arg>
explicit tc_optional_base ( in_place_init_t, const Arg& arg )
: m_initialized(false)
@ -289,13 +300,13 @@ class tc_optional_base : public optional_tag
{
construct(in_place_init, arg);
}
explicit tc_optional_base ( in_place_init_t )
: m_initialized(false)
{
construct(in_place_init);
}
template<class Arg>
explicit tc_optional_base ( in_place_init_if_t, bool cond, const Arg& arg )
: m_initialized(false)
@ -303,15 +314,15 @@ class tc_optional_base : public optional_tag
if ( cond )
construct(in_place_init, arg);
}
template<class Arg>
explicit tc_optional_base ( in_place_init_if_t, bool cond, Arg& arg )
: m_initialized(false)
{
if ( cond )
construct(in_place_init, arg);
}
}
explicit tc_optional_base ( in_place_init_if_t, bool cond )
: m_initialized(false)
{
@ -359,7 +370,7 @@ class tc_optional_base : public optional_tag
template<class Expr>
void construct ( Expr const& factory, in_place_factory_base const* )
{
boost_optional_detail::construct<value_type>(factory, m_storage.address());
boost_optional_detail::construct<value_type>(factory, boost::addressof(m_storage));
m_initialized = true ;
}

View File

@ -1,5 +1,5 @@
// Copyright (C) 2003, 2008 Fernando Luis Cacciola Carballal.
// Copyright (C) 2014 - 2018 Andrzej Krzemienski.
// Copyright (C) 2014 - 2021 Andrzej Krzemienski.
//
// Use, modification, and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
@ -18,7 +18,9 @@
#define BOOST_OPTIONAL_OPTIONAL_FLC_19NOV2002_HPP
#include <new>
#ifndef BOOST_NO_IOSTREAM
#include <iosfwd>
#endif // BOOST_NO_IOSTREAM
#ifdef BOOST_OPTIONAL_DETAIL_USE_STD_TYPE_TRAITS
# include <type_traits>
@ -35,14 +37,18 @@
#include <boost/type.hpp>
#include <boost/type_traits/alignment_of.hpp>
#include <boost/type_traits/conditional.hpp>
#include <boost/type_traits/conjunction.hpp>
#include <boost/type_traits/disjunction.hpp>
#include <boost/type_traits/has_nothrow_constructor.hpp>
#include <boost/type_traits/type_with_alignment.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <boost/type_traits/decay.hpp>
#include <boost/type_traits/is_assignable.hpp>
#include <boost/type_traits/is_base_of.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/is_constructible.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <boost/type_traits/is_lvalue_reference.hpp>
#include <boost/type_traits/is_nothrow_move_assignable.hpp>
#include <boost/type_traits/is_nothrow_move_constructible.hpp>
@ -59,6 +65,7 @@
#include <boost/optional/detail/optional_config.hpp>
#include <boost/optional/detail/optional_factory_support.hpp>
#include <boost/optional/detail/optional_aligned_storage.hpp>
#include <boost/optional/detail/optional_hash.hpp>
namespace boost { namespace optional_detail {
@ -123,6 +130,7 @@ class optional_base : public optional_tag
protected :
typedef T value_type ;
typedef typename boost::remove_const<T>::type unqualified_value_type;
protected:
typedef T & reference_type ;
@ -399,14 +407,14 @@ class optional_base : public optional_tag
void construct ( argument_type val )
{
::new (m_storage.address()) value_type(val) ;
::new (m_storage.address()) unqualified_value_type(val) ;
m_initialized = true ;
}
#ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
void construct ( rval_reference_type val )
{
::new (m_storage.address()) value_type( boost::move(val) ) ;
::new (m_storage.address()) unqualified_value_type( boost::move(val) ) ;
m_initialized = true ;
}
#endif
@ -418,7 +426,7 @@ class optional_base : public optional_tag
template<class... Args>
void construct ( in_place_init_t, Args&&... args )
{
::new (m_storage.address()) value_type( boost::forward<Args>(args)... ) ;
::new (m_storage.address()) unqualified_value_type( boost::forward<Args>(args)... ) ;
m_initialized = true ;
}
@ -449,13 +457,13 @@ class optional_base : public optional_tag
template<class Arg>
void construct ( in_place_init_t, Arg&& arg )
{
::new (m_storage.address()) value_type( boost::forward<Arg>(arg) );
::new (m_storage.address()) unqualified_value_type( boost::forward<Arg>(arg) );
m_initialized = true ;
}
void construct ( in_place_init_t )
{
::new (m_storage.address()) value_type();
::new (m_storage.address()) unqualified_value_type();
m_initialized = true ;
}
@ -509,20 +517,20 @@ class optional_base : public optional_tag
template<class Arg>
void construct ( in_place_init_t, const Arg& arg )
{
::new (m_storage.address()) value_type( arg );
::new (m_storage.address()) unqualified_value_type( arg );
m_initialized = true ;
}
template<class Arg>
void construct ( in_place_init_t, Arg& arg )
{
::new (m_storage.address()) value_type( arg );
::new (m_storage.address()) unqualified_value_type( arg );
m_initialized = true ;
}
void construct ( in_place_init_t )
{
::new (m_storage.address()) value_type();
::new (m_storage.address()) unqualified_value_type();
m_initialized = true ;
}
@ -667,7 +675,7 @@ class optional_base : public optional_tag
template<class Expr>
void construct ( Expr&& expr, void const* )
{
new (m_storage.address()) value_type(boost::forward<Expr>(expr)) ;
new (m_storage.address()) unqualified_value_type(boost::forward<Expr>(expr)) ;
m_initialized = true ;
}
@ -688,7 +696,7 @@ class optional_base : public optional_tag
template<class Expr>
void construct ( Expr const& expr, void const* )
{
new (m_storage.address()) value_type(expr) ;
new (m_storage.address()) unqualified_value_type(expr) ;
m_initialized = true ;
}
@ -726,7 +734,7 @@ class optional_base : public optional_tag
{
// An exception can be thrown here.
// It it happens, THIS will be left uninitialized.
new (m_storage.address()) value_type(boost::move(expr.get())) ;
new (m_storage.address()) unqualified_value_type(boost::move(expr.get())) ;
m_initialized = true ;
}
}
@ -739,7 +747,7 @@ class optional_base : public optional_tag
{
// An exception can be thrown here.
// It it happens, THIS will be left uninitialized.
new (m_storage.address()) value_type(expr.get()) ;
new (m_storage.address()) unqualified_value_type(expr.get()) ;
m_initialized = true ;
}
}
@ -777,9 +785,9 @@ class optional_base : public optional_tag
#include <boost/optional/detail/optional_trivially_copyable_base.hpp>
// definition of metafunciton is_optional_val_init_candidate
// definition of metafunction is_optional_val_init_candidate
template <typename U>
struct is_optional_related
struct is_optional_or_tag
: boost::conditional< boost::is_base_of<optional_detail::optional_tag, BOOST_DEDUCED_TYPENAME boost::decay<U>::type>::value
|| boost::is_same<BOOST_DEDUCED_TYPENAME boost::decay<U>::type, none_t>::value
|| boost::is_same<BOOST_DEDUCED_TYPENAME boost::decay<U>::type, in_place_init_t>::value
@ -787,14 +795,22 @@ struct is_optional_related
boost::true_type, boost::false_type>::type
{};
template <typename T, typename U>
struct has_dedicated_constructor
: boost::disjunction<is_optional_or_tag<U>, boost::is_same<T, BOOST_DEDUCED_TYPENAME boost::decay<U>::type> >
{};
template <typename U>
struct is_in_place_factory
: boost::disjunction< boost::is_base_of<boost::in_place_factory_base, BOOST_DEDUCED_TYPENAME boost::decay<U>::type>,
boost::is_base_of<boost::typed_in_place_factory_base, BOOST_DEDUCED_TYPENAME boost::decay<U>::type> >
{};
#if !defined(BOOST_OPTIONAL_DETAIL_NO_IS_CONSTRUCTIBLE_TRAIT)
template <typename T, typename U>
struct is_convertible_to_T_or_factory
: boost::conditional< boost::is_base_of<boost::in_place_factory_base, BOOST_DEDUCED_TYPENAME boost::decay<U>::type>::value
|| boost::is_base_of<boost::typed_in_place_factory_base, BOOST_DEDUCED_TYPENAME boost::decay<U>::type>::value
|| (boost::is_constructible<T, U&&>::value && !boost::is_same<T, BOOST_DEDUCED_TYPENAME boost::decay<U>::type>::value)
, boost::true_type, boost::false_type>::type
struct is_factory_or_constructible_to_T
: boost::disjunction< is_in_place_factory<U>, boost::is_constructible<T, U&&> >
{};
template <typename T, typename U>
@ -804,7 +820,7 @@ struct is_optional_constructible : boost::is_constructible<T, U>
#else
template <typename, typename>
struct is_convertible_to_T_or_factory : boost::true_type
struct is_factory_or_constructible_to_T : boost::true_type
{};
template <typename T, typename U>
@ -813,10 +829,58 @@ struct is_optional_constructible : boost::true_type
#endif // is_convertible condition
#if !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1800)
// for is_assignable
#if (!defined BOOST_NO_CXX11_RVALUE_REFERENCES)
// On some initial rvalue reference implementations GCC does it in a strange way,
// preferring perfect-forwarding constructor to implicit copy constructor.
template <typename T, typename U>
struct is_opt_assignable
: boost::conjunction<boost::is_convertible<U&&, T>, boost::is_assignable<T&, U&&> >
{};
#else
template <typename T, typename U>
struct is_opt_assignable
: boost::conjunction<boost::is_convertible<U, T>, boost::is_assignable<T&, U> >
{};
#endif
#else
template <typename T, typename U>
struct is_opt_assignable : boost::is_convertible<U, T>
{};
#endif
template <typename T, typename U>
struct is_factory_or_opt_assignable_to_T
: boost::disjunction< is_in_place_factory<U>, is_opt_assignable<T, U> >
{};
template <typename T, typename U, bool = has_dedicated_constructor<T, U>::value>
struct is_optional_val_init_candidate
: boost::conditional< !is_optional_related<U>::value && is_convertible_to_T_or_factory<T, U>::value
, boost::true_type, boost::false_type>::type
: boost::false_type
{};
template <typename T, typename U>
struct is_optional_val_init_candidate<T, U, false>
: is_factory_or_constructible_to_T<T, U>
{};
template <typename T, typename U, bool = has_dedicated_constructor<T, U>::value>
struct is_optional_val_assign_candidate
: boost::false_type
{};
template <typename T, typename U>
struct is_optional_val_assign_candidate<T, U, false>
: is_factory_or_opt_assignable_to_T<T, U>
{};
} // namespace optional_detail
@ -967,7 +1031,7 @@ class optional
// Can throw if T::T(T&&) does
#ifndef BOOST_OPTIONAL_DETAIL_NO_DEFAULTED_MOVE_FUNCTIONS
optional ( optional && rhs ) = default;
optional ( optional && ) = default;
#else
optional ( optional && rhs )
BOOST_NOEXCEPT_IF(::boost::is_nothrow_move_constructible<T>::value)
@ -989,7 +1053,7 @@ class optional
#ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
template<class Expr>
BOOST_DEDUCED_TYPENAME boost::enable_if<optional_detail::is_optional_val_init_candidate<T, Expr>, optional&>::type
BOOST_DEDUCED_TYPENAME boost::enable_if<optional_detail::is_optional_val_assign_candidate<T, Expr>, optional&>::type
operator= ( Expr&& expr )
{
this->assign_expr(boost::forward<Expr>(expr),boost::addressof(expr));
@ -1581,6 +1645,7 @@ get_pointer ( optional<T>& opt )
} // namespace boost
#ifndef BOOST_NO_IOSTREAM
namespace boost {
// The following declaration prevents a bug where operator safe-bool is used upon streaming optional object if you forget the IO header.
@ -1593,6 +1658,7 @@ operator<<(std::basic_ostream<CharType, CharTrait>& os, optional_detail::optiona
}
} // namespace boost
#endif // BOOST_NO_IOSTREAM
#include <boost/optional/detail/optional_relops.hpp>
#include <boost/optional/detail/optional_swap.hpp>

View File

@ -12,6 +12,7 @@
#ifndef BOOST_OPTIONAL_OPTIONAL_IO_FLC_19NOV2002_HPP
#define BOOST_OPTIONAL_OPTIONAL_IO_FLC_19NOV2002_HPP
#ifndef BOOST_NO_IOSTREAM
#include <istream>
#include <ostream>
@ -31,7 +32,7 @@ operator<<(std::basic_ostream<CharType, CharTrait>& out, none_t)
{
out << "--";
}
return out;
}
@ -90,5 +91,5 @@ operator>>(std::basic_istream<CharType, CharTrait>& in, optional<T>& v)
} // namespace boost
#endif // BOOST_NO_IOSTREAM
#endif

View File

@ -12,5 +12,6 @@
"maintainers": [
"Fernando Cacciola <fernando_cacciola -at- ciudad.com.ar>",
"Andrzej Krzemienski <akrzemi1 -at- gmail.com>"
]
],
"cxxstd": "03"
}

View File

@ -22,9 +22,11 @@ import testing ;
[ run optional_test_swap.cpp ]
[ run optional_test_conversions_from_U.cpp ]
[ run optional_test_convert_from_T.cpp ]
[ run optional_test_convert_assign.cpp ]
[ run optional_test_empty_braces.cpp ]
[ run optional_test_make_optional.cpp ]
[ run optional_test_flat_map.cpp ]
[ run optional_test_hash.cpp ]
[ run optional_test_map.cpp ]
[ run optional_test_tie.cpp ]
[ run optional_test_ref_assign_portable_minimum.cpp ]
@ -50,6 +52,7 @@ import testing ;
[ run optional_test_member_T.cpp ]
[ run optional_test_tc_base.cpp ]
[ compile optional_test_sfinae_friendly_ctor.cpp ]
[ compile optional_test_path_assignment.cpp ]
[ compile-fail optional_test_fail_const_swap.cpp ]
[ compile-fail optional_test_ref_convert_assign_const_int_prevented.cpp ]
[ compile-fail optional_test_fail1.cpp ]

View File

@ -13,7 +13,7 @@
#include "boost/optional/optional.hpp"
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
#pragma hdrstop
#endif

View File

@ -12,7 +12,9 @@
// Revisions:
// 12 May 2008 (added more swap tests)
//
#ifndef BOOST_NO_IOSTREAM
#include<iostream>
#endif // BOOST_NO_IOSTREAM
#include<stdexcept>
#include<string>
@ -24,7 +26,7 @@
#include "boost/optional/optional.hpp"
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
#pragma hdrstop
#endif
@ -908,7 +910,7 @@ void test_no_implicit_conversions()
// Test for support for classes with overridden operator&
class CustomAddressOfClass
class CustomAddressOfClass
{
int n;
@ -950,5 +952,3 @@ int main()
return boost::report_errors();
}

View File

@ -26,12 +26,14 @@ struct size_tag {};
template< typename T, typename U >
struct is_constructible
{
template< typename T1, typename U1 >
static yes_type check_helper(size_tag< sizeof(static_cast< T1 >(U1())) >*);
template< typename T1, typename U1 >
static U& get();
template< typename T1 >
static yes_type check_helper(size_tag< sizeof(static_cast< T1 >(get())) >*);
template< typename T1 >
static no_type check_helper(...);
static const bool value = sizeof(check_helper< T, U >(0)) == sizeof(yes_type);
static const bool value = sizeof(check_helper< T >(0)) == sizeof(yes_type);
};
template< typename T >

View File

@ -11,7 +11,7 @@
#include "boost/optional/optional.hpp"
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
#pragma hdrstop
#endif

View File

@ -0,0 +1,57 @@
// Copyright (C) 2021 Andrzej Krzemienski.
//
// Use, modification, and distribution is 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)
//
// See http://www.boost.org/lib/optional for documentation.
//
// You are welcome to contact the author at:
// akrzemi1@gmail.com
#include "boost/optional/optional.hpp"
#include "boost/core/lightweight_test.hpp"
#include "boost/none.hpp"
//#ifndef BOOST_OPTIONAL_NO_CONVERTING_COPY_CTOR
using boost::optional;
struct implicit_bool_conv
{
operator bool() const { return false; }
};
struct explicit_bool_conv
{
bool operator!() const BOOST_NOEXCEPT { return false; }
BOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT()
};
template <typename To, typename From>
void test_convert_assign()
{
optional<To> oi;
oi = From();
BOOST_TEST(oi);
}
void test_no_bad_assignment()
{
#if !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1800)
// this means that type trait `boost::is_assignable` works.
BOOST_STATIC_ASSERT((boost::is_assignable<optional<bool>&, bool>::value));
BOOST_STATIC_ASSERT((boost::is_assignable<optional<bool>&, implicit_bool_conv>::value));
BOOST_STATIC_ASSERT((! boost::is_assignable<optional<bool>&, explicit_bool_conv>::value));
#endif
}
int main()
{
test_convert_assign<int, short>();
test_convert_assign<bool, implicit_bool_conv>();
test_no_bad_assignment();
return boost::report_errors();
}

View File

@ -11,7 +11,7 @@
#include "boost/optional/optional.hpp"
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
#pragma hdrstop
#endif

View File

@ -1,5 +1,5 @@
// Copyright 2017 Peter Dimov
// Copyright 2017 Vinnie NotDefaultConstructible
// Copyright 2017 Vinnie Falco
// Copyright 2018 Andrzej Krzemienski
//
// Distributed under the Boost Software License, Version 1.0.

View File

@ -11,10 +11,11 @@
#include "boost/optional/optional.hpp"
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
#pragma hdrstop
#endif
#include <string>
#include "boost/core/lightweight_test.hpp"
#include "boost/none.hpp"

View File

@ -11,7 +11,7 @@
#include "boost/optional/optional.hpp"
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
#pragma hdrstop
#endif

View File

@ -11,7 +11,7 @@
#include "boost/optional/optional.hpp"
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
#pragma hdrstop
#endif

View File

@ -11,7 +11,7 @@
#include "boost/optional/optional.hpp"
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
#pragma hdrstop
#endif

View File

@ -11,7 +11,7 @@
#include "boost/optional/optional.hpp"
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
#pragma hdrstop
#endif

View File

@ -0,0 +1,64 @@
// Copyright (C) 2014 Andrzej Krzemienski.
//
// Use, modification, and distribution is 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)
//
// See http://www.boost.org/lib/optional for documentation.
//
// You are welcome to contact the author at:
// akrzemi1@gmail.com
#include "boost/optional/optional.hpp"
#include "boost/config.hpp"
#include "boost/core/lightweight_test.hpp"
#if !defined(BOOST_NO_CXX11_HDR_UNORDERED_SET) && !defined(BOOST_OPTIONAL_CONFIG_DO_NOT_SPECIALIZE_STD_HASH)
#include <unordered_set>
void test_unordered_map()
{
std::unordered_set<boost::optional<int> > set;
set.insert(boost::optional<int>(1));
set.insert(boost::optional<int>(1));
BOOST_TEST(set.size() == 1u);
BOOST_TEST(set.find(boost::optional<int>(1)) != set.end());
}
#else
void test_unordered_map()
{}
#endif
#if !defined(BOOST_OPTIONAL_CONFIG_DO_NOT_SPECIALIZE_STD_HASH) && !defined(BOOST_NO_CXX11_HDR_FUNCTIONAL)
void tets_hash()
{
std::hash<boost::optional<int> > hash_int;
boost::optional<int> oN;
boost::optional<int> o1(1);
BOOST_TEST(hash_int(oN) == hash_int(oN));
BOOST_TEST(hash_int(o1) == hash_int(o1));
}
#else
void tets_hash()
{}
#endif
int main()
{
test_unordered_map();
tets_hash();
return boost::report_errors();
}

View File

@ -13,7 +13,7 @@
#include<string>
#include "boost/optional/optional.hpp"
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
#pragma hdrstop
#endif
@ -31,10 +31,10 @@ struct Guard
std::string str;
Guard() : num() {}
Guard(double num_, std::string str_) : num(num_), str(str_) {}
friend bool operator==(const Guard& lhs, const Guard& rhs) { return lhs.num == rhs.num && lhs.str == rhs.str; }
friend bool operator!=(const Guard& lhs, const Guard& rhs) { return !(lhs == rhs); }
private:
Guard(const Guard&);
Guard& operator=(const Guard&);
@ -44,26 +44,30 @@ void test_ctor()
{
#ifndef BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT
Guard g0, g1(1.0, "one"), g2(2.0, "two");
boost::optional<Guard> og0 ( boost::in_place() );
boost::optional<Guard> og1 ( boost::in_place(1.0, "one") );
boost::optional<Guard> og1_( boost::in_place(1.0, "one") );
boost::optional<Guard> og2 ( boost::in_place<Guard>(2.0, "two") );
BOOST_TEST(og0);
BOOST_TEST(og1);
BOOST_TEST(og1_);
BOOST_TEST(og2);
BOOST_TEST(*og0 == g0);
BOOST_TEST(*og1 == g1);
BOOST_TEST(*og1_ == g1);
BOOST_TEST(*og2 == g2);
BOOST_TEST(og1_ == og1);
BOOST_TEST(og1_ != og2);
BOOST_TEST(og1_ != og0);
#endif
boost::optional<unsigned int> o( boost::in_place(5) );
BOOST_TEST(o);
BOOST_TEST(*o == 5);
#endif
}
void test_assign()
@ -71,27 +75,32 @@ void test_assign()
#ifndef BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT
#ifndef BOOST_OPTIONAL_WEAK_OVERLOAD_RESOLUTION
Guard g0, g1(1.0, "one"), g2(2.0, "two");
boost::optional<Guard> og0, og1, og1_, og2;
og0 = boost::in_place();
og1 = boost::in_place(1.0, "one");
og1_ = boost::in_place(1.0, "one");
og2 = boost::in_place<Guard>(2.0, "two");
BOOST_TEST(og0);
BOOST_TEST(og1);
BOOST_TEST(og1_);
BOOST_TEST(og2);
BOOST_TEST(*og0 == g0);
BOOST_TEST(*og1 == g1);
BOOST_TEST(*og1_ == g1);
BOOST_TEST(*og2 == g2);
BOOST_TEST(og1_ == og1);
BOOST_TEST(og1_ != og2);
BOOST_TEST(og1_ != og0);
boost::optional<unsigned int> o;
o = boost::in_place(5);
BOOST_TEST(o);
BOOST_TEST(*o == 5);
#endif
#endif
}
@ -101,4 +110,4 @@ int main()
test_ctor();
test_assign();
return boost::report_errors();
}
}

View File

@ -13,7 +13,7 @@
#include<string>
#include "boost/optional/optional.hpp"
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
#pragma hdrstop
#endif

View File

@ -13,7 +13,7 @@
#include<string>
#include "boost/optional/optional.hpp"
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
#pragma hdrstop
#endif

View File

@ -10,15 +10,19 @@
// You are welcome to contact the author at:
// fernando_cacciola@hotmail.com
#include <sstream>
#include "boost/optional/optional.hpp"
#include "boost/optional/optional_io.hpp"
#include "boost/core/lightweight_test.hpp"
#ifdef __BORLANDC__
#ifndef BOOST_NO_IOSTREAM
#include <sstream>
#ifdef BOOST_BORLANDC
#pragma hdrstop
#endif
#include "boost/core/lightweight_test.hpp"
using boost::optional;
@ -29,7 +33,7 @@ void test2( Opt o, Opt buff )
const int markv = 123 ;
int mark = 0 ;
s << o << " " << markv ;
s >> buff >> mark ;
@ -85,3 +89,12 @@ int main()
return boost::report_errors();
}
#else // BOOST_NO_IOSTREAM
int main()
{
return boost::report_errors();
}
#endif // BOOST_NO_IOSTREAM

View File

@ -11,7 +11,7 @@
#include "boost/optional/optional.hpp"
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
#pragma hdrstop
#endif

View File

@ -11,7 +11,7 @@
#include "boost/optional/optional.hpp"
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
#pragma hdrstop
#endif

View File

@ -11,7 +11,7 @@
#include "boost/optional/optional.hpp"
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
#pragma hdrstop
#endif

View File

@ -11,7 +11,7 @@
#include "boost/optional/optional.hpp"
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
#pragma hdrstop
#endif

View File

@ -11,10 +11,11 @@
#include "boost/optional/optional.hpp"
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
#pragma hdrstop
#endif
#include <string>
#include "boost/core/lightweight_test.hpp"
#include "boost/none.hpp"

View File

@ -12,7 +12,7 @@
#include "boost/optional/optional.hpp"
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
#pragma hdrstop
#endif

View File

@ -12,7 +12,7 @@
#define BOOST_OPTIONAL_CONFIG_NO_RVALUE_REFERENCES
#include "boost/optional/optional.hpp"
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
#pragma hdrstop
#endif

View File

@ -12,7 +12,7 @@
#include "boost/static_assert.hpp"
#include "boost/optional/optional.hpp"
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
#pragma hdrstop
#endif

View File

@ -12,7 +12,7 @@
#define BOOST_OPTIONAL_CONFIG_USE_OLD_IMPLEMENTATION_OF_OPTIONAL // does old implementation still work for basic usage?
#include "boost/optional/optional.hpp"
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
#pragma hdrstop
#endif

View File

@ -0,0 +1,73 @@
// Copyright (C) 2019 Andrzej Krzemienski.
//
// Use, modification, and distribution is 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)
//
// See http://www.boost.org/lib/optional for documentation.
//
// You are welcome to contact the author at:
// akrzemi1@gmail.com
#include "boost/optional/optional.hpp"
#ifdef BOOST_BORLANDC
#pragma hdrstop
#endif
#ifndef BOOST_OPTIONAL_DETAIL_NO_IS_CONSTRUCTIBLE_TRAIT
#ifndef BOOST_OPTIONAL_DETAIL_NO_SFINAE_FRIENDLY_CONSTRUCTORS
template <typename, typename>
struct void_t
{
typedef void type;
};
template <typename T, typename = void>
struct trait
{
};
// the following trait emulates properties std::iterator_traits
template <typename T>
struct trait<T, BOOST_DEDUCED_TYPENAME void_t<BOOST_DEDUCED_TYPENAME T::value_type,
BOOST_DEDUCED_TYPENAME boost::enable_if<boost::is_constructible<T, T&> >::type
>::type>
{
typedef BOOST_DEDUCED_TYPENAME T::value_type value_type;
};
// This class emulates the properties of std::filesystem::path
struct Path
{
#if __cplusplus >= 201103
template <typename T, typename = BOOST_DEDUCED_TYPENAME trait<T>::value_type>
Path(T const&);
#else
template <typename T>
Path(T const&, BOOST_DEDUCED_TYPENAME trait<T>::value_type* = 0);
#endif
};
#endif
#endif
int main()
{
#ifndef BOOST_OPTIONAL_DETAIL_NO_IS_CONSTRUCTIBLE_TRAIT
#ifndef BOOST_OPTIONAL_DETAIL_NO_SFINAE_FRIENDLY_CONSTRUCTORS
boost::optional<Path> optFs1;
boost::optional<Path> optFs2;
optFs1 = optFs2;
// the following still fails although it shouldn't
//BOOST_STATIC_ASSERT((std::is_copy_constructible<boost::optional<Path>>::value));
#endif
#endif
}

View File

@ -11,7 +11,7 @@
#include "boost/optional/optional.hpp"
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
#pragma hdrstop
#endif

View File

@ -11,7 +11,7 @@
#include "boost/optional/optional.hpp"
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
#pragma hdrstop
#endif

View File

@ -11,7 +11,7 @@
#include "boost/optional/optional.hpp"
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
#pragma hdrstop
#endif

View File

@ -11,7 +11,7 @@
#include "boost/optional/optional.hpp"
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
#pragma hdrstop
#endif

View File

@ -11,7 +11,7 @@
#include "boost/optional/optional.hpp"
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
#pragma hdrstop
#endif

View File

@ -11,7 +11,7 @@
#include "boost/optional/optional.hpp"
#ifdef __BORLANDC__
#ifdef BOOST_BORLANDC
#pragma hdrstop
#endif

Some files were not shown because too many files have changed in this diff Show More