mirror of
https://github.com/boostorg/mpl.git
synced 2026-08-04 04:34:09 +02:00
Compare commits
95 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9c0f98f088 | |||
| 3d8a60ed6a | |||
| e01a10925d | |||
| 273db79266 | |||
| c7df450a81 | |||
| ac67f5952e | |||
| 758a7f6c6a | |||
| 95733a1c45 | |||
| e44b2ae761 | |||
| 42c794ad42 | |||
| 270f33f679 | |||
| 41d036aea2 | |||
| 44ebb23b6a | |||
| b877c35841 | |||
| b295845afe | |||
| 71d523d949 | |||
| 3c1910797c | |||
| f48fd09d02 | |||
| 29c10a72a1 | |||
| 238cda5fb9 | |||
| 2371f85461 | |||
| f311a495ed | |||
| dbcc7b8c7b | |||
| ef60815c66 | |||
| 523bc5a782 | |||
| a81b00a5f0 | |||
| 13e4e53259 | |||
| ecb4d2a89f | |||
| 4265eb6319 | |||
| 525c773836 | |||
| efc2a862a3 | |||
| 3b126bdf8c | |||
| 869438d60b | |||
| f023a68f78 | |||
| bc8b860037 | |||
| 7a15566169 | |||
| e1cb5fe91e | |||
| 9153e25b63 | |||
| 1f463f62ef | |||
| daaf813cee | |||
| 53d9af7e8f | |||
| 1f64380f62 | |||
| 4d1b6b3dc7 | |||
| b4fe64a73c | |||
| 7c9701ee5c | |||
| dd5f2d9c03 | |||
| 0e262c22a0 | |||
| 7cd0559ce8 | |||
| 10e7609c67 | |||
| 133a980224 | |||
| 95f79d95a5 | |||
| d5dcd7abb1 | |||
| 2531010a0a | |||
| 90951ea9e4 | |||
| 8a8b7b134e | |||
| 82e81345f2 | |||
| 0f5451623c | |||
| eaa3f26c9c | |||
| 07a5457dcd | |||
| f0f1680f3c | |||
| 2be4714cc5 | |||
| 952471841f | |||
| c8fe35643d | |||
| feb7835e62 | |||
| faf17ec858 | |||
| 77cda02d85 | |||
| f807edab2e | |||
| fc18efc259 | |||
| c7798600d6 | |||
| 1c02715e49 | |||
| 6fd793c787 | |||
| ff4944f0ec | |||
| 6a0f617a6c | |||
| a30e4a49a8 | |||
| c296697981 | |||
| c7997e039d | |||
| a9a1eddba8 | |||
| cddc55a6c4 | |||
| 332389f50e | |||
| 6064a97e3a | |||
| a46a787a49 | |||
| 9bbc806090 | |||
| 64f50f82aa | |||
| 6b37526352 | |||
| b2d6e667a0 | |||
| a469a67ab8 | |||
| e296279084 | |||
| 07bff9e105 | |||
| 82890fd03e | |||
| d6bc9845ba | |||
| afe0e6bbc4 | |||
| bde91646cf | |||
| aec459a49c | |||
| 1169c26856 | |||
| 6893e5e5de |
+175
@@ -0,0 +1,175 @@
|
||||
# Copyright 2016 Peter Dimov
|
||||
# Copyright 2017, 2018 James E. King III
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#
|
||||
# Generic Travis CI build script for boostorg repositories
|
||||
# See: https://github.com/jeking3/boost-ci
|
||||
#
|
||||
# Instructions for customizing this script for your library:
|
||||
#
|
||||
# 1. Customize the compilers and language levels you want in the 'jobs'.
|
||||
# 2. If you have more than include/, src/, test/, example/, examples/, or
|
||||
# tools/ directories, modify your Travis CI project and add the environment
|
||||
# variable DEPINST. For example if your build uses code in "bench/" and
|
||||
# "fog/" directories, then set DEPINST to the following:
|
||||
# --include bench --include fog
|
||||
# 3. If you want to enable Coverity Scan, you need to provide the environment
|
||||
# variables COVERITY_SCAN_TOKEN and COVERITY_SCAN_NOTIFICATION_EMAIL in
|
||||
# your github settings.
|
||||
# 4. Enable pull request builds in your boostorg/<library> account.
|
||||
#
|
||||
# That's it - the scripts will do everything else for you.
|
||||
|
||||
sudo: false
|
||||
dist: trusty
|
||||
language: cpp
|
||||
|
||||
env:
|
||||
global:
|
||||
# see: http://www.boost.org/build/doc/html/bbv2/overview/invocation.html#bbv2.overview.invocation.properties
|
||||
# to use the default for a given environment, comment it out; recommend you build debug and release however..
|
||||
# - B2_ADDRESS_MODEL=address-model=64,32
|
||||
# - B2_LINK=link=shared,static
|
||||
# - B2_THREADING=threading=multi,single
|
||||
- B2_VARIANT=variant=release,debug
|
||||
|
||||
install:
|
||||
- git clone https://github.com/jeking3/boost-ci.git boost-ci
|
||||
- cp -pr boost-ci/ci boost-ci/.codecov.yml .
|
||||
- source ci/travis/install.sh
|
||||
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- binutils-gold
|
||||
- gdb
|
||||
- libc6-dbg
|
||||
|
||||
branches:
|
||||
only:
|
||||
- develop
|
||||
- master
|
||||
|
||||
script:
|
||||
- cd $BOOST_ROOT/libs/$SELF
|
||||
- ci/travis/build.sh
|
||||
|
||||
#
|
||||
# Default toolsets in Ubuntu
|
||||
#
|
||||
# trusty xenial bionic
|
||||
# 14.04 16.04 18.04
|
||||
# ------ ------ ------
|
||||
# clang 3.4 3.8 6.0
|
||||
# gcc 4.8.2 5.3.1 7.3.0
|
||||
#
|
||||
|
||||
anchors:
|
||||
clang-34: &clang-34 { apt: { packages: [ "clang-3.4" ], sources: [ "llvm-toolchain-trusty-3.4" ] } }
|
||||
clang-38: &clang-38 { apt: { packages: [ "clang-3.8",
|
||||
"libstdc++-6-dev" ], sources: [ "llvm-toolchain-trusty-3.8",
|
||||
"ubuntu-toolchain-r-test" ] } }
|
||||
clang-4: &clang-4 { apt: { packages: [ "clang-4.0",
|
||||
"libstdc++-6-dev" ], sources: [ "llvm-toolchain-trusty-4.0",
|
||||
"ubuntu-toolchain-r-test" ] } }
|
||||
clang-5: &clang-5 { apt: { packages: [ "clang-5.0",
|
||||
"libstdc++-7-dev" ], sources: [ "llvm-toolchain-trusty-5.0",
|
||||
"ubuntu-toolchain-r-test" ] } }
|
||||
clang-6: &clang-6 { apt: { packages: [ "clang-6.0",
|
||||
"libc++-dev",
|
||||
"libstdc++-8-dev",
|
||||
"valgrind" ], sources: [ "llvm-toolchain-trusty-6.0",
|
||||
"ubuntu-toolchain-r-test" ] } }
|
||||
gcc-44: &gcc-44 { apt: { packages: [ "g++-4.4" ], sources: [ "ubuntu-toolchain-r-test" ] } }
|
||||
gcc-46: &gcc-46 { apt: { packages: [ "g++-4.6" ], sources: [ "ubuntu-toolchain-r-test" ] } }
|
||||
gcc-48: &gcc-48 { apt: { packages: [ "g++-4.8" ], sources: [ "ubuntu-toolchain-r-test" ] } }
|
||||
gcc-5: &gcc-5 { apt: { packages: [ "g++-5" ], sources: [ "ubuntu-toolchain-r-test" ] } }
|
||||
gcc-6: &gcc-6 { apt: { packages: [ "g++-6" ], sources: [ "ubuntu-toolchain-r-test" ] } }
|
||||
gcc-7: &gcc-7 { apt: { packages: [ "g++-7" ], sources: [ "ubuntu-toolchain-r-test" ] } }
|
||||
gcc-8: &gcc-8 { apt: { packages: [ "g++-8" ], sources: [ "ubuntu-toolchain-r-test" ] } }
|
||||
|
||||
jobs:
|
||||
allow_failures:
|
||||
- env:
|
||||
- COPY="all the environment settings from your job"
|
||||
|
||||
include:
|
||||
# libstdc++
|
||||
- { os: "linux", env: [ "TOOLSET=gcc-4.4", "CXXSTD=98,0x" ], addons: *gcc-44 }
|
||||
- { os: "linux", env: [ "TOOLSET=gcc-4.6", "CXXSTD=03,0x" ], addons: *gcc-46 }
|
||||
- { os: "linux", env: [ "TOOLSET=gcc-4.8", "CXXSTD=03,11" ], addons: *gcc-48 }
|
||||
- { os: "linux", env: [ "TOOLSET=gcc-5", "CXXSTD=03,11" ], addons: *gcc-5 }
|
||||
- { os: "linux", env: [ "TOOLSET=gcc-6", "CXXSTD=03,11,14" ], addons: *gcc-6 }
|
||||
- { os: "linux", env: [ "TOOLSET=gcc-7", "CXXSTD=03,11,14,17" ], addons: *gcc-7 }
|
||||
- { os: "linux", env: [ "TOOLSET=gcc-8", "CXXSTD=03,11,14,17,2a" ], addons: *gcc-8 }
|
||||
- { os: "linux", env: [ "TOOLSET=clang-3.4", "CXXSTD=03,11" ], addons: *clang-34 }
|
||||
- { os: "linux", env: [ "TOOLSET=clang-3.8", "CXXSTD=03,11,14" ], addons: *clang-38 }
|
||||
- { os: "linux", env: [ "TOOLSET=clang-4.0", "CXXSTD=03,11,14" ], addons: *clang-4 }
|
||||
- { os: "linux", env: [ "TOOLSET=clang-5.0", "CXXSTD=03,11,14,17" ], addons: *clang-5 }
|
||||
- { os: "linux", env: [ "TOOLSET=clang-6.0", "CXXSTD=03,11,14,17,2a" ], addons: *clang-6 }
|
||||
# libc++
|
||||
- { os: "linux", env: [ "TOOLSET=clang-6.0", "CXXSTD=03,11,14,17,2a",
|
||||
"CXXFLAGS=-stdlib=libc++" ], addons: *clang-6 }
|
||||
# the rvm environment on osx is taking over basic commands like "cd" and breaking things!
|
||||
# - { os: "osx" , env: [ "COMMENT=libc++",
|
||||
# "TOOLSET=clang", "CXXSTD=03,11,14" ] }
|
||||
|
||||
- os: linux
|
||||
env:
|
||||
- COMMENT=codecov.io
|
||||
- TOOLSET=gcc-7
|
||||
- DEFINES="define=BOOST_NO_STRESS_TEST=1"
|
||||
addons: *gcc-7
|
||||
script:
|
||||
- pushd /tmp && git clone https://github.com/linux-test-project/lcov.git && export PATH=/tmp/lcov/bin:$PATH && which lcov && lcov --version && popd
|
||||
- cd $BOOST_ROOT/libs/$SELF
|
||||
- ci/travis/codecov.sh
|
||||
|
||||
- os: linux
|
||||
env:
|
||||
- COMMENT=cppcheck
|
||||
script:
|
||||
- cd $BOOST_ROOT/libs/$SELF
|
||||
- ci/travis/cppcheck.sh
|
||||
|
||||
- os: linux
|
||||
env:
|
||||
- COMMENT=ubsan
|
||||
- B2_VARIANT=variant=debug
|
||||
- TOOLSET=gcc-8
|
||||
- CXXSTD=03,11,14,17,2a
|
||||
- DEFINES="define=BOOST_NO_STRESS_TEST=1"
|
||||
- CXXFLAGS="cxxflags=-fno-omit-frame-pointer cxxflags=-fsanitize=undefined cxxflags=-fno-sanitize-recover=undefined"
|
||||
- LINKFLAGS="linkflags=-fsanitize=undefined linkflags=-fno-sanitize-recover=undefined linkflags=-fuse-ld=gold"
|
||||
- UBSAN_OPTIONS=print_stacktrace=1
|
||||
addons: *gcc-8
|
||||
|
||||
- os: linux
|
||||
env:
|
||||
- COMMENT=valgrind
|
||||
- TOOLSET=clang-6.0
|
||||
- CXXSTD=03,11,14,17,2a
|
||||
- DEFINES="define=BOOST_NO_STRESS_TEST=1"
|
||||
- B2_VARIANT=variant=debug
|
||||
- TESTFLAGS=testing.launcher=valgrind
|
||||
- VALGRIND_OPTS=--error-exitcode=1
|
||||
addons: *clang-6
|
||||
|
||||
#################### Jobs to run on pushes to master, develop ###################
|
||||
|
||||
# Coverity Scan
|
||||
- os: linux
|
||||
if: (env(COVERITY_SCAN_NOTIFICATION_EMAIL) IS present) AND (branch IN (develop, master)) AND (type IN (cron, push))
|
||||
env:
|
||||
- COMMENT="Coverity Scan"
|
||||
- TOOLSET=gcc-7
|
||||
addons: *gcc-7
|
||||
script:
|
||||
- cd $BOOST_ROOT/libs/$SELF
|
||||
- ci/travis/coverity.sh
|
||||
|
||||
notifications:
|
||||
email:
|
||||
false
|
||||
@@ -0,0 +1,26 @@
|
||||
# Copyright 2018 Mike Dev
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt
|
||||
#
|
||||
# NOTE: CMake support for Boost.Mpl is currently experimental at best
|
||||
# and the interface is likely to change in the future
|
||||
|
||||
cmake_minimum_required( VERSION 3.5 )
|
||||
project( BoostMpl LANGUAGES CXX )
|
||||
|
||||
add_library( boost_mpl INTERFACE )
|
||||
add_library( Boost::mpl ALIAS boost_mpl )
|
||||
|
||||
target_include_directories( boost_mpl INTERFACE include )
|
||||
|
||||
target_link_libraries( boost_mpl
|
||||
INTERFACE
|
||||
Boost::config
|
||||
Boost::core
|
||||
Boost::predef
|
||||
Boost::preprocessor
|
||||
Boost::static_assert
|
||||
Boost::type_traits
|
||||
Boost::utility
|
||||
)
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
# Boost.MPL Library Jamfile
|
||||
#
|
||||
# Copyright (c) 2018 James E. King III
|
||||
#
|
||||
# Use, modification, and distribution are subject to the
|
||||
# Boost Software License, Version 1.0. (See accompanying file
|
||||
# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
# please order by name to ease maintenance
|
||||
build-project example ;
|
||||
build-project test ;
|
||||
@@ -0,0 +1,23 @@
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
Permission is hereby granted, free of charge, to any person or organization
|
||||
obtaining a copy of the software and accompanying documentation covered by
|
||||
this license (the "Software") to use, reproduce, display, distribute,
|
||||
execute, and transmit the Software, and to prepare derivative works of the
|
||||
Software, and to permit third-parties to whom the Software is furnished to
|
||||
do so, all subject to the following:
|
||||
|
||||
The copyright notices in the Software and this entire statement, including
|
||||
the above license grant, this restriction and the following disclaimer,
|
||||
must be included in all copies of the Software, in whole or in part, and
|
||||
all derivative works of the Software, unless such copies or derivative
|
||||
works are solely in the form of machine-executable object code generated by
|
||||
a source language processor.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
@@ -0,0 +1,34 @@
|
||||
MPL, part of collection of the [Boost C++ Libraries](http://github.com/boostorg), provides a general-purpose, high-level C++ template metaprogramming framework of compile-time algorithms, sequences and metafunctions.
|
||||
|
||||
### License
|
||||
|
||||
Distributed under the [Boost Software License, Version 1.0](http://www.boost.org/LICENSE_1_0.txt).
|
||||
|
||||
### Properties
|
||||
|
||||
* C++03
|
||||
* Header Only
|
||||
|
||||
### Build Status
|
||||
|
||||
Branch | Travis | Appveyor | Coverity Scan | codecov.io | Deps | Docs | Tests |
|
||||
:-------------: | ------ | -------- | ------------- | ---------- | ---- | ---- | ----- |
|
||||
[`master`](https://github.com/boostorg/mpl/tree/master) | [](https://travis-ci.org/boostorg/mpl) | [](https://ci.appveyor.com/project/jeking3/mpl-nrhfm/branch/master) | [](https://scan.coverity.com/projects/boostorg-mpl) | [](https://codecov.io/gh/boostorg/mpl/branch/master)| [](https://pdimov.github.io/boostdep-report/master/mpl.html) | [](http://www.boost.org/doc/libs/master/doc/html/mpl.html) | [](http://www.boost.org/development/tests/master/developer/mpl.html)
|
||||
[`develop`](https://github.com/boostorg/mpl/tree/develop) | [](https://travis-ci.org/boostorg/mpl) | [](https://ci.appveyor.com/project/jeking3/mpl-nrhfm/branch/develop) | [](https://scan.coverity.com/projects/boostorg-mpl) | [](https://codecov.io/gh/boostorg/mpl/branch/develop) | [](https://pdimov.github.io/boostdep-report/develop/mpl.html) | [](http://www.boost.org/doc/libs/develop/doc/html/mpl.html) | [](http://www.boost.org/development/tests/develop/developer/mpl.html)
|
||||
|
||||
### Directories
|
||||
|
||||
| Name | Purpose |
|
||||
| ----------- | ------------------------------ |
|
||||
| `doc` | documentation |
|
||||
| `example` | examples |
|
||||
| `include` | headers |
|
||||
| `test` | unit tests |
|
||||
|
||||
### More information
|
||||
|
||||
* [Ask questions](http://stackoverflow.com/questions/ask?tags=c%2B%2B,boost,boost-mpl)
|
||||
* [Report bugs](https://github.com/boostorg/mpl/issues): Be sure to mention Boost version, platform and compiler you're using. A small compilable code sample to reproduce the problem is always good as well.
|
||||
* Submit your patches as pull requests against **develop** branch. Note that by submitting patches you agree to license your modifications under the [Boost Software License, Version 1.0](http://www.boost.org/LICENSE_1_0.txt).
|
||||
* Discussions about the library are held on the [Boost developers mailing list](http://www.boost.org/community/groups.html#main). Be sure to read the [discussion policy](http://www.boost.org/community/policy.html) before posting and add the `[mpl]` tag at the beginning of the subject line.
|
||||
|
||||
+126
@@ -0,0 +1,126 @@
|
||||
# Copyright 2016, 2017 Peter Dimov
|
||||
# Copyright (C) 2017, 2018 James E. King III
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#
|
||||
# Generic Appveyor build script for boostorg repositories
|
||||
# See: https://github.com/jeking3/boost-ci/
|
||||
#
|
||||
# Instructions for customizing this script for your library:
|
||||
#
|
||||
# 1. Customize the compilers and language levels you want.
|
||||
# 2. If you have move than include/, src/, test/, example/, examples/,
|
||||
# benchmark/ or tools/ directories, set the environment variable DEPINST.
|
||||
# For example if your build uses code in "bench/" and "fog/" directories:
|
||||
# - DEPINST: --include bench --include fog
|
||||
# 3. Enable pull request builds in your boostorg/<library> account.
|
||||
#
|
||||
# That's it - the script will do everything else for you.
|
||||
#
|
||||
|
||||
version: 1.0.{build}-{branch}
|
||||
|
||||
shallow_clone: true
|
||||
|
||||
branches:
|
||||
only:
|
||||
- develop
|
||||
- master
|
||||
|
||||
matrix:
|
||||
# Adding MAYFAIL to any matrix job allows it to fail but the build stays green:
|
||||
allow_failures:
|
||||
- MAYFAIL: true
|
||||
|
||||
environment:
|
||||
global:
|
||||
# see: http://www.boost.org/build/doc/html/bbv2/overview/invocation.html#bbv2.overview.invocation.properties
|
||||
# to use the default for a given environment, comment it out; recommend you build debug and release however:
|
||||
# on Windows it is important to exercise all the possibilities, especially shared vs static, however most
|
||||
# libraries that care about this exercise it in their Jamfiles...
|
||||
# B2_ADDRESS_MODEL: address-model=64,32
|
||||
# B2_LINK: link=shared,static
|
||||
# B2_THREADING: threading=multi,single
|
||||
B2_VARIANT: variant=release,debug
|
||||
|
||||
matrix:
|
||||
- FLAVOR: Visual Studio 2017 C++2a Strict
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
TOOLSET: msvc-14.1
|
||||
B2_ADDRESS_MODEL: address-model=64
|
||||
CXXFLAGS: cxxflags=-permissive-
|
||||
CXXSTD: latest # 2a
|
||||
|
||||
- FLAVOR: Visual Studio 2017 C++17
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
TOOLSET: msvc-14.1
|
||||
B2_ADDRESS_MODEL: address-model=64
|
||||
CXXSTD: 17
|
||||
|
||||
- FLAVOR: Visual Studio 2017 C++14 (Default)
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
TOOLSET: msvc-14.1
|
||||
B2_ADDRESS_MODEL: address-model=64,32
|
||||
|
||||
- FLAVOR: Visual Studio 2015 C++14 (Default)
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
TOOLSET: msvc-14.0
|
||||
B2_ADDRESS_MODEL: address-model=64,32
|
||||
|
||||
- FLAVOR: Visual Studio 2010, 2012, 2013
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
|
||||
TOOLSET: msvc-10.0,msvc-11.0,msvc-12.0
|
||||
|
||||
- FLAVOR: cygwin (32-bit)
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
ADDPATH: C:\cygwin\bin;
|
||||
B2_ADDRESS_MODEL: address-model=32
|
||||
CXXSTD: 03,11
|
||||
# https://github.com/boostorg/test/issues/144
|
||||
DEFINES: define=_POSIX_C_SOURCE=200112L
|
||||
THREADING: threadapi=pthread
|
||||
TOOLSET: gcc
|
||||
|
||||
- FLAVOR: cygwin (64-bit)
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
ADDPATH: C:\cygwin64\bin;
|
||||
B2_ADDRESS_MODEL: address-model=64
|
||||
CXXSTD: 11,17
|
||||
# https://github.com/boostorg/test/issues/144
|
||||
DEFINES: define=_POSIX_C_SOURCE=200112L define=__USE_ISOC99
|
||||
THREADING: threadapi=pthread
|
||||
TOOLSET: gcc
|
||||
|
||||
- FLAVOR: mingw32
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
ARCH: i686
|
||||
B2_ADDRESS_MODEL: address-model=32
|
||||
CXXSTD: 03,11
|
||||
SCRIPT: ci\appveyor\mingw.bat
|
||||
|
||||
- FLAVOR: mingw64
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
ARCH: x86_64
|
||||
B2_ADDRESS_MODEL: address-model=64
|
||||
CXXSTD: 11,17
|
||||
DEFINES: define=__USE_ISOC99
|
||||
SCRIPT: ci\appveyor\mingw.bat
|
||||
|
||||
install:
|
||||
- set SELF=%APPVEYOR_PROJECT_NAME:-=_%
|
||||
- git clone https://github.com/jeking3/boost-ci.git C:\boost-ci
|
||||
- xcopy /s /e /q /i C:\boost-ci\ci .\ci
|
||||
- ci\appveyor\install.bat
|
||||
|
||||
build: off
|
||||
|
||||
test_script:
|
||||
- set SELF=%APPVEYOR_PROJECT_NAME:-=_%
|
||||
- PATH=%ADDPATH%%PATH%
|
||||
# The definition of TOOLCXX omits CXXSTD= if it was not defined above
|
||||
- IF NOT DEFINED CXXSTD (SET TOOLCXX=toolset=%TOOLSET%) ELSE (SET TOOLCXX=toolset=%TOOLSET% cxxstd=%CXXSTD%)
|
||||
# Echo the complete build command to the build log
|
||||
- IF NOT DEFINED SCRIPT (ECHO b2 libs/%SELF:\=/% %TOOLCXX% %CXXFLAGS% %DEFINES% %THREADING% %B2_ADDRESS_MODEL% %B2_LINK% %B2_THREADING% %B2_VARIANT% -j3)
|
||||
# Now go build...
|
||||
- IF DEFINED SCRIPT (call libs\%SELF%\%SCRIPT%) ELSE (b2 libs/%SELF:\=/% %TOOLCXX% %CXXFLAGS% %DEFINES% %THREADING% %B2_ADDRESS_MODEL% %B2_LINK% %B2_THREADING% %B2_VARIANT% -j3)
|
||||
Executable → Regular
+1
-1
@@ -35,7 +35,7 @@ metafunctions. It provides a conceptual foundation and an extensive
|
||||
set of powerful and coherent tools that make doing explict metaprogramming
|
||||
in C++ as easy and enjoyable as possible within the current language.</p>
|
||||
<p>There are several places to start when getting familiar with the library,
|
||||
depending on what your know about metaprogramming in general and
|
||||
depending on what you know about metaprogramming in general and
|
||||
C++ template metaprogramming in particular. Starting with
|
||||
Boost version 1.32, the MPL comes with both an <a class="reference" href="./tutorial/tutorial-metafunctions.html">in-depth tutorial</a> on its
|
||||
fundamental concepts and an annotated <a class="reference" href="./tutorial/reference-manual.html">reference manual</a> covering all concepts
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<div class="section" id="acknowledgements">
|
||||
<h1><a class="toc-backref" href="../refmanual.html#id1614">Acknowledgements</a></h1>
|
||||
<p id="label-acknowledgements">The format and language of this reference documentation has been greatly influenced by
|
||||
the SGI's <a class="reference external" href="http://www.sgi.com/tech/stl/" target="_top">Standard Template Library Programmer's Guide</a>.</p>
|
||||
the SGI's <a class="reference external" href="https://boost.org/sgi/stl/" target="_top">Standard Template Library Programmer's Guide</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="footer-separator"></div>
|
||||
|
||||
@@ -38,7 +38,7 @@ implementations by operating on <a class="reference internal" href="./iterators.
|
||||
major categories: iteration algorithms, querying algorithms, and
|
||||
transformation algorithms. The transformation algorithms introduce
|
||||
an associated <a class="reference internal" href="./inserter.html">Inserter</a> concept, a rough equivalent for the notion of
|
||||
<a class="reference external" href="http://www.sgi.com/tech/stl/OutputIterator.html" target="_top">Output Iterator</a> in the Standard Library. Moreover, every
|
||||
<a class="reference external" href="https://boost.org/sgi/stl/OutputIterator.html" target="_top">Output Iterator</a> in the Standard Library. Moreover, every
|
||||
transformation algorithm provides a <tt class="literal"><span class="pre">reverse_</span></tt> counterpart,
|
||||
allowing for a wider range of efficient transformations — a
|
||||
common functionality documented by the <a class="reference internal" href="./reversible-algorithm.html">Reversible Algorithm</a>
|
||||
|
||||
@@ -71,7 +71,7 @@ every element in the [<tt class="literal"><span class="pre"><a href="./begin.htm
|
||||
<td>A transformation.</td>
|
||||
</tr>
|
||||
<tr><td><tt class="literal"><span class="pre">f</span></tt></td>
|
||||
<td>An <a class="reference external" href="http://www.sgi.com/tech/stl/UnaryFunction.html" target="_top">unary function object</a></td>
|
||||
<td>An <a class="reference external" href="https://boost.org/sgi/stl/UnaryFunction.html" target="_top">unary function object</a></td>
|
||||
<td>A runtime operation to apply.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -80,7 +80,7 @@ every element in the [<tt class="literal"><span class="pre"><a href="./begin.htm
|
||||
<div class="section" id="id816">
|
||||
<h3><a class="subsection-title" href="#expression-semantics" name="expression-semantics">Expression semantics</a></h3>
|
||||
<p>For any <a class="reference internal" href="./forward-sequence.html">Forward Sequence</a> <tt class="literal"><span class="pre">s</span></tt>, <a class="reference internal" href="./lambda-expression.html">Lambda Expression</a> <tt class="literal"><span class="pre">op</span></tt> , and an
|
||||
<a class="reference external" href="http://www.sgi.com/tech/stl/UnaryFunction.html" target="_top">unary function object</a> <tt class="literal"><span class="pre">f</span></tt>:</p>
|
||||
<a class="reference external" href="https://boost.org/sgi/stl/UnaryFunction.html" target="_top">unary function object</a> <tt class="literal"><span class="pre">f</span></tt>:</p>
|
||||
<pre class="literal-block">
|
||||
<a href="./for-each.html" class="identifier">for_each</a><s>( f );
|
||||
</pre>
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="generator" content="Docutils 0.7: http://docutils.sourceforge.net/" />
|
||||
<title>The MPL Reference Manual: BOOST_MPL_GET_TAG_DEF</title>
|
||||
<link rel="stylesheet" href="../style.css" type="text/css" />
|
||||
</head>
|
||||
<body class="docframe refmanual">
|
||||
<table class="header"><tr class="header"><td class="header-group navigation-bar"><span class="navigation-group"><a href="./introspection.html" class="navigation-link">Prev</a> <a href="./has-xxx-trait-named-def.html" class="navigation-link">Next</a></span><span class="navigation-group-separator"> | </span><span class="navigation-group"><a href="./introspection.html" class="navigation-link">Back</a> <a href="./get-tag-def.html" class="navigation-link">Along</a></span><span class="navigation-group-separator"> | </span><span class="navigation-group"><a href="./introspection.html" class="navigation-link">Up</a> <a href="../refmanual.html" class="navigation-link">Home</a></span><span class="navigation-group-separator"> | </span><span class="navigation-group"><a href="./refmanual_toc.html" class="navigation-link">Full TOC</a></span></td>
|
||||
<td class="header-group page-location"><a href="../refmanual.html" class="navigation-link">Front Page</a> / <a href="./macros.html" class="navigation-link">Macros</a> / <a href="./introspection.html" class="navigation-link">Introspection</a> / <a href="./has-xxx-trait-def.html" class="navigation-link">BOOST_MPL_GET_TAG_DEF</a></td>
|
||||
</tr></table><div class="header-separator"></div>
|
||||
<div class="section" id="boost-mpl-has-xxx-trait-def">
|
||||
<h1><a class="toc-backref" href="./introspection.html#id1595">BOOST_MPL_GET_TAG_DEF</a></h1>
|
||||
<div class="section" id="id1329">
|
||||
<h3><a class="subsection-title" href="#synopsis" name="synopsis">Synopsis</a></h3>
|
||||
<pre class="literal-block">
|
||||
#define <a href="./has-xxx-trait-def.html" class="identifier">BOOST_MPL_GET_TAG_DEF</a>(name) \
|
||||
<em>unspecified token sequence</em> \
|
||||
/**/
|
||||
</pre>
|
||||
</div>
|
||||
<div class="section" id="id1330">
|
||||
<h3><a class="subsection-title" href="#description" name="description">Description</a></h3>
|
||||
<p>Expands into a definition of a lazy getter <a class="reference internal" href="./metafunction.html">Metafunction</a> <tt class="literal"><span class="pre">get_tag_name</span></tt>
|
||||
such that for any type <tt class="literal"><span class="pre">x</span></tt> <tt class="literal"><span class="pre">get_tag_name<x>::type</span> <span class="pre">is</span> <span class="pre">type</span></tt> where
|
||||
<tt class="literal"><span class="pre">name</span></tt> is a nested type member of <tt class="literal"><span class="pre">x</span></tt>.</p>
|
||||
</div>
|
||||
<div class="section" id="id1331">
|
||||
<h3><a class="subsection-title" href="#header" name="header">Header</a></h3>
|
||||
<pre class="literal-block">
|
||||
#include <<a href="../../../../boost/mpl/get_tag.hpp" class="header">boost/mpl/get_tag.hpp</a>>
|
||||
</pre>
|
||||
</div>
|
||||
<div class="section" id="id1332">
|
||||
<h3><a class="subsection-title" href="#parameters" name="parameters">Parameters</a></h3>
|
||||
<table border="1" class="docutils table">
|
||||
<colgroup>
|
||||
<col width="15%" />
|
||||
<col width="32%" />
|
||||
<col width="53%" />
|
||||
</colgroup>
|
||||
<thead valign="bottom">
|
||||
<tr><th class="head">Parameter</th>
|
||||
<th class="head">Requirement</th>
|
||||
<th class="head">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody valign="top">
|
||||
<tr><td><tt class="literal"><span class="pre">name</span></tt></td>
|
||||
<td>A legal identifier token</td>
|
||||
<td>A name of the member to get.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="section" id="id1333">
|
||||
<h3><a class="subsection-title" href="#expression-semantics" name="expression-semantics">Expression semantics</a></h3>
|
||||
<p>For any legal C++ identifier <tt class="literal"><span class="pre">name</span></tt>:</p>
|
||||
<pre class="literal-block">
|
||||
<a href="./has-xxx-trait-def.html" class="identifier">BOOST_MPL_GET_TAG_DEF</a>(name)
|
||||
</pre>
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field"><th class="field-name">Precondition:</th><td class="field-body"><p class="first">Appears at namespace scope.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="field"><th class="field-name">Return type:</th><td class="field-body"><p class="first">None.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="field"><th class="field-name">Semantics:</th><td class="field-body"><p class="first">Equivalent to</p>
|
||||
<pre class="last literal-block">
|
||||
namespace boost { namespace mpl {</pre>
|
||||
<pre class="last literal-block">
|
||||
template<class T>
|
||||
struct get_##name {
|
||||
typedef typename T::name type;
|
||||
};</pre>
|
||||
<pre class="last literal-block">
|
||||
}}
|
||||
</pre>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="section" id="id1334">
|
||||
<h3><a class="subsection-title" href="#example" name="example">Example</a></h3>
|
||||
<pre class="literal-block">
|
||||
struct test_type_get_tag_def;
|
||||
|
||||
<a href="get-tag-def.html" class="identifier">BOOST_MPL_GET_TAG_DEF</a>(a_tag);
|
||||
|
||||
namespace boost { namespace mpl {
|
||||
|
||||
struct test_type_get_tag_def
|
||||
{
|
||||
typedef int a_tag;
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
typedef boost::mpl::get_a_tag<test_type_get_tag_def>::type got_the_tag;
|
||||
|
||||
</pre>
|
||||
</div>
|
||||
<div class="section" id="id1335">
|
||||
<h3><a class="subsection-title" href="#see-also" name="see-also">See also</a></h3>
|
||||
<p><a class="reference internal" href="./macros.html">Macros</a>, <a class="reference internal" href="./has-xxx-trait-named-def.html">BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF</a></p>
|
||||
<!-- Macros/Introspection/BOOST_MPL_GET_TAG_DEF -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="footer-separator"></div>
|
||||
<table class="footer"><tr class="footer"><td class="header-group navigation-bar"><span class="navigation-group"><a href="./introspection.html" class="navigation-link">Prev</a> <a href="./has-xxx-template-named-def.html" class="navigation-link">Next</a></span><span class="navigation-group-separator"> | </span><span class="navigation-group"><a href="./introspection.html" class="navigation-link">Back</a> <a href="./get-tag-def.html" class="navigation-link">Along</a></span><span class="navigation-group-separator"> | </span><span class="navigation-group"><a href="./introspection.html" class="navigation-link">Up</a> <a href="../refmanual.html" class="navigation-link">Home</a></span><span class="navigation-group-separator"> | </span><span class="navigation-group"><a href="./refmanual_toc.html" class="navigation-link">Full TOC</a></span></td>
|
||||
<td><div class="copyright-footer"><div class="copyright">Copyright © 2017 Sergey Krivonos and Edward Diener</div>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at <a class="reference external" href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)</div></td></tr></table></body>
|
||||
</html>
|
||||
@@ -15,7 +15,7 @@
|
||||
<h1><a class="toc-backref" href="./algorithms-concepts.html#id1462">Inserter</a></h1>
|
||||
<div class="section" id="id454">
|
||||
<h3><a class="subsection-title" href="#description" name="description">Description</a></h3>
|
||||
<p>An <a class="reference internal" href="./inserter.html">Inserter</a> is a compile-time substitute for STL <a class="reference external" href="http://www.sgi.com/tech/stl/OutputIterator.html" target="_top">Output Iterator</a>.
|
||||
<p>An <a class="reference internal" href="./inserter.html">Inserter</a> is a compile-time substitute for STL <a class="reference external" href="https://boost.org/sgi/stl/OutputIterator.html" target="_top">Output Iterator</a>.
|
||||
Under the hood, it's simply a type holding
|
||||
two entities: a <em>state</em> and an <em>operation</em>. When passed to a
|
||||
<a class="reference internal" href="./transformation-algorithms.html">transformation algorithm</a>, the inserter's binary operation is
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
<!-- Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<ul class="toc simple" id="outline">
|
||||
<li><a class="reference internal" href="./get-tag-def.html" id="id1615">BOOST_MPL_GET_TAG_DEF</a></li>
|
||||
<li><a class="reference internal" href="./has-xxx-template-def.html" id="id1593">BOOST_MPL_HAS_XXX_TEMPLATE_DEF</a></li>
|
||||
<li><a class="reference internal" href="./has-xxx-template-named-def.html" id="id1594">BOOST_MPL_HAS_XXX_TEMPLATE_NAMED_DEF</a></li>
|
||||
<li><a class="reference internal" href="./has-xxx-trait-def.html" id="id1595">BOOST_MPL_HAS_XXX_TRAIT_DEF</a></li>
|
||||
|
||||
@@ -276,6 +276,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li><a class="reference internal" href="./introspection.html" id="id1592">Introspection</a><ul class="toc" id="outline">
|
||||
<li><a class="reference internal" href="./get-tag-def.html" id="id1615">BOOST_MPL_GET_TAG_DEF</a></li>
|
||||
<li><a class="reference internal" href="./has-xxx-template-def.html" id="id1593">BOOST_MPL_HAS_XXX_TEMPLATE_DEF</a></li>
|
||||
<li><a class="reference internal" href="./has-xxx-template-named-def.html" id="id1594">BOOST_MPL_HAS_XXX_TEMPLATE_NAMED_DEF</a></li>
|
||||
<li><a class="reference internal" href="./has-xxx-trait-def.html" id="id1595">BOOST_MPL_HAS_XXX_TRAIT_DEF</a></li>
|
||||
|
||||
@@ -19,7 +19,7 @@ ones by performing some kind of transformation. A typical transformation
|
||||
alogrithm takes one or more input sequences and a transformation
|
||||
metafunction/predicate, and returns a new sequence built according to the
|
||||
algorithm's semantics through the means of its <a class="reference internal" href="./inserter.html">Inserter</a> argument, which
|
||||
plays a role similar to the role of run-time <a class="reference external" href="http://www.sgi.com/tech/stl/OutputIterator.html" target="_top">Output Iterator</a>.</p>
|
||||
plays a role similar to the role of run-time <a class="reference external" href="https://boost.org/sgi/stl/OutputIterator.html" target="_top">Output Iterator</a>.</p>
|
||||
<!-- Say something about optionality of Inserters/their default behavior -->
|
||||
<p>Every transformation algorithm is a <a class="reference internal" href="./reversible-algorithm.html">Reversible Algorithm</a>, providing
|
||||
an accordingly named <tt class="literal"><span class="pre">reverse_</span></tt> counterpart carrying the transformation
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
The format and language of this reference documentation has been greatly influenced by
|
||||
the SGI's `Standard Template Library Programmer's Guide`__.
|
||||
|
||||
__ http://www.sgi.com/tech/stl/
|
||||
__ https://boost.org/sgi/stl/
|
||||
|
||||
|
||||
.. copyright:: Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams
|
||||
|
||||
@@ -35,7 +35,7 @@ common functionality documented by the |Reversible Algorithm|
|
||||
concept.
|
||||
|
||||
|
||||
.. |Output Iterator| replace:: `Output Iterator <http://www.sgi.com/tech/stl/OutputIterator.html>`__
|
||||
.. |Output Iterator| replace:: `Output Iterator <https://boost.org/sgi/stl/OutputIterator.html>`__
|
||||
.. |sequence algorithms| replace:: `sequence algorithms`_
|
||||
.. _`sequence algorithms`: `Algorithms`_
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ it possible to decouple `algorithms`__ from concrete compile-time `sequence
|
||||
implementations`__. Under the hood, all MPL sequence algorithms are
|
||||
implemented in terms of iterators. In particular, that means that they
|
||||
will work on any custom compile-time sequence, given that the appropriate
|
||||
iterator inteface is provided.
|
||||
iterator interface is provided.
|
||||
|
||||
__ `Algorithms`_
|
||||
__ `label-Sequences-Classes`_
|
||||
@@ -14,6 +14,6 @@ __ `label-Sequences-Classes`_
|
||||
.. More?
|
||||
|
||||
|
||||
.. copyright:: Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams
|
||||
.. copyright:: Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams
|
||||
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)
|
||||
|
||||
@@ -136,7 +136,7 @@ See also
|
||||
|
||||
|Runtime Algorithms|, |Views|, |transform_view|
|
||||
|
||||
.. |unary function object| replace:: `unary function object <http://www.sgi.com/tech/stl/UnaryFunction.html>`__
|
||||
.. |unary function object| replace:: `unary function object <https://boost.org/sgi/stl/UnaryFunction.html>`__
|
||||
.. |value_initialized| replace:: `value_initialized <http://www.boost.org/libs/utility/value_init.htm>`__
|
||||
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ arguments), which comes down to the follwing two criteria:</p>
|
||||
placeholders do contain these).</li>
|
||||
</ol>
|
||||
<p>If these two hold, you can safely put <tt class="literal"><span class="pre">BOOST_MPL_AUX_LAMBDA_SUPPORT</span></tt> inside
|
||||
your metafunction and forget about the issue. If not, your are out of luck and
|
||||
your metafunction and forget about the issue. If not, you are out of luck and
|
||||
probably have to write a metafunction class instead.</p>
|
||||
<p>The good news are that most of the MPL's own metafunctions and <a class="reference" href="../../../type_traits/index.html" target="_top">Boost.Type Traits</a>
|
||||
templates are "placeholder-safe" and have the workaround applied to them, so
|
||||
|
||||
@@ -33,12 +33,12 @@ Complete Guide</a>", by David Vandevoorde and Nicolai M. Josuttis — <em>t
|
||||
on the details and workings of the C++ template system.</p>
|
||||
<p>We can also recommend a number online resources:</p>
|
||||
<ul class="simple">
|
||||
<li>Todd L. Veldhuizen, "<a class="reference" href="http://osl.iu.edu/~tveldhui/papers/Template-Metaprograms/meta-art.html" target="_top">Using C++ template metaprograms</a>", C++ Report
|
||||
<li>Todd L. Veldhuizen, "<a class="reference" href="https://dl.acm.org/citation.cfm?id=260748" target="_top">Using C++ template metaprograms</a>", C++ Report
|
||||
Vol. 7 No. 4 (May 1995), pp. 36-43.</li>
|
||||
<li>Todd L. Veldhuizen and Dennis Gannon, "<a class="reference" href="http://osl.iu.edu/~tveldhui/papers/oo98.html" target="_top">Active Libraries: Rethinking the roles of
|
||||
<li>Todd L. Veldhuizen and Dennis Gannon, "<a class="reference" href="https://arxiv.org/abs/math/9810022" target="_top">Active Libraries: Rethinking the roles of
|
||||
compilers and libraries</a>", SIAM Workshop on Object Oriented Methods for Inter-operable
|
||||
Scientific and Engineering Computing, October 21-23, 1998</li>
|
||||
<li>Todd L. Veldhuizen, "<a class="reference" href="http://osl.iu.edu/~tveldhui/papers/pepm99/" target="_top">C++ Templates as Partial Evaluation</a>", 1999 ACM SIGPLAN
|
||||
<li>Todd L. Veldhuizen, "<a class="reference" href="https://arxiv.org/abs/cs/9810010" target="_top">C++ Templates as Partial Evaluation</a>", 1999 ACM SIGPLAN
|
||||
Workshop on Partial Evaluation and Semantics-Based Program Manipulation (PEPM'99).</li>
|
||||
</ul>
|
||||
<!-- What about Todd's PhD dissertation? Too far off the beaten track? -->
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
# Boost.MPL Library example Jamfile
|
||||
#
|
||||
# Copyright (c) 2008 James E. King III
|
||||
#
|
||||
# Distributed under the Boost Software License, Version 1.0. (See accompany-
|
||||
# ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
import testing ;
|
||||
|
||||
test-suite "mpl-examples"
|
||||
: [ run inherit_linearly.cpp ]
|
||||
[ compile integer.cpp ]
|
||||
[ run tuple_from_list.cpp ]
|
||||
;
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
// $Revision$
|
||||
|
||||
#include <memory>
|
||||
#include <boost/config.hpp>
|
||||
|
||||
namespace fsm { namespace aux {
|
||||
|
||||
@@ -25,13 +26,32 @@ struct base_event
|
||||
public:
|
||||
virtual ~base_event() {};
|
||||
|
||||
#if defined(BOOST_NO_CXX11_SMART_PTR)
|
||||
|
||||
std::auto_ptr<base_event> clone() const
|
||||
|
||||
#else
|
||||
|
||||
std::unique_ptr<base_event> clone() const
|
||||
|
||||
#endif
|
||||
|
||||
{
|
||||
return do_clone();
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
#if defined(BOOST_NO_CXX11_SMART_PTR)
|
||||
|
||||
virtual std::auto_ptr<base_event> do_clone() const = 0;
|
||||
|
||||
#else
|
||||
|
||||
virtual std::unique_ptr<base_event> do_clone() const = 0;
|
||||
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
@@ -26,12 +26,27 @@ struct event
|
||||
typedef base_event base_t;
|
||||
|
||||
private:
|
||||
|
||||
#if defined(BOOST_NO_CXX11_SMART_PTR)
|
||||
|
||||
virtual std::auto_ptr<base_event> do_clone() const
|
||||
{
|
||||
return std::auto_ptr<base_event>(
|
||||
new Derived(static_cast<Derived const&>(*this))
|
||||
);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
virtual std::unique_ptr<base_event> do_clone() const
|
||||
{
|
||||
return std::unique_ptr<base_event>(
|
||||
new Derived(static_cast<Derived const&>(*this))
|
||||
);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
Executable → Regular
Executable → Regular
@@ -83,7 +83,17 @@ class state_machine
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
#if defined(BOOST_NO_CXX11_SMART_PTR)
|
||||
|
||||
void post_event(std::auto_ptr<base_event_t const> evt)
|
||||
|
||||
#else
|
||||
|
||||
void post_event(std::unique_ptr<base_event_t const> evt)
|
||||
|
||||
#endif
|
||||
|
||||
{
|
||||
m_events_queue.push(base_event_ptr_t(evt.release()));
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
#include <boost/mpl/if.hpp>
|
||||
#endif
|
||||
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610)) \
|
||||
#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x610)) \
|
||||
|| (BOOST_MPL_CFG_GCC != 0) \
|
||||
|| BOOST_WORKAROUND(__IBMCPP__, <= 600)
|
||||
# define BOOST_MPL_CFG_ASSERT_USE_RELATION_NAMES
|
||||
@@ -47,7 +47,7 @@
|
||||
|
||||
#if BOOST_WORKAROUND(__MWERKS__, < 0x3202) \
|
||||
|| BOOST_WORKAROUND(__EDG_VERSION__, <= 238) \
|
||||
|| BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610)) \
|
||||
|| BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x610)) \
|
||||
|| BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840))
|
||||
# define BOOST_MPL_CFG_ASSERT_BROKEN_POINTER_TO_POINTER_TO_MEMBER
|
||||
#endif
|
||||
@@ -55,8 +55,8 @@
|
||||
// agurt, 10/nov/06: use enums for Borland (which cannot cope with static constants)
|
||||
// and GCC (which issues "unused variable" warnings when static constants are used
|
||||
// at a function scope)
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610)) \
|
||||
|| (BOOST_MPL_CFG_GCC != 0) || (BOOST_MPL_CFG_GPU != 0)
|
||||
#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x610)) \
|
||||
|| (BOOST_MPL_CFG_GCC != 0) || (BOOST_MPL_CFG_GPU != 0) || defined(__PGI)
|
||||
# define BOOST_MPL_AUX_ASSERT_CONSTANT(T, expr) enum { expr }
|
||||
#else
|
||||
# define BOOST_MPL_AUX_ASSERT_CONSTANT(T, expr) BOOST_STATIC_CONSTANT(T, expr)
|
||||
@@ -184,16 +184,27 @@ template< typename P > struct assert_arg_pred_not
|
||||
typedef typename assert_arg_pred_impl<p>::type type;
|
||||
};
|
||||
|
||||
#if defined(BOOST_GCC) && BOOST_GCC >= 80000
|
||||
#define BOOST_MPL_IGNORE_PARENTHESES_WARNING
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wparentheses"
|
||||
#endif
|
||||
|
||||
template< typename Pred >
|
||||
failed ************ (Pred::************
|
||||
failed ************ (Pred::************
|
||||
assert_arg( void (*)(Pred), typename assert_arg_pred<Pred>::type )
|
||||
);
|
||||
|
||||
template< typename Pred >
|
||||
failed ************ (boost::mpl::not_<Pred>::************
|
||||
failed ************ (boost::mpl::not_<Pred>::************
|
||||
assert_not_arg( void (*)(Pred), typename assert_arg_pred_not<Pred>::type )
|
||||
);
|
||||
|
||||
#ifdef BOOST_MPL_IGNORE_PARENTHESES_WARNING
|
||||
#undef BOOST_MPL_IGNORE_PARENTHESES_WARNING
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
template< typename Pred >
|
||||
AUX778076_ASSERT_ARG(assert<false>)
|
||||
assert_arg( void (*)(Pred), typename assert_arg_pred_not<Pred>::type );
|
||||
@@ -432,8 +443,17 @@ BOOST_MPL_AUX_ASSERT_CONSTANT( \
|
||||
/**/
|
||||
#endif
|
||||
|
||||
#define BOOST_MPL_ASSERT_MSG( c, msg, types_ ) \
|
||||
#if 0
|
||||
// Work around BOOST_MPL_ASSERT_MSG_IMPL generating multiple definition linker errors on VC++8.
|
||||
// #if defined(BOOST_MSVC) && BOOST_MSVC < 1500
|
||||
# include <boost/static_assert.hpp>
|
||||
# define BOOST_MPL_ASSERT_MSG( c, msg, types_ ) \
|
||||
BOOST_STATIC_ASSERT_MSG( c, #msg ) \
|
||||
/**/
|
||||
#else
|
||||
# define BOOST_MPL_ASSERT_MSG( c, msg, types_ ) \
|
||||
BOOST_MPL_ASSERT_MSG_IMPL( BOOST_MPL_AUX_PP_COUNTER(), c, msg, types_ ) \
|
||||
/**/
|
||||
#endif
|
||||
|
||||
#endif // BOOST_MPL_ASSERT_HPP_INCLUDED
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
#include <boost/mpl/aux_/config/workaround.hpp>
|
||||
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, < 0x561)
|
||||
#if BOOST_WORKAROUND(BOOST_BORLANDC, < 0x561)
|
||||
// agurt, 12/nov/02: to suppress the bogus "Cannot have both a template class
|
||||
// and function named 'xxx'" diagnostic
|
||||
# define BOOST_MPL_AUX_COMMON_NAME_WKND(name) \
|
||||
@@ -29,6 +29,6 @@ template< typename > void name(); \
|
||||
|
||||
# define BOOST_MPL_AUX_COMMON_NAME_WKND(name) /**/
|
||||
|
||||
#endif // __BORLANDC__
|
||||
#endif // BOOST_BORLANDC
|
||||
|
||||
#endif // BOOST_MPL_AUX_COMMON_NAME_WKND_HPP_INCLUDED
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
#if !defined(BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE) \
|
||||
&& ( BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1400)) \
|
||||
|| BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610)) \
|
||||
|| BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x610)) \
|
||||
|| BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840)) \
|
||||
|| BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3202)) \
|
||||
|| BOOST_WORKAROUND(BOOST_INTEL_CXX_VERSION, BOOST_TESTED_AT(810)) \
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#if !defined(BOOST_MPL_CFG_NO_DEPENDENT_ARRAY_TYPES) \
|
||||
&& !defined(BOOST_MPL_PREPROCESSING_MODE) \
|
||||
&& ( BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610)) \
|
||||
&& ( BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x610)) \
|
||||
|| BOOST_WORKAROUND(BOOST_MSVC, <= 1300) \
|
||||
)
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
|
||||
#if !defined(BOOST_MPL_CFG_BCC590_WORKAROUNDS) \
|
||||
&& !defined(BOOST_MPL_PREPROCESSING_MODE) \
|
||||
&& BOOST_WORKAROUND(__BORLANDC__, >= 0x590) \
|
||||
&& BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610))
|
||||
&& BOOST_WORKAROUND(BOOST_BORLANDC, >= 0x590) \
|
||||
&& BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x610))
|
||||
|
||||
# define BOOST_MPL_CFG_BCC590_WORKAROUNDS
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#if !defined(BOOST_MPL_CFG_NO_BIND_TEMPLATE) \
|
||||
&& !defined(BOOST_MPL_PREPROCESSING_MODE) \
|
||||
&& ( BOOST_WORKAROUND(BOOST_MSVC, <= 1300) \
|
||||
|| BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610)) \
|
||||
|| BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x610)) \
|
||||
)
|
||||
|
||||
# define BOOST_MPL_CFG_NO_BIND_TEMPLATE
|
||||
|
||||
@@ -32,10 +32,10 @@
|
||||
# elif BOOST_WORKAROUND(BOOST_MPL_CFG_GCC, BOOST_TESTED_AT(0x0304))
|
||||
# define BOOST_MPL_CFG_COMPILER_DIR gcc
|
||||
|
||||
# elif BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610))
|
||||
# elif BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x610))
|
||||
# if !defined(BOOST_MPL_CFG_NO_DEFAULT_PARAMETERS_IN_NESTED_TEMPLATES)
|
||||
# define BOOST_MPL_CFG_COMPILER_DIR bcc551
|
||||
# elif BOOST_WORKAROUND(__BORLANDC__, >= 0x590)
|
||||
# elif BOOST_WORKAROUND(BOOST_BORLANDC, >= 0x590)
|
||||
# define BOOST_MPL_CFG_COMPILER_DIR bcc
|
||||
# else
|
||||
# define BOOST_MPL_CFG_COMPILER_DIR bcc_pre590
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#if !defined(BOOST_MPL_CFG_NO_NONTYPE_TEMPLATE_PARTIAL_SPEC) \
|
||||
&& !defined(BOOST_MPL_PREPROCESSING_MODE) \
|
||||
&& BOOST_WORKAROUND(__BORLANDC__, < 0x582)
|
||||
&& BOOST_WORKAROUND(BOOST_BORLANDC, < 0x582)
|
||||
|
||||
# define BOOST_MPL_CFG_NO_NONTYPE_TEMPLATE_PARTIAL_SPEC
|
||||
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
|
||||
#if !defined(BOOST_MPL_CFG_NO_DEFAULT_PARAMETERS_IN_NESTED_TEMPLATES) \
|
||||
&& !defined(BOOST_MPL_PREPROCESSING_MODE) \
|
||||
&& BOOST_WORKAROUND(__BORLANDC__, >= 0x560) \
|
||||
&& BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610))
|
||||
&& BOOST_WORKAROUND(BOOST_BORLANDC, >= 0x560) \
|
||||
&& BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x610))
|
||||
|
||||
# define BOOST_MPL_CFG_NO_DEFAULT_PARAMETERS_IN_NESTED_TEMPLATES
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#if !defined(BOOST_MPL_CFG_BROKEN_DEFAULT_PARAMETERS_IN_NESTED_TEMPLATES) \
|
||||
&& !defined(BOOST_MPL_PREPROCESSING_MODE) \
|
||||
&& ( BOOST_WORKAROUND(__MWERKS__, <= 0x3001) \
|
||||
|| BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610)) \
|
||||
|| BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x610)) \
|
||||
|| defined(BOOST_MPL_CFG_NO_DEFAULT_PARAMETERS_IN_NESTED_TEMPLATES) \
|
||||
)
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
#if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING) \
|
||||
&& !defined(BOOST_MPL_PREPROCESSING_MODE) \
|
||||
&& BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610))
|
||||
&& BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x610))
|
||||
|
||||
# define BOOST_MPL_CFG_NO_NESTED_FORWARDING
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#if !defined(BOOST_MPL_CFG_BCC_INTEGRAL_CONSTANTS) \
|
||||
&& !defined(BOOST_MPL_PREPROCESSING_MODE) \
|
||||
&& BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610))
|
||||
&& BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x610))
|
||||
|
||||
# define BOOST_MPL_CFG_BCC_INTEGRAL_CONSTANTS
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#if !defined(BOOST_MPL_CFG_USE_OPERATORS_OVERLOADING) \
|
||||
&& ( BOOST_WORKAROUND(BOOST_MSVC, <= 1300) \
|
||||
|| BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610)) \
|
||||
|| BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x610)) \
|
||||
|| BOOST_WORKAROUND(__EDG_VERSION__, <= 245) \
|
||||
|| BOOST_WORKAROUND(BOOST_MPL_CFG_GCC, <= 0x0295) \
|
||||
|| BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600)) \
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
#if !defined(BOOST_MPL_CFG_BROKEN_OVERLOAD_RESOLUTION) \
|
||||
&& !defined(BOOST_MPL_PREPROCESSING_MODE) \
|
||||
&& ( BOOST_WORKAROUND(__BORLANDC__, < 0x590) \
|
||||
&& ( BOOST_WORKAROUND(BOOST_BORLANDC, < 0x590) \
|
||||
|| BOOST_WORKAROUND(__MWERKS__, < 0x3001) \
|
||||
)
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
#if !defined(BOOST_MPL_CFG_BROKEN_PP_MACRO_EXPANSION) \
|
||||
&& ( BOOST_WORKAROUND(__MWERKS__, <= 0x3003) \
|
||||
|| BOOST_WORKAROUND(__BORLANDC__, < 0x582) \
|
||||
|| BOOST_WORKAROUND(BOOST_BORLANDC, < 0x582) \
|
||||
|| BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(502)) \
|
||||
)
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#if !defined(BOOST_MPL_CFG_NO_TEMPLATE_TEMPLATE_PARAMETERS) \
|
||||
&& ( defined(BOOST_NO_TEMPLATE_TEMPLATES) \
|
||||
|| BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT( 0x590) ) \
|
||||
|| BOOST_WORKAROUND( BOOST_BORLANDC, BOOST_TESTED_AT( 0x590) ) \
|
||||
)
|
||||
|
||||
# define BOOST_MPL_CFG_NO_TEMPLATE_TEMPLATE_PARAMETERS
|
||||
@@ -31,7 +31,7 @@
|
||||
#if !defined(BOOST_MPL_CFG_EXTENDED_TEMPLATE_PARAMETERS_MATCHING) \
|
||||
&& !defined(BOOST_MPL_PREPROCESSING_MODE) \
|
||||
&& ( BOOST_WORKAROUND(BOOST_MPL_CFG_GCC, BOOST_TESTED_AT(0x0302)) \
|
||||
|| BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610)) \
|
||||
|| BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x610)) \
|
||||
)
|
||||
|
||||
# define BOOST_MPL_CFG_EXTENDED_TEMPLATE_PARAMETERS_MATCHING
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace boost { namespace mpl {
|
||||
template< typename Tag > struct count_impl
|
||||
{
|
||||
template< typename Sequence, typename T > struct apply
|
||||
#if BOOST_WORKAROUND(__BORLANDC__,BOOST_TESTED_AT(0x561))
|
||||
#if BOOST_WORKAROUND(BOOST_BORLANDC,BOOST_TESTED_AT(0x561))
|
||||
{
|
||||
typedef typename count_if< Sequence,same_as<T> >::type type;
|
||||
BOOST_STATIC_CONSTANT(int, value = BOOST_MPL_AUX_VALUE_WKND(type)::value);
|
||||
|
||||
@@ -60,7 +60,7 @@ struct AUX778076_FOLD_IMPL_NAME;
|
||||
|
||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
|
||||
# if !BOOST_WORKAROUND(__BORLANDC__, < 0x600)
|
||||
# if !BOOST_WORKAROUND(BOOST_BORLANDC, < 0x600)
|
||||
|
||||
# define BOOST_PP_ITERATION_PARAMS_1 \
|
||||
(3,(0, BOOST_MPL_LIMIT_UNROLLING, <boost/mpl/aux_/fold_impl_body.hpp>))
|
||||
@@ -125,7 +125,7 @@ struct AUX778076_FOLD_IMPL_NAME<-1,Last,Last,State,ForwardOp>
|
||||
typedef Last iterator;
|
||||
};
|
||||
|
||||
# else // BOOST_WORKAROUND(__BORLANDC__, < 0x600)
|
||||
# else // BOOST_WORKAROUND(BOOST_BORLANDC, < 0x600)
|
||||
|
||||
// Borland have some serious problems with the unrolled version, so
|
||||
// we always use a basic implementation
|
||||
@@ -164,7 +164,7 @@ struct AUX778076_FOLD_IMPL_NAME<N,Last,Last,State,ForwardOp >
|
||||
typedef state type;
|
||||
};
|
||||
|
||||
# endif // BOOST_WORKAROUND(__BORLANDC__, < 0x600)
|
||||
# endif // BOOST_WORKAROUND(BOOST_BORLANDC, < 0x600)
|
||||
|
||||
#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
# include <boost/mpl/if.hpp>
|
||||
# include <boost/mpl/bool.hpp>
|
||||
# include <boost/mpl/aux_/msvc_is_class.hpp>
|
||||
#elif BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610))
|
||||
#elif BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x610))
|
||||
# include <boost/mpl/if.hpp>
|
||||
# include <boost/mpl/bool.hpp>
|
||||
# include <boost/mpl/aux_/yes_no.hpp>
|
||||
@@ -62,7 +62,7 @@ struct has_rebind
|
||||
template< typename T > struct has_rebind_tag {};
|
||||
no_tag operator|(has_rebind_tag<int>, void const volatile*);
|
||||
|
||||
# if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610))
|
||||
# if !BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x610))
|
||||
template< typename T >
|
||||
struct has_rebind
|
||||
{
|
||||
@@ -71,7 +71,7 @@ struct has_rebind
|
||||
sizeof(has_rebind_tag<int>() | get()) == sizeof(yes_tag)
|
||||
);
|
||||
};
|
||||
# else // __BORLANDC__
|
||||
# else // BOOST_BORLANDC
|
||||
template< typename T >
|
||||
struct has_rebind_impl
|
||||
{
|
||||
@@ -90,7 +90,7 @@ struct has_rebind
|
||||
>::type
|
||||
{
|
||||
};
|
||||
# endif // __BORLANDC__
|
||||
# endif // BOOST_BORLANDC
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -14,9 +14,10 @@
|
||||
// $Date$
|
||||
// $Revision$
|
||||
|
||||
#include <boost/mpl/copy.hpp>
|
||||
#include <boost/mpl/placeholders.hpp>
|
||||
#include <boost/mpl/fold.hpp>
|
||||
#include <boost/mpl/insert.hpp>
|
||||
#include <boost/mpl/clear.hpp>
|
||||
#include <boost/mpl/front_inserter.hpp>
|
||||
#include <boost/mpl/joint_view.hpp>
|
||||
#include <boost/mpl/iterator_range.hpp>
|
||||
#include <boost/mpl/aux_/na_spec.hpp>
|
||||
@@ -43,29 +44,31 @@ struct insert_range_impl
|
||||
>
|
||||
struct apply
|
||||
#if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING)
|
||||
: reverse_copy<
|
||||
joint_view<
|
||||
: reverse_fold<
|
||||
joint_view<
|
||||
iterator_range<typename begin<Sequence>::type,Pos>
|
||||
, joint_view<
|
||||
, joint_view<
|
||||
Range
|
||||
, iterator_range<Pos,typename end<Sequence>::type>
|
||||
>
|
||||
>
|
||||
, front_inserter< typename clear<Sequence>::type >
|
||||
, typename clear<Sequence>::type
|
||||
, insert<_1, begin<_1>, _2>
|
||||
>
|
||||
{
|
||||
#else
|
||||
{
|
||||
typedef typename reverse_copy<
|
||||
joint_view<
|
||||
iterator_range<typename begin<Sequence>::type,Pos>
|
||||
, joint_view<
|
||||
Range
|
||||
, iterator_range<Pos,typename end<Sequence>::type>
|
||||
>
|
||||
>
|
||||
, front_inserter< typename clear<Sequence>::type >
|
||||
>::type type;
|
||||
typedef typename reverse_fold<
|
||||
joint_view<
|
||||
iterator_range<typename begin<Sequence>::type,Pos>
|
||||
, joint_view<
|
||||
Range
|
||||
, iterator_range<Pos,typename end<Sequence>::type>
|
||||
>
|
||||
>
|
||||
, typename clear<Sequence>::type
|
||||
, insert<_1, begin<_1>, _2>
|
||||
>::type type;
|
||||
#endif
|
||||
};
|
||||
};
|
||||
|
||||
@@ -63,7 +63,7 @@ struct AUX_WRAPPER_NAME
|
||||
public:
|
||||
typedef AUX_WRAPPER_INST(next_value) next;
|
||||
typedef AUX_WRAPPER_INST(prior_value) prior;
|
||||
#elif BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x561)) \
|
||||
#elif BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x561)) \
|
||||
|| BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(502)) \
|
||||
|| (BOOST_WORKAROUND(__HP_aCC, <= 53800) && (BOOST_WORKAROUND(__hpxstd98, != 1)))
|
||||
typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N + 1)) ) next;
|
||||
|
||||
@@ -110,7 +110,7 @@ template< typename T > struct has_rebind_tag;
|
||||
typedef BOOST_PP_CAT(name,_rebind) rebind; \
|
||||
/**/
|
||||
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610))
|
||||
#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x610))
|
||||
# define BOOST_MPL_AUX_LAMBDA_SUPPORT_HAS_REBIND(i, name, params) \
|
||||
template< BOOST_MPL_PP_PARAMS(i,typename T) > \
|
||||
::boost::mpl::aux::yes_tag operator|( \
|
||||
@@ -134,7 +134,7 @@ template< BOOST_MPL_PP_PARAMS(i,typename T) > \
|
||||
# define BOOST_MPL_AUX_LAMBDA_SUPPORT_HAS_REBIND(i, name, params) /**/
|
||||
#endif
|
||||
|
||||
# if !defined(__BORLANDC__)
|
||||
# if !defined(BOOST_BORLANDC)
|
||||
# define BOOST_MPL_AUX_LAMBDA_SUPPORT(i, name, params) \
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(i, name, params) \
|
||||
}; \
|
||||
@@ -160,7 +160,7 @@ class BOOST_PP_CAT(name,_rebind) \
|
||||
typedef typename name< BOOST_MPL_PP_PARAMS(i,U) >::type type; \
|
||||
}; \
|
||||
/**/
|
||||
# endif // __BORLANDC__
|
||||
# endif // BOOST_BORLANDC
|
||||
|
||||
#endif // __EDG_VERSION__
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#include <boost/mpl/aux_/config/workaround.hpp>
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MPL_CFG_GCC, BOOST_TESTED_AT(0x0302)) \
|
||||
|| BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x561)) \
|
||||
|| BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x561)) \
|
||||
|| BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x530)) \
|
||||
|| BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840))
|
||||
|
||||
|
||||
@@ -15,9 +15,16 @@
|
||||
// $Revision$
|
||||
|
||||
#include <boost/preprocessor/seq/subseq.hpp>
|
||||
#include <boost/preprocessor/repetition/repeat.hpp>
|
||||
#include <boost/preprocessor/arithmetic/add.hpp>
|
||||
|
||||
#define BOOST_MPL_PP_RANGE_ITEM(z,n,_) (n)
|
||||
|
||||
#define BOOST_MPL_PP_RANGE(first, length) \
|
||||
BOOST_PP_SEQ_SUBSEQ((0)(1)(2)(3)(4)(5)(6)(7)(8)(9), first, length) \
|
||||
BOOST_PP_SEQ_SUBSEQ( \
|
||||
BOOST_PP_REPEAT(BOOST_PP_ADD(first,length), BOOST_MPL_PP_RANGE_ITEM, _), \
|
||||
first, length \
|
||||
) \
|
||||
/**/
|
||||
|
||||
#endif // BOOST_MPL_AUX_PREPROCESSOR_RANGE_HPP_INCLUDED
|
||||
|
||||
@@ -29,7 +29,7 @@ template< typename Tag >
|
||||
struct size_impl
|
||||
{
|
||||
template< typename Sequence > struct apply
|
||||
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x561))
|
||||
#if !BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x561))
|
||||
: distance<
|
||||
typename begin<Sequence>::type
|
||||
, typename end<Sequence>::type
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
#include <boost/mpl/aux_/config/workaround.hpp>
|
||||
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x561)) \
|
||||
#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x561)) \
|
||||
|| BOOST_WORKAROUND(__GNUC__, < 3) \
|
||||
|| BOOST_WORKAROUND(__MWERKS__, <= 0x3001)
|
||||
# define BOOST_MPL_AUX_STATIC_CAST(T, expr) (T)(expr)
|
||||
|
||||
@@ -17,12 +17,11 @@
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/aux_/config/msvc.hpp>
|
||||
#include <boost/mpl/aux_/config/workaround.hpp>
|
||||
#include <boost/mpl/aux_/lambda_support.hpp>
|
||||
|
||||
#include <boost/type_traits/integral_constant.hpp>
|
||||
#include <boost/type_traits/is_empty.hpp>
|
||||
|
||||
// should be always the last #include directive
|
||||
#include <boost/type_traits/detail/bool_trait_def.hpp>
|
||||
|
||||
namespace boost { namespace mpl {
|
||||
|
||||
// empty base class, guaranteed to have no members; inheritance from
|
||||
@@ -51,9 +50,14 @@ struct is_empty_base<empty_base>
|
||||
}}
|
||||
|
||||
namespace boost {
|
||||
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_empty, mpl::empty_base, true)
|
||||
|
||||
template<> struct is_empty< mpl::empty_base >
|
||||
: public ::boost::integral_constant<bool,true>
|
||||
{
|
||||
public:
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(1,is_empty,(mpl::empty_base))
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#include <boost/type_traits/detail/bool_trait_undef.hpp>
|
||||
|
||||
#endif // BOOST_MPL_EMPTY_BASE_HPP_INCLUDED
|
||||
|
||||
@@ -23,7 +23,8 @@ namespace boost { namespace mpl {
|
||||
|
||||
struct empty_sequence
|
||||
{
|
||||
struct tag;
|
||||
struct tag;
|
||||
typedef empty_sequence type;
|
||||
struct begin { typedef random_access_iterator_tag category; };
|
||||
typedef begin end;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
|
||||
#ifndef BOOST_MPL_GET_TAG_HPP_INCLUDED
|
||||
#define BOOST_MPL_GET_TAG_HPP_INCLUDED
|
||||
|
||||
// Copyright Sergey Krivonos 2017
|
||||
//
|
||||
// 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)
|
||||
//
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
// $Id$
|
||||
// $Date$
|
||||
// $Revision$
|
||||
|
||||
|
||||
#define BOOST_MPL_GET_TAG_DEF(TAG) \
|
||||
namespace boost { namespace mpl { \
|
||||
template<typename T> \
|
||||
struct get_##TAG { \
|
||||
typedef typename T::TAG type; \
|
||||
}; \
|
||||
}}
|
||||
|
||||
#endif
|
||||
@@ -33,7 +33,7 @@
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
|
||||
|
||||
#if BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT(0x590) )
|
||||
#if BOOST_WORKAROUND( BOOST_BORLANDC, BOOST_TESTED_AT(0x590) )
|
||||
# include <boost/type_traits/is_class.hpp>
|
||||
#endif
|
||||
|
||||
@@ -196,7 +196,7 @@ struct trait \
|
||||
}; \
|
||||
/**/
|
||||
|
||||
# elif BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT(0x590) )
|
||||
# elif BOOST_WORKAROUND( BOOST_BORLANDC, BOOST_TESTED_AT(0x590) )
|
||||
|
||||
# define BOOST_MPL_HAS_XXX_TRAIT_NAMED_BCB_DEF(trait, trait_tester, name, default_) \
|
||||
template< typename T, bool IS_CLASS > \
|
||||
|
||||
@@ -46,7 +46,7 @@ struct if_c<false,T1,T2>
|
||||
};
|
||||
|
||||
// agurt, 05/sep/04: nondescriptive parameter names for the sake of DigitalMars
|
||||
// (and possibly MWCW < 8.0); see http://article.gmane.org/gmane.comp.lib.boost.devel/108959
|
||||
// (and possibly MWCW < 8.0); see https://lists.boost.org/Archives/boost/2004/09/71383.php
|
||||
template<
|
||||
typename BOOST_MPL_AUX_NA_PARAM(T1)
|
||||
, typename BOOST_MPL_AUX_NA_PARAM(T2)
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
|
||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
|
||||
&& !BOOST_WORKAROUND(__BORLANDC__, <= 0x551)
|
||||
&& !BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x551)
|
||||
BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
|
||||
// 'bool' constant doesn't have 'next'/'prior' members
|
||||
template< bool C >
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include <boost/mpl/aux_/na_spec.hpp>
|
||||
#include <boost/mpl/aux_/config/workaround.hpp>
|
||||
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610))
|
||||
#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x610))
|
||||
# define BOOST_MPL_CFG_STRIPPED_DOWN_LOWER_BOUND_IMPL
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
|
||||
#ifndef BOOST_MPL_MAP_AUX_INSERT_RANGE_IMPL_HPP_INCLUDED
|
||||
#define BOOST_MPL_MAP_AUX_INSERT_RANGE_IMPL_HPP_INCLUDED
|
||||
|
||||
// Copyright Bruno Dutra 2015
|
||||
//
|
||||
// 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)
|
||||
//
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
// $Id$
|
||||
// $Date$
|
||||
// $Revision$
|
||||
|
||||
#include <boost/mpl/insert_range_fwd.hpp>
|
||||
#include <boost/mpl/map/aux_/tag.hpp>
|
||||
#include <boost/mpl/placeholders.hpp>
|
||||
#include <boost/mpl/fold.hpp>
|
||||
#include <boost/mpl/insert.hpp>
|
||||
|
||||
namespace boost { namespace mpl {
|
||||
|
||||
template<>
|
||||
struct insert_range_impl< aux::map_tag >
|
||||
{
|
||||
template<
|
||||
typename Sequence
|
||||
, typename /*Pos*/
|
||||
, typename Range
|
||||
>
|
||||
struct apply
|
||||
: fold<Range, Sequence, insert<_1, _2> >
|
||||
{
|
||||
};
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
#endif // BOOST_MPL_MAP_AUX_INSERT_RANGE_IMPL_HPP_INCLUDED
|
||||
@@ -40,6 +40,7 @@ struct m_item
|
||||
typedef Key key_;
|
||||
typedef pair<Key,T> item;
|
||||
typedef Base base;
|
||||
typedef m_item type;
|
||||
|
||||
typedef typename next< typename Base::size >::type size;
|
||||
typedef typename next< typename Base::order >::type order;
|
||||
@@ -62,6 +63,7 @@ struct m_mask
|
||||
{
|
||||
typedef void_ key_;
|
||||
typedef Base base;
|
||||
typedef m_mask type;
|
||||
|
||||
typedef typename prior< typename Base::size >::type size;
|
||||
typedef typename x_order_impl<Base,Key>::type key_order_;
|
||||
@@ -123,6 +125,7 @@ struct m_mask
|
||||
{
|
||||
typedef void_ key_;
|
||||
typedef Base base;
|
||||
typedef m_mask type;
|
||||
|
||||
typedef typename prior< typename Base::size >::type size;
|
||||
typedef typename x_order_impl<Base,Key>::type key_order_;
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <boost/mpl/map/aux_/at_impl.hpp>
|
||||
//#include <boost/mpl/map/aux_/O1_size.hpp>
|
||||
#include <boost/mpl/map/aux_/insert_impl.hpp>
|
||||
#include <boost/mpl/map/aux_/insert_range_impl.hpp>
|
||||
#include <boost/mpl/map/aux_/erase_impl.hpp>
|
||||
#include <boost/mpl/map/aux_/erase_key_impl.hpp>
|
||||
#include <boost/mpl/map/aux_/has_key_impl.hpp>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
// resolves conflicts with 'boost::numeric_cast' function template.
|
||||
// use it in your own code _only_ if you care about compatibility with
|
||||
// these outdated compilers!
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570) )
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) || BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x570) )
|
||||
# define BOOST_MPL_AUX_NUMERIC_CAST numeric_cast_
|
||||
#else
|
||||
# define BOOST_MPL_AUX_NUMERIC_CAST numeric_cast
|
||||
|
||||
@@ -47,7 +47,10 @@ struct print
|
||||
#endif
|
||||
{
|
||||
#if defined(__clang__)
|
||||
# pragma clang diagnostic push
|
||||
# pragma clang diagnostic ignored "-Wc++11-extensions"
|
||||
const int m_x = 1 / (sizeof(T) - sizeof(T));
|
||||
# pragma clang diagnostic pop
|
||||
#elif defined(BOOST_MSVC)
|
||||
enum { n = sizeof(T) + -1 };
|
||||
#elif defined(__MWERKS__)
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
|
||||
#ifndef BOOST_MPL_SET_AUX_INSERT_RANGE_IMPL_HPP_INCLUDED
|
||||
#define BOOST_MPL_SET_AUX_INSERT_RANGE_IMPL_HPP_INCLUDED
|
||||
|
||||
// Copyright Bruno Dutra 2015
|
||||
//
|
||||
// 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)
|
||||
//
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
// $Id$
|
||||
// $Date$
|
||||
// $Revision$
|
||||
|
||||
#include <boost/mpl/insert_range_fwd.hpp>
|
||||
#include <boost/mpl/set/aux_/tag.hpp>
|
||||
#include <boost/mpl/placeholders.hpp>
|
||||
#include <boost/mpl/fold.hpp>
|
||||
#include <boost/mpl/insert.hpp>
|
||||
|
||||
namespace boost { namespace mpl {
|
||||
|
||||
template<>
|
||||
struct insert_range_impl< aux::set_tag >
|
||||
{
|
||||
template<
|
||||
typename Sequence
|
||||
, typename /*Pos*/
|
||||
, typename Range
|
||||
>
|
||||
struct apply
|
||||
: fold<Range, Sequence, insert<_1, _2> >
|
||||
{
|
||||
};
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
#endif // BOOST_MPL_SET_AUX_INSERT_RANGE_IMPL_HPP_INCLUDED
|
||||
@@ -33,6 +33,7 @@ struct s_item
|
||||
typedef void_ last_masked_;
|
||||
typedef T item_type_;
|
||||
typedef typename Base::item_ base;
|
||||
typedef s_item type;
|
||||
|
||||
typedef typename next< typename Base::size >::type size;
|
||||
typedef typename next< typename Base::order >::type order;
|
||||
@@ -57,6 +58,7 @@ struct s_mask
|
||||
typedef void_ item_type_;
|
||||
typedef typename Base::item_ base;
|
||||
typedef typename prior< typename Base::size >::type size;
|
||||
typedef s_mask type;
|
||||
|
||||
BOOST_MPL_AUX_SET_OVERLOAD( aux::yes_tag, IS_MASKED, s_mask, aux::type_wrapper<T>* );
|
||||
};
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <boost/mpl/set/aux_/size_impl.hpp>
|
||||
#include <boost/mpl/set/aux_/empty_impl.hpp>
|
||||
#include <boost/mpl/set/aux_/insert_impl.hpp>
|
||||
#include <boost/mpl/set/aux_/insert_range_impl.hpp>
|
||||
#include <boost/mpl/set/aux_/erase_impl.hpp>
|
||||
#include <boost/mpl/set/aux_/erase_key_impl.hpp>
|
||||
#include <boost/mpl/set/aux_/has_key_impl.hpp>
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace boost { namespace mpl
|
||||
#define BOOST_MPL_MULTICHAR_LENGTH(c) \
|
||||
(std::size_t)((c<CHAR_MIN) ? 4 : ((c>0xffffff)+(c>0xffff)+(c>0xff)+1))
|
||||
|
||||
#if defined(BOOST_ENDIAN_LITTLE_BYTE) && defined(__SUNPRO_CC)
|
||||
#if BOOST_ENDIAN_LITTLE_BYTE && defined(__SUNPRO_CC)
|
||||
|
||||
#define BOOST_MPL_MULTICHAR_AT(c,i) \
|
||||
(char)(0xff&((unsigned)(c)>>(8*(std::size_t)(i))))
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include <boost/mpl/aux_/na_spec.hpp>
|
||||
#include <boost/mpl/aux_/config/workaround.hpp>
|
||||
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610))
|
||||
#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x610))
|
||||
# define BOOST_MPL_CFG_STRIPPED_DOWN_UPPER_BOUND_IMPL
|
||||
#endif
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ template< BOOST_MPL_AUX_NTTP_DECL(long, n_) >
|
||||
struct at_impl< aux::vector_tag<n_> >
|
||||
{
|
||||
template< typename Vector, typename N > struct apply
|
||||
#if !defined(__BORLANDC__)
|
||||
#if !defined(BOOST_BORLANDC)
|
||||
: v_at<
|
||||
Vector
|
||||
, BOOST_MPL_AUX_VALUE_WKND(N)::value
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"key": "mpl",
|
||||
"name": "MPL",
|
||||
"authors": [
|
||||
"Aleksey Gurtovoy"
|
||||
],
|
||||
"description": "The Boost.MPL library is a general-purpose, high-level C++ template metaprogramming framework of compile-time algorithms, sequences and metafunctions. It provides a conceptual foundation and an extensive set of powerful and coherent tools that make doing explict metaprogramming in C++ as easy and enjoyable as possible within the current language.",
|
||||
"category": [
|
||||
"Metaprogramming"
|
||||
],
|
||||
"maintainers": [
|
||||
"Aleksey Gurtovoy <agurtovoy -at- meta-comm.com>"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
Pre-processing of MPL-containers
|
||||
--------------------------------
|
||||
|
||||
Pre-processing of MPL-containers can be accomplished using the script
|
||||
"boost_mpl_preprocess.py". In the simple case call it with a single
|
||||
argument which is the path to the source-directory of Boost.
|
||||
|
||||
python boost_mpl_preprocess.py <path-to-boost-sourcedir>
|
||||
|
||||
If the Boost source-directory is the one this script resides in, you
|
||||
can just call it without any arguments.
|
||||
|
||||
python boost_mpl_preprocess.py
|
||||
|
||||
Either way, this will pre-process all four MPL-container types (vector,
|
||||
list, set, map) and makes them able to hold up to 100 elements. They can
|
||||
be used either in their 'numbered' or their 'variadic' form.
|
||||
|
||||
Additionally, the script also allows more fine-grained pre-processing.
|
||||
The maximal number of elements an MPL-container type is able to hold can
|
||||
be different from the one of other MPL-container types and it can also
|
||||
differ between its 'numbered' and 'variadic' form.
|
||||
To see all options, call the script like this:
|
||||
|
||||
python boost_mpl_preprocess.py --help
|
||||
|
||||
|
||||
Fixing pre-processing of MPL-containers
|
||||
---------------------------------------
|
||||
|
||||
Sadly, pre-processing of MPL-containers might fail, if the source-files
|
||||
used as input are missing some header-comments required during the pre-
|
||||
processing step.
|
||||
However, the script "boost_mpl_preprocess.py" makes sure to patch these
|
||||
input source-files prior to pre-processing (by implicitly calling script
|
||||
"fix_boost_mpl_preprocess.py" with the chosen settings). It only patches
|
||||
the source-files needed for pre-processing the selected MPL-container
|
||||
types and their selected form ('numbered' or 'variadic').
|
||||
If calling it with a single (or no) argument (as in the former section)
|
||||
all input source-files will be patched automatically.
|
||||
|
||||
Instead of fixing the input-files implicitly during pre-processing one
|
||||
can also fix them explicitly by calling "fix_boost_mpl_preprocess.py"
|
||||
directly.
|
||||
If you just want to test if any fixing is needed call it like this:
|
||||
|
||||
python fix_boost_mpl_preprocess.py --check-only <path-to-boost-sourcedir>
|
||||
|
||||
This will tell you if any fixing is needed. In such a case call the script
|
||||
"fix_boost_mpl_preprocess.py" like this:
|
||||
|
||||
python fix_boost_mpl_preprocess.py <path-to-boost-sourcedir>
|
||||
|
||||
This will fix the header-comments of all the source-files needed during
|
||||
pre-processing. Calling "boost_mpl_preprocess.py" afterwards should then
|
||||
successfully pre-process the MPL-containers (without the need of implicitly
|
||||
fixing any files again).
|
||||
|
||||
Note:
|
||||
Failure of pre-processing can be checked by examining at least one of the
|
||||
following directories in which automatically generated files will be put
|
||||
during pre-processing. If at least one file in these directories (or sub-
|
||||
directories therein) has a size of zero bytes, fixing is needed.
|
||||
|
||||
<path-to-boost-sourcedir>/boost/mpl/vector/aux_/preprocessed/
|
||||
<path-to-boost-sourcedir>/boost/mpl/list/aux_/preprocessed/
|
||||
<path-to-boost-sourcedir>/boost/mpl/set/aux_/preprocessed/
|
||||
<path-to-boost-sourcedir>/boost/mpl/map/aux_/preprocessed/
|
||||
<path-to-boost-sourcedir>/boost/mpl/aux_/preprocessed/
|
||||
|
||||
Executable
+250
@@ -0,0 +1,250 @@
|
||||
# Copyright Deniz Bahadir 2015
|
||||
#
|
||||
# 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)
|
||||
#
|
||||
# See http://www.boost.org/libs/mpl for documentation.
|
||||
# See http://stackoverflow.com/a/20660264/3115457 for further information.
|
||||
# See http://stackoverflow.com/a/29627158/3115457 for further information.
|
||||
|
||||
import fix_boost_mpl_preprocess as fixmpl
|
||||
import argparse
|
||||
import sys
|
||||
import os
|
||||
import os.path
|
||||
import re
|
||||
import fileinput
|
||||
import shutil
|
||||
|
||||
|
||||
def create_more_container_files(sourceDir, suffix, maxElements, containers, containers2):
|
||||
"""Creates additional files for the individual MPL-containers."""
|
||||
|
||||
# Create files for each MPL-container with 20 to 'maxElements' elements
|
||||
# which will be used during generation.
|
||||
for container in containers:
|
||||
for i in range(20, maxElements, 10):
|
||||
# Create copy of "template"-file.
|
||||
newFile = os.path.join( sourceDir, container, container + str(i+10) + suffix )
|
||||
shutil.copyfile( os.path.join( sourceDir, container, container + "20" + suffix ), newFile )
|
||||
# Adjust copy of "template"-file accordingly.
|
||||
for line in fileinput.input( newFile, inplace=1, mode="rU" ):
|
||||
line = re.sub(r'20', '%TWENTY%', line.rstrip())
|
||||
line = re.sub(r'11', '%ELEVEN%', line.rstrip())
|
||||
line = re.sub(r'10(?![0-9])', '%TEN%', line.rstrip())
|
||||
line = re.sub(r'%TWENTY%', re.escape(str(i+10)), line.rstrip())
|
||||
line = re.sub(r'%ELEVEN%', re.escape(str(i + 1)), line.rstrip())
|
||||
line = re.sub(r'%TEN%', re.escape(str(i)), line.rstrip())
|
||||
print(line)
|
||||
for container in containers2:
|
||||
for i in range(20, maxElements, 10):
|
||||
# Create copy of "template"-file.
|
||||
newFile = os.path.join( sourceDir, container, container + str(i+10) + "_c" + suffix )
|
||||
shutil.copyfile( os.path.join( sourceDir, container, container + "20_c" + suffix ), newFile )
|
||||
# Adjust copy of "template"-file accordingly.
|
||||
for line in fileinput.input( newFile, inplace=1, mode="rU" ):
|
||||
line = re.sub(r'20', '%TWENTY%', line.rstrip())
|
||||
line = re.sub(r'11', '%ELEVEN%', line.rstrip())
|
||||
line = re.sub(r'10(?![0-9])', '%TEN%', line.rstrip())
|
||||
line = re.sub(r'%TWENTY%', re.escape(str(i+10)), line.rstrip())
|
||||
line = re.sub(r'%ELEVEN%', re.escape(str(i + 1)), line.rstrip())
|
||||
line = re.sub(r'%TEN%', re.escape(str(i)), line.rstrip())
|
||||
print(line)
|
||||
|
||||
|
||||
def create_input_for_numbered_sequences(headerDir, sourceDir, containers, maxElements):
|
||||
"""Creates additional source- and header-files for the numbered sequence MPL-containers."""
|
||||
# Create additional container-list without "map".
|
||||
containersWithoutMap = containers[:]
|
||||
try:
|
||||
containersWithoutMap.remove('map')
|
||||
except ValueError:
|
||||
# We can safely ignore if "map" is not contained in 'containers'!
|
||||
pass
|
||||
# Create header/source-files.
|
||||
create_more_container_files(headerDir, ".hpp", maxElements, containers, containersWithoutMap)
|
||||
create_more_container_files(sourceDir, ".cpp", maxElements, containers, containersWithoutMap)
|
||||
|
||||
|
||||
def adjust_container_limits_for_variadic_sequences(headerDir, containers, maxElements):
|
||||
"""Adjusts the limits of variadic sequence MPL-containers."""
|
||||
for container in containers:
|
||||
headerFile = os.path.join( headerDir, "limits", container + ".hpp" )
|
||||
regexMatch = r'(define\s+BOOST_MPL_LIMIT_' + container.upper() + r'_SIZE\s+)[0-9]+'
|
||||
regexReplace = r'\g<1>' + re.escape( str(maxElements) )
|
||||
for line in fileinput.input( headerFile, inplace=1, mode="rU" ):
|
||||
line = re.sub(regexMatch, regexReplace, line.rstrip())
|
||||
print(line)
|
||||
|
||||
|
||||
def current_boost_dir():
|
||||
"""Returns the (relative) path to the Boost source-directory this file is located in (if any)."""
|
||||
# Path to directory containing this script.
|
||||
path = os.path.dirname( os.path.realpath(__file__) )
|
||||
# Making sure it is located in "${boost-dir}/libs/mpl/preprocessed".
|
||||
for directory in reversed( ["libs", "mpl", "preprocessed"] ):
|
||||
(head, tail) = os.path.split(path)
|
||||
if tail == directory:
|
||||
path = head
|
||||
else:
|
||||
return None
|
||||
return os.path.relpath( path )
|
||||
|
||||
|
||||
|
||||
def to_positive_multiple_of_10(string):
|
||||
"""Converts a string into its encoded positive integer (greater zero) or throws an exception."""
|
||||
try:
|
||||
value = int(string)
|
||||
except ValueError:
|
||||
msg = '"%r" is not a positive multiple of 10 (greater zero).' % string
|
||||
raise argparse.ArgumentTypeError(msg)
|
||||
if value <= 0 or value % 10 != 0:
|
||||
msg = '"%r" is not a positive multiple of 10 (greater zero).' % string
|
||||
raise argparse.ArgumentTypeError(msg)
|
||||
return value
|
||||
|
||||
|
||||
def to_existing_absolute_path(string):
|
||||
"""Converts a path into its absolute path and verifies that it exists or throws an exception."""
|
||||
value = os.path.abspath(string)
|
||||
if not os.path.exists( value ) or not os.path.isdir( value ):
|
||||
msg = '"%r" is not a valid path to a directory.' % string
|
||||
raise argparse.ArgumentTypeError(msg)
|
||||
return value
|
||||
|
||||
|
||||
def main():
|
||||
"""The main function."""
|
||||
|
||||
# Find the current Boost source-directory in which this script is located.
|
||||
sourceDir = current_boost_dir()
|
||||
if sourceDir == None:
|
||||
sourceDir = ""
|
||||
|
||||
# Prepare and run cmdline-parser.
|
||||
cmdlineParser = argparse.ArgumentParser(description="A generator-script for pre-processed Boost.MPL headers.")
|
||||
cmdlineParser.add_argument("-v", "--verbose", dest='verbose', action='store_true',
|
||||
help="Be a little bit more verbose.")
|
||||
cmdlineParser.add_argument("-s", "--sequence-type", dest='seqType', choices=['variadic', 'numbered', 'both'],
|
||||
default='both',
|
||||
help="Only update pre-processed headers for the selected sequence types, "
|
||||
"either 'numbered' sequences, 'variadic' sequences or 'both' sequence "
|
||||
"types. (Default=both)")
|
||||
cmdlineParser.add_argument("--no-vector", dest='want_vector', action='store_false',
|
||||
help="Do not update pre-processed headers for Boost.MPL Vector.")
|
||||
cmdlineParser.add_argument("--no-list", dest='want_list', action='store_false',
|
||||
help="Do not update pre-processed headers for Boost.MPL List.")
|
||||
cmdlineParser.add_argument("--no-set", dest='want_set', action='store_false',
|
||||
help="Do not update pre-processed headers for Boost.MPL Set.")
|
||||
cmdlineParser.add_argument("--no-map", dest='want_map', action='store_false',
|
||||
help="Do not update pre-processed headers for Boost.MPL Map.")
|
||||
cmdlineParser.add_argument("--num-elements", dest='numElements', metavar="<num-elements>",
|
||||
type=to_positive_multiple_of_10, default=100,
|
||||
help="The maximal number of elements per container sequence. (Default=100)")
|
||||
cmdlineParser.add_argument(dest='sourceDir', metavar="<source-dir>", default=current_boost_dir(), nargs='?',
|
||||
type=to_existing_absolute_path,
|
||||
help="The source-directory of Boost. (Default=\"" + sourceDir + "\")")
|
||||
args = cmdlineParser.parse_args()
|
||||
|
||||
# Some verbose debug output.
|
||||
if args.verbose:
|
||||
print "Arguments extracted from command-line:"
|
||||
print " verbose = ", args.verbose
|
||||
print " source directory = ", args.sourceDir
|
||||
print " num elements = ", args.numElements
|
||||
print " sequence type = ", args.seqType
|
||||
print " want: vector = ", args.want_vector
|
||||
print " want: list = ", args.want_list
|
||||
print " want: set = ", args.want_set
|
||||
print " want: map = ", args.want_map
|
||||
|
||||
# Verify that we received any source-directory.
|
||||
if args.sourceDir == None:
|
||||
print "You should specify a valid path to the Boost source-directory."
|
||||
sys.exit(0)
|
||||
|
||||
# The directories for header- and source files of Boost.MPL.
|
||||
# NOTE: Assuming 'args.sourceDir' is the source-directory of the entire boost project.
|
||||
headerDir = os.path.join( args.sourceDir, "boost", "mpl" )
|
||||
sourceDir = os.path.join( args.sourceDir, "libs", "mpl", "preprocessed" )
|
||||
# Check that the header/source-directories exist.
|
||||
if not os.path.exists( headerDir ) or not os.path.exists( sourceDir ):
|
||||
# Maybe 'args.sourceDir' is not the source-directory of the entire boost project
|
||||
# but instead of the Boost.MPL git-directory, only?
|
||||
headerDir = os.path.join( args.sourceDir, "include", "boost", "mpl" )
|
||||
sourceDir = os.path.join( args.sourceDir, "preprocessed" )
|
||||
if not os.path.exists( headerDir ) or not os.path.exists( sourceDir ):
|
||||
cmdlineParser.print_usage()
|
||||
print "error: Cannot find Boost.MPL header/source files in given Boost source-directory!"
|
||||
sys.exit(0)
|
||||
|
||||
# Some verbose debug output.
|
||||
if args.verbose:
|
||||
print "Chosen header-directory: ", headerDir
|
||||
print "Chosen source-directory: ", sourceDir
|
||||
|
||||
# Create list of containers for which files shall be pre-processed.
|
||||
containers = []
|
||||
if args.want_vector:
|
||||
containers.append('vector')
|
||||
if args.want_list:
|
||||
containers.append('list')
|
||||
if args.want_set:
|
||||
containers.append('set')
|
||||
if args.want_map:
|
||||
containers.append('map')
|
||||
if containers == []:
|
||||
print "Nothing to do."
|
||||
print "(Why did you prevent generating pre-processed headers for all Boost.MPL container types?)"
|
||||
sys.exit(0)
|
||||
|
||||
# Possibly fix the header-comments of input-files needed for pre-processing.
|
||||
if args.verbose:
|
||||
print "Checking if prior to pre-processing some input-files need fixing."
|
||||
needFixing = fixmpl.check_input_files(headerDir, sourceDir, containers, args.seqType, args.verbose)
|
||||
if needFixing:
|
||||
if args.verbose:
|
||||
print "Fixing of some input-files prior to pre-processing is needed."
|
||||
print "Will fix them now!"
|
||||
fixmpl.fix_input_files(headerDir, sourceDir, containers, args.seqType, args.verbose)
|
||||
|
||||
# Some verbose debug output.
|
||||
if args.verbose:
|
||||
print "Containers for which to pre-process headers: ", containers
|
||||
|
||||
# Create (additional) input files for generating pre-processed headers of numbered sequence MPL containers.
|
||||
if args.seqType == "both" or args.seqType == "numbered":
|
||||
create_input_for_numbered_sequences(headerDir, sourceDir, containers, args.numElements)
|
||||
# Modify settings for generating pre-processed headers of variadic sequence MPL containers.
|
||||
if args.seqType == "both" or args.seqType == "variadic":
|
||||
adjust_container_limits_for_variadic_sequences(headerDir, containers, args.numElements)
|
||||
|
||||
# Generate MPL-preprocessed files.
|
||||
os.chdir( sourceDir )
|
||||
if args.seqType == "both" or args.seqType == "numbered":
|
||||
if args.want_vector:
|
||||
if args.verbose:
|
||||
print "Pre-process headers for Boost.MPL numbered vectors."
|
||||
os.system( "python " + os.path.join( sourceDir, "preprocess_vector.py" ) + " all " + args.sourceDir )
|
||||
if args.want_list:
|
||||
if args.verbose:
|
||||
print "Pre-process headers for Boost.MPL numbered lists."
|
||||
os.system( "python " + os.path.join( sourceDir, "preprocess_list.py" ) + " all " + args.sourceDir )
|
||||
if args.want_set:
|
||||
if args.verbose:
|
||||
print "Pre-process headers for Boost.MPL numbered sets."
|
||||
os.system( "python " + os.path.join( sourceDir, "preprocess_set.py" ) + " all " + args.sourceDir )
|
||||
if args.want_map:
|
||||
if args.verbose:
|
||||
print "Pre-process headers for Boost.MPL numbered maps."
|
||||
os.system( "python " + os.path.join( sourceDir, "preprocess_map.py" ) + " all " + args.sourceDir )
|
||||
if args.seqType == "both" or args.seqType == "variadic":
|
||||
if args.verbose:
|
||||
print "Pre-process headers for Boost.MPL variadic containers."
|
||||
os.system( "python " + os.path.join( sourceDir, "preprocess.py" ) + " all " + args.sourceDir )
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Executable
+205
@@ -0,0 +1,205 @@
|
||||
# Copyright Deniz Bahadir 2015
|
||||
#
|
||||
# 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)
|
||||
#
|
||||
# See http://www.boost.org/libs/mpl for documentation.
|
||||
# See http://stackoverflow.com/a/29627158/3115457 for further information.
|
||||
|
||||
import argparse
|
||||
import sys
|
||||
import os.path
|
||||
import re
|
||||
import fileinput
|
||||
import datetime
|
||||
import glob
|
||||
|
||||
|
||||
def check_header_comment(filename):
|
||||
"""Checks if the header-comment of the given file needs fixing."""
|
||||
# Check input file.
|
||||
name = os.path.basename( filename )
|
||||
# Read content of input file.
|
||||
sourcefile = open( filename, "rU" )
|
||||
content = sourcefile.read()
|
||||
sourcefile.close()
|
||||
# Search content for '$Id$'.
|
||||
match = re.search(r'\$Id\$', content)
|
||||
if match == None:
|
||||
# Make sure that the correct value for '$Id$' was already set.
|
||||
match = re.search(r'\$Id: ' + name + r'\s+[^$]+\$', content)
|
||||
if match != None:
|
||||
# The given file needs no fixing.
|
||||
return False
|
||||
# The given file needs fixing.
|
||||
return True
|
||||
|
||||
|
||||
def check_input_files_for_variadic_seq(headerDir, sourceDir):
|
||||
"""Checks if files, used as input when pre-processing MPL-containers in their variadic form, need fixing."""
|
||||
# Check input files in include/source-directories.
|
||||
files = glob.glob( os.path.join( headerDir, "*.hpp" ) )
|
||||
files += glob.glob( os.path.join( headerDir, "aux_", "*.hpp" ) )
|
||||
files += glob.glob( os.path.join( sourceDir, "src", "*" ) )
|
||||
for currentFile in sorted( files ):
|
||||
if check_header_comment( currentFile ):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def check_input_files_for_numbered_seq(sourceDir, suffix, containers):
|
||||
"""Check if files, used as input when pre-processing MPL-containers in their numbered form, need fixing."""
|
||||
# Check input files for each MPL-container type.
|
||||
for container in containers:
|
||||
files = glob.glob( os.path.join( sourceDir, container, container + '*' + suffix ) )
|
||||
for currentFile in sorted( files ):
|
||||
if check_header_comment( currentFile ):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def check_input_files(headerDir, sourceDir, containers=['vector', 'list', 'set', 'map'],
|
||||
seqType='both', verbose=False):
|
||||
"""Checks if source- and header-files, used as input when pre-processing MPL-containers, need fixing."""
|
||||
# Check the input files for containers in their variadic form.
|
||||
result1 = False
|
||||
if seqType == "both" or seqType == "variadic":
|
||||
if verbose:
|
||||
print "Check if input files for pre-processing Boost.MPL variadic containers need fixing."
|
||||
result1 = check_input_files_for_variadic_seq(headerDir, sourceDir)
|
||||
if verbose:
|
||||
if result1:
|
||||
print " At least one input file needs fixing!"
|
||||
else:
|
||||
print " No input file needs fixing!"
|
||||
# Check the input files for containers in their numbered form.
|
||||
result2 = False
|
||||
result3 = False
|
||||
if seqType == "both" or seqType == "numbered":
|
||||
if verbose:
|
||||
print "Check input files for pre-processing Boost.MPL numbered containers."
|
||||
result2 = check_input_files_for_numbered_seq(headerDir, ".hpp", containers)
|
||||
result3 = check_input_files_for_numbered_seq(sourceDir, ".cpp", containers)
|
||||
if verbose:
|
||||
if result2 or result3:
|
||||
print " At least one input file needs fixing!"
|
||||
else:
|
||||
print " No input file needs fixing!"
|
||||
# Return result.
|
||||
return result1 or result2 or result3
|
||||
|
||||
def fix_header_comment(filename, timestamp):
|
||||
"""Fixes the header-comment of the given file."""
|
||||
# Fix input file.
|
||||
name = os.path.basename( filename )
|
||||
for line in fileinput.input( filename, inplace=1, mode="rU" ):
|
||||
# If header-comment already contains anything for '$Id$', remove it.
|
||||
line = re.sub(r'\$Id:[^$]+\$', r'$Id$', line.rstrip())
|
||||
# Replace '$Id$' by a string containing the file's name (and a timestamp)!
|
||||
line = re.sub(re.escape(r'$Id$'), r'$Id: ' + name + r' ' + timestamp.isoformat() + r' $', line.rstrip())
|
||||
print(line)
|
||||
|
||||
|
||||
def fix_input_files_for_variadic_seq(headerDir, sourceDir, timestamp):
|
||||
"""Fixes files used as input when pre-processing MPL-containers in their variadic form."""
|
||||
# Fix files in include/source-directories.
|
||||
files = glob.glob( os.path.join( headerDir, "*.hpp" ) )
|
||||
files += glob.glob( os.path.join( headerDir, "aux_", "*.hpp" ) )
|
||||
files += glob.glob( os.path.join( sourceDir, "src", "*" ) )
|
||||
for currentFile in sorted( files ):
|
||||
fix_header_comment( currentFile, timestamp )
|
||||
|
||||
|
||||
def fix_input_files_for_numbered_seq(sourceDir, suffix, timestamp, containers):
|
||||
"""Fixes files used as input when pre-processing MPL-containers in their numbered form."""
|
||||
# Fix input files for each MPL-container type.
|
||||
for container in containers:
|
||||
files = glob.glob( os.path.join( sourceDir, container, container + '*' + suffix ) )
|
||||
for currentFile in sorted( files ):
|
||||
fix_header_comment( currentFile, timestamp )
|
||||
|
||||
|
||||
def fix_input_files(headerDir, sourceDir, containers=['vector', 'list', 'set', 'map'],
|
||||
seqType='both', verbose=False):
|
||||
"""Fixes source- and header-files used as input when pre-processing MPL-containers."""
|
||||
# The new modification time.
|
||||
timestamp = datetime.datetime.now();
|
||||
# Fix the input files for containers in their variadic form.
|
||||
if seqType == "both" or seqType == "variadic":
|
||||
if verbose:
|
||||
print "Fix input files for pre-processing Boost.MPL variadic containers."
|
||||
fix_input_files_for_variadic_seq(headerDir, sourceDir, timestamp)
|
||||
# Fix the input files for containers in their numbered form.
|
||||
if seqType == "both" or seqType == "numbered":
|
||||
if verbose:
|
||||
print "Fix input files for pre-processing Boost.MPL numbered containers."
|
||||
fix_input_files_for_numbered_seq(headerDir, ".hpp", timestamp, containers)
|
||||
fix_input_files_for_numbered_seq(sourceDir, ".cpp", timestamp, containers)
|
||||
|
||||
|
||||
def to_existing_absolute_path(string):
|
||||
"""Converts a path into its absolute path and verifies that it exists or throws an exception."""
|
||||
value = os.path.abspath(string)
|
||||
if not os.path.exists( value ) or not os.path.isdir( value ):
|
||||
msg = '"%r" is not a valid path to a directory.' % string
|
||||
raise argparse.ArgumentTypeError(msg)
|
||||
return value
|
||||
|
||||
|
||||
def main():
|
||||
"""The main function."""
|
||||
|
||||
# Prepare and run cmdline-parser.
|
||||
cmdlineParser = argparse.ArgumentParser(
|
||||
description="Fixes the input files used for pre-processing of Boost.MPL headers.")
|
||||
cmdlineParser.add_argument("-v", "--verbose", dest='verbose', action='store_true',
|
||||
help="Be a little bit more verbose.")
|
||||
cmdlineParser.add_argument("--check-only", dest='checkonly', action='store_true',
|
||||
help="Only checks if fixing is required.")
|
||||
cmdlineParser.add_argument(dest='sourceDir', metavar="<source-dir>",
|
||||
type=to_existing_absolute_path,
|
||||
help="The source-directory of Boost.")
|
||||
args = cmdlineParser.parse_args()
|
||||
|
||||
# Some verbose debug output.
|
||||
if args.verbose:
|
||||
print "Arguments extracted from command-line:"
|
||||
print " verbose = ", args.verbose
|
||||
print " check-only = ", args.checkonly
|
||||
print " source directory = ", args.sourceDir
|
||||
|
||||
# The directories for header- and source files of Boost.MPL.
|
||||
# NOTE: Assuming 'args.sourceDir' is the source-directory of the entire boost project.
|
||||
headerDir = os.path.join( args.sourceDir, "boost", "mpl" )
|
||||
sourceDir = os.path.join( args.sourceDir, "libs", "mpl", "preprocessed" )
|
||||
# Check that the header/source-directories exist.
|
||||
if not os.path.exists( headerDir ) or not os.path.exists( sourceDir ):
|
||||
# Maybe 'args.sourceDir' is not the source-directory of the entire boost project
|
||||
# but instead of the Boost.MPL git-directory, only?
|
||||
headerDir = os.path.join( args.sourceDir, "include", "boost", "mpl" )
|
||||
sourceDir = os.path.join( args.sourceDir, "preprocessed" )
|
||||
if not os.path.exists( headerDir ) or not os.path.exists( sourceDir ):
|
||||
cmdlineParser.print_usage()
|
||||
print "error: Cannot find Boost.MPL header/source files in given Boost source-directory!"
|
||||
sys.exit(0)
|
||||
|
||||
# Some verbose debug output.
|
||||
if args.verbose:
|
||||
print "Chosen header-directory: ", headerDir
|
||||
print "Chosen source-directory: ", sourceDir
|
||||
|
||||
if args.checkonly:
|
||||
# Check input files for generating pre-processed headers.
|
||||
result = check_input_files(headerDir, sourceDir, verbose = args.verbose)
|
||||
if result:
|
||||
print "Fixing the input-files used for pre-processing of Boost.MPL headers IS required."
|
||||
else:
|
||||
print "Fixing the input-files used for pre-processing of Boost.MPL headers is NOT required."
|
||||
else:
|
||||
# Fix input files for generating pre-processed headers.
|
||||
fix_input_files(headerDir, sourceDir, verbose = args.verbose)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,26 +0,0 @@
|
||||
|
||||
// Copyright Aleksey Gurtovoy 2003-2004
|
||||
//
|
||||
// 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)
|
||||
//
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
// $Id$
|
||||
// $Date$
|
||||
// $Revision$
|
||||
|
||||
#define BOOST_NO_CONFIG
|
||||
#define BOOST_MSVC 1200
|
||||
#define BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
#define BOOST_NO_INCLASS_MEMBER_INITIALIZATION
|
||||
#define BOOST_NO_TEMPLATE_TEMPLATES
|
||||
#define BOOST_NO_CV_VOID_SPECIALIZATIONS
|
||||
#define BOOST_NO_INTRINSIC_WCHAR_T
|
||||
#define BOOST_NO_STD_ALLOCATOR
|
||||
#define BOOST_MPL_CFG_NO_BIND_TEMPLATE
|
||||
#define BOOST_MPL_CFG_NO_APPLY_TEMPLATE
|
||||
#define BOOST_MPL_CFG_MSVC_60_ETI_BUG
|
||||
#define BOOST_MPL_CFG_MSVC_ETI_BUG
|
||||
#define BOOST_MPL_CFG_NO_NESTED_VALUE_ARITHMETIC
|
||||
@@ -1,21 +0,0 @@
|
||||
|
||||
// Copyright Aleksey Gurtovoy 2003-2004
|
||||
//
|
||||
// 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)
|
||||
//
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
// $Id$
|
||||
// $Date$
|
||||
// $Revision$
|
||||
|
||||
#define BOOST_NO_CONFIG
|
||||
#define BOOST_MSVC 1300
|
||||
#define BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
#define BOOST_NO_INCLASS_MEMBER_INITIALIZATION
|
||||
#define BOOST_MPL_CFG_NO_BIND_TEMPLATE
|
||||
#define BOOST_MPL_CFG_NO_APPLY_TEMPLATE
|
||||
#define BOOST_MPL_CFG_MSVC_ETI_BUG
|
||||
#define BOOST_MPL_CFG_NO_NESTED_VALUE_ARITHMETIC
|
||||
@@ -1,15 +0,0 @@
|
||||
|
||||
// Copyright Aleksey Gurtovoy 2003-2004
|
||||
//
|
||||
// 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)
|
||||
//
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
// $Id$
|
||||
// $Date$
|
||||
// $Revision$
|
||||
|
||||
#define BOOST_NO_CONFIG
|
||||
#define BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
Executable → Regular
+1
-1
@@ -1 +1 @@
|
||||
gcc -E -C -P "-I%(boost_root)s" "-D BOOST_USER_CONFIG=<%(boost_root)s/libs/mpl/preprocessed/include/%(mode)s/user.hpp>" -D BOOST_MPL_CFG_NO_OWN_PP_PRIMITIVES %(file)s >"%(file_path)s"
|
||||
gcc -E -C -P "-I%(boost_root)s" "-D BOOST_USER_CONFIG=\"%(boost_root)s/libs/mpl/preprocessed/include/%(mode)s/user.hpp\"" -D BOOST_MPL_CFG_NO_OWN_PP_PRIMITIVES %(file)s >"%(file_path)s"
|
||||
|
||||
@@ -82,7 +82,7 @@ def main( all_modes, src_dir, dst_dir ):
|
||||
if __name__ == '__main__':
|
||||
|
||||
main(
|
||||
["bcc", "bcc551", "gcc", "msvc60", "msvc70", "mwcw", "dmc", "no_ctps", "no_ttp", "plain"]
|
||||
["bcc", "bcc551", "gcc", "mwcw", "dmc", "no_ttp", "plain"]
|
||||
, "src"
|
||||
, os.path.join( "boost", "mpl", "aux_", "preprocessed" )
|
||||
)
|
||||
|
||||
@@ -15,7 +15,7 @@ import preprocess
|
||||
import os.path
|
||||
|
||||
preprocess.main(
|
||||
[ "plain", "typeof_based", "no_ctps" ]
|
||||
[ "plain", "typeof_based" ]
|
||||
, "map"
|
||||
, os.path.join( "boost", "mpl", "map", "aux_", "preprocessed" )
|
||||
)
|
||||
|
||||
@@ -15,7 +15,7 @@ import preprocess
|
||||
import os.path
|
||||
|
||||
preprocess.main(
|
||||
[ "no_ctps", "plain", "typeof_based" ]
|
||||
[ "plain", "typeof_based" ]
|
||||
, "vector"
|
||||
, os.path.join( "boost", "mpl", "vector", "aux_", "preprocessed" )
|
||||
)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
|
||||
compile aux_/increased_arity.cpp ;
|
||||
compile aux_/largest_int.cpp ;
|
||||
compile aux_/msvc_is_class.cpp ;
|
||||
compile aux_/template_arity.cpp ;
|
||||
@@ -12,6 +13,7 @@ compile apply_wrap.cpp ;
|
||||
compile arithmetic.cpp ;
|
||||
compile as_sequence.cpp ;
|
||||
compile assert.cpp ;
|
||||
# link assert_vc8_p1.cpp assert_vc8_p2.cpp ;
|
||||
compile at.cpp ;
|
||||
compile back.cpp ;
|
||||
compile bind.cpp ;
|
||||
@@ -36,6 +38,7 @@ compile find_if.cpp ;
|
||||
compile fold.cpp ;
|
||||
run for_each.cpp ;
|
||||
compile front.cpp ;
|
||||
compile get_tag_def.cpp ;
|
||||
compile has_xxx.cpp ;
|
||||
compile identity.cpp ;
|
||||
compile if.cpp ;
|
||||
|
||||
+2
-2
@@ -76,7 +76,7 @@ MPL_TEST_CASE()
|
||||
|
||||
typedef apply1< _1, std_vector<_1> >::type v_lambda;
|
||||
typedef apply1<v_lambda,int>::type v_int;
|
||||
MPL_ASSERT(( is_same< v,std_vector<int> > ));
|
||||
MPL_ASSERT(( is_same< v_int,std_vector<int> > ));
|
||||
}
|
||||
|
||||
MPL_TEST_CASE()
|
||||
@@ -86,7 +86,7 @@ MPL_TEST_CASE()
|
||||
|
||||
typedef apply1< lambda<_1>, std_vector<_1> >::type make_vector;
|
||||
typedef apply_wrap1< make_vector,int >::type v_int;
|
||||
MPL_ASSERT(( is_same< v,std_vector<int> > ));
|
||||
MPL_ASSERT(( is_same< v_int,std_vector<int> > ));
|
||||
}
|
||||
|
||||
MPL_TEST_CASE()
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
|
||||
// Copyright Robin Linden 2018
|
||||
//
|
||||
// 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)
|
||||
//
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
// $Id$
|
||||
// $Date$
|
||||
// $Revision$
|
||||
|
||||
// Part of a test to demonstrate a linking error with
|
||||
// BOOST_MPL_ASSERT_MSG inside of functions under VC++8.
|
||||
|
||||
#include <boost/mpl/assert.hpp>
|
||||
|
||||
template<class T>
|
||||
bool func()
|
||||
{
|
||||
BOOST_MPL_ASSERT_MSG(
|
||||
true,
|
||||
ALWAYS_TRUE,
|
||||
(T));
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
|
||||
// Copyright Robin Linden 2018
|
||||
//
|
||||
// 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)
|
||||
//
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
// $Id$
|
||||
// $Date$
|
||||
// $Revision$
|
||||
|
||||
// Part of a test to demonstrate a linking error with
|
||||
// BOOST_MPL_ASSERT_MSG inside of functions under VC++8.
|
||||
|
||||
#include "assert_vc8.hpp"
|
||||
|
||||
static bool a = func<int>();
|
||||
|
||||
int main()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
|
||||
// Copyright Robin Linden 2018
|
||||
//
|
||||
// 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)
|
||||
//
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
// $Id$
|
||||
// $Date$
|
||||
// $Revision$
|
||||
|
||||
// Part of a test to demonstrate a linking error with
|
||||
// BOOST_MPL_ASSERT_MSG inside of functions under VC++8.
|
||||
|
||||
#include "assert_vc8.hpp"
|
||||
|
||||
static bool a = func<int>();
|
||||
@@ -0,0 +1,50 @@
|
||||
|
||||
// Copyright Bruno Dutra 2015
|
||||
//
|
||||
// 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)
|
||||
//
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
// $Id$
|
||||
// $Date$
|
||||
// $Revision$
|
||||
|
||||
#define BOOST_MPL_LIMIT_METAFUNCTION_ARITY 15
|
||||
#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
|
||||
|
||||
#include <boost/mpl/logical.hpp>
|
||||
#include <boost/mpl/placeholders.hpp>
|
||||
#include <boost/mpl/apply.hpp>
|
||||
|
||||
#include <boost/mpl/aux_/test.hpp>
|
||||
|
||||
#include <boost/preprocessor/inc.hpp>
|
||||
#include <boost/preprocessor/repeat_from_to.hpp>
|
||||
#include <boost/preprocessor/enum_params.hpp>
|
||||
#include <boost/preprocessor/facilities/intercept.hpp>
|
||||
|
||||
#define TEST_N_ARY(unused1, N, unused2) \
|
||||
static_assert_< \
|
||||
apply< \
|
||||
and_<BOOST_PP_ENUM_PARAMS(N, _ BOOST_PP_INTERCEPT)>, \
|
||||
BOOST_PP_ENUM_PARAMS(N, true_ BOOST_PP_INTERCEPT) \
|
||||
> \
|
||||
>(); \
|
||||
/**/
|
||||
|
||||
template<typename assertion>
|
||||
void static_assert_(){
|
||||
MPL_ASSERT((typename assertion::type));
|
||||
}
|
||||
|
||||
MPL_TEST_CASE()
|
||||
{
|
||||
BOOST_PP_REPEAT_FROM_TO(
|
||||
2,
|
||||
BOOST_PP_INC(BOOST_MPL_LIMIT_METAFUNCTION_ARITY),
|
||||
TEST_N_ARY,
|
||||
_
|
||||
)
|
||||
}
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <boost/mpl/distance.hpp>
|
||||
#include <boost/mpl/advance.hpp>
|
||||
#include <boost/mpl/begin_end.hpp>
|
||||
#include <boost/mpl/equal.hpp>
|
||||
#include <boost/mpl/aux_/test.hpp>
|
||||
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
@@ -33,4 +34,6 @@ MPL_TEST_CASE()
|
||||
|
||||
typedef advance_c<begin,0>::type advanced;
|
||||
MPL_ASSERT(( is_same<advanced,end> ));
|
||||
|
||||
MPL_ASSERT(( equal< empty_sequence, empty_sequence::type > ));
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <boost/mpl/list.hpp>
|
||||
#include <boost/mpl/sizeof.hpp>
|
||||
#include <boost/mpl/deref.hpp>
|
||||
#include <boost/mpl/equal.hpp>
|
||||
#include <boost/mpl/aux_/test.hpp>
|
||||
|
||||
#include <boost/type_traits/is_float.hpp>
|
||||
@@ -26,6 +27,10 @@
|
||||
MPL_TEST_CASE()
|
||||
{
|
||||
typedef mpl::list<int,float,long,float,char[50],long double,char> types;
|
||||
typedef mpl::list<float,float,long double> floats;
|
||||
|
||||
MPL_ASSERT(( equal< mpl::filter_view< types,boost::is_float<_> >::type,floats > ));
|
||||
|
||||
typedef mpl::max_element<
|
||||
mpl::transform_view<
|
||||
mpl::filter_view< types,boost::is_float<_> >
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
|
||||
// Copyright Sergey Krivonos 2017
|
||||
//
|
||||
// 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)
|
||||
//
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
// $Id$
|
||||
// $Date$
|
||||
// $Revision$
|
||||
|
||||
|
||||
#include <boost/mpl/get_tag.hpp>
|
||||
#include <boost/mpl/aux_/test.hpp>
|
||||
#include <boost/mpl/aux_/test/assert.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
|
||||
|
||||
struct test_type_get_tag_def
|
||||
{
|
||||
typedef int a_tag;
|
||||
};
|
||||
|
||||
BOOST_MPL_GET_TAG_DEF(a_tag);
|
||||
|
||||
MPL_TEST_CASE()
|
||||
{
|
||||
MPL_ASSERT(( is_same<int, boost::mpl::get_a_tag<test_type_get_tag_def>::type> ));
|
||||
MPL_ASSERT(( is_same<test_type_get_tag_def::a_tag, boost::mpl::get_a_tag<test_type_get_tag_def>::type> ));
|
||||
}
|
||||
@@ -15,9 +15,17 @@
|
||||
#include <boost/mpl/find.hpp>
|
||||
#include <boost/mpl/vector_c.hpp>
|
||||
#include <boost/mpl/list.hpp>
|
||||
#include <boost/mpl/set.hpp>
|
||||
#include <boost/mpl/set_c.hpp>
|
||||
#include <boost/mpl/map.hpp>
|
||||
#include <boost/mpl/size.hpp>
|
||||
#include <boost/mpl/range_c.hpp>
|
||||
#include <boost/mpl/equal.hpp>
|
||||
#include <boost/mpl/fold.hpp>
|
||||
#include <boost/mpl/placeholders.hpp>
|
||||
#include <boost/mpl/logical.hpp>
|
||||
#include <boost/mpl/contains.hpp>
|
||||
#include <boost/mpl/joint_view.hpp>
|
||||
|
||||
#include <boost/mpl/aux_/test.hpp>
|
||||
|
||||
@@ -33,3 +41,33 @@ MPL_TEST_CASE()
|
||||
typedef insert_range< list0<>,end< list0<> >::type,list1<int> >::type result2;
|
||||
MPL_ASSERT_RELATION( size<result2>::value, ==, 1 );
|
||||
}
|
||||
|
||||
template<typename A, typename B>
|
||||
void test_associative()
|
||||
{
|
||||
typedef typename insert_range< A,typename end< A >::type,B >::type C;
|
||||
|
||||
MPL_ASSERT_RELATION( size<C>::value, <=, (size<A>::value + size<B>::value) );
|
||||
MPL_ASSERT(( fold< joint_view< A,B >,true_,and_< _1,contains< C,_2 > > > ));
|
||||
}
|
||||
|
||||
MPL_TEST_CASE()
|
||||
{
|
||||
typedef set3< short,int,long > signed_integers;
|
||||
typedef set3< unsigned short,unsigned int,unsigned long > unsigned_integers;
|
||||
test_associative<signed_integers, unsigned_integers>();
|
||||
|
||||
typedef set_c< int,1,3,5,7,9 > odds;
|
||||
typedef set_c< int,0,2,4,6,8 > evens;
|
||||
test_associative<odds, evens>();
|
||||
|
||||
typedef map2<
|
||||
pair< void,void* >
|
||||
, pair< int,int* >
|
||||
> pointers;
|
||||
typedef map2<
|
||||
pair< void const,void const* >
|
||||
, pair< int const,int const* >
|
||||
> pointers_to_const;
|
||||
test_associative<pointers, pointers_to_const>();
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
#include <cassert>
|
||||
|
||||
#if !BOOST_WORKAROUND(__BORLANDC__, < 0x600)
|
||||
#if !BOOST_WORKAROUND(BOOST_BORLANDC, < 0x600)
|
||||
# define INTEGRAL_WRAPPER_RUNTIME_TEST(i, T) \
|
||||
BOOST_TEST(( WRAPPER(T,i)() == i )); \
|
||||
BOOST_TEST(( WRAPPER(T,i)::value == i )); \
|
||||
@@ -34,7 +34,7 @@
|
||||
#define CONSTEXPR_INTEGRAL_TEST(T, i) { static_assert(T() == i, "Constexpr for integral constant failed"); }
|
||||
#endif
|
||||
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582))
|
||||
#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x582))
|
||||
// agurt 20/nov/06: see http://article.gmane.org/gmane.comp.lib.boost.devel/151065
|
||||
#define INTEGRAL_WRAPPER_TEST(unused1, i, T) \
|
||||
{ \
|
||||
|
||||
@@ -30,6 +30,7 @@ MPL_TEST_CASE()
|
||||
typedef range_c<int,0,15> answer;
|
||||
|
||||
MPL_ASSERT(( equal<numbers,answer> ));
|
||||
MPL_ASSERT(( equal<numbers::type,answer> ));
|
||||
MPL_ASSERT_RELATION( size<numbers>::value, ==, 15 );
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ MPL_TEST_CASE()
|
||||
AUX_LAMBDA_TEST( int& );
|
||||
AUX_LAMBDA_TEST( int* );
|
||||
#if !BOOST_WORKAROUND(BOOST_MPL_CFG_GCC, <= 0x0295) \
|
||||
&& !BOOST_WORKAROUND(__BORLANDC__, < 0x600)
|
||||
&& !BOOST_WORKAROUND(BOOST_BORLANDC, < 0x600)
|
||||
AUX_LAMBDA_TEST( int[] );
|
||||
#endif
|
||||
AUX_LAMBDA_TEST( int[10] );
|
||||
|
||||
@@ -217,3 +217,19 @@ MPL_TEST_CASE()
|
||||
>
|
||||
));
|
||||
}
|
||||
|
||||
MPL_TEST_CASE()
|
||||
{
|
||||
typedef insert< map<>, pair<int,int> >::type little_map;
|
||||
|
||||
MPL_ASSERT_RELATION(size<little_map>::value, ==, 1);
|
||||
MPL_ASSERT_RELATION(size<little_map::type>::value, ==, 1);
|
||||
}
|
||||
|
||||
MPL_TEST_CASE()
|
||||
{
|
||||
typedef erase_key< map< pair<float,float>, pair<int,int> >, float >::type little_map;
|
||||
|
||||
MPL_ASSERT_RELATION(size<little_map>::value, ==, 1);
|
||||
MPL_ASSERT_RELATION(size<little_map::type>::value, ==, 1);
|
||||
}
|
||||
|
||||
@@ -329,3 +329,19 @@ MPL_TEST_CASE()
|
||||
find_test<s>();
|
||||
find_test<s::type>();
|
||||
}
|
||||
|
||||
MPL_TEST_CASE()
|
||||
{
|
||||
typedef insert< set<>, int >::type little_set;
|
||||
|
||||
MPL_ASSERT_RELATION(size<little_set>::value, ==, 1);
|
||||
MPL_ASSERT_RELATION(size<little_set::type>::value, ==, 1);
|
||||
}
|
||||
|
||||
MPL_TEST_CASE()
|
||||
{
|
||||
typedef erase_key< set< float, int >, float >::type little_set;
|
||||
|
||||
MPL_ASSERT_RELATION(size<little_set>::value, ==, 1);
|
||||
MPL_ASSERT_RELATION(size<little_set::type>::value, ==, 1);
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include <boost/mpl/advance.hpp>
|
||||
#include <boost/mpl/size.hpp>
|
||||
#include <boost/mpl/begin_end.hpp>
|
||||
#include <boost/mpl/equal.hpp>
|
||||
#include <boost/mpl/aux_/test.hpp>
|
||||
|
||||
MPL_TEST_CASE()
|
||||
@@ -37,4 +38,6 @@ MPL_TEST_CASE()
|
||||
MPL_ASSERT_RELATION( (mpl::distance<last,last>::value), ==, 0 );
|
||||
|
||||
MPL_ASSERT_RELATION( size<view>::value, ==, 1 );
|
||||
|
||||
MPL_ASSERT(( equal< view, view::type > ));
|
||||
}
|
||||
|
||||
+11
-1
@@ -16,12 +16,22 @@
|
||||
#include <boost/mpl/max_element.hpp>
|
||||
#include <boost/mpl/list.hpp>
|
||||
#include <boost/mpl/sizeof.hpp>
|
||||
#include <boost/mpl/equal.hpp>
|
||||
#include <boost/mpl/aux_/test.hpp>
|
||||
|
||||
|
||||
MPL_TEST_CASE()
|
||||
{
|
||||
typedef list<int,long,char,char[50],double> types;
|
||||
typedef list<
|
||||
sizeof_<int>::type,
|
||||
sizeof_<long>::type,
|
||||
sizeof_<char>::type,
|
||||
sizeof_<char[50]>::type,
|
||||
sizeof_<double>::type
|
||||
> sizes;
|
||||
|
||||
MPL_ASSERT(( equal< transform_view< types, sizeof_<_> >::type,sizes > ));
|
||||
|
||||
typedef max_element<
|
||||
transform_view< types, sizeof_<_> >
|
||||
>::type iter;
|
||||
|
||||
Reference in New Issue
Block a user