Compare commits

..

121 Commits

Author SHA1 Message Date
53da4e0b2c Fix include guard in adapt_assoc_adt.hpp (#273) 2024-05-15 17:13:08 +08:00
7d4c03fa03 Don't include std stream headers ourselves (#270) 2023-03-18 16:31:22 +08:00
5d19cc2d57 Remove template arguments redefinition workaround for VS2022 update 5. (#268)
Update 5 adds /Zc:templateScope flag which causes compile errors in
typedefs redefining template parameters.
2023-02-28 07:29:50 +08:00
049303436c Old permissions restored (#265) 2023-02-25 16:45:19 +08:00
8c32ebea0b Removed executable flags from files. (#267) 2023-02-21 08:35:45 +08:00
3044c2beaf missing make_pair() for r-value refs (#264)
* missing make_pair() for r-value refs

hello guys!

the `make_pair()` for r-value refs is required for r-value, otherwise `non-copyable` but `movable` can be constructed.


thanks!

* fix for prev commit

conditional support for r-values was fixed

* the test case was added

* fix for prev commit

* Update Jamfile

* one more fix for Jamfile

* the forgotten r-value ctor was added

* ah, they should be conditional
2023-02-11 10:10:25 +08:00
d6298309fb Implemented ability to set fallback for tag_of (#263) 2022-12-22 08:16:10 +08:00
0a2da9d0ac Add describe dependency (#262)
* Add describe dependency

* Add mp11 dependency
2022-12-21 13:49:11 +08:00
036b90cd5d Fix Clang 13 -Wdeprecated-copy warnings (#261)
Clang 13 have new warning under the same group
2022-10-11 10:28:11 +08:00
cd2d748648 Added missing includes (#246) 2022-09-26 14:02:56 +08:00
05c2c97ea0 Merge branch 'develop' 2022-09-26 11:54:49 +08:00
6ee2b188ef [transform_view_ext] Unary transform_view is an Associative Sequence now 2022-09-26 11:41:12 +08:00
03500e4fd3 [transform_view_ext] Updated docs 2022-09-26 11:41:12 +08:00
3c82db82df Merge branch 'develop' 2022-09-26 11:40:31 +08:00
287ca90947 Merge branch 'develop' 2022-09-26 11:40:31 +08:00
a884709253 deref_data_impl.hpp: fix missing includes 2022-09-26 11:35:55 +08:00
8d8db27953 Fix Clang 13 -Wdeprecated-copy warnings
Clang 13 have new warning under the same group
2022-09-26 11:35:55 +08:00
72c5c094b9 [githubactions] Fixed reverse_view test for C++03 2022-09-26 11:35:55 +08:00
b13fc27cf2 Diff simplified && update copyrights 2022-09-26 11:35:55 +08:00
efe3d59c73 [identity_view] Fix for spoiled prvalue 2022-09-26 11:35:55 +08:00
622e048cf2 Update identity_view.cpp 2022-09-26 11:35:55 +08:00
2a9a44ee7c Update identity_view.cpp 2022-09-26 11:35:55 +08:00
aca00012d1 [identity_view] Added boost::fusion::identity_view 2022-09-26 11:35:55 +08:00
c4e7f2bb1a [transform_view_ext] Unary transform_view is an Associative Sequence now 2022-09-26 11:35:55 +08:00
3a98d9dbeb [transform_view_ext] Updated docs 2022-09-26 11:35:33 +08:00
116768f3b2 Update appveyor.yml 2022-09-26 11:34:26 +08:00
df37668501 Update appveyor.yml 2022-09-26 11:34:26 +08:00
2a70da0170 Update appveyor.yml 2022-09-26 11:34:26 +08:00
60408efa18 Update view.qbk 2022-09-26 11:34:26 +08:00
d49b59bdf9 Fixed all '*_data' methods in reverse_view 2022-09-26 11:34:26 +08:00
e15016adb6 Applied fixes for reverse_view 2022-09-26 11:34:26 +08:00
24138813d6 Update reverse_view.cpp 2022-09-26 11:34:26 +08:00
0c6c0b17e5 Update reverse_view.cpp 2022-09-26 11:34:26 +08:00
95b6ebdc61 Merge branch 'develop' 2022-09-26 11:34:26 +08:00
dd3bf8aa3e Merge branch 'develop' 2022-09-26 11:34:25 +08:00
3f6f947233 Revert "Added functional dependency to master" 2022-09-26 11:34:03 +08:00
6191e9763a Merge remote-tracking branch 'origin/master' 2022-09-26 10:55:17 +08:00
14c22945cc Merge branch 'develop' 2022-09-26 10:54:48 +08:00
a19d919f7b develop from master again (#260)
* Added functional dependency to master

* Revert "Added functional dependency to master"

* Merge branch 'develop'

* Merge branch 'develop'

* Update view.qbk

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* [transform_view_ext] Updated docs

* [transform_view_ext] Unary transform_view is an Associative Sequence now

* [identity_view] Added boost::fusion::identity_view

* Update identity_view.cpp

* Update identity_view.cpp

* [identity_view] Fix for spoiled prvalue

* Update reverse_view.cpp

* Update reverse_view.cpp

* Applied fixes for reverse_view

* Fixed all '*_data' methods in reverse_view

* Diff simplified && update copyrights

* [githubactions] Fixed CI

* Fix Clang 13 `-Wdeprecated-copy` warnings

Clang 13 have new warning under the same group

* [githubactions] Fixed reverse_view test for C++03

* deref_data_impl.hpp: fix missing includes

Co-authored-by: Denis Mikhailov <denismikhaylov38@gmail.com>
Co-authored-by: Nikita Kniazev <nok.raven@gmail.com>
2022-09-26 10:43:24 +08:00
9a65c81640 Merge branch 'develop' 2022-09-26 10:41:11 +08:00
1c858a5fdc Merge branch 'master' into develop 2022-09-26 10:38:15 +08:00
3c749cbf49 Merge branch 'develop' 2022-09-26 10:22:37 +08:00
4c4d2ad66c Merge branch 'master' into develop 2022-09-26 08:59:02 +08:00
63727a3f16 Merge pull request #257 from Kojoley/deprecated-copy-again
Fix Clang 13 `-Wdeprecated-copy` warnings
2022-09-26 08:56:30 +08:00
bbddc4f10a Merge pull request #245 from denzor200/githubactions
Extended CI && Fixed test for C++03
2022-09-26 08:56:30 +08:00
22be72a3c5 deref_data_impl.hpp: fix missing includes 2022-09-26 08:56:30 +08:00
9a2f490130 [githubactions] Fixed reverse_view test for C++03 2022-09-26 08:56:30 +08:00
90721d48e9 Fix Clang 13 -Wdeprecated-copy warnings
Clang 13 have new warning under the same group
2022-09-26 08:56:30 +08:00
427d46e7dc [githubactions] Fixed CI 2022-09-26 08:56:30 +08:00
195a0521eb Merge remote-tracking branch 'sdarwin/githubactions' into githubactions 2022-09-26 08:56:30 +08:00
d2f9a048f7 Merge pull request #237 from denzor200/denzor200-patch-3
Fixed reverse_view
2022-09-26 08:56:10 +08:00
1a9faa6744 Diff simplified && update copyrights 2022-09-26 08:56:10 +08:00
1a16250b06 Merge remote-tracking branch 'origin/develop' into denzor200-patch-3 2022-09-26 08:56:10 +08:00
cdf26a72e9 Fixed all '*_data' methods in reverse_view 2022-09-26 08:56:10 +08:00
2a295202f7 Applied fixes for reverse_view 2022-09-26 08:56:10 +08:00
afba308e47 Update reverse_view.cpp 2022-09-26 08:55:49 +08:00
662567cb9f Update reverse_view.cpp 2022-09-26 08:55:49 +08:00
d9c89fc17c Merge pull request #240 from denzor200/identity_view
Added boost::fusion::identity_view
2022-09-26 08:55:25 +08:00
c59c1790c3 [identity_view] Fix for spoiled prvalue 2022-09-26 08:55:25 +08:00
11abd9b156 Update identity_view.cpp 2022-09-26 08:55:25 +08:00
62b45086c0 Update identity_view.cpp 2022-09-26 08:55:25 +08:00
596056930a [identity_view] Added boost::fusion::identity_view 2022-09-26 08:55:25 +08:00
41aae2c684 Merge pull request #239 from denzor200/transform_view_ext
Transform view ext
2022-09-26 08:55:10 +08:00
41fe9ba9b5 Merge pull request #236 from denzor200/denzor200-patch-2
Fixed CI
2022-09-26 08:55:10 +08:00
2aed5b1ab5 Merge branch 'boostorg:develop' into transform_view_ext 2022-09-26 08:55:10 +08:00
360dd957f2 [transform_view_ext] Unary transform_view is an Associative Sequence now 2022-09-26 08:55:10 +08:00
cc865135c9 Merge remote-tracking branch 'origin/denzor200-patch-4' into transform_view_ext
Conflicts:
	doc/view.qbk
2022-09-26 08:54:52 +08:00
c16e4f046b [transform_view_ext] Updated docs 2022-09-26 08:54:31 +08:00
58e72e74a6 Merge pull request #238 from denzor200/denzor200-patch-4
Fixed typo in the doc && less tautology
2022-09-26 08:54:12 +08:00
638855c861 Update appveyor.yml 2022-09-26 08:54:12 +08:00
cf99c66176 Update appveyor.yml 2022-09-26 08:54:12 +08:00
516a7a7add Update appveyor.yml 2022-09-26 08:54:12 +08:00
41b38d4adc Update view.qbk 2022-09-26 08:53:59 +08:00
fa5f1b7741 Merge pull request #200 from Kojoley/simplify-vector-assign_sequence
vector: Simplify assign_sequence
2022-09-26 08:53:43 +08:00
d8e3cc29da Merge branch 'master' into develop 2022-09-26 08:38:53 +08:00
af411a959c Merge branch 'develop' 2022-09-26 08:38:01 +08:00
51629ef53a Merge branch 'master' into develop 2022-09-26 08:12:29 +08:00
e79a8690f0 Merge branch 'develop' 2022-09-26 08:11:49 +08:00
8f49ff2006 Merge pull request #257 from Kojoley/deprecated-copy-again
Fix Clang 13 `-Wdeprecated-copy` warnings
2022-09-10 06:22:02 +08:00
ba320bf395 deref_data_impl.hpp: fix missing includes 2022-09-09 21:32:01 +03:00
7fe4a887ae Fix Clang 13 -Wdeprecated-copy warnings
Clang 13 have new warning under the same group
2022-09-08 21:29:55 +03:00
6539567952 Merge pull request #255 from boostorg/revert-251-patch-2
Revert "Added functional dependency to master"
2022-07-15 09:58:22 +08:00
37ed70fc43 Merge pull request #250 from denzor200/patch-1
Added functional dependency to develop
2022-07-04 18:30:41 +08:00
283d1a62c4 Added functional dependency to develop 2022-07-04 16:25:03 +06:00
2dceadd1f0 Merge pull request #249 from fanquake/deprecated_headers
refactor: remove some usage of deprecated headers
2022-04-09 10:30:03 +08:00
6da4ec1ae5 refactor: use core/noncopyable over noncopyable
The later is deprecated:
```cpp

// The header file at this path is deprecated;
// use boost/core/noncopyable.hpp instead.

```
2022-04-08 15:02:43 +01:00
8e58e09ba7 refactor: use core/ref.hpp over ref.hpp
The later has been deprecated:
```cpp

// The header file at this path is deprecated;
// use boost/core/ref.hpp instead.

```
2022-04-08 15:00:20 +01:00
45054c239b Merge pull request #245 from denzor200/githubactions
Extended CI && Fixed test for C++03
2022-01-25 15:32:53 +08:00
145b54d060 [githubactions] Fixed reverse_view test for C++03 2022-01-24 23:40:18 +04:00
d77dc74c7f [githubactions] Fixed CI 2022-01-24 23:27:28 +04:00
b50f10d1dd Merge remote-tracking branch 'sdarwin/githubactions' into githubactions 2022-01-24 23:15:04 +04:00
23e78a5974 Merge pull request #237 from denzor200/denzor200-patch-3
Fixed reverse_view
2022-01-16 18:10:43 +08:00
d22982e3a9 Diff simplified && update copyrights 2022-01-16 09:49:52 +04:00
1c5d3ac6f6 Merge remote-tracking branch 'origin/develop' into denzor200-patch-3 2022-01-16 09:43:41 +04:00
13593be807 Merge pull request #240 from denzor200/identity_view
Added boost::fusion::identity_view
2022-01-16 08:39:38 +08:00
21a449ae46 [identity_view] Fix for spoiled prvalue 2022-01-15 22:22:46 +04:00
d26c2e4212 Update identity_view.cpp 2022-01-12 10:14:07 +04:00
b0f60d5933 Update identity_view.cpp 2022-01-12 09:48:26 +04:00
eed79cb557 [identity_view] Added boost::fusion::identity_view 2022-01-10 21:19:38 +04:00
438d4d1874 Merge pull request #239 from denzor200/transform_view_ext
Transform view ext
2022-01-10 20:57:45 +08:00
9c1105ca00 Merge pull request #236 from denzor200/denzor200-patch-2
Fixed CI
2022-01-10 20:54:20 +08:00
37f64aa622 Merge branch 'boostorg:develop' into transform_view_ext 2022-01-10 09:34:00 +04:00
9be3b29738 Merge pull request #238 from denzor200/denzor200-patch-4
Fixed typo in the doc && less tautology
2022-01-10 07:50:57 +08:00
a57683a68d [transform_view_ext] Unary transform_view is an Associative Sequence now 2022-01-09 16:34:07 +04:00
e3429dac26 Merge remote-tracking branch 'origin/denzor200-patch-4' into transform_view_ext
Conflicts:
	doc/view.qbk
2022-01-09 15:31:15 +04:00
aa5ea2af69 Update view.qbk 2022-01-09 07:45:54 +04:00
2bb8a26c5b Fixed all '*_data' methods in reverse_view 2021-11-08 02:11:31 +04:00
95cf8bdb8d Applied fixes for reverse_view 2021-11-07 23:07:18 +04:00
380a2bc7a0 Update reverse_view.cpp 2021-11-07 03:29:06 +04:00
f07cca743f Update reverse_view.cpp 2021-11-07 03:03:18 +04:00
5db3ed8134 [transform_view_ext] Updated docs 2021-11-06 20:33:38 +04:00
8ea7f31294 Update appveyor.yml 2021-11-05 15:39:10 +04:00
10f44ff5a0 Update appveyor.yml 2021-11-05 14:51:22 +04:00
12c5097cf7 Update appveyor.yml 2021-11-05 14:13:09 +04:00
ccdcdd5610 Merge pull request #235 from denzor200/denzor200-patch-1
Fixed typos in the doc
2021-10-31 21:26:29 +08:00
25f12dedc8 Update sequence.qbk 2021-10-31 13:32:28 +04:00
c199f5c6fa Update sequence.qbk 2021-10-31 13:22:35 +04:00
de61a00d62 Fix doc as per https://github.com/boostorg/fusion/issues/234 2021-09-26 09:00:54 +08:00
3e20342084 Merge pull request #200 from Kojoley/simplify-vector-assign_sequence
vector: Simplify assign_sequence
2021-09-04 14:16:30 +08:00
b0f80684fd Add GitHub Actions config [ci skip] 2021-03-02 14:54:00 +00:00
26e8b5e459 vector: Simplify assign_sequence 2018-10-10 03:09:54 +03:00
83 changed files with 1726 additions and 152 deletions

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

@ -0,0 +1,471 @@
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-4.4 CXXSTD=98,0x Job 0"
buildtype: "boost"
packages: "g++-4.4"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:16.04"
cxx: "g++"
sources: ""
llvm_os: ""
llvm_ver: ""
toolset: "gcc-4.4"
cxxstd: "98,0x"
- name: "TOOLSET=gcc-4.6 CXXSTD=03,0x Job 1"
buildtype: "boost"
packages: "g++-4.6"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:16.04"
cxx: "g++"
sources: ""
llvm_os: ""
llvm_ver: ""
toolset: "gcc-4.6"
cxxstd: "03,0x"
- name: "TOOLSET=gcc-4.7 CXXSTD=03,11 Job 2"
buildtype: "boost"
packages: "g++-4.7"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:16.04"
cxx: "g++"
sources: ""
llvm_os: ""
llvm_ver: ""
toolset: "gcc-4.7"
cxxstd: "03,11"
- name: "TOOLSET=gcc-4.8 CXXSTD=03,11,1y Job 3"
buildtype: "boost"
packages: "g++-4.8"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:16.04"
cxx: "g++"
sources: ""
llvm_os: ""
llvm_ver: ""
toolset: "gcc-4.8"
cxxstd: "03,11,1y"
- name: "TOOLSET=gcc-4.9 CXXSTD=03,11,14 Job 4"
buildtype: "boost"
packages: "g++-4.9"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:16.04"
cxx: "g++"
sources: ""
llvm_os: ""
llvm_ver: ""
toolset: "gcc-4.9"
cxxstd: "03,11,14"
- name: "TOOLSET=gcc-5 CXXSTD=03,11,14,17 Job 5"
buildtype: "boost"
packages: "g++-5"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:16.04"
cxx: "g++"
sources: ""
llvm_os: ""
llvm_ver: ""
toolset: "gcc-5"
cxxstd: "03,11,14,17"
- name: "TOOLSET=gcc-6 CXXSTD=03,11,14,17 Job 6"
buildtype: "boost"
packages: "g++-6"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:16.04"
cxx: "g++"
sources: ""
llvm_os: ""
llvm_ver: ""
toolset: "gcc-6"
cxxstd: "03,11,14,17"
- name: "TOOLSET=gcc-7 CXXSTD=03,11,14,17 Job 7"
buildtype: "boost"
packages: "g++-7"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:16.04"
cxx: "g++"
sources: ""
llvm_os: ""
llvm_ver: ""
toolset: "gcc-7"
cxxstd: "03,11,14,17"
- name: "TOOLSET=gcc-8 CXXSTD=03,11,14,17,2a Job 8"
buildtype: "boost"
packages: "g++-8"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:16.04"
cxx: "g++"
sources: ""
llvm_os: ""
llvm_ver: ""
toolset: "gcc-8"
cxxstd: "03,11,14,17,2a"
- name: "TOOLSET=clang-3.5 CXXSTD=03,11,14,1z Job 9"
buildtype: "boost"
packages: "clang-3.5"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:16.04"
cxx: "g++"
sources: ""
llvm_os: ""
llvm_ver: ""
toolset: "clang-3.5"
cxxstd: "03,11,14"
- name: "TOOLSET=clang-3.6 CXXSTD=03,11,14,1z Job 10"
buildtype: "boost"
packages: "clang-3.6"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:16.04"
cxx: "g++"
sources: ""
llvm_os: ""
llvm_ver: ""
toolset: "clang-3.6"
cxxstd: "03,11,14"
- name: "TOOLSET=clang-3.7 CXXSTD=03,11,14,1z Job 11"
buildtype: "boost"
packages: "clang-3.7"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:16.04"
cxx: "g++"
sources: ""
llvm_os: ""
llvm_ver: ""
toolset: "clang-3.7"
cxxstd: "03,11,14"
- name: "TOOLSET=clang-3.8 CXXSTD=03,11,14,1z Job 12"
buildtype: "boost"
packages: "clang-3.8"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:16.04"
cxx: "g++"
sources: ""
llvm_os: ""
llvm_ver: ""
toolset: "clang-3.8"
cxxstd: "03,11,14"
- name: "TOOLSET=clang-3.9 CXXSTD=03,11,14,1z Job 13"
buildtype: "boost"
packages: "clang-3.9"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:16.04"
cxx: "g++"
sources: ""
llvm_os: ""
llvm_ver: ""
toolset: "clang-3.9"
cxxstd: "03,11,14"
- name: "TOOLSET=clang-4.0 CXXSTD=03,11,14,1z Job 14"
buildtype: "boost"
packages: "clang-4.0"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:16.04"
cxx: "g++"
sources: ""
llvm_os: ""
llvm_ver: ""
toolset: "clang-4.0"
cxxstd: "03,11,14"
- name: "TOOLSET=clang-5.0 CXXSTD=03,11,14,17,2a Job 15"
buildtype: "boost"
packages: "clang-5.0"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:16.04"
cxx: "g++"
sources: ""
llvm_os: "xenial"
llvm_ver: "5.0"
toolset: "clang-5.0"
cxxstd: "03,11,14,17,2a"
- name: "TOOLSET=clang-6.0 CXXSTD=03,11,14,17,2a Job 16"
buildtype: "boost"
packages: "clang-6.0"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:16.04"
cxx: "g++"
sources: ""
llvm_os: "xenial"
llvm_ver: "6.0"
toolset: "clang-6.0"
cxxstd: "03,11,14,17,2a"
- name: "TOOLSET=clang-7 CXXSTD=03,11,14,17,2a Job 17"
buildtype: "boost"
packages: "clang-7"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:16.04"
cxx: "g++"
sources: ""
llvm_os: "xenial"
llvm_ver: "7"
toolset: "clang-7"
cxxstd: "03,11,14,17,2a"
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 }}
CXXSTD: ${{ matrix.cxxstd }}
COMPILER: ${{ matrix.compiler }}
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 --depth 1 -b $BOOST_BRANCH https://github.com/boostorg/boost.git boost-root
cd boost-root
git submodule init libs/array
git submodule init libs/assert
git submodule init libs/bind
git submodule init libs/concept_check
git submodule init libs/config
git submodule init libs/container_hash
git submodule init libs/conversion
git submodule init libs/core
git submodule init libs/detail
git submodule init libs/function
git submodule init libs/function_types
git submodule init libs/functional
git submodule init libs/integer
git submodule init libs/iterator
git submodule init libs/lambda
git submodule init libs/move
git submodule init libs/mpl
git submodule init libs/optional
git submodule init libs/predef
git submodule init libs/preprocessor
git submodule init libs/smart_ptr
git submodule init libs/static_assert
git submodule init libs/throw_exception
git submodule init libs/tuple
git submodule init libs/type_index
git submodule init libs/type_traits
git submodule init libs/typeof
git submodule init libs/utility
git submodule init libs/describe
git submodule init libs/mp11
git submodule init libs/headers tools/boost_install tools/build
git submodule update
rm -rf libs/fusion
cp -rp $TRAVIS_BUILD_DIR libs/fusion
ln -s $(pwd)/libs/fusion $TRAVIS_BUILD_DIR
./bootstrap.sh
./b2 headers
echo '==================================> SCRIPT'
./b2 -j`(nproc || sysctl -n hw.ncpu) 2> /dev/null` libs/fusion/test toolset=$TOOLSET cxxstd=$CXXSTD
fi
osx:
strategy:
fail-fast: false
matrix:
include:
- name: "TOOLSET=clang COMPILER=clang++ CXXSTD=03,11,1 Job 18"
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 }}
CXXSTD: ${{ matrix.cxxstd }}
COMPILER: ${{ matrix.compiler }}
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 --depth 1 -b $BOOST_BRANCH https://github.com/boostorg/boost.git boost-root
cd boost-root
git submodule init libs/array
git submodule init libs/assert
git submodule init libs/bind
git submodule init libs/concept_check
git submodule init libs/config
git submodule init libs/container_hash
git submodule init libs/conversion
git submodule init libs/core
git submodule init libs/detail
git submodule init libs/function
git submodule init libs/function_types
git submodule init libs/functional
git submodule init libs/integer
git submodule init libs/iterator
git submodule init libs/lambda
git submodule init libs/move
git submodule init libs/mpl
git submodule init libs/optional
git submodule init libs/predef
git submodule init libs/preprocessor
git submodule init libs/smart_ptr
git submodule init libs/static_assert
git submodule init libs/throw_exception
git submodule init libs/tuple
git submodule init libs/type_index
git submodule init libs/type_traits
git submodule init libs/typeof
git submodule init libs/utility
git submodule init libs/describe
git submodule init libs/mp11
git submodule init libs/headers tools/boost_install tools/build
git submodule update
rm -rf libs/fusion
cp -rp $TRAVIS_BUILD_DIR libs/fusion
ln -s $(pwd)/libs/fusion $TRAVIS_BUILD_DIR
./bootstrap.sh
./b2 headers
echo '==================================> SCRIPT'
./b2 -j`(nproc || sysctl -n hw.ncpu) 2> /dev/null` libs/fusion/test toolset=$TOOLSET cxxstd=$CXXSTD
fi

View File

@ -23,4 +23,7 @@ target_link_libraries(boost_fusion
Boost::type_traits
Boost::typeof
Boost::utility
Boost::functional
Boost::describe
Boost::mp11
)

View File

@ -11,15 +11,19 @@ environment:
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
TOOLSET: msvc-9.0
ADDRMD: 32
CXXSTD: latest # fake
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
TOOLSET: msvc-10.0
ADDRMD: 32
CXXSTD: latest # fake
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
TOOLSET: msvc-11.0
ADDRMD: 32
CXXSTD: latest # fake
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
TOOLSET: msvc-12.0
ADDRMD: 32
CXXSTD: latest # fake
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
TOOLSET: msvc-14.0
@ -78,6 +82,8 @@ install:
- git submodule init libs/type_traits
- git submodule init libs/typeof
- git submodule init libs/utility
- git submodule init libs/describe
- git submodule init libs/mp11
- git submodule init libs/headers tools/boost_install tools/build
- git submodule update
@ -88,4 +94,5 @@ install:
build: off
test_script:
- b2 -j%NUMBER_OF_PROCESSORS% --hash libs/fusion/test toolset=%TOOLSET% cxxstd=%CXXSTD%
- if not "%ADDRMD%" == "" set ADDRMD=address-model=%ADDRMD%
- b2 -j%NUMBER_OF_PROCESSORS% --hash libs/fusion/test toolset=%TOOLSET% cxxstd=%CXXSTD% %ADDRMD%

View File

@ -1016,8 +1016,8 @@ __note_ref_wrappers__, __fusion_pair__
[section Tiers]
Tiers are sequences, where all elements are non-const reference types. They
are constructed with a call to a couple of /tie/ function templates. The
Tiers are sequences, where all elements are reference types. They are
constructed with a call to a couple of /tie/ function templates. The
succeeding sections document the various /tier/ flavors.
* __list_tie__
@ -2005,7 +2005,7 @@ __fusion_pair__s. There may be no duplicate __fusion_pair__ key types.
as_map(__make_vector__(
__fusion_make_pair__<int>('X')
, __fusion_make_pair__<double>("Men")))
// from associative sequence
namespace ns
{
@ -2222,7 +2222,7 @@ __fusion_pair__s. There may be no duplicate __fusion_pair__ key types.
result_of::as_map<__vector__<
__fusion_pair__<int, char>
, __fusion_pair__<double, std::string> > >::type
// from associative sequence
namespace ns
{

View File

@ -130,6 +130,7 @@
[def __reverse_view__ [link fusion.view.reverse_view `reverse_view`]]
[def __zip_view__ [link fusion.view.zip_view `zip_view`]]
[def __flatten_view__ [link fusion.view.flatten_view `flatten_view`]]
[def __identity_view__ [link fusion.view.identity_view `identity_view`]]
[def __array__ [link fusion.adapted.array array]]
[def __std_pair__ [link fusion.adapted.std__pair `std::pair`]]

View File

@ -163,6 +163,7 @@
<dt><span class="section"><a href="fusion/view/zip_view.html">zip_view</a></span></dt>
<dt><span class="section"><a href="fusion/view/transform_view.html">transform_view</a></span></dt>
<dt><span class="section"><a href="fusion/view/reverse_view.html">reverse_view</a></span></dt>
<dt><span class="section"><a href="fusion/view/identity_view.html">identity_view</a></span></dt>
<dt><span class="section"><a href="fusion/view/nview.html">nview</a></span></dt>
<dt><span class="section"><a href="fusion/view/repetitive_view.html">repetitive_view</a></span></dt>
<dt><span class="section"><a href="fusion/view/flatten_view.html">flatten_view</a></span></dt>

View File

@ -254,6 +254,7 @@ expressions must be valid:
* __iterator_range__ iterator (where adapted iterators are __associative_iterator__\ s)
* __joint_view__ iterator (where adapted sequences are __associative_sequence__\ s and __forward_sequence__\ s)
* __reverse_view__ iterator (where adapted sequence is an __associative_sequence__ and a __bidirectional_sequence__)
* __transform_view__ iterator (where adapted sequence is an __associative_sequence__ and a __forward_sequence__)
[endsect]

View File

@ -60,6 +60,7 @@ link against.
* single_view
* transform_view
* zip_view
* identity_view
* container
* deque
* list

View File

@ -166,7 +166,7 @@ Bidirectional Sequence the following must be met:
[[`__back__(s)`] [Any type] [] [Constant]]
[[`__back__(s) = o`] [Any type] [`s` is mutable and
`e = o`, where `e`
is the first element
is the last element
in the sequence, is
a valid expression.] [Constant]]
]
@ -237,14 +237,14 @@ any Random Access Sequence the following must be met:
[[`__at_c__<N>(s)`] [Any type] [] [Constant]]
[[`__at_c__<N>(s) = o`] [Any type] [`s` is mutable and
`e = o`, where `e`
is the first element
in the sequence, is
is the N-th element from the beginning
of the sequence, is
a valid expression.] [Constant]]
[[`__at__<M>(s)`] [Any type] [] [Constant]]
[[`__at__<M>(s) = o`] [Any type] [`s` is mutable and
`e = o`, where `e`
is the first element
in the sequence, is
is the M-th element from the beginning
of the sequence, is
a valid expression.] [Constant]]
]
@ -321,8 +321,7 @@ For any Associative Sequence the following expressions must be valid:
[[`__at_key__<K>(s)`] [Any type] [] [Constant]]
[[`__at_key__<K>(s) = o`] [Any type] [`s` is mutable and
`e = o`, where `e`
is the first element
in the sequence, is
is the element associated with K, is
a valid expression.] [Constant]]
]
@ -361,6 +360,7 @@ you can use `__result_of_value_at_key__<S, K>`.]
* __iterator_range__ (where adapted iterators are __associative_iterator__\ s)
* __joint_view__ (where adapted sequences are __associative_sequence__\ s and __forward_sequence__\ s)
* __reverse_view__ (where adapted sequence is an __associative_sequence__ and a __bidirectional_sequence__)
* __transform_view__ (where adapted sequence is an __associative_sequence__ and a __forward_sequence__)
[endsect]
@ -714,11 +714,11 @@ Returns the M-th element from the beginning of the sequence.
[heading Synopsis]
template <typename M, typename Sequence>
typename __result_of_at__<Sequence, N>::type
typename __result_of_at__<Sequence, M>::type
at(Sequence& seq);
template <typename M, typename Sequence>
typename __result_of_at__<Sequence const, N>::type
typename __result_of_at__<Sequence const, M>::type
at(Sequence const& seq);
[heading Parameters]

View File

@ -1,6 +1,7 @@
[/==============================================================================
Copyright (C) 2001-2011 Joel de Guzman
Copyright (C) 2006 Dan Marsden
Copyright (c) 2022 Denis Mikhailov
Use, modification and distribution is subject to the Boost Software
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
@ -328,9 +329,7 @@ defined in __forward_sequence__.
The unary version of `transform_view` presents a view of its underlying
sequence given a unary function object or function pointer. The binary
version of `transform_view` presents a view of 2 underlying sequences,
given a binary function object or function pointer. The `transform_view`
inherits the traversal characteristics (see __traversal_concept__) of
its underlying sequence or sequences.
given a binary function object or function pointer.
[heading Header]
@ -364,7 +363,8 @@ its underlying sequence or sequences.
* __forward_sequence__, __bidirectional_sequence__ or
__random_access_sequence__ depending on the traversal characteristics (see
__traversal_concept__) of its underlying sequence.
__traversal_concept__) of its underlying sequence or sequences.
* __associative_sequence__ if underlying sequence implements the __associative_sequence__ model(available only with unary version of `transform_view`).
[variablelist Notation
[[`TV`] [A `transform_view` type]]
@ -381,9 +381,7 @@ __traversal_concept__) of its underlying sequence.
[heading Expression Semantics]
Semantics of an expression is defined only where it differs from, or is not
defined in __forward_sequence__, __bidirectional_sequence__ or
__random_access_sequence__ depending on the traversal characteristics (see
__traversal_concept__) of its underlying sequence or sequences.
defined in the implemented models.
[table
[[Expression] [Semantics]]
@ -667,4 +665,60 @@ defined in __forward_sequence__.
[endsect]
[section identity_view]
[heading Description]
`identity_view` presents underlying sequence unchanged.
[heading Header]
#include <boost/fusion/view/identity_view.hpp>
#include <boost/fusion/include/identity_view.hpp>
[heading Synopsis]
template <typename Sequence>
struct identity_view;
[heading Template parameters]
[table
[[Parameter] [Description] [Default]]
[[`Sequence`] [A __forward_sequence__] []]
]
[heading Model of]
* A model of __forward_sequence__ if `Sequence` is a __forward_sequence__ else, __bidirectional_sequence__ if `Sequence` is a __bidirectional_sequence__
else, __random_access_sequence__ if `Sequence` is a __random_access_sequence__.
* __associative_sequence__ if `Sequence` implements the __associative_sequence__ model.
[variablelist Notation
[[`IV`] [An `identity_view` type]]
[[`s`] [An instance of `Sequence`]]
[[`iv`, `iv2`] [Instances of `identity_view`]]
]
[heading Expression Semantics]
Semantics of an expression is defined only where it differs from, or is not
defined in the implemented models.
[table
[[Expression] [Semantics]]
[[`IV(s)`] [Creates an `identity_view` given sequence, `s`.]]
[[`IV(iv)`] [Copy constructs an `identity_view` from another `identity_view`, `iv`.]]
[[`iv = iv2`] [Assigns to an `identity_view`, `iv`, from another `identity_view`, `iv2`.]]
]
[heading Example]
typedef __vector__<int, short, double> vector_type;
vector_type vec(2, 5, 3.3);
__identity_view__<vector_type> identity(vec);
std::cout << identity << std::endl; // (2 5 3.3)
[endsect]
[endsect]

View File

@ -46,7 +46,7 @@
#include <boost/mpl/max.hpp>
#include <boost/mpl/next.hpp>
#include <boost/ref.hpp>
#include <boost/core/ref.hpp>
#include <iostream>
#include <typeinfo>

View File

@ -18,6 +18,11 @@
#include <boost/type_traits/is_const.hpp>
#include <boost/fusion/iterator/iterator_facade.hpp>
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
namespace boost { namespace fusion
{
struct random_access_traversal_tag;
@ -102,11 +107,13 @@ namespace boost { namespace fusion
return type();
}
};
BOOST_DELETED_FUNCTION(array_iterator& operator=(array_iterator const&))
};
}}
#ifdef _MSC_VER
# pragma warning(pop)
#endif
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
namespace std
{

View File

@ -45,6 +45,10 @@ namespace boost { namespace fusion
template <typename Cons>
struct boost_tuple_iterator_identity;
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
template <typename Cons = tuples::null_type>
struct boost_tuple_iterator
: iterator_facade<boost_tuple_iterator<Cons>, forward_traversal_tag>
@ -143,10 +147,10 @@ namespace boost { namespace fusion
struct equal_to
: is_same<typename I1::identity, typename I2::identity>
{};
// silence MSVC warning C4512: assignment operator could not be generated
BOOST_DELETED_FUNCTION(boost_tuple_iterator& operator= (boost_tuple_iterator const&))
};
#ifdef _MSC_VER
# pragma warning(pop)
#endif
template <typename Null>
struct boost_tuple_null_iterator

View File

@ -19,6 +19,11 @@
#include <boost/fusion/iterator/iterator_facade.hpp>
#include <boost/fusion/adapted/std_array/detail/array_size.hpp>
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
namespace boost { namespace fusion
{
struct random_access_traversal_tag;
@ -99,9 +104,11 @@ namespace boost { namespace fusion
return type();
}
};
BOOST_DELETED_FUNCTION(std_array_iterator& operator=(std_array_iterator const&))
};
}}
#ifdef _MSC_VER
# pragma warning(pop)
#endif
#endif

View File

@ -17,6 +17,11 @@
#include <tuple>
#include <utility>
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
namespace boost { namespace fusion
{
struct random_access_traversal_tag;
@ -107,6 +112,10 @@ namespace boost { namespace fusion
};
}}
#ifdef _MSC_VER
# pragma warning(pop)
#endif
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
namespace std
{

View File

@ -143,7 +143,7 @@
I, \
ATTRIBUTE)
#ifdef BOOST_MSVC
#if defined(BOOST_MSVC) && (BOOST_MSVC < 1935)
# define BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAM(R,_,ELEM) \
typedef ELEM ELEM;
# define BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS_IMPL(SEQ) \

View File

@ -326,6 +326,9 @@
#define BOOST_FUSION_DEFINE_STRUCT_INLINE_ITERATOR_IMPL_IMPL( \
NAME, ATTRIBUTES_SEQ, ATTRIBUTES_SEQ_SIZE) \
\
BOOST_FUSION_PUSH_WARNINGS \
BOOST_FUSION_DISABLE_MSVC_WARNING(4512) \
\
template <typename boost_fusion_detail_Seq, int N> \
struct BOOST_FUSION_ITERATOR_NAME(NAME) \
: boost::fusion::iterator_facade< \
@ -418,7 +421,10 @@
return type(it.seq_); \
} \
}; \
};
}; \
\
BOOST_FUSION_POP_WARNINGS \
/**/
#define BOOST_FUSION_DEFINE_STRUCT_INLINE_MEMBERS_IMPL_IMPL( \

View File

@ -19,6 +19,9 @@
\
BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DEFINITION_BEGIN(NAMESPACE_SEQ) \
\
BOOST_FUSION_PUSH_WARNINGS \
BOOST_FUSION_DISABLE_MSVC_WARNING(4512) \
\
struct NAME \
{ \
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
@ -27,10 +30,10 @@
{} \
\
WRAPPED_TYPE& obj; \
\
BOOST_DELETED_FUNCTION(NAME& operator= (NAME const&)) \
}; \
\
BOOST_FUSION_POP_WARNINGS \
\
BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DEFINITION_END(NAMESPACE_SEQ)
#define BOOST_FUSION_ADAPT_STRUCT_DEFINE_PROXY_TYPE( \

View File

@ -14,6 +14,10 @@
namespace boost { namespace fusion { namespace detail
{
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
template <typename Fun>
struct segmented_fold_fun
{
@ -37,6 +41,9 @@ namespace boost { namespace fusion { namespace detail
}
};
};
#ifdef _MSC_VER
# pragma warning(pop)
#endif
// The default implementation of this lives in detail/fold.hpp
template <typename Sequence, typename State, typename Fun, bool IsSequence, bool IsSegmented>

View File

@ -13,6 +13,11 @@
#include <boost/fusion/algorithm/iteration/for_each_fwd.hpp>
#include <boost/fusion/support/segmented_fold_until.hpp>
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
namespace boost { namespace fusion { namespace detail
{
template <typename Fun>
@ -49,4 +54,8 @@ namespace boost { namespace fusion { namespace detail
}
}}}
#ifdef _MSC_VER
# pragma warning(pop)
#endif
#endif

View File

@ -18,6 +18,11 @@
#include <boost/mpl/int.hpp>
#include <boost/mpl/if.hpp>
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
namespace boost { namespace fusion
{
template <typename Iterator_, bool IsLast>
@ -168,5 +173,9 @@ namespace boost { namespace fusion
}
}}
#ifdef _MSC_VER
# pragma warning(pop)
#endif
#endif

View File

@ -20,6 +20,11 @@
#include <boost/type_traits/add_const.hpp>
#include <boost/type_traits/add_reference.hpp>
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
namespace boost { namespace fusion {
struct bidirectional_traversal_tag;
@ -110,13 +115,14 @@ namespace boost { namespace fusion {
{};
Seq& seq_;
// silence MSVC warning C4512: assignment operator could not be generated
BOOST_DELETED_FUNCTION(deque_iterator& operator= (deque_iterator const&))
};
}}
#ifdef _MSC_VER
# pragma warning(pop)
#endif
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
namespace std
{

View File

@ -26,6 +26,10 @@ namespace boost { namespace fusion
template <typename Cons>
struct cons_iterator_identity;
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
template <typename Cons = nil_>
struct cons_iterator : iterator_base<cons_iterator<Cons> >
{
@ -41,10 +45,10 @@ namespace boost { namespace fusion
: cons(in_cons) {}
cons_type& cons;
// silence MSVC warning C4512: assignment operator could not be generated
BOOST_DELETED_FUNCTION(cons_iterator& operator= (cons_iterator const&))
};
#ifdef _MSC_VER
# pragma warning(pop)
#endif
struct nil_iterator : iterator_base<nil_iterator>
{

View File

@ -17,6 +17,11 @@
#include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/add_const.hpp>
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
namespace boost { namespace fusion
{
struct random_access_traversal_tag;
@ -155,13 +160,13 @@ namespace boost { namespace fusion
{};
Seq& seq_;
// silence MSVC warning C4512: assignment operator could not be generated
BOOST_DELETED_FUNCTION(map_iterator& operator= (map_iterator const&))
};
}}
#ifdef _MSC_VER
# pragma warning(pop)
#endif
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
namespace std
{

View File

@ -220,21 +220,12 @@ namespace boost { namespace fusion
void
assign_sequence(Sequence&& seq)
{
assign(std::forward<Sequence>(seq), detail::index_sequence<I...>());
}
template <typename Sequence>
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
void
assign(Sequence&&, detail::index_sequence<>) {}
template <typename Sequence, std::size_t N, std::size_t ...M>
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
void
assign(Sequence&& seq, detail::index_sequence<N, M...>)
{
at_impl(mpl::int_<N>()) = vector_detail::forward_at_c<N>(seq);
assign(std::forward<Sequence>(seq), detail::index_sequence<M...>());
#ifndef BOOST_NO_CXX17_FOLD_EXPRESSIONS
(void(store<I, T>::elem = vector_detail::forward_at_c<I>(static_cast<Sequence&&>(seq))), ...);
#else
int nofold[] = { (void(store<I, T>::elem = vector_detail::forward_at_c<I>(static_cast<Sequence&&>(seq))), 0)..., 0 };
(void)nofold;
#endif
}
private:

View File

@ -19,6 +19,11 @@
#include <boost/type_traits/add_const.hpp>
#include <boost/mpl/int.hpp>
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
namespace boost { namespace fusion
{
struct vector_iterator_tag;
@ -41,17 +46,14 @@ namespace boost { namespace fusion
vector_iterator(Vector& in_vec)
: vec(in_vec) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
vector_iterator(vector_iterator const& rhs)
: vec(rhs.vec) {}
Vector& vec;
// silence MSVC warning C4512: assignment operator could not be generated
BOOST_DELETED_FUNCTION(vector_iterator& operator= (vector_iterator const&))
};
}}
#ifdef _MSC_VER
# pragma warning(pop)
#endif
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
namespace std
{

View File

@ -6,7 +6,7 @@
==============================================================================*/
#ifndef BOOST_FUSION_INCLUDE_ADAPT_ASSOC_ADT_HPP
#define BOOST_FUSION_INCLUDE_ADAPT_ASSOC_ADR_HPP
#define BOOST_FUSION_INCLUDE_ADAPT_ASSOC_ADT_HPP
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/adapted/adt/adapt_assoc_adt.hpp>

View File

@ -0,0 +1,12 @@
/*=============================================================================
Copyright (c) 2022 Denis Mikhailov
Distributed under 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)
==============================================================================*/
#if !defined(FUSION_INCLUDE_IDENTITY_VIEW)
#define FUSION_INCLUDE_IDENTITY_VIEW
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/view/identity_view.hpp>
#endif

View File

@ -13,6 +13,11 @@
#include <boost/fusion/support/tag_of.hpp>
#include <boost/fusion/sequence/intrinsic_fwd.hpp>
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
namespace boost { namespace fusion { namespace detail
{
struct segment_sequence_tag {};
@ -36,6 +41,10 @@ namespace boost { namespace fusion { namespace detail
};
}
#ifdef _MSC_VER
# pragma warning(pop)
#endif
namespace extension
{
template<typename Tag>

View File

@ -19,6 +19,11 @@
#include <boost/fusion/iterator/value_of.hpp>
#include <boost/type_traits/remove_const.hpp>
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
namespace boost { namespace fusion
{
template <typename Derived_, typename Iterator_,
@ -135,6 +140,10 @@ namespace boost { namespace fusion
};
}}
#ifdef _MSC_VER
# pragma warning(pop)
#endif
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
namespace std
{

View File

@ -10,7 +10,6 @@
#define FUSION_IN_05052005_0121
#include <boost/fusion/support/config.hpp>
#include <istream>
#include <boost/fusion/sequence/io/detail/manip.hpp>
#include <boost/mpl/bool.hpp>

View File

@ -36,10 +36,10 @@ namespace boost { namespace fusion
namespace detail
{
template <typename Tag>
int get_xalloc_index(Tag* = 0)
int get_xalloc_index(int xalloc())
{
// each Tag will have a unique index
static int index = std::ios::xalloc();
static int const index = xalloc();
return index;
}
@ -66,15 +66,19 @@ namespace boost { namespace fusion
{
static arena ar; // our arena
ar.data.push_back(new T(data));
stream.pword(get_xalloc_index<Tag>()) = ar.data.back();
stream.pword(get_xalloc_index<Tag>(stream.xalloc)) = ar.data.back();
}
static T const* get(Stream& stream)
{
return (T const*)stream.pword(get_xalloc_index<Tag>());
return (T const*)stream.pword(get_xalloc_index<Tag>(stream.xalloc));
}
};
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
template <typename Tag, typename Stream>
class string_ios_manip
{
@ -110,7 +114,6 @@ namespace boost { namespace fusion
{
// read a delimiter
string_type const* p = stream_data_t::get(stream);
std::ws(stream);
if (p)
{
@ -137,16 +140,16 @@ namespace boost { namespace fusion
if (stream.get() != c)
{
stream.unget();
stream.setstate(std::ios::failbit);
stream.setstate(Stream::failbit);
}
}
}
Stream& stream;
// silence MSVC warning C4512: assignment operator could not be generated
BOOST_DELETED_FUNCTION(string_ios_manip& operator= (string_ios_manip const&))
};
#ifdef _MSC_VER
# pragma warning(pop)
#endif
} // detail

View File

@ -10,7 +10,6 @@
#define FUSION_OUT_05052005_0121
#include <boost/fusion/support/config.hpp>
#include <ostream>
#include <boost/fusion/sequence/io/detail/manip.hpp>
#include <boost/mpl/bool.hpp>

View File

@ -10,9 +10,9 @@
#define BOOST_IN_05042005_0120
#include <boost/fusion/support/config.hpp>
#include <istream>
#include <boost/fusion/sequence/io/detail/in.hpp>
#include <boost/fusion/support/is_sequence.hpp>
#include <iosfwd>
namespace boost { namespace fusion
{

View File

@ -10,11 +10,11 @@
#define BOOST_OUT_05042005_0120
#include <boost/fusion/support/config.hpp>
#include <ostream>
#include <boost/fusion/sequence/io/detail/out.hpp>
#include <boost/fusion/support/is_sequence.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/mpl/or.hpp>
#include <iosfwd>
namespace boost { namespace fusion
{

View File

@ -127,4 +127,14 @@ namespace boost { namespace fusion { namespace detail
# define BOOST_FUSION_NOEXCEPT_ON_DEFAULTED BOOST_NOEXCEPT
#endif
#ifdef _MSC_VER
# define BOOST_FUSION_PUSH_WARNINGS __pragma(warning(push))
# define BOOST_FUSION_POP_WARNINGS __pragma(warning(pop))
# define BOOST_FUSION_DISABLE_MSVC_WARNING(num) __pragma(warning(disable : num))
#else
# define BOOST_FUSION_PUSH_WARNINGS
# define BOOST_FUSION_POP_WARNINGS
# define BOOST_FUSION_DISABLE_MSVC_WARNING(num)
#endif
#endif

View File

@ -10,7 +10,7 @@
#define BOOST_FUSION_SUPPORT_DEDUCE_HPP_INCLUDED
#include <boost/fusion/support/config.hpp>
#include <boost/ref.hpp>
#include <boost/core/ref.hpp>
#ifndef BOOST_NO_CXX11_HDR_FUNCTIONAL
#include <functional>

View File

@ -9,7 +9,7 @@
#define FUSION_AS_FUSION_ELEMENT_05052005_0338
#include <boost/fusion/support/config.hpp>
#include <boost/ref.hpp>
#include <boost/core/ref.hpp>
#ifndef BOOST_NO_CXX11_HDR_FUNCTIONAL
#include <functional>

View File

@ -120,6 +120,17 @@ namespace boost { namespace fusion
return pair<First, typename detail::as_fusion_element<Second>::type>(val);
}
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
template <typename First, typename Second>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename result_of::make_pair<First,Second>::type
make_pair(Second&& val)
{
return pair<First, typename detail::as_fusion_element<Second>::type>(
BOOST_FUSION_FWD_ELEM(Second, val));
}
#endif
template <typename First, typename Second>
inline std::ostream&
operator<<(std::ostream& os, pair<First, Second> const& p)

View File

@ -48,11 +48,17 @@ namespace boost { namespace fusion
{
BOOST_MPL_HAS_XXX_TRAIT_DEF(fusion_tag)
template<typename Sequence, typename Active=void>
struct tag_of_fallback
{
typedef non_fusion_tag type;
};
template <typename Sequence, typename Active>
struct tag_of_impl
: mpl::if_<fusion::detail::is_mpl_sequence<Sequence>,
mpl::identity<mpl_sequence_tag>,
mpl::identity<non_fusion_tag> >::type
mpl::identity<typename tag_of_fallback<Sequence>::type> >::type
{};
template <typename Sequence>

View File

@ -17,5 +17,6 @@
#include <boost/fusion/view/transform_view.hpp>
#include <boost/fusion/view/zip_view.hpp>
#include <boost/fusion/view/flatten_view.hpp>
#include <boost/fusion/view/identity_view.hpp>
#endif

View File

@ -22,6 +22,11 @@
#include <boost/mpl/inherit.hpp>
#include <boost/mpl/identity.hpp>
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
namespace boost { namespace fusion
{
struct filter_view_tag;
@ -51,22 +56,18 @@ namespace boost { namespace fusion
: seq(in_seq)
{}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
filter_view(filter_view const& rhs)
: seq(rhs.seq)
{}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
first_type first() const { return fusion::begin(seq); }
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
last_type last() const { return fusion::end(seq); }
typename mpl::if_<traits::is_view<Sequence>, Sequence, Sequence&>::type seq;
// silence MSVC warning C4512: assignment operator could not be generated
BOOST_DELETED_FUNCTION(filter_view& operator= (filter_view const&))
};
}}
#ifdef _MSC_VER
# pragma warning(pop)
#endif
#endif

View File

@ -26,6 +26,11 @@
#include <boost/fusion/view/filter_view/detail/value_of_data_impl.hpp>
#include <boost/fusion/view/filter_view/detail/key_of_impl.hpp>
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
namespace boost { namespace fusion
{
struct filter_view_iterator_tag;
@ -59,17 +64,14 @@ namespace boost { namespace fusion
filter_iterator(First const& in_first)
: first(filter::iter_call(first_converter::call(in_first))) {}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
filter_iterator(filter_iterator const& rhs)
: first(rhs.first) {}
first_type first;
// silence MSVC warning C4512: assignment operator could not be generated
BOOST_DELETED_FUNCTION(filter_iterator& operator= (filter_iterator const&))
};
}}
#ifdef _MSC_VER
# pragma warning(pop)
#endif
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
namespace std
{

View File

@ -19,6 +19,10 @@
#include <boost/fusion/sequence/intrinsic/end.hpp>
#include <boost/fusion/view/flatten_view/flatten_view_iterator.hpp>
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
namespace boost { namespace fusion
{
@ -52,6 +56,10 @@ namespace boost { namespace fusion
};
}}
#ifdef _MSC_VER
# pragma warning(pop)
#endif
namespace boost { namespace fusion { namespace extension
{
template<>

View File

@ -19,6 +19,10 @@
#include <boost/fusion/iterator/deref.hpp>
#include <boost/fusion/iterator/value_of.hpp>
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
namespace boost { namespace fusion
{
@ -46,6 +50,10 @@ namespace boost { namespace fusion
};
}}
#ifdef _MSC_VER
# pragma warning(pop)
#endif
namespace boost { namespace fusion { namespace detail
{
template<class Iterator, class = void>

View File

@ -0,0 +1,14 @@
/*=============================================================================
Copyright (c) 2022 Denis Mikhailov
Distributed under 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)
==============================================================================*/
#if !defined(BOOST_FUSION_SEQUENCE_IDENTITY_VIEW_HPP_INCLUDED)
#define BOOST_FUSION_SEQUENCE_IDENTITY_VIEW_HPP_INCLUDED
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/view/identity_view/identity_view.hpp>
#endif

View File

@ -0,0 +1,50 @@
/*=============================================================================
Copyright (c) 2022 Denis Mikhailov
Distributed under 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)
==============================================================================*/
#if !defined(BOOST_FUSION_IDENTITY_VIEW_HPP_INCLUDED)
#define BOOST_FUSION_IDENTITY_VIEW_HPP_INCLUDED
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/view/transform_view.hpp>
#include <boost/functional/identity.hpp>
#include <boost/utility/result_of.hpp>
namespace boost { namespace fusion {
namespace detail {
struct identity : boost::identity
{
};
}
}}
namespace boost {
template<typename T>
struct result_of<fusion::detail::identity(T)>
{
typedef T type;
};
}
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
namespace boost { namespace fusion {
template<typename Sequence> struct identity_view
: transform_view<Sequence, detail::identity>
{
typedef transform_view<Sequence, detail::identity> base_type;
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
identity_view(Sequence& in_seq)
: base_type(in_seq, detail::identity()) {}
};
}}
#ifdef _MSC_VER
# pragma warning(pop)
#endif
#endif

View File

@ -25,6 +25,11 @@
#include <boost/mpl/inherit.hpp>
#include <boost/mpl/identity.hpp>
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
namespace boost { namespace fusion
{
struct joint_view_tag;
@ -69,15 +74,16 @@ namespace boost { namespace fusion
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
concat_last_type concat_last() const { return fusion::end(seq2); }
// silence MSVC warning C4512: assignment operator could not be generated
BOOST_DELETED_FUNCTION(joint_view& operator= (joint_view const&))
private:
typename mpl::if_<traits::is_view<Sequence1>, Sequence1, Sequence1&>::type seq1;
typename mpl::if_<traits::is_view<Sequence2>, Sequence2, Sequence2&>::type seq2;
};
}}
#ifdef _MSC_VER
# pragma warning(pop)
#endif
#endif

View File

@ -20,6 +20,11 @@
#include <boost/fusion/view/joint_view/detail/key_of_impl.hpp>
#include <boost/static_assert.hpp>
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
namespace boost { namespace fusion
{
struct joint_view_iterator_tag;
@ -49,12 +54,13 @@ namespace boost { namespace fusion
first_type first;
concat_type concat;
// silence MSVC warning C4512: assignment operator could not be generated
BOOST_DELETED_FUNCTION(joint_view_iterator& operator= (joint_view_iterator const&))
};
}}
#ifdef _MSC_VER
# pragma warning(pop)
#endif
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
namespace std
{

View File

@ -26,6 +26,11 @@
#include <boost/fusion/view/nview/detail/distance_impl.hpp>
#include <boost/fusion/view/nview/detail/equal_to_impl.hpp>
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
namespace boost { namespace fusion
{
struct nview_iterator_tag;
@ -46,13 +51,14 @@ namespace boost { namespace fusion
: seq(in_seq) {}
Sequence& seq;
// silence MSVC warning C4512: assignment operator could not be generated
BOOST_DELETED_FUNCTION(nview_iterator& operator= (nview_iterator const&))
};
}}
#ifdef _MSC_VER
# pragma warning(pop)
#endif
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
namespace std
{

View File

@ -18,6 +18,10 @@
#include <boost/fusion/view/repetitive_view/detail/begin_impl.hpp>
#include <boost/fusion/view/repetitive_view/detail/end_impl.hpp>
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
namespace boost { namespace fusion
{
@ -43,11 +47,12 @@ namespace boost { namespace fusion
: seq(in_seq) {}
stored_seq_type seq;
// silence MSVC warning C4512: assignment operator could not be generated
BOOST_DELETED_FUNCTION(repetitive_view& operator= (repetitive_view const&))
};
}}
#ifdef _MSC_VER
# pragma warning(pop)
#endif
#endif

View File

@ -19,6 +19,11 @@
#include <boost/fusion/view/repetitive_view/detail/next_impl.hpp>
#include <boost/fusion/view/repetitive_view/detail/value_of_impl.hpp>
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
namespace boost { namespace fusion
{
struct repetitive_view_iterator_tag;
@ -46,12 +51,13 @@ namespace boost { namespace fusion
Sequence& seq;
pos_type pos;
// silence MSVC warning C4512: assignment operator could not be generated
BOOST_DELETED_FUNCTION(repetitive_view_iterator& operator= (repetitive_view_iterator const&))
};
}}
#ifdef _MSC_VER
# pragma warning(pop)
#endif
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
namespace std
{

View File

@ -1,5 +1,6 @@
/*=============================================================================
Copyright (c) 2009 Christopher Schmidt
Copyright (c) 2021-2022 Denis Mikhailov
Distributed under 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)
@ -10,6 +11,7 @@
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/iterator/deref_data.hpp>
#include <boost/fusion/iterator/prior.hpp>
namespace boost { namespace fusion { namespace extension
{
@ -23,14 +25,18 @@ namespace boost { namespace fusion { namespace extension
struct apply
{
typedef typename
result_of::deref_data<typename It::first_type>::type
result_of::deref_data<
typename result_of::prior<
typename It::first_type
>::type
>::type
type;
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(It const& it)
{
return fusion::deref_data(it.first);
return fusion::deref_data(fusion::prior(it.first));
}
};
};

View File

@ -1,5 +1,6 @@
/*=============================================================================
Copyright (c) 2009 Christopher Schmidt
Copyright (c) 2021-2022 Denis Mikhailov
Distributed under 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)
@ -10,6 +11,7 @@
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/iterator/key_of.hpp>
#include <boost/fusion/iterator/prior.hpp>
namespace boost { namespace fusion { namespace extension
{
@ -21,8 +23,15 @@ namespace boost { namespace fusion { namespace extension
{
template <typename It>
struct apply
: result_of::key_of<typename It::it_type>
{};
{
typedef typename
result_of::key_of<
typename result_of::prior<
typename It::first_type
>::type
>::type
type;
};
};
}}}

View File

@ -1,5 +1,6 @@
/*=============================================================================
Copyright (c) 2009 Christopher Schmidt
Copyright (c) 2021-2022 Denis Mikhailov
Distributed under 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)
@ -10,6 +11,7 @@
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/iterator/value_of_data.hpp>
#include <boost/fusion/iterator/prior.hpp>
namespace boost { namespace fusion { namespace extension
{
@ -21,8 +23,15 @@ namespace boost { namespace fusion { namespace extension
{
template <typename It>
struct apply
: result_of::value_of_data<typename It::first_type>
{};
{
typedef typename
result_of::value_of_data<
typename result_of::prior<
typename It::first_type
>::type
>::type
type;
};
};
}}}

View File

@ -27,6 +27,11 @@
#include <boost/mpl/inherit.hpp>
#include <boost/mpl/identity.hpp>
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
namespace boost { namespace fusion
{
struct reverse_view_tag;
@ -60,12 +65,13 @@ namespace boost { namespace fusion
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
last_type last() const { return fusion::end(seq); }
typename mpl::if_<traits::is_view<Sequence>, Sequence, Sequence&>::type seq;
// silence MSVC warning C4512: assignment operator could not be generated
BOOST_DELETED_FUNCTION(reverse_view& operator= (reverse_view const&))
};
}}
#ifdef _MSC_VER
# pragma warning(pop)
#endif
#endif

View File

@ -24,6 +24,11 @@
#include <boost/type_traits/is_base_of.hpp>
#include <boost/static_assert.hpp>
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
namespace boost { namespace fusion
{
struct reverse_view_iterator_tag;
@ -47,12 +52,13 @@ namespace boost { namespace fusion
: first(converter::call(in_first)) {}
first_type first;
// silence MSVC warning C4512: assignment operator could not be generated
BOOST_DELETED_FUNCTION(reverse_view_iterator& operator= (reverse_view_iterator const&))
};
}}
#ifdef _MSC_VER
# pragma warning(pop)
#endif
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
namespace std
{

View File

@ -20,6 +20,11 @@
#include <boost/fusion/view/single_view/detail/value_of_impl.hpp>
#include <boost/config.hpp>
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
namespace boost { namespace fusion
{
struct single_view_iterator_tag;
@ -40,11 +45,13 @@ namespace boost { namespace fusion
: view(in_view) {}
SingleView& view;
BOOST_DELETED_FUNCTION(single_view_iterator& operator=(single_view_iterator const&))
};
}}
#ifdef _MSC_VER
# pragma warning(pop)
#endif
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
namespace std
{

View File

@ -0,0 +1,73 @@
/*=============================================================================
Copyright (c) 2022 Denis Mikhailov
Distributed under 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)
==============================================================================*/
#if !defined(BOOST_FUSION_TRANSFORM_VIEW_DEREF_DATA_IMPL_JAN_9_2022_0354PM)
#define BOOST_FUSION_TRANSFORM_VIEW_DEREF_DATA_IMPL_JAN_9_2022_0354PM
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/iterator/deref.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/type_traits/add_reference.hpp>
#include <boost/type_traits/add_const.hpp>
#include <boost/type_traits/is_reference.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/utility/result_of.hpp>
#include <boost/mpl/if.hpp>
namespace boost { namespace fusion
{
struct transform_view_iterator_tag;
struct transform_view_iterator2_tag;
namespace extension
{
template<typename Tag>
struct deref_data_impl;
// Unary Version
template<>
struct deref_data_impl<transform_view_iterator_tag>
{
template <typename Iterator>
struct apply
{
typedef typename
result_of::deref<typename Iterator::first_type>::type
value_type;
typedef typename Iterator::transform_type F;
typedef typename boost::result_of<F(value_type)>::type transformed_type;
typedef typename boost::remove_reference<transformed_type>::type transformed_type_unref;
typedef typename boost::remove_const<transformed_type_unref>::type transformed_type_unconst;
typedef typename transformed_type_unconst::second_type raw_type;
typedef typename
boost::mpl::if_<
is_reference<transformed_type>
, typename boost::mpl::if_<
is_const<transformed_type_unref>
, typename boost::add_reference<typename boost::add_const<raw_type>::type>::type
, typename boost::add_reference<raw_type>::type
>::type
, raw_type
>::type
type;
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(Iterator const& i)
{
return i.f(fusion::deref(i.first)).second;
}
};
};
// Binary Version is not supported with Associative Sequence
}
}}
#endif

View File

@ -0,0 +1,49 @@
/*=============================================================================
Copyright (c) 2022 Denis Mikhailov
Distributed under 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)
==============================================================================*/
#if !defined(BOOST_FUSION_TRANSFORM_VIEW_KEY_OF_IMPL_JAN_9_2022_0354PM)
#define BOOST_FUSION_TRANSFORM_VIEW_KEY_OF_IMPL_JAN_9_2022_0354PM
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/iterator/deref.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/utility/result_of.hpp>
namespace boost { namespace fusion
{
struct transform_view_iterator_tag;
struct transform_view_iterator2_tag;
namespace extension
{
template<typename Tag>
struct key_of_impl;
// Unary Version
template<>
struct key_of_impl<transform_view_iterator_tag>
{
template <typename Iterator>
struct apply
{
typedef typename
result_of::deref<typename Iterator::first_type>::type
value_type;
typedef typename Iterator::transform_type F;
typedef typename boost::result_of<F(value_type)>::type transformed_type;
typedef typename boost::remove_reference<transformed_type>::type transformed_type_unref;
typedef typename boost::remove_const<transformed_type_unref>::type transformed_type_unconst;
typedef typename transformed_type_unconst::first_type type;
};
};
// Binary Version is not supported with Associative Sequence
}
}}
#endif

View File

@ -0,0 +1,49 @@
/*=============================================================================
Copyright (c) 2022 Denis Mikhailov
Distributed under 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)
==============================================================================*/
#if !defined(BOOST_FUSION_TRANSFORM_VIEW_VALUE_OF_IMPL_JAN_9_2022_0354PM)
#define BOOST_FUSION_TRANSFORM_VIEW_VALUE_OF_IMPL_JAN_9_2022_0354PM
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/iterator/deref.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/utility/result_of.hpp>
namespace boost { namespace fusion
{
struct transform_view_iterator_tag;
struct transform_view_iterator2_tag;
namespace extension
{
template<typename Tag>
struct value_of_data_impl;
// Unary Version
template<>
struct value_of_data_impl<transform_view_iterator_tag>
{
template <typename Iterator>
struct apply
{
typedef typename
result_of::deref<typename Iterator::first_type>::type
value_type;
typedef typename Iterator::transform_type F;
typedef typename boost::result_of<F(value_type)>::type transformed_type;
typedef typename boost::remove_reference<transformed_type>::type transformed_type_unref;
typedef typename boost::remove_const<transformed_type_unref>::type transformed_type_unconst;
typedef typename transformed_type_unconst::second_type type;
};
};
// Binary Version is not supported with Associative Sequence
}
}}
#endif

View File

@ -27,6 +27,11 @@
#include <boost/fusion/sequence/intrinsic/size.hpp>
#include <boost/mpl/bool.hpp>
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
namespace boost { namespace fusion
{
struct void_;
@ -75,9 +80,6 @@ namespace boost { namespace fusion
transform_type f;
typename mpl::if_<traits::is_view<Sequence1>, Sequence1, Sequence1&>::type seq1;
typename mpl::if_<traits::is_view<Sequence2>, Sequence2, Sequence2&>::type seq2;
// silence MSVC warning C4512: assignment operator could not be generated
BOOST_DELETED_FUNCTION(transform_view& operator= (transform_view const&))
};
// Unary Version
@ -111,12 +113,13 @@ namespace boost { namespace fusion
last_type last() const { return fusion::end(seq); }
typename mpl::if_<traits::is_view<Sequence>, Sequence, Sequence&>::type seq;
transform_type f;
// silence MSVC warning C4512: assignment operator could not be generated
BOOST_DELETED_FUNCTION(transform_view& operator= (transform_view const&))
};
}}
#ifdef _MSC_VER
# pragma warning(pop)
#endif
#endif

View File

@ -19,6 +19,14 @@
#include <boost/fusion/view/transform_view/detail/advance_impl.hpp>
#include <boost/fusion/view/transform_view/detail/distance_impl.hpp>
#include <boost/fusion/view/transform_view/detail/equal_to_impl.hpp>
#include <boost/fusion/view/transform_view/detail/key_of_impl.hpp>
#include <boost/fusion/view/transform_view/detail/value_of_data_impl.hpp>
#include <boost/fusion/view/transform_view/detail/deref_data_impl.hpp>
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
namespace boost { namespace fusion
{
@ -41,9 +49,6 @@ namespace boost { namespace fusion
first_type first;
transform_type f;
// silence MSVC warning C4512: assignment operator could not be generated
BOOST_DELETED_FUNCTION(transform_view_iterator& operator= (transform_view_iterator const&))
};
// Binary Version
@ -68,12 +73,13 @@ namespace boost { namespace fusion
first1_type first1;
first2_type first2;
transform_type f;
// silence MSVC warning C4512: assignment operator could not be generated
BOOST_DELETED_FUNCTION(transform_view_iterator2& operator= (transform_view_iterator2 const&))
};
}}
#ifdef _MSC_VER
# pragma warning(pop)
#endif
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
namespace std
{

View File

@ -156,6 +156,7 @@ project
: <define>BOOST_FUSION_DISABLE_VARIADIC_VECTOR
: tuple_traits__no_variadic ]
[ run sequence/transform_view.cpp ]
[ run sequence/identity_view.cpp ]
[ run sequence/vector_comparison.cpp ]
[ run sequence/vector_construction.cpp ]
[ run sequence/vector_conversion.cpp ]
@ -270,6 +271,11 @@ project
: [ requires cxx11_variadic_templates ] ]
[ compile support/tag_of.cpp ]
[ compile support/unused.cpp ]
[ compile support/detail/tag_of_fallback.cpp ]
[ compile-fail support/make_pair_r-value.cpp ]
[ compile support/make_pair_r-value.cpp
: [ requires cxx11_rvalue_references ] ]
# [ compile-fail xxx.cpp ]

View File

@ -9,7 +9,7 @@
#include <boost/fusion/functional/adapter/fused.hpp>
#include <boost/detail/lightweight_test.hpp>
#include <boost/noncopyable.hpp>
#include <boost/core/noncopyable.hpp>
#include <boost/fusion/container/generation/make_vector.hpp>
#include <boost/fusion/container/vector.hpp>

View File

@ -9,7 +9,7 @@
#include <boost/fusion/functional/adapter/fused_function_object.hpp>
#include <boost/detail/lightweight_test.hpp>
#include <boost/noncopyable.hpp>
#include <boost/core/noncopyable.hpp>
#include <boost/mpl/empty_base.hpp>
#include <boost/fusion/container/generation/make_vector.hpp>

View File

@ -9,7 +9,7 @@
#include <boost/fusion/functional/adapter/fused_procedure.hpp>
#include <boost/detail/lightweight_test.hpp>
#include <boost/noncopyable.hpp>
#include <boost/core/noncopyable.hpp>
#include <boost/mpl/empty_base.hpp>
#include <boost/fusion/container/generation/make_vector.hpp>

View File

@ -16,7 +16,7 @@
#endif
#include <memory>
#include <boost/noncopyable.hpp>
#include <boost/core/noncopyable.hpp>
#include <boost/type_traits/is_same.hpp>

View File

@ -17,7 +17,7 @@
#include <boost/type_traits/is_same.hpp>
#include <memory>
#include <boost/noncopyable.hpp>
#include <boost/core/noncopyable.hpp>
#include <boost/mpl/int.hpp>

View File

@ -16,7 +16,7 @@
#endif
#include <memory>
#include <boost/noncopyable.hpp>
#include <boost/core/noncopyable.hpp>
#include <boost/mpl/int.hpp>

View File

@ -9,7 +9,7 @@
#include <boost/fusion/functional/generation/make_fused.hpp>
#include <boost/detail/lightweight_test.hpp>
#include <boost/noncopyable.hpp>
#include <boost/core/noncopyable.hpp>
#include <boost/mpl/empty_base.hpp>
#include <boost/fusion/container/generation/make_vector.hpp>

View File

@ -9,7 +9,7 @@
#include <boost/fusion/functional/generation/make_fused_function_object.hpp>
#include <boost/detail/lightweight_test.hpp>
#include <boost/noncopyable.hpp>
#include <boost/core/noncopyable.hpp>
#include <boost/mpl/empty_base.hpp>
#include <boost/fusion/container/generation/make_vector.hpp>

View File

@ -9,7 +9,7 @@
#include <boost/fusion/functional/generation/make_fused_procedure.hpp>
#include <boost/detail/lightweight_test.hpp>
#include <boost/noncopyable.hpp>
#include <boost/core/noncopyable.hpp>
#include <boost/mpl/empty_base.hpp>
#include <boost/fusion/container/generation/make_vector.hpp>

View File

@ -9,7 +9,7 @@
#include <boost/fusion/functional/generation/make_unfused.hpp>
#include <boost/detail/lightweight_test.hpp>
#include <boost/noncopyable.hpp>
#include <boost/core/noncopyable.hpp>
#include <boost/mpl/empty_base.hpp>
#include <boost/mpl/if.hpp>
@ -19,11 +19,11 @@
#include <boost/utility/result_of.hpp>
#include <boost/core/enable_if.hpp>
#include <boost/core/ref.hpp>
#include <boost/fusion/sequence/intrinsic/empty.hpp>
#include <boost/fusion/algorithm/iteration/fold.hpp>
#include <boost/ref.hpp>
namespace fusion = boost::fusion;
namespace mpl = boost::mpl;

View File

@ -9,7 +9,7 @@
#include <boost/fusion/functional/adapter/unfused.hpp>
#include <boost/detail/lightweight_test.hpp>
#include <boost/noncopyable.hpp>
#include <boost/core/noncopyable.hpp>
#include <boost/mpl/empty_base.hpp>
#include <boost/mpl/identity.hpp>

View File

@ -9,7 +9,7 @@
#include <boost/fusion/functional/adapter/unfused_typed.hpp>
#include <boost/detail/lightweight_test.hpp>
#include <boost/noncopyable.hpp>
#include <boost/core/noncopyable.hpp>
#include <boost/mpl/empty_base.hpp>
#include <boost/mpl/identity.hpp>

View File

@ -13,7 +13,7 @@
#include <boost/mpl/equal.hpp>
#include <boost/ref.hpp>
#include <boost/core/ref.hpp>
#ifndef BOOST_NO_CXX11_HDR_FUNCTIONAL
#include <functional>
#endif

View File

@ -0,0 +1,193 @@
/*=============================================================================
Copyright (c) 2022 Denis Mikhailov
Distributed under 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)
==============================================================================*/
#include <boost/detail/lightweight_test.hpp>
#include <boost/fusion/container/vector/vector.hpp>
#include <boost/fusion/container/map/map.hpp>
#include <boost/fusion/container/generation/make_map.hpp>
#include <boost/fusion/algorithm/auxiliary/copy.hpp>
#include <boost/fusion/adapted/mpl.hpp>
#include <boost/fusion/sequence/io/out.hpp>
#include <boost/fusion/container/generation/make_vector.hpp>
#include <boost/fusion/sequence/comparison/equal_to.hpp>
#include <boost/fusion/view/identity_view/identity_view.hpp>
#include <boost/fusion/sequence/intrinsic/begin.hpp>
#include <boost/fusion/sequence/intrinsic/at.hpp>
#include <boost/fusion/sequence/intrinsic/value_at.hpp>
#include <boost/fusion/sequence/intrinsic/at_key.hpp>
#include <boost/fusion/sequence/intrinsic/value_at_key.hpp>
#include <boost/fusion/sequence/intrinsic/has_key.hpp>
#include <boost/fusion/sequence/intrinsic/begin.hpp>
#include <boost/fusion/iterator/next.hpp>
#include <boost/fusion/iterator/prior.hpp>
#include <boost/fusion/iterator/advance.hpp>
#include <boost/fusion/iterator/deref.hpp>
#include <boost/fusion/iterator/distance.hpp>
#include <boost/fusion/iterator/key_of.hpp>
#include <boost/fusion/iterator/deref_data.hpp>
#include <boost/fusion/iterator/value_of_data.hpp>
#include <boost/fusion/support/pair.hpp>
#include <boost/fusion/support/category_of.hpp>
#include <boost/mpl/range_c.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/mpl/at.hpp>
#include <boost/mpl/map.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/static_assert.hpp>
#include <boost/typeof/typeof.hpp>
#include <boost/type_traits/remove_reference.hpp>
struct abstract
{
virtual void foo() = 0;
};
int
main()
{
using namespace boost::fusion;
std::cout << tuple_open('[');
std::cout << tuple_close(']');
std::cout << tuple_delimiter(", ");
/// Testing the identity_view
{
typedef boost::mpl::range_c<int, 5, 9> sequence_type;
sequence_type sequence;
typedef identity_view<sequence_type> xform_type;
xform_type xform(sequence);
std::cout << xform << std::endl;
BOOST_TEST((xform == make_vector(5, 6, 7, 8)));
typedef boost::fusion::result_of::begin<xform_type>::type first_type;
first_type first_it(boost::fusion::begin(xform));
typedef boost::fusion::result_of::next<first_type>::type next_type;
next_type next_it(boost::fusion::next(first_it));
BOOST_TEST((*next_it == 6));
BOOST_TEST((*boost::fusion::prior(next_it) == 5));
BOOST_TEST((boost::fusion::distance(first_it, next_it) == 1));
BOOST_TEST((*boost::fusion::advance_c<3>(boost::fusion::begin(xform)) == 8));
BOOST_TEST((boost::fusion::at_c<2>(xform) == 7));
BOOST_MPL_ASSERT((boost::is_same<boost::fusion::result_of::value_at_c<xform_type, 0>::type, boost::mpl::integral_c<int, 5> >));
}
{
typedef vector<int, int, int, int, int> sequence_type;
sequence_type seq;
identity_view<sequence_type> ident(seq);
copy(make_vector(1, 2, 3, 4, 5), ident);
std::cout << seq << std::endl;
BOOST_TEST((seq == make_vector(1, 2, 3, 4, 5)));
}
/// Associative
{
typedef map<
pair<int, char>
, pair<double, std::string>
, pair<abstract, int> >
map_type;
typedef identity_view<map_type> transformed_type;
BOOST_MPL_ASSERT((traits::is_associative<transformed_type>));
BOOST_MPL_ASSERT((traits::is_random_access<transformed_type>));
map_type m(
make_pair<int>('X')
, make_pair<double>("Men")
, make_pair<abstract>(2));
transformed_type t(m);
std::cout << at_key<int>(t) << std::endl;
std::cout << at_key<double>(t) << std::endl;
std::cout << at_key<abstract>(t) << std::endl;
BOOST_TEST(at_key<int>(t) == 'X');
BOOST_TEST(at_key<double>(t) == "Men");
BOOST_TEST(at_key<abstract>(t) == 2);
BOOST_STATIC_ASSERT((
boost::is_same<boost::fusion::result_of::value_at_key<transformed_type, int>::type, char>::value));
BOOST_STATIC_ASSERT((
boost::is_same<boost::fusion::result_of::value_at_key<transformed_type, double>::type, std::string>::value));
BOOST_STATIC_ASSERT((
boost::is_same<boost::fusion::result_of::value_at_key<transformed_type, abstract>::type, int>::value));
std::cout << t << std::endl;
BOOST_STATIC_ASSERT((boost::fusion::result_of::has_key<transformed_type, int>::value));
BOOST_STATIC_ASSERT((boost::fusion::result_of::has_key<transformed_type, double>::value));
BOOST_STATIC_ASSERT((boost::fusion::result_of::has_key<transformed_type, abstract>::value));
BOOST_STATIC_ASSERT((!boost::fusion::result_of::has_key<transformed_type, std::string>::value));
std::cout << deref_data(begin(t)) << std::endl;
std::cout << deref_data(boost::fusion::next(begin(t))) << std::endl;
BOOST_TEST(deref_data(begin(t)) == 'X');
BOOST_TEST(deref_data(boost::fusion::next(begin(t))) == "Men");
BOOST_TEST(deref_data(boost::fusion::next(next(begin(t)))) == 2);
BOOST_STATIC_ASSERT((boost::is_same<boost::fusion::result_of::key_of<boost::fusion::result_of::begin<transformed_type>::type>::type, int>::value));
BOOST_STATIC_ASSERT((boost::is_same<boost::fusion::result_of::key_of<boost::fusion::result_of::next<boost::fusion::result_of::begin<transformed_type>::type>::type>::type, double>::value));
BOOST_STATIC_ASSERT((boost::is_same<boost::fusion::result_of::key_of<boost::fusion::result_of::next<boost::fusion::result_of::next<boost::fusion::result_of::begin<transformed_type>::type>::type>::type>::type, abstract>::value));
BOOST_STATIC_ASSERT((boost::is_same<boost::fusion::result_of::value_of_data<boost::fusion::result_of::begin<transformed_type>::type>::type, char>::value));
BOOST_STATIC_ASSERT((boost::is_same<boost::fusion::result_of::value_of_data<boost::fusion::result_of::next<boost::fusion::result_of::begin<transformed_type>::type>::type>::type, std::string>::value));
BOOST_STATIC_ASSERT((boost::is_same<boost::fusion::result_of::value_of_data<boost::fusion::result_of::next<boost::fusion::result_of::next<boost::fusion::result_of::begin<transformed_type>::type>::type>::type>::type, int>::value));
// Test random access interface.
pair<int, char> a = at_c<0>(t); (void) a;
pair<double, std::string> b = at_c<1>(t);
pair<abstract, int> c = at_c<2>(t);
(void)c;
typedef boost::fusion::result_of::begin<transformed_type>::type first;
typedef boost::fusion::result_of::next<first>::type second;
typedef boost::fusion::result_of::next<second>::type third;
BOOST_MPL_ASSERT((boost::is_same<boost::fusion::result_of::value_of<first>::type, boost::fusion::pair<int, char> >));
BOOST_MPL_ASSERT((boost::is_same<boost::fusion::result_of::value_of<second>::type, boost::fusion::pair<double, std::string> >));
BOOST_MPL_ASSERT((boost::is_same<boost::fusion::result_of::value_of<third>::type, boost::fusion::pair<abstract, int> >));
}
{
// compile test only
// make sure result_of::deref_data returns a reference
typedef map<pair<float, int> > map_type;
typedef identity_view<map_type> transformed_type;
typedef boost::fusion::result_of::begin<transformed_type>::type i_type;
typedef boost::fusion::result_of::deref_data<i_type>::type r_type;
BOOST_STATIC_ASSERT((boost::is_same<r_type, int&>::value));
}
{
// compile test only
// make sure result_of::deref_data is const correct
typedef map<pair<float, int> > const map_type;
typedef identity_view<map_type> transformed_type;
typedef boost::fusion::result_of::begin<transformed_type>::type i_type;
typedef boost::fusion::result_of::deref_data<i_type>::type r_type;
BOOST_STATIC_ASSERT((boost::is_same<r_type, int const&>::value));
}
{
// compile test only
// make sure result_of::deref_data will not const for non-constant references
typedef map<pair<float, int&> > const map_type;
typedef identity_view<map_type> transformed_type;
typedef boost::fusion::result_of::begin<transformed_type>::type i_type;
typedef boost::fusion::result_of::deref_data<i_type>::type r_type;
BOOST_STATIC_ASSERT((boost::is_same<r_type, int&>::value));
}
return boost::report_errors();
}

View File

@ -1,5 +1,6 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2021-2022 Denis Mikhailov
Distributed under 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)
@ -15,6 +16,9 @@
#include <boost/fusion/sequence/intrinsic/begin.hpp>
#include <boost/fusion/sequence/intrinsic/at.hpp>
#include <boost/fusion/sequence/intrinsic/value_at.hpp>
#include <boost/fusion/sequence/intrinsic/has_key.hpp>
#include <boost/fusion/sequence/intrinsic/at_key.hpp>
#include <boost/fusion/sequence/intrinsic/value_at_key.hpp>
#include <boost/fusion/iterator/next.hpp>
#include <boost/fusion/iterator/prior.hpp>
#include <boost/fusion/iterator/deref.hpp>
@ -102,6 +106,21 @@ main()
BOOST_TEST((at_c<2>(rev) == pair2("two")));
BOOST_TEST((at_c<3>(rev) == pair1("one")));
BOOST_TEST((at_c<4>(rev) == pair0("zero")));
BOOST_TEST(( has_key< boost::mpl::int_<0> >(rev)
&& has_key< boost::mpl::int_<4> >(rev)
&& !has_key< boost::mpl::int_<-1> >(rev)
&& !has_key< boost::mpl::int_<5> >(rev) ));
BOOST_TEST((at_key< boost::mpl::int_<0> >(rev) == "zero"));
BOOST_TEST((at_key< boost::mpl::int_<1> >(rev) == "one"));
BOOST_TEST((at_key< boost::mpl::int_<2> >(rev) == "two"));
BOOST_TEST((at_key< boost::mpl::int_<3> >(rev) == "three"));
BOOST_TEST((at_key< boost::mpl::int_<4> >(rev) == "four"));
BOOST_TEST(( (at_key< boost::mpl::int_<0> >(rev) = "new_zero") == "new_zero"
&& at_key< boost::mpl::int_<0> >(rev) == "new_zero" ));
BOOST_MPL_ASSERT((boost::mpl::and_<result_of::has_key<view_type, boost::mpl::int_<0> >
, boost::mpl::not_<result_of::has_key<view_type, boost::mpl::int_<-1> > > >));
BOOST_MPL_ASSERT((boost::is_same<result_of::at_key<view_type, boost::mpl::int_<0> >::type, std::string&>));
BOOST_MPL_ASSERT((boost::is_same<result_of::value_at_key<view_type, boost::mpl::int_<0> >::type, std::string>));
}
return boost::report_errors();

View File

@ -21,6 +21,10 @@
#include <boost/static_assert.hpp>
#include "tree.hpp"
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
struct ostream_fun
{
ostream_fun(std::ostream &sout)
@ -34,6 +38,9 @@ struct ostream_fun
private:
std::ostream & sout_;
};
#ifdef _MSC_VER
# pragma warning(pop)
#endif
template<typename Tree>
void

View File

@ -1,11 +1,14 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2022 Denis Mikhailov
Distributed under 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)
==============================================================================*/
#include <boost/detail/lightweight_test.hpp>
#include <boost/fusion/container/vector/vector.hpp>
#include <boost/fusion/container/map/map.hpp>
#include <boost/fusion/container/generation/make_map.hpp>
#include <boost/fusion/adapted/mpl.hpp>
#include <boost/fusion/sequence/io/out.hpp>
#include <boost/fusion/container/generation/make_vector.hpp>
@ -14,15 +17,29 @@
#include <boost/fusion/sequence/intrinsic/begin.hpp>
#include <boost/fusion/sequence/intrinsic/at.hpp>
#include <boost/fusion/sequence/intrinsic/value_at.hpp>
#include <boost/fusion/sequence/intrinsic/at_key.hpp>
#include <boost/fusion/sequence/intrinsic/value_at_key.hpp>
#include <boost/fusion/sequence/intrinsic/has_key.hpp>
#include <boost/fusion/sequence/intrinsic/begin.hpp>
#include <boost/fusion/iterator/next.hpp>
#include <boost/fusion/iterator/prior.hpp>
#include <boost/fusion/iterator/advance.hpp>
#include <boost/fusion/iterator/deref.hpp>
#include <boost/fusion/iterator/distance.hpp>
#include <boost/fusion/iterator/key_of.hpp>
#include <boost/fusion/iterator/deref_data.hpp>
#include <boost/fusion/iterator/value_of_data.hpp>
#include <boost/fusion/support/pair.hpp>
#include <boost/fusion/support/category_of.hpp>
#include <boost/mpl/range_c.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/mpl/at.hpp>
#include <boost/mpl/map.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/static_assert.hpp>
#include <boost/typeof/typeof.hpp>
#include <boost/type_traits/remove_reference.hpp>
struct square
{
@ -60,6 +77,85 @@ struct add
}
};
struct abstract
{
virtual void foo() = 0;
};
struct functor
{
typedef boost::fusion::pair<short, char> pair_0;
typedef boost::fusion::pair<double, std::string> pair_1;
typedef boost::fusion::pair<abstract, long> pair_2;
typedef boost::mpl::map<
boost::mpl::pair< boost::fusion::pair<int, char> , pair_0>
, boost::mpl::pair< pair_1 , pair_1>
, boost::mpl::pair< boost::fusion::pair<abstract, int> , pair_2>
> m;
template<typename Sig>
struct result;
template<class F, class T>
struct result<F(T)>
: boost::mpl::at<
m,
typename boost::remove_reference<T>::type
>
{};
pair_0 operator() (const boost::fusion::pair<int, char>& arg) const
{
return pair_0(arg.second);
}
pair_1 operator() (const pair_1 & arg) const
{
return pair_1(arg.second + "_transformed");
}
pair_2 operator() (const boost::fusion::pair<abstract, int>& arg) const
{
return pair_2(arg.second);
}
};
struct simple_identity
{
template<typename Sig>
struct result;
template<typename U>
struct result<simple_identity(U)>
{
typedef U type;
};
template<typename T>
T& operator() (T& arg) const
{
return arg;
}
};
struct simple_identity_nonref
{
template<typename Sig>
struct result;
template<typename U>
struct result<simple_identity_nonref(U)>
: boost::remove_reference<U>
{};
template<typename T>
T operator() (T arg) const
{
return arg;
}
};
int
main()
{
@ -110,6 +206,183 @@ main()
BOOST_MPL_ASSERT((boost::is_same<boost::fusion::result_of::value_at_c<xform_type, 0>::type, int>));
}
/// Associative
{
typedef map<
pair<int, char>
, pair<double, std::string>
, pair<abstract, int> >
map_type;
typedef transform_view<map_type, functor> transformed_type;
BOOST_MPL_ASSERT((traits::is_associative<transformed_type>));
BOOST_MPL_ASSERT((traits::is_random_access<transformed_type>));
map_type m(
make_pair<int>('X')
, make_pair<double>("Men")
, make_pair<abstract>(2));
transformed_type t(m, functor());
std::cout << at_key<short>(t) << std::endl;
std::cout << at_key<double>(t) << std::endl;
std::cout << at_key<abstract>(t) << std::endl;
BOOST_TEST(at_key<short>(t) == 'X');
BOOST_TEST(at_key<double>(t) == "Men_transformed");
BOOST_TEST(at_key<abstract>(t) == 2);
BOOST_STATIC_ASSERT((
boost::is_same<boost::fusion::result_of::value_at_key<transformed_type, short>::type, char>::value));
BOOST_STATIC_ASSERT((
boost::is_same<boost::fusion::result_of::value_at_key<transformed_type, double>::type, std::string>::value));
BOOST_STATIC_ASSERT((
boost::is_same<boost::fusion::result_of::value_at_key<transformed_type, abstract>::type, long>::value));
std::cout << t << std::endl;
BOOST_STATIC_ASSERT((boost::fusion::result_of::has_key<transformed_type, short>::value));
BOOST_STATIC_ASSERT((boost::fusion::result_of::has_key<transformed_type, double>::value));
BOOST_STATIC_ASSERT((boost::fusion::result_of::has_key<transformed_type, abstract>::value));
BOOST_STATIC_ASSERT((!boost::fusion::result_of::has_key<transformed_type, std::string>::value));
std::cout << deref_data(begin(t)) << std::endl;
std::cout << deref_data(boost::fusion::next(begin(t))) << std::endl;
BOOST_TEST(deref_data(begin(t)) == 'X');
BOOST_TEST(deref_data(boost::fusion::next(begin(t))) == "Men_transformed");
BOOST_TEST(deref_data(boost::fusion::next(next(begin(t)))) == 2);
BOOST_STATIC_ASSERT((boost::is_same<boost::fusion::result_of::key_of<boost::fusion::result_of::begin<transformed_type>::type>::type, short>::value));
BOOST_STATIC_ASSERT((boost::is_same<boost::fusion::result_of::key_of<boost::fusion::result_of::next<boost::fusion::result_of::begin<transformed_type>::type>::type>::type, double>::value));
BOOST_STATIC_ASSERT((boost::is_same<boost::fusion::result_of::key_of<boost::fusion::result_of::next<boost::fusion::result_of::next<boost::fusion::result_of::begin<transformed_type>::type>::type>::type>::type, abstract>::value));
BOOST_STATIC_ASSERT((boost::is_same<boost::fusion::result_of::value_of_data<boost::fusion::result_of::begin<transformed_type>::type>::type, char>::value));
BOOST_STATIC_ASSERT((boost::is_same<boost::fusion::result_of::value_of_data<boost::fusion::result_of::next<boost::fusion::result_of::begin<transformed_type>::type>::type>::type, std::string>::value));
BOOST_STATIC_ASSERT((boost::is_same<boost::fusion::result_of::value_of_data<boost::fusion::result_of::next<boost::fusion::result_of::next<boost::fusion::result_of::begin<transformed_type>::type>::type>::type>::type, long>::value));
// Test random access interface.
pair<short, char> a = at_c<0>(t); (void) a;
pair<double, std::string> b = at_c<1>(t);
pair<abstract, int> c = at_c<2>(t);
(void)c;
typedef boost::fusion::result_of::begin<transformed_type>::type first;
typedef boost::fusion::result_of::next<first>::type second;
typedef boost::fusion::result_of::next<second>::type third;
BOOST_MPL_ASSERT((boost::is_same<boost::fusion::result_of::value_of<first>::type, boost::fusion::pair<short, char> >));
BOOST_MPL_ASSERT((boost::is_same<boost::fusion::result_of::value_of<second>::type, boost::fusion::pair<double, std::string> >));
BOOST_MPL_ASSERT((boost::is_same<boost::fusion::result_of::value_of<third>::type, boost::fusion::pair<abstract, long> >));
}
{
typedef map<
pair<int, char>
, pair<double, std::string>
, pair<abstract, int> >
map_type;
typedef transform_view<map_type, simple_identity> transformed_type;
BOOST_MPL_ASSERT((traits::is_associative<transformed_type>));
BOOST_MPL_ASSERT((traits::is_random_access<transformed_type>));
map_type m(
make_pair<int>('X')
, make_pair<double>("Men")
, make_pair<abstract>(2));
transformed_type t(m, simple_identity());
std::cout << at_key<int>(t) << std::endl;
std::cout << at_key<double>(t) << std::endl;
std::cout << at_key<abstract>(t) << std::endl;
BOOST_TEST(at_key<int>(t) == 'X');
BOOST_TEST(at_key<double>(t) == "Men");
BOOST_TEST(at_key<abstract>(t) == 2);
BOOST_STATIC_ASSERT((
boost::is_same<boost::fusion::result_of::value_at_key<transformed_type, int>::type, char>::value));
BOOST_STATIC_ASSERT((
boost::is_same<boost::fusion::result_of::value_at_key<transformed_type, double>::type, std::string>::value));
BOOST_STATIC_ASSERT((
boost::is_same<boost::fusion::result_of::value_at_key<transformed_type, abstract>::type, int>::value));
std::cout << t << std::endl;
BOOST_STATIC_ASSERT((boost::fusion::result_of::has_key<transformed_type, int>::value));
BOOST_STATIC_ASSERT((boost::fusion::result_of::has_key<transformed_type, double>::value));
BOOST_STATIC_ASSERT((boost::fusion::result_of::has_key<transformed_type, abstract>::value));
BOOST_STATIC_ASSERT((!boost::fusion::result_of::has_key<transformed_type, std::string>::value));
std::cout << deref_data(begin(t)) << std::endl;
std::cout << deref_data(boost::fusion::next(begin(t))) << std::endl;
BOOST_TEST(deref_data(begin(t)) == 'X');
BOOST_TEST(deref_data(boost::fusion::next(begin(t))) == "Men");
BOOST_TEST(deref_data(boost::fusion::next(next(begin(t)))) == 2);
BOOST_STATIC_ASSERT((boost::is_same<boost::fusion::result_of::key_of<boost::fusion::result_of::begin<transformed_type>::type>::type, int>::value));
BOOST_STATIC_ASSERT((boost::is_same<boost::fusion::result_of::key_of<boost::fusion::result_of::next<boost::fusion::result_of::begin<transformed_type>::type>::type>::type, double>::value));
BOOST_STATIC_ASSERT((boost::is_same<boost::fusion::result_of::key_of<boost::fusion::result_of::next<boost::fusion::result_of::next<boost::fusion::result_of::begin<transformed_type>::type>::type>::type>::type, abstract>::value));
BOOST_STATIC_ASSERT((boost::is_same<boost::fusion::result_of::value_of_data<boost::fusion::result_of::begin<transformed_type>::type>::type, char>::value));
BOOST_STATIC_ASSERT((boost::is_same<boost::fusion::result_of::value_of_data<boost::fusion::result_of::next<boost::fusion::result_of::begin<transformed_type>::type>::type>::type, std::string>::value));
BOOST_STATIC_ASSERT((boost::is_same<boost::fusion::result_of::value_of_data<boost::fusion::result_of::next<boost::fusion::result_of::next<boost::fusion::result_of::begin<transformed_type>::type>::type>::type>::type, int>::value));
// Test random access interface.
pair<int, char> a = at_c<0>(t); (void) a;
pair<double, std::string> b = at_c<1>(t);
pair<abstract, int> c = at_c<2>(t);
(void)c;
typedef boost::fusion::result_of::begin<transformed_type>::type first;
typedef boost::fusion::result_of::next<first>::type second;
typedef boost::fusion::result_of::next<second>::type third;
// BOOST_MPL_ASSERT((boost::is_same<boost::fusion::result_of::value_of<first>::type, boost::fusion::pair<int, char> >));
// BOOST_MPL_ASSERT((boost::is_same<boost::fusion::result_of::value_of<second>::type, boost::fusion::pair<double, std::string> >));
// BOOST_MPL_ASSERT((boost::is_same<boost::fusion::result_of::value_of<third>::type, boost::fusion::pair<abstract, int> >));
}
{
// compile test only
// make sure result_of::deref_data returns a reference
typedef map<pair<float, int> > map_type;
typedef transform_view<map_type, simple_identity> transformed_type;
typedef boost::fusion::result_of::begin<transformed_type>::type i_type;
typedef boost::fusion::result_of::deref_data<i_type>::type r_type;
BOOST_STATIC_ASSERT((boost::is_same<r_type, int&>::value));
}
{
// compile test only
// make sure result_of::deref_data is const correct
typedef map<pair<float, int> > const map_type;
typedef transform_view<map_type, simple_identity> transformed_type;
typedef boost::fusion::result_of::begin<transformed_type>::type i_type;
typedef boost::fusion::result_of::deref_data<i_type>::type r_type;
BOOST_STATIC_ASSERT((boost::is_same<r_type, int const&>::value));
}
{
// compile test only
// make sure result_of::deref_data will not return a reference to temp object
typedef map<pair<float, int> > const map_type;
typedef transform_view<map_type, simple_identity_nonref> transformed_type;
typedef boost::fusion::result_of::begin<transformed_type>::type i_type;
typedef boost::fusion::result_of::deref_data<i_type>::type r_type;
BOOST_STATIC_ASSERT((boost::is_same<r_type, int>::value));
}
{
// compile test only
// make sure result_of::deref_data will not const for non-constant references
typedef map<pair<float, int&> > const map_type;
typedef transform_view<map_type, simple_identity> transformed_type;
typedef boost::fusion::result_of::begin<transformed_type>::type i_type;
typedef boost::fusion::result_of::deref_data<i_type>::type r_type;
BOOST_STATIC_ASSERT((boost::is_same<r_type, int&>::value));
}
return boost::report_errors();
}

View File

@ -0,0 +1,50 @@
/*=============================================================================
Copyright (c) 2022 Denis Mikhailov
Distributed under 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)
==============================================================================*/
#include <boost/fusion/support/tag_of.hpp>
#include <boost/static_assert.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/core/enable_if.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/if.hpp>
namespace mpl = boost::mpl;
template<typename T>
struct my_is_implicitly_reflectable;
namespace boost { namespace fusion
{
struct boost_my_reflectable_tag;
namespace detail
{
template<typename Sequence>
struct tag_of_fallback<Sequence, typename boost::enable_if<boost::is_same<Sequence, Sequence> >::type>
{
typedef typename mpl::if_<my_is_implicitly_reflectable<Sequence>
, boost_my_reflectable_tag
, non_fusion_tag
>::type type;
};
}
}}
struct reflectable {};
struct non_reflectable {};
template<typename T>
struct my_is_implicitly_reflectable : mpl::false_ {};
template<>
struct my_is_implicitly_reflectable<reflectable> : mpl::true_ {};
typedef boost::fusion::traits::tag_of<reflectable>::type ReflectableTag;
typedef boost::fusion::traits::tag_of<non_reflectable>::type NonReflectableTag;
BOOST_STATIC_ASSERT((boost::is_same<ReflectableTag, boost::fusion::boost_my_reflectable_tag>::value));
BOOST_STATIC_ASSERT((boost::is_same<NonReflectableTag, boost::fusion::non_fusion_tag>::value));
int
main() { }

View File

@ -0,0 +1,24 @@
/*=============================================================================
Copyright (c) 2022 niXman (github dot nixman at pm.me)
Distributed under 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)
==============================================================================*/
#include <boost/fusion/support/pair.hpp>
struct noncopyable_type {
noncopyable_type(const noncopyable_type &) = delete;
noncopyable_type& operator=(const noncopyable_type &) = delete;
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
noncopyable_type(noncopyable_type &&) = default;
noncopyable_type& operaotr=(noncopyable_type &&) = default;
#endif
};
int main() {
using namespace boost::fusion;
pair<int, noncopyable_type> val = make_pair<int>(noncopyable_type{});
return 0;
}