Squashed 'third_party/boostorg/core/' content from commit e128f4e
Change-Id: Ieb2dc8269dd1750337cfc876826ea7af75f12d63
git-subtree-dir: third_party/boostorg/core
git-subtree-split: e128f4e1b8904d47561700892843f07d5d1160db
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..3e84d7c
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,96 @@
+* text=auto !eol svneol=native#text/plain
+*.gitattributes text svneol=native#text/plain
+
+# Scriptish formats
+*.bat text svneol=native#text/plain
+*.bsh text svneol=native#text/x-beanshell
+*.cgi text svneol=native#text/plain
+*.cmd text svneol=native#text/plain
+*.js text svneol=native#text/javascript
+*.php text svneol=native#text/x-php
+*.pl text svneol=native#text/x-perl
+*.pm text svneol=native#text/x-perl
+*.py text svneol=native#text/x-python
+*.sh eol=lf svneol=LF#text/x-sh
+configure eol=lf svneol=LF#text/x-sh
+
+# Image formats
+*.bmp binary svneol=unset#image/bmp
+*.gif binary svneol=unset#image/gif
+*.ico binary svneol=unset#image/ico
+*.jpeg binary svneol=unset#image/jpeg
+*.jpg binary svneol=unset#image/jpeg
+*.png binary svneol=unset#image/png
+*.tif binary svneol=unset#image/tiff
+*.tiff binary svneol=unset#image/tiff
+*.svg text svneol=native#image/svg%2Bxml
+
+# Data formats
+*.pdf binary svneol=unset#application/pdf
+*.avi binary svneol=unset#video/avi
+*.doc binary svneol=unset#application/msword
+*.dsp text svneol=crlf#text/plain
+*.dsw text svneol=crlf#text/plain
+*.eps binary svneol=unset#application/postscript
+*.gz binary svneol=unset#application/gzip
+*.mov binary svneol=unset#video/quicktime
+*.mp3 binary svneol=unset#audio/mpeg
+*.ppt binary svneol=unset#application/vnd.ms-powerpoint
+*.ps binary svneol=unset#application/postscript
+*.psd binary svneol=unset#application/photoshop
+*.rdf binary svneol=unset#text/rdf
+*.rss text svneol=unset#text/xml
+*.rtf binary svneol=unset#text/rtf
+*.sln text svneol=native#text/plain
+*.swf binary svneol=unset#application/x-shockwave-flash
+*.tgz binary svneol=unset#application/gzip
+*.vcproj text svneol=native#text/xml
+*.vcxproj text svneol=native#text/xml
+*.vsprops text svneol=native#text/xml
+*.wav binary svneol=unset#audio/wav
+*.xls binary svneol=unset#application/vnd.ms-excel
+*.zip binary svneol=unset#application/zip
+
+# Text formats
+.htaccess text svneol=native#text/plain
+*.bbk text svneol=native#text/xml
+*.cmake text svneol=native#text/plain
+*.css text svneol=native#text/css
+*.dtd text svneol=native#text/xml
+*.htm text svneol=native#text/html
+*.html text svneol=native#text/html
+*.ini text svneol=native#text/plain
+*.log text svneol=native#text/plain
+*.mak text svneol=native#text/plain
+*.qbk text svneol=native#text/plain
+*.rst text svneol=native#text/plain
+*.sql text svneol=native#text/x-sql
+*.txt text svneol=native#text/plain
+*.xhtml text svneol=native#text/xhtml%2Bxml
+*.xml text svneol=native#text/xml
+*.xsd text svneol=native#text/xml
+*.xsl text svneol=native#text/xml
+*.xslt text svneol=native#text/xml
+*.xul text svneol=native#text/xul
+*.yml text svneol=native#text/plain
+boost-no-inspect text svneol=native#text/plain
+CHANGES text svneol=native#text/plain
+COPYING text svneol=native#text/plain
+INSTALL text svneol=native#text/plain
+Jamfile text svneol=native#text/plain
+Jamroot text svneol=native#text/plain
+Jamfile.v2 text svneol=native#text/plain
+Jamrules text svneol=native#text/plain
+Makefile* text svneol=native#text/plain
+README text svneol=native#text/plain
+TODO text svneol=native#text/plain
+
+# Code formats
+*.c text svneol=native#text/plain
+*.cpp text svneol=native#text/plain
+*.h text svneol=native#text/plain
+*.hpp text svneol=native#text/plain
+*.ipp text svneol=native#text/plain
+*.tpp text svneol=native#text/plain
+*.jam text svneol=native#text/plain
+*.java text svneol=native#text/plain
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..5998f2b
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,203 @@
+# Copyright 2016, 2017 Peter Dimov
+# 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)
+
+language: cpp
+
+sudo: false
+
+python: "2.7"
+
+branches:
+ only:
+ - master
+ - develop
+ - /feature\/.*/
+
+env:
+ matrix:
+ - BOGUS_JOB=true
+
+matrix:
+
+ exclude:
+ - env: BOGUS_JOB=true
+
+ include:
+ - os: linux
+ compiler: g++
+ env: TOOLSET=gcc COMPILER=g++ CXXSTD=03,11
+
+ - os: linux
+ compiler: g++-4.7
+ env: TOOLSET=gcc COMPILER=g++-4.7 CXXSTD=03,11
+ addons:
+ apt:
+ packages:
+ - g++-4.7
+ sources:
+ - ubuntu-toolchain-r-test
+
+ - os: linux
+ compiler: g++-4.8
+ env: TOOLSET=gcc COMPILER=g++-4.8 CXXSTD=03,11
+ addons:
+ apt:
+ packages:
+ - g++-4.8
+ sources:
+ - ubuntu-toolchain-r-test
+
+ - os: linux
+ compiler: g++-4.9
+ env: TOOLSET=gcc COMPILER=g++-4.9 CXXSTD=03,11
+ addons:
+ apt:
+ packages:
+ - g++-4.9
+ sources:
+ - ubuntu-toolchain-r-test
+
+ - os: linux
+ compiler: g++-5
+ env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=03,11,14,1z
+ addons:
+ apt:
+ packages:
+ - g++-5
+ sources:
+ - ubuntu-toolchain-r-test
+
+ - os: linux
+ compiler: g++-6
+ env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=03,11,14,1z
+ addons:
+ apt:
+ packages:
+ - g++-6
+ sources:
+ - ubuntu-toolchain-r-test
+
+ - os: linux
+ dist: trusty
+ compiler: g++-7
+ env: TOOLSET=gcc COMPILER=g++-7 CXXSTD=03,11,14,17
+ addons:
+ apt:
+ packages:
+ - g++-7
+ sources:
+ - ubuntu-toolchain-r-test
+
+ - os: linux
+ compiler: clang++
+ env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11
+
+ - os: linux
+ compiler: clang++-3.5
+ env: TOOLSET=clang COMPILER=clang++-3.5 CXXSTD=03,11,14,1z
+ addons:
+ apt:
+ packages:
+ - clang-3.5
+ - libstdc++-4.9-dev
+ sources:
+ - ubuntu-toolchain-r-test
+ - llvm-toolchain-precise-3.5
+
+ - os: linux
+ compiler: clang++-3.6
+ env: TOOLSET=clang COMPILER=clang++-3.6 CXXSTD=03,11,14,1z
+ addons:
+ apt:
+ packages:
+ - clang-3.6
+ sources:
+ - ubuntu-toolchain-r-test
+ - llvm-toolchain-precise-3.6
+
+ - os: linux
+ compiler: clang++-3.7
+ env: TOOLSET=clang COMPILER=clang++-3.7 CXXSTD=03,11,14,1z
+ addons:
+ apt:
+ packages:
+ - clang-3.7
+ sources:
+ - ubuntu-toolchain-r-test
+ - llvm-toolchain-precise-3.7
+
+ - os: linux
+ compiler: clang++-3.8
+ env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=03,11,14,1z
+ addons:
+ apt:
+ packages:
+ - clang-3.8
+ - libstdc++-4.9-dev
+ sources:
+ - ubuntu-toolchain-r-test
+ - llvm-toolchain-precise-3.8
+
+ - os: linux
+ compiler: clang++-3.9
+ env: TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=03,11,14,1z
+ addons:
+ apt:
+ packages:
+ - clang-3.9
+ - libstdc++-4.9-dev
+ sources:
+ - ubuntu-toolchain-r-test
+ - llvm-toolchain-precise-3.9
+
+ - os: linux
+ compiler: clang++-4.0
+ env: TOOLSET=clang COMPILER=clang++-4.0 CXXSTD=03,11,14,1z
+ addons:
+ apt:
+ packages:
+ - clang-4.0
+ sources:
+ - ubuntu-toolchain-r-test
+ - llvm-toolchain-trusty-4.0
+
+ - os: linux
+ compiler: clang++-5.0
+ env: TOOLSET=clang COMPILER=clang++-5.0 CXXSTD=03,11,14,1z
+ addons:
+ apt:
+ packages:
+ - clang-5.0
+ sources:
+ - ubuntu-toolchain-r-test
+ - llvm-toolchain-trusty-5.0
+
+ - os: osx
+ compiler: clang++
+ env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11,14,1z
+
+install:
+ - BOOST_BRANCH=develop && [ "$TRAVIS_BRANCH" == "master" ] && BOOST_BRANCH=master || true
+ - cd ..
+ - git clone -b $BOOST_BRANCH https://github.com/boostorg/boost.git boost-root
+ - cd boost-root
+ - git submodule init libs/assert
+ - git submodule init libs/config
+ - git submodule init libs/predef
+ - git submodule init libs/static_assert
+ - git submodule init libs/type_traits
+ - git submodule init tools/build
+ - git submodule update
+ - cp -r $TRAVIS_BUILD_DIR/* libs/core
+ - ./bootstrap.sh
+ - ./b2 headers
+
+script:
+ - |-
+ echo "using $TOOLSET : : $COMPILER ;" > ~/user-config.jam
+ - ./b2 -j 3 libs/core/test toolset=$TOOLSET cxxstd=$CXXSTD
+
+notifications:
+ email:
+ on_success: always
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..52bd71b
--- /dev/null
+++ b/README.md
@@ -0,0 +1,32 @@
+Boost.Core
+==========
+
+Boost.Core, part of collection of the [Boost C++ Libraries](http://github.com/boostorg), is a collection of core utilities used by other Boost libraries.
+The criteria for inclusion is that the utility component be:
+
+* simple,
+* used by other Boost libraries, and
+* not dependent on any other Boost modules except Core itself, Config, Assert, Static Assert, or Predef.
+
+### CI Status
+
+Branch | Travis | Appveyor
+---------|--------|---------
+Develop | [](https://travis-ci.org/boostorg/core) | [](https://ci.appveyor.com/project/pdimov/core)
+Master | [](https://travis-ci.org/boostorg/core) | [](https://ci.appveyor.com/project/pdimov/core)
+
+### Directories
+
+* **doc** - Documentation of the components
+* **include** - Interface headers
+* **test** - Unit tests
+
+### More information
+
+* [Documentation](http://boost.org/libs/core)
+* [Report bugs](https://svn.boost.org/trac/boost/newticket?component=core;version=Boost%20Release%20Branch). 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).
+
+### License
+
+Distributed under the [Boost Software License, Version 1.0](http://boost.org/LICENSE_1_0.txt).
diff --git a/appveyor.yml b/appveyor.yml
new file mode 100644
index 0000000..f652c05
--- /dev/null
+++ b/appveyor.yml
@@ -0,0 +1,64 @@
+# Copyright 2016, 2017 Peter Dimov
+# 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)
+
+version: 1.0.{build}-{branch}
+
+shallow_clone: true
+
+branches:
+ only:
+ - master
+ - develop
+ - /feature\/.*/
+
+environment:
+ matrix:
+ - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
+ TOOLSET: msvc-9.0,msvc-10.0,msvc-11.0,msvc-12.0
+
+ - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
+ ADDPATH: C:\cygwin\bin;
+ TOOLSET: gcc
+ CXXSTD: 03,11
+
+ - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
+ ADDPATH: C:\mingw\bin;
+ TOOLSET: gcc
+ CXXSTD: 03,11
+
+ - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
+ ADDPATH: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin;
+ TOOLSET: gcc
+ CXXSTD: 03,11
+
+ - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
+ TOOLSET: msvc-14.0
+
+ - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
+ TOOLSET: msvc-14.1
+ CXXSTD: 14,17
+
+install:
+ - set BOOST_BRANCH=develop
+ - if "%APPVEYOR_REPO_BRANCH%" == "master" set BOOST_BRANCH=master
+ - cd ..
+ - git clone -b %BOOST_BRANCH% https://github.com/boostorg/boost.git boost-root
+ - cd boost-root
+ - git submodule init libs/assert
+ - git submodule init libs/config
+ - git submodule init libs/predef
+ - git submodule init libs/static_assert
+ - git submodule init libs/type_traits
+ - git submodule init tools/build
+ - git submodule update
+ - xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\core
+ - cmd /c bootstrap
+ - b2 headers
+
+build: off
+
+test_script:
+ - PATH=%ADDPATH%%PATH%
+ - if not "%CXXSTD%" == "" set CXXSTD=cxxstd=%CXXSTD%
+ - b2 -j 3 libs/core/test toolset=%TOOLSET% %CXXSTD%
diff --git a/doc/Jamfile.v2 b/doc/Jamfile.v2
new file mode 100644
index 0000000..f598bb7
--- /dev/null
+++ b/doc/Jamfile.v2
@@ -0,0 +1,59 @@
+# Copyright (c) 2014 Glen Joseph Fernandes
+# glenfe at live dot com
+#
+# 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)
+
+import doxygen ;
+import quickbook ;
+
+doxygen ref_reference
+ :
+ [ glob ../../../boost/core/ref.hpp ]
+ :
+ <doxygen:param>ENABLE_PREPROCESSING=YES
+ <doxygen:param>EXPAND_ONLY_PREDEF=YES
+ <doxygen:param>EXTRACT_ALL=NO
+ <doxygen:param>EXTRACT_PRIVATE=NO
+ <doxygen:param>HIDE_UNDOC_MEMBERS=YES
+ <doxygen:param>MACRO_EXPANSION=YES
+ <doxygen:param>"PREDEFINED=BOOST_CORE_DOXYGEN \\
+ BOOST_SYMBOL_VISIBLE= \\
+ BOOST_FORCEINLINE=inline \\
+ BOOST_GPU_ENABLED= \\
+ BOOST_STATIC_ASSERT(x)= \\
+ BOOST_STATIC_ASSERT_MSG(x,y)= \\
+ BOOST_STATIC_CONSTANT(x,y)=\"static constexpr x y\" \\
+ BOOST_RV_REF(x)=\"x&&\" \\
+ BOOST_NESTED_TEMPLATE=template \\
+ BOOST_CONSTEXPR=constexpr \\
+ BOOST_CONSTEXPR_OR_CONST=constexpr \\
+ BOOST_NOEXCEPT=noexcept \\
+ BOOST_NOEXCEPT_IF(x)=noexcept(x) \\
+ BOOST_NOEXCEPT_OR_NOTHROW=noexcept \\
+ BOOST_COPY_ASSIGN_REF(x)=\"x const&\" \\
+ BOOST_DEFAULTED_FUNCTION(x,y)=\"x = default;\" \\
+ BOOST_DELETED_FUNCTION(x)=\"x = delete;\" \\
+ BOOST_EXPLICIT_OPERATOR_BOOL()=\"explicit operator bool() const;\" \\
+ BOOST_REF_CONST=const"
+ ;
+
+xml core : core.qbk ;
+
+boostbook standalone
+ :
+ core
+ :
+ <dependency>ref_reference
+ <xsl:param>boost.root=../../../..
+ <xsl:param>generate.section.toc.level=1
+ <xsl:param>toc.max.depth=1
+ <format>pdf:<xsl:param>boost.url.prefix=http://www.boost.org/doc/libs/release/libs/core/doc/html
+ ;
+
+###############################################################################
+alias boostdoc ;
+explicit boostdoc ;
+alias boostrelease : standalone ;
+explicit boostrelease ;
diff --git a/doc/addressof.qbk b/doc/addressof.qbk
new file mode 100644
index 0000000..56ce3bb
--- /dev/null
+++ b/doc/addressof.qbk
@@ -0,0 +1,78 @@
+[/
+ Copyright 2014 Peter Dimov
+
+ 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
+]
+
+[section:addressof addressof]
+
+[simplesect Authors]
+
+* Brad King
+* Douglas Gregor
+* Peter Dimov
+* Glen Fernandes
+
+[endsimplesect]
+
+[section Header <boost/core/addressof.hpp>]
+
+The header `<boost/core/addressof.hpp>` defines the function
+template `boost::addressof`. `boost::addressof(x)` returns the
+address of `x`. Ordinarily, this address can be obtained by
+`&x`, but the unary `&` operator can be overloaded. `boost::addressof`
+avoids calling used-defined `operator&()`.
+
+`boost::addressof` was originally contributed by Brad King
+based on ideas from discussion with Doug Gregor.
+
+[section Synopsis]
+
+``
+namespace boost
+{
+ template<class T> T* addressof( T& x );
+}
+``
+
+[endsect]
+
+[section Example]
+
+``
+#include <boost/core/addressof.hpp>
+
+struct useless_type { };
+
+class nonaddressable {
+ useless_type operator&() const;
+};
+
+void f() {
+ nonaddressable x;
+ nonaddressable* xp = boost::addressof(x);
+ // nonaddressable* xpe = &x; /* error */
+}
+``
+
+[endsect]
+
+[section Notes]
+
+In C++11 and above, `boost::addressof` is conditionally
+`constexpr` when possible. This is indicated by
+`BOOST_CORE_NO_CONSTEXPR_ADDRESSOF` not being defined.
+
+With supported compilers, `boost::addressof` is always
+`constexpr` by leveraging compiler intrinsics. This is
+indicated by `BOOST_CORE_HAS_BUILTIN_ADDRESSOF` being
+defined.
+
+[endsect]
+
+[endsect]
+
+[endsect]
diff --git a/doc/checked_delete.qbk b/doc/checked_delete.qbk
new file mode 100644
index 0000000..156eb1b
--- /dev/null
+++ b/doc/checked_delete.qbk
@@ -0,0 +1,138 @@
+[/
+ / Copyright (c) 2002, 2003, 2005 Peter Dimov
+ / Copyright (c) 2014 Glen Fernandes
+ /
+ / 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)
+ /]
+
+[section:checked_delete checked_delete]
+
+[simplesect Authors]
+
+* Beman Dawes
+* Dave Abrahams
+* Vladimir Prus
+* Rainer Deyke
+* John Maddock
+
+[endsimplesect]
+
+[section Overview]
+
+The header `<boost/checked_delete.hpp>` defines two function
+templates, `checked_delete` and `checked_array_delete`, and two
+class templates, `checked_deleter` and `checked_array_deleter`.
+
+The C++ Standard allows, in 5.3.5/5, pointers to incomplete
+class types to be deleted with a delete-expression. When the
+class has a non-trivial destructor, or a class-specific
+operator delete, the behavior is undefined. Some compilers
+issue a warning when an incomplete type is deleted, but
+unfortunately, not all do, and programmers sometimes ignore or
+disable warnings.
+
+A particularly troublesome case is when a smart pointer's
+destructor, such as `boost::scoped_ptr<T>::~scoped_ptr`, is
+instantiated with an incomplete type. This can often lead to
+silent, hard to track failures.
+
+The supplied function and class templates can be used to
+prevent these problems, as they require a complete type, and
+cause a compilation error otherwise.
+
+[endsect]
+
+[section Synopsis]
+
+``
+namespace boost
+{
+ template<class T> void checked_delete(T * p);
+ template<class T> void checked_array_delete(T * p);
+ template<class T> struct checked_deleter;
+ template<class T> struct checked_array_deleter;
+}
+``
+
+[endsect]
+
+[section checked_delete]
+
+[section template<class T> void checked_delete(T * p);]
+
+* *Requires:* `T` must be a complete type. The expression
+ `delete p` must be well-formed.
+* *Effects:* `delete p;`
+
+[endsect]
+
+[endsect]
+
+[section checked_array_delete]
+
+[section template<class T> void checked_array_delete(T * p);]
+
+* *Requires:* `T` must be a complete type. The expression
+ `delete [] p` must be well-formed.
+* *Effects:* `delete [] p;`
+
+[endsect]
+
+[endsect]
+
+[section checked_deleter]
+
+``
+template<class T> struct checked_deleter
+{
+ typedef void result_type;
+ typedef T * argument_type;
+ void operator()(T * p) const;
+};
+``
+
+[section void checked_deleter<T>::operator()(T * p) const;]
+
+* *Requires:* `T` must be a complete type. The expression
+ `delete p` must be well-formed.
+* *Effects:* `delete p;`
+
+[endsect]
+
+[endsect]
+
+[section checked_array_deleter]
+
+``
+template<class T> struct checked_array_deleter
+{
+ typedef void result_type;
+ typedef T * argument_type;
+ void operator()(T * p) const;
+};
+``
+
+[section void checked_array_deleter<T>::operator()(T * p) const;]
+
+* *Requires:* `T` must be a complete type. The expression
+ `delete [] p` must be well-formed.
+* *Effects:* `delete [] p;`
+
+[endsect]
+
+[endsect]
+
+[section Acknowledgements]
+
+The function templates `checked_delete` and
+`checked_array_delete` were originally part of
+`<boost/utility.hpp>`, and the documentation
+acknowledged Beman Dawes, Dave Abrahams,
+Vladimir Prus, Rainer Deyke, John Maddock,
+and others as contributors.
+
+[endsect]
+
+[endsect]
diff --git a/doc/core.qbk b/doc/core.qbk
new file mode 100644
index 0000000..0eaaf67
--- /dev/null
+++ b/doc/core.qbk
@@ -0,0 +1,57 @@
+[/
+ Copyright (c) 2014 Glen Joseph Fernandes
+ glenfe at live dot com
+
+ 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)
+]
+
+[library Boost.Core
+ [quickbook 1.6]
+ [id core]
+ [copyright 2014 Peter Dimov]
+ [copyright 2014 Glen Fernandes]
+ [copyright 2014 Andrey Semashev]
+ [dirname core]
+ [license Distributed under the
+ [@http://boost.org/LICENSE_1_0.txt Boost Software License,
+ Version 1.0].
+ ]
+]
+
+[template simplesect[title]
+[block '''<simplesect><title>'''[title]'''</title>''']]
+
+[template endsimplesect[]
+[block '''</simplesect>''']]
+
+[section Introduction]
+
+The Boost.Core library is a collection of core utilities. The
+criteria for inclusion is that the utility component be:
+
+* simple,
+* used by other Boost libraries, and
+* not dependent on any other Boost modules except Core
+ itself, Config, Assert, Static Assert, or Predef.
+
+[endsect]
+
+[include addressof.qbk]
+[include checked_delete.qbk]
+[include demangle.qbk]
+[include enable_if.qbk]
+[include exchange.qbk]
+[include explicit_operator_bool.qbk]
+[include ignore_unused.qbk]
+[include is_same.qbk]
+[include lightweight_test.qbk]
+[include no_exceptions_support.qbk]
+[include noncopyable.qbk]
+[include null_deleter.qbk]
+[include pointer_traits.qbk]
+[include ref.qbk]
+[include scoped_enum.qbk]
+[include swap.qbk]
+[include typeinfo.qbk]
diff --git a/doc/demangle.qbk b/doc/demangle.qbk
new file mode 100644
index 0000000..16bd65e
--- /dev/null
+++ b/doc/demangle.qbk
@@ -0,0 +1,136 @@
+[/
+ Copyright 2014 Peter Dimov
+ Copyright 2014 Andrey Semashev
+
+ Distributed under the Boost Software License, Version 1.0.
+
+ See accompanying file LICENSE_1_0.txt
+ or copy at http://boost.org/LICENSE_1_0.txt
+]
+
+[section:demangle demangle]
+
+[simplesect Authors]
+
+* Peter Dimov
+* Andrey Semashev
+
+[endsimplesect]
+
+[section Header <boost/core/demangle.hpp>]
+
+The header `<boost/core/demangle.hpp>` defines several tools for undecorating
+symbol names.
+
+[section Synopsis]
+
+ namespace boost
+ {
+
+ namespace core
+ {
+ std::string demangle( char const * name );
+
+ char const * demangle_alloc( char const * name ) noexcept;
+ void demangle_free( char const * demangled_name ) noexcept;
+
+ class scoped_demangled_name
+ {
+ public:
+ explicit scoped_demangled_name( char const * name ) noexcept;
+ ~scoped_demangled_name() noexcept;
+ char const * get() const noexcept;
+
+ scoped_demangled_name( scoped_demangled_name const& ) = delete;
+ scoped_demangled_name& operator= ( scoped_demangled_name const& ) = delete;
+ };
+ }
+
+ }
+
+[endsect]
+
+[section Conventional interface]
+
+The function `boost::core::demangle` is the conventional
+way to obtain demangled symbol name. It takes a mangled string such as
+those returned by `typeid(T).name()` on certain implementations
+such as `g++`, and returns its demangled, human-readable, form. In case if
+demangling fails (e.g. if `name` cannot be interpreted as a mangled name)
+the function returns `name`.
+
+[section Example]
+
+ #include <boost/core/demangle.hpp>
+ #include <typeinfo>
+ #include <iostream>
+
+ template<class T> struct X
+ {
+ };
+
+ int main()
+ {
+ char const * name = typeid( X<int> ).name();
+
+ std::cout << name << std::endl; // prints 1XIiE
+ std::cout << boost::core::demangle( name ) << std::endl; // prints X<int>
+ }
+
+[endsect]
+
+[endsect]
+
+[section Low level interface]
+
+In some cases more low level interface may be desirable. For example:
+
+* Assuming that symbol demangling may fail, the user wants to be able to handle such errors.
+* The user needs to post-process the demangled name (e.g. remove common namespaces), and
+allocating a temporary string with the complete demangled name is significant overhead.
+
+The function `boost::core::demangle_alloc` performs name demangling and returns a pointer
+to a string with the demangled name, if succeeded, or `nullptr` otherwise. The returned pointer
+must be passed to `boost::core::demangle_free` to reclaim resources. Note that on some platforms
+the pointer returned by `boost::core::demangle_alloc` may refer to the string denoted by `name`,
+so this string must be kept immutable for the whole life time of the returned pointer.
+
+The `boost::core::scoped_demangled_name` class is a scope guard that automates the calls to
+`boost::core::demangle_alloc` (on its construction) and `boost::core::demangle_free` (on destruction).
+The string with the demangled name can be obtained with its `get` method. Note that this method may
+return `nullptr` if demangling failed.
+
+[section Example]
+
+ #include <boost/core/demangle.hpp>
+ #include <typeinfo>
+ #include <iostream>
+
+ template<class T> struct X
+ {
+ };
+
+ int main()
+ {
+ char const * name = typeid( X<int> ).name();
+ boost::core::scoped_demangled_name demangled( name );
+
+ std::cout << name << std::endl; // prints 1XIiE
+ std::cout << (demangled.get() ? demangled.get() : "[unknown]") << std::endl; // prints X<int>
+ }
+
+[endsect]
+
+[endsect]
+
+[endsect]
+
+[section Acknowledgments]
+
+The implementation of `core::demangle` was taken from
+`boost/exception/detail/type_info.hpp`, which in turn was adapted
+from `boost/units/detail/utility.hpp` and `boost/log/utility/type_info_wrapper.hpp`.
+
+[endsect]
+
+[endsect]
diff --git a/doc/enable_if.qbk b/doc/enable_if.qbk
new file mode 100644
index 0000000..a64a2b1
--- /dev/null
+++ b/doc/enable_if.qbk
@@ -0,0 +1,500 @@
+[/
+ / Copyright (c) 2003, 2004 Jaakko Jarvi
+ / Copyright (c) 2008 John Maddock
+ / Copyright (c) 2011, 2013 Jeremiah Willcock
+ / Copyright (c) 2014 Glen Fernandes
+ /
+ / Use, modification, and distribution is subject to the Boost Software
+ / License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+ / http://www.boost.org/LICENSE_1_0.txt)
+ /]
+
+[section:enable_if enable_if]
+
+[simplesect Authors]
+
+* Jaakko J\u00E4rvi
+* Jeremiah Willcock
+* Andrew Lumsdaine
+
+[endsimplesect]
+
+[section Introduction]
+
+The `enable_if` family of templates is a set of tools to allow
+a function template or a class template specialization to
+include or exclude itself from a set of matching functions or
+specializations based on properties of its template arguments.
+For example, one can define function templates that are only
+enabled for, and thus only match, an arbitrary set of types
+defined by a traits class. The `enable_if` templates can also
+be applied to enable class template specializations.
+Applications of `enable_if` are discussed in length in
+[link REF1 \[1\]] and [link REF2 \[2\]].
+
+[section Header <boost/core/enable_if.hpp>]
+
+``
+namespace boost {
+ template <class Cond, class T = void> struct enable_if;
+ template <class Cond, class T = void> struct disable_if;
+ template <class Cond, class T> struct lazy_enable_if;
+ template <class Cond, class T> struct lazy_disable_if;
+
+ template <bool B, class T = void> struct enable_if_c;
+ template <bool B, class T = void> struct disable_if_c;
+ template <bool B, class T> struct lazy_enable_if_c;
+ template <bool B, class T> struct lazy_disable_if_c;
+}
+``
+
+[endsect]
+
+[section Background]
+
+Sensible operation of template function overloading in C++
+relies on the /SFINAE/ (substitution-failure-is-not-an-error)
+principle [link REF3 \[3\]]: if an invalid argument or return
+type is formed during the instantiation of a function template,
+the instantiation is removed from the overload resolution set
+instead of causing a compilation error. The following example,
+taken from [link REF1 \[1\]], demonstrates why this is
+important:
+
+``
+int negate(int i) { return -i; }
+
+template <class F>
+typename F::result_type negate(const F& f) { return -f(); }
+``
+
+Suppose the compiler encounters the call `negate(1)`. The first
+definition is obviously a better match, but the compiler must
+nevertheless consider (and instantiate the prototypes) of both
+definitions to find this out. Instantiating the latter
+definition with `F` as `int` would result in:
+
+``
+int::result_type negate(const int&);
+``
+
+where the return type is invalid. If this were an error, adding
+an unrelated function template (that was never called) could
+break otherwise valid code. Due to the SFINAE principle the
+above example is not, however, erroneous. The latter definition
+of `negate` is simply removed from the overload resolution set.
+
+The `enable_if` templates are tools for controlled creation of
+the SFINAE conditions.
+
+[endsect]
+
+[endsect]
+
+[section The enable_if templates]
+
+The names of the `enable_if` templates have three parts: an
+optional `lazy_` tag, either `enable_if` or `disable_if`, and
+an optional `_c` tag. All eight combinations of these parts
+are supported. The meaning of the `lazy_` tag is described
+in the section [link
+core.enable_if.using_enable_if.enable_if_lazy below]. The
+second part of the name indicates whether a true condition
+argument should enable or disable the current overload. The
+third part of the name indicates whether the condition
+argument is a `bool` value (`_c` suffix), or a type containing
+a static `bool` constant named `value` (no suffix). The latter
+version interoperates with Boost.MPL.
+
+The definitions of `enable_if_c` and `enable_if` are as follows
+(we use `enable_if` templates unqualified but they are in the
+`boost` namespace).
+
+``
+template <bool B, class T = void>
+struct enable_if_c {
+ typedef T type;
+};
+
+template <class T>
+struct enable_if_c<false, T> {};
+
+template <class Cond, class T = void>
+struct enable_if : public enable_if_c<Cond::value, T> {};
+``
+
+An instantiation of the `enable_if_c` template with the
+parameter `B` as `true` contains a member type `type`, defined
+to be `T`. If `B` is `false`, no such member is defined. Thus
+`enable_if_c<B, T>::type` is either a valid or an invalid type
+expression, depending on the value of `B`. When valid,
+`enable_if_c<B, T>::type` equals `T`. The `enable_if_c`
+template can thus be used for controlling when functions are
+considered for overload resolution and when they are not. For
+example, the following function is defined for all arithmetic
+types (according to the classification of the Boost
+*type_traits* library):
+
+``
+template <class T>
+typename enable_if_c<boost::is_arithmetic<T>::value, T>::type
+foo(T t) { return t; }
+``
+
+The `disable_if_c` template is provided as well, and has the
+same functionality as `enable_if_c` except for the negated
+condition. The following function is enabled for all
+non-arithmetic types.
+
+``
+template <class T>
+typename disable_if_c<boost::is_arithmetic<T>::value, T>::type
+bar(T t) { return t; }
+``
+
+For easier syntax in some cases and interoperation with
+Boost.MPL we provide versions of the `enable_if` templates
+taking any type with a `bool` member constant named `value` as
+the condition argument. The MPL `bool_`, `and_`, `or_`, and
+`not_` templates are likely to be useful for creating such
+types. Also, the traits classes in the Boost.Type_traits
+library follow this convention. For example, the above example
+function `foo` can be alternatively written as:
+
+``
+template <class T>
+typename enable_if<boost::is_arithmetic<T>, T>::type
+foo(T t) { return t; }
+``
+
+[endsect]
+
+[section:using_enable_if Using enable_if]
+
+The `enable_if` templates are defined in
+`boost/utility/enable_if.hpp`, which is included by
+`boost/utility.hpp`.
+
+With respect to function templates, `enable_if` can be used in
+multiple different ways:
+
+* As the return type of an instantiatied function
+* As an extra parameter of an instantiated function
+* As an extra template parameter (useful only in a compiler
+ that supports C++0x default arguments for function template
+ parameters, see [link
+ core.enable_if.using_enable_if.enable_if_0x Enabling function
+ templates in C++0x] for details.
+
+In the previous section, the return type form of `enable_if`
+was shown. As an example of using the form of `enable_if` that
+works via an extra function parameter, the `foo` function in
+the previous section could also be written as:
+
+``
+template <class T>
+T foo(T t,
+ typename enable_if<boost::is_arithmetic<T> >::type* dummy = 0);
+``
+
+Hence, an extra parameter of type `void*` is added, but it is
+given a default value to keep the parameter hidden from client
+code. Note that the second template argument was not given to
+`enable_if`, as the default `void` gives the desired behavior.
+
+Which way to write the enabler is largely a matter of taste,
+but for certain functions, only a subset of the options is
+possible:
+
+* Many operators have a fixed number of arguments, thus
+ `enable_if` must be used either in the return type or in an
+ extra template parameter.
+* Functions that have a variadic parameter list must use either
+ the return type form or an extra template parameter.
+* Constructors do not have a return type so you must use either
+ an extra function parameter or an extra template parameter.
+* Constructors that have a variadic parameter list must an
+ extra template parameter.
+* Conversion operators can only be written with an extra
+ template parameter.
+
+[section:enable_if_0x Enabling function templates in C++0x]
+
+In a compiler which supports C++0x default arguments for
+function template parameters, you can enable and disable
+function templates by adding an additional template parameter.
+This approach works in all situations where you would use
+either the return type form of `enable_if` or the function
+parameter form, including operators, constructors, variadic
+function templates, and even overloaded conversion operations.
+
+As an example:
+
+``
+#include <boost/type_traits/is_arithmetic.hpp>
+#include <boost/type_traits/is_pointer.hpp>
+#include <boost/utility/enable_if.hpp>
+
+class test
+{
+public:
+ // A constructor that works for any argument list of size 10
+ template< class... T,
+ typename boost::enable_if_c< sizeof...( T ) == 10,
+ int >::type = 0>
+ test( T&&... );
+
+ // A conversion operation that can convert to any arithmetic type
+ template< class T,
+ typename boost::enable_if< boost::is_arithmetic< T >,
+ int >::type = 0>
+ operator T() const;
+
+ // A conversion operation that can convert to any pointer type
+ template< class T,
+ typename boost::enable_if< boost::is_pointer< T >,
+ int >::type = 0>
+ operator T() const;
+};
+
+int main()
+{
+ // Works
+ test test_( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 );
+
+ // Fails as expected
+ test fail_construction( 1, 2, 3, 4, 5 );
+
+ // Works by calling the conversion operator enabled for arithmetic types
+ int arithmetic_object = test_;
+
+ // Works by calling the conversion operator enabled for pointer types
+ int* pointer_object = test_;
+
+ // Fails as expected
+ struct {} fail_conversion = test_;
+}
+``
+
+[endsect]
+
+[section Enabling template class specializations]
+
+Class template specializations can be enabled or disabled with
+`enable_if`. One extra template parameter needs to be added for
+the enabler expressions. This parameter has the default value
+`void`. For example:
+
+``
+template <class T, class Enable = void>
+class A { ... };
+
+template <class T>
+class A<T, typename enable_if<is_integral<T> >::type> { ... };
+
+template <class T>
+class A<T, typename enable_if<is_float<T> >::type> { ... };
+``
+
+Instantiating `A` with any integral type matches the first
+specialization, whereas any floating point type matches the
+second one. All other types match the primary template.
+The condition can be any compile-time boolean expression that
+depends on the template arguments of the class. Note that
+again, the second argument to `enable_if` is not needed; the
+default (`void`) is the correct value.
+
+The `enable_if_has_type` template is usable this scenario but instead of
+using a type traits to enable or disable a specialization, it use a
+SFINAE context to check for the existence of a dependent type inside
+its parameter. For example, the following structure extracts a dependent
+`value_type` from T if and only if `T::value_type` exists.
+
+``
+template <class T, class Enable = void>
+class value_type_from
+{
+ typedef T type;
+};
+
+template <class T>
+class value_type_from<T, typename enable_if_has_type<typename T::value_type>::type>
+{
+ typedef typename T::value_type type;
+};
+``
+
+[endsect]
+
+[section Overlapping enabler conditions]
+
+Once the compiler has examined the enabling conditions and
+included the function into the overload resolution set, normal
+C++ overload resolution rules are used to select the best
+matching function. In particular, there is no ordering between
+enabling conditions. Function templates with enabling
+conditions that are not mutually exclusive can lead to
+ambiguities. For example:
+
+``
+template <class T>
+typename enable_if<boost::is_integral<T>, void>::type
+foo(T t) {}
+
+template <class T>
+typename enable_if<boost::is_arithmetic<T>, void>::type
+foo(T t) {}
+``
+
+All integral types are also arithmetic. Therefore, say, for the
+call `foo(1)`, both conditions are true and both functions are
+thus in the overload resolution set. They are both equally good
+matches and thus ambiguous. Of course, more than one enabling
+condition can be simultaneously true as long as other arguments
+disambiguate the functions.
+
+The above discussion applies to using `enable_if` in class
+template partial specializations as well.
+
+[endsect]
+
+[section:enable_if_lazy Lazy enable_if]
+
+In some cases it is necessary to avoid instantiating part of a
+function signature unless an enabling condition is true. For
+example:
+
+``
+template <class T, class U> class mult_traits;
+
+template <class T, class U>
+typename enable_if<is_multipliable<T, U>,
+ typename mult_traits<T, U>::type>::type
+operator*(const T& t, const U& u) { ... }
+``
+
+Assume the class template `mult_traits` is a traits class
+defining the resulting type of a multiplication operator. The
+`is_multipliable` traits class specifies for which types to
+enable the operator. Whenever `is_multipliable<A, B>::value` is
+`true` for some types `A` and `B`, then
+`mult_traits<A, B>::type` is defined.
+
+Now, trying to invoke (some other overload) of `operator*`
+with, say, operand types `C` and `D` for which
+`is_multipliable<C, D>::value` is `false` and
+`mult_traits<C, D>::type` is not defined is an error on some
+compilers. The SFINAE principle is not applied because the
+invalid type occurs as an argument to another template. The
+`lazy_enable_if` and `lazy_disable_if` templates (and their
+`_c` versions) can be used in such situations:
+
+``
+template<class T, class U>
+typename lazy_enable_if<is_multipliable<T, U>,
+ mult_traits<T, U> >::type
+operator*(const T& t, const U& u) { ... }
+
+``The second argument of `lazy_enable_if` must be a class type
+that defines a nested type named `type` whenever the first
+parameter (the condition) is true.
+
+[note Referring to one member type or static constant in a
+traits class causes all of the members (type and static
+constant) of that specialization to be instantiated.
+Therefore, if your traits classes can sometimes contain invalid
+types, you should use two distinct templates for describing the
+conditions and the type mappings. In the above example,
+`is_multipliable<T, U>::value` defines when
+`mult_traits<T, U>::type` is valid.]
+
+[endsect]
+
+[section Compiler workarounds]
+
+Some compilers flag functions as ambiguous if the only
+distinguishing factor is a different condition in an enabler
+(even though the functions could never be ambiguous). For
+example, some compilers (e.g. GCC 3.2) diagnose the following
+two functions as ambiguous:
+
+``
+template <class T>
+typename enable_if<boost::is_arithmetic<T>, T>::type
+foo(T t);
+
+template <class T>
+typename disable_if<boost::is_arithmetic<T>, T>::type
+foo(T t);
+``
+
+Two workarounds can be applied:
+
+* Use an extra dummy parameter which disambiguates the
+ functions. Use a default value for it to hide the parameter
+ from the caller. For example:
+ ``
+ template <int> struct dummy { dummy(int) {} };
+
+ template <class T>
+ typename enable_if<boost::is_arithmetic<T>, T>::type
+ foo(T t, dummy<0> = 0);
+
+ template <class T>
+ typename disable_if<boost::is_arithmetic<T>, T>::type
+ foo(T t, dummy<1> = 0);
+ ``
+* Define the functions in different namespaces and bring them
+ into a common namespace with `using` declarations:
+ ``
+ namespace A {
+ template <class T>
+ typename enable_if<boost::is_arithmetic<T>, T>::type
+ foo(T t);
+ }
+
+ namespace B {
+ template <class T>
+ typename disable_if<boost::is_arithmetic<T>, T>::type
+ foo(T t);
+ }
+
+ using A::foo;
+ using B::foo;
+ ``
+ Note that the second workaround above cannot be used for
+ member templates. On the other hand, operators do not accept
+ extra arguments, which makes the first workaround unusable.
+ As the net effect, neither of the workarounds are of
+ assistance for templated operators that need to be defined as
+ member functions (assignment and subscript operators).
+
+[endsect]
+
+[endsect]
+
+[section Acknowledgements]
+
+We are grateful to Howard Hinnant, Jason Shirk, Paul
+Mensonides, and Richard Smith whose findings have
+influenced the library.
+
+[endsect]
+
+[section References]
+
+* [#REF1] \[1\] Jaakko J\u00E4rvi, Jeremiah Willcock, Howard
+ Hinnant, and Andrew Lumsdaine. Function overloading based on
+ arbitrary properties of types. /C++ Users Journal/,
+ 21(6):25--32, June 2003.
+* [#REF2] \[2\] Jaakko J\u00E4rvi, Jeremiah Willcock, and
+ Andrew Lumsdaine. Concept-controlled polymorphism. In Frank
+ Pfennig and Yannis Smaragdakis, editors, /Generative
+ Programming and Component Engineering/, volume 2830 of
+ /LNCS/, pages 228--244. Springer Verlag, September 2003.
+* [#REF3] \[3\] David Vandevoorde and Nicolai M. Josuttis.
+ /C++ Templates: The Complete Guide/. Addison-Wesley, 2002.
+
+[endsect]
+
+[endsect]
diff --git a/doc/exchange.qbk b/doc/exchange.qbk
new file mode 100644
index 0000000..5e7c5cf
--- /dev/null
+++ b/doc/exchange.qbk
@@ -0,0 +1,62 @@
+[/
+Copyright 2018 Glen Joseph Fernandes
+(glenjofe@gmail.com)
+
+Distributed under the Boost Software License, Version 1.0.
+(http://www.boost.org/LICENSE_1_0.txt)
+]
+
+[section:exchange exchange]
+
+[simplesect Authors]
+
+* Glen Fernandes
+
+[endsimplesect]
+
+[section Overview]
+
+The header <boost/core/exchange.hpp> provides the function template
+`boost::exchange` which is an implementation of the `std::exchange`
+function introduced in C++14.
+
+[endsect]
+
+[section Examples]
+
+The following example shows `boost::exchange` used to simplify the
+implementation of a move constructor.
+
+```
+Node(Node&& other)
+ : head_(boost::exchange(other.head_, nullptr))
+ , tail_(boost::exchange(other.tail_, nullptr)) { }
+```
+
+[endsect]
+
+[section Reference]
+
+```
+namespace boost {
+ template<class T, class U = T>
+ constexpr T exchange(T& t, U&& u);
+}
+```
+[section Functions]
+
+[*`template<class T, class U = T> constexpr T exchange(T& t, U&& u);`]
+
+Equivalent to:
+
+```
+T v = std::move(t);
+t = std::forward<U>(u);
+return v;
+```
+
+[endsect]
+
+[endsect]
+
+[endsect]
diff --git a/doc/explicit_operator_bool.qbk b/doc/explicit_operator_bool.qbk
new file mode 100644
index 0000000..1c50332
--- /dev/null
+++ b/doc/explicit_operator_bool.qbk
@@ -0,0 +1,86 @@
+[/
+ / Copyright (c) 2013 Andrey Semashev
+ /
+ / 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)
+ /]
+
+[section:explicit_operator_bool explicit_operator_bool]
+
+[/=================]
+[simplesect Authors]
+[/=================]
+
+* Andrey Semashev
+
+[endsimplesect]
+
+[/===============]
+[section Overview]
+[/===============]
+
+Header `<boost/core/explicit_operator_bool.hpp>` provides
+`BOOST_EXPLICIT_OPERATOR_BOOL()`, `BOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT()`
+and `BOOST_CONSTEXPR_EXPLICIT_OPERATOR_BOOL()` compatibility helper macros
+that expand to an explicit conversion operator to `bool`. For compilers not
+supporting explicit conversion operators introduced in C++11 the macros expand
+to a conversion operator that implements the
+[@http://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/Safe_bool safe bool idiom].
+In case if the compiler is not able to handle safe bool idiom well the macros
+expand to a regular conversion operator to `bool`.
+
+[endsect]
+
+[/===============]
+[section Examples]
+[/===============]
+
+Both macros are intended to be placed within a user's class definition. The
+generated conversion operators will be implemented in terms of `operator!()`
+that should be defined by user in this class. In case of
+`BOOST_CONSTEXPR_EXPLICIT_OPERATOR_BOOL()` the generated conversion operator
+will be declared `constexpr` which requires the corresponding `operator!()`
+to also be `constexpr`.
+
+``
+template< typename T >
+class my_ptr
+{
+ T* m_p;
+
+public:
+ BOOST_EXPLICIT_OPERATOR_BOOL()
+
+ bool operator!() const
+ {
+ return !m_p;
+ }
+};
+``
+
+Now `my_ptr` can be used in conditional expressions, similarly to a regular pointer:
+
+``
+my_ptr< int > p;
+if (p)
+ std::cout << "true" << std::endl;
+``
+
+[endsect]
+
+[/==============]
+[section History]
+[/==============]
+
+[heading boost 1.56]
+
+* Added new macros `BOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT` and `BOOST_CONSTEXPR_EXPLICIT_OPERATOR_BOOL` to define `noexcept` and `constexpr` operators.
+* The header moved to Boost.Core.
+
+[heading boost 1.55]
+
+* The macro was extracted from Boost.Log.
+
+[endsect]
+
+[endsect]
diff --git a/doc/ignore_unused.qbk b/doc/ignore_unused.qbk
new file mode 100644
index 0000000..e3bdc4c
--- /dev/null
+++ b/doc/ignore_unused.qbk
@@ -0,0 +1,60 @@
+[/
+ Copyright 2014 Adam Wulkiewicz
+
+ 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
+]
+
+[section:ignore_unused ignore_unused]
+
+[simplesect Authors]
+
+* Adam Wulkiewicz
+
+[endsimplesect]
+
+[section Header <boost/core/ignore_unused.hpp>]
+
+The header `<boost/core/ignore_unused.hpp>` defines the function template
+`boost::ignore_unused()`. It may be used to suppress the "unused variable" or
+"unused local typedefs" compiler warnings when the variable or typedef
+can't be removed or commented out, e.g. when some blocks of the code are
+conditionally activated. C++11 variadic templates are used if they're supported,
+otherwise they're emulated with overloads.
+
+[section Usage]
+
+``
+boost::ignore_unused(v1, v2, v3);
+boost::ignore_unused<T1, T2, T3>();
+``
+
+[endsect]
+
+[section Example]
+
+``
+int fun( int foo, int bar )
+{
+ boost::ignore_unused(bar);
+#ifdef ENABLE_DEBUG_OUTPUT
+ if ( foo < bar )
+ std::cerr << "warning! foo < bar";
+#endif
+ return foo + 2;
+}
+``
+
+[endsect]
+
+[endsect]
+
+[section Acknowledgments]
+
+`boost::ignore_unused()` was contributed by Adam Wulkiewicz.
+
+[endsect]
+
+[endsect]
diff --git a/doc/is_same.qbk b/doc/is_same.qbk
new file mode 100644
index 0000000..657c591
--- /dev/null
+++ b/doc/is_same.qbk
@@ -0,0 +1,69 @@
+[/
+ Copyright 2014 Peter Dimov
+
+ 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
+]
+
+[section:is_same is_same]
+
+[simplesect Authors]
+
+* Peter Dimov
+
+[endsimplesect]
+
+[section Header <boost/core/is_same.hpp>]
+
+The header `<boost/core/is_same.hpp>` defines the class template
+`boost::core::is_same<T1,T2>`. It defines a nested integral constant
+`value` which is `true` when `T1` and `T2` are the same type, and
+`false` when they are not.
+
+In tandem with `BOOST_TEST_TRAIT_TRUE` and `BOOST_TEST_TRAIT_FALSE`,
+`is_same` is useful for writing tests for traits classes that have
+to define specific nested types.
+
+[section Synopsis]
+
+``
+namespace boost
+{
+
+namespace core
+{
+ template<class T1, class T2> struct is_same;
+}
+
+}
+``
+
+[endsect]
+
+[section Example]
+
+``
+#include <boost/core/lightweight_test_trait.hpp>
+#include <boost/core/is_same.hpp>
+
+template<class T> struct X
+{
+ typedef T& type;
+};
+
+using boost::core::is_same;
+
+int main()
+{
+ BOOST_TEST_TRAIT_TRUE(( is_same<X<int>::type, int&> ));
+ return boost::report_errors();
+}
+``
+
+[endsect]
+
+[endsect]
+
+[endsect]
diff --git a/doc/lightweight_test.qbk b/doc/lightweight_test.qbk
new file mode 100644
index 0000000..8884239
--- /dev/null
+++ b/doc/lightweight_test.qbk
@@ -0,0 +1,308 @@
+[/
+ Copyright 2010, 2011 Beman Dawes
+ Copyright 2013 Ion Gaztanaga
+ Copyright 2014, 2017 Peter Dimov
+ Copyright 2017 Kohei Takahashi
+
+ 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
+]
+
+[section:lightweight_test lightweight_test]
+
+[simplesect Authors]
+
+* Peter Dimov
+* Beman Dawes
+
+[endsimplesect]
+
+[section Header <boost/core/lightweight_test.hpp>]
+
+The header `<boost/core/lightweight_test.hpp>` is a
+lightweight test framework. It's useful for writing
+Boost regression tests for components that are dependencies
+of Boost.Test.
+
+When using `lightweight_test.hpp`, *do not forget* to
+`return boost::report_errors()` from `main`.
+
+[section Synopsis]
+
+``
+#define BOOST_TEST(expression) /*unspecified*/
+#define BOOST_TEST_NOT(expression) /*unspecified*/
+#define BOOST_ERROR(message) /*unspecified*/
+#define BOOST_TEST_EQ(expr1, expr2) /*unspecified*/
+#define BOOST_TEST_NE(expr1, expr2) /*unspecified*/
+#define BOOST_TEST_LT(expr1, expr2) /*unspecified*/
+#define BOOST_TEST_LE(expr1, expr2) /*unspecified*/
+#define BOOST_TEST_GT(expr1, expr2) /*unspecified*/
+#define BOOST_TEST_GE(expr1, expr2) /*unspecified*/
+#define BOOST_TEST_CSTR_EQ(expr1, expr2) /*unspecified*/
+#define BOOST_TEST_CSTR_NE(expr1, expr2) /*unspecified*/
+#define BOOST_TEST_ALL_EQ(begin1, end1, begin2, end2) /* unspecified */
+#define BOOST_TEST_ALL_WITH(begin1, end1, begin2, end2, predicate) /* unspecified */
+#define BOOST_TEST_THROWS(expr, excep) /*unspecified*/
+
+namespace boost
+{
+ int report_errors();
+}
+``
+
+[endsect]
+
+[section BOOST_TEST]
+
+``
+BOOST_TEST(expression)
+``
+
+If expression is false increases the error count and outputs a
+message containing `expression`.
+
+[endsect]
+
+[section BOOST_TEST_NOT]
+
+``
+BOOST_TEST_NOT(expression)
+``
+
+If expression is true increases the error count and outputs a
+message containing `!(expression)`.
+
+[endsect]
+
+[section BOOST_ERROR]
+
+``
+BOOST_ERROR(message)
+``
+
+Increases error count and outputs a message containing
+`message`.
+
+[endsect]
+
+[section BOOST_TEST_EQ]
+
+``
+BOOST_TEST_EQ(expr1, expr2)
+``
+
+If `expr1 == expr2` is not true increases the error count and outputs a
+message containing both expressions.
+
+[endsect]
+
+[section BOOST_TEST_NE]
+
+``
+BOOST_TEST_NE(expr1, expr2)
+``
+
+If `expr1 != expr2` is not true increases the error count and outputs a
+message containing both expressions.
+
+[endsect]
+
+[section BOOST_TEST_LT]
+
+``
+BOOST_TEST_LT(expr1, expr2)
+``
+
+If `expr1 < expr2` is not true increases the error count and outputs a
+message containing both expressions.
+
+[endsect]
+
+[section BOOST_TEST_LE]
+
+``
+BOOST_TEST_LE(expr1, expr2)
+``
+
+If `expr1 <= expr2` is not true increases the error count and outputs a
+message containing both expressions.
+
+[endsect]
+
+[section BOOST_TEST_GT]
+
+``
+BOOST_TEST_GT(expr1, expr2)
+``
+
+If `expr1 > expr2` is not true increases the error count and outputs a
+message containing both expressions.
+
+[endsect]
+
+[section BOOST_TEST_GE]
+
+``
+BOOST_TEST_GE(expr1, expr2)
+``
+
+If `expr1 >= expr2` is not true increases the error count and outputs a
+message containing both expressions.
+
+[endsect]
+
+[section BOOST_TEST_CSTR_EQ]
+
+``
+BOOST_TEST_CSTR_EQ(expr1, expr2)
+``
+
+Specialization of `BOOST_TEST_EQ` which interprets `expr1` and `expr2` as pointers to null-terminated byte strings (C strings). If `std::strcmp(expr1, expr2) != 0`, increase the error count and output a message containing both expressions.
+
+[endsect]
+
+[section BOOST_TEST_CSTR_NE]
+
+``
+BOOST_TEST_CSTR_NE(expr1, expr2)
+``
+
+Specialization of `BOOST_TEST_NE` which interprets `expr1` and `expr2` as pointers to null-terminated byte strings (C strings). If `std::strcmp(expr1, expr2) == 0`, increase the error count and output a message containing both expressions.
+
+[endsect]
+
+[section BOOST_TEST_ALL_EQ]
+
+``
+BOOST_TEST_ALL_EQ(begin1, end1, begin2, end2)
+``
+
+Compares the content of two sequences. If they have different sizes, or if any pairwise element differs, increases the error count and outputs a message containing at most 8 differing elements.
+
+[endsect]
+
+[section BOOST_TEST_ALL_WITH]
+
+``
+BOOST_TEST_ALL_WITH(begin1, end1, begin2, end2, predicate)
+``
+
+Compares the content of two sequences. If they have different sizes, or if any pairwise element do not fulfill the binary predicate, increases the error count and outputs a message containing at most 8 differing elements.
+
+[endsect]
+
+[section BOOST_TEST_THROWS]
+
+``
+BOOST_TEST_THROWS(expr, excep)
+``
+
+If `BOOST_NO_EXCEPTIONS` is *not* defined and if `expr` does not
+throw an exception of type `excep`, increases the error count
+and outputs a message containing the expression.
+
+If `BOOST_NO_EXCEPTIONS` is defined, this macro expands to
+nothing and `expr` is not evaluated.
+
+[endsect]
+
+[section report_errors]
+
+``
+int boost::report_errors()
+``
+
+Return the error count from `main`.
+
+[endsect]
+
+[section Example]
+
+``
+#include <boost/core/lightweight_test.hpp>
+
+int sqr( int x )
+{
+ return x * x;
+}
+
+int main()
+{
+ BOOST_TEST( sqr(2) == 4 );
+ BOOST_TEST_EQ( sqr(-3), 9 );
+
+ return boost::report_errors();
+}
+``
+
+[endsect]
+
+[endsect]
+
+[section Header <boost/core/lightweight_test_trait.hpp>]
+
+The header `<boost/core/lightweight_test_trait.hpp>` defines
+a couple of extra macros for testing compile-time traits that
+return a boolean value.
+
+[section Synopsis]
+
+``
+#define BOOST_TEST_TRAIT_TRUE((Trait)) /*unspecified*/
+#define BOOST_TEST_TRAIT_FALSE((Trait)) /*unspecified*/
+``
+
+[endsect]
+
+[section BOOST_TEST_TRAIT_TRUE]
+
+``
+BOOST_TEST_TRAIT_TRUE((Trait))
+``
+
+If `Trait::value != true` increases the error count and outputs a
+message containing `Trait`. Note the double set of parentheses; these
+enable `Trait` to contain a comma, which is common for templates.
+
+[endsect]
+
+[section BOOST_TEST_TRAIT_FALSE]
+
+``
+BOOST_TEST_TRAIT_FALSE((Trait))
+``
+
+If `Trait::value != false` increases the error count and outputs a
+message containing `Trait`. Note the double set of parentheses.
+
+[endsect]
+
+[section Example]
+
+``
+#include <boost/core/lightweight_test_trait.hpp>
+#include <boost/core/is_same.hpp>
+
+template<class T, class U> struct X
+{
+ typedef T type;
+};
+
+using boost::core::is_same;
+
+int main()
+{
+ BOOST_TEST_TRAIT_TRUE(( is_same<X<int, long>::type, int> ));
+
+ return boost::report_errors();
+}
+``
+
+[endsect]
+
+[endsect]
+
+[endsect]
diff --git a/doc/no_exceptions_support.qbk b/doc/no_exceptions_support.qbk
new file mode 100644
index 0000000..c5eb0fe
--- /dev/null
+++ b/doc/no_exceptions_support.qbk
@@ -0,0 +1,87 @@
+[/
+ Copyright 2004 Pavel Vozenilek
+ Copyright 2014 Peter Dimov
+
+ 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
+]
+
+[section:no_exceptions_support no_exceptions_support]
+
+[simplesect Authors]
+
+* Pavel Vozenilek
+
+[endsimplesect]
+
+[section Header <boost/core/no_exceptions_support.hpp>]
+
+The header `<boost/core/no_exceptions_support.hpp>` defines
+macros for use in code that needs to be portable to environments
+that do not have support for C++ exceptions.
+
+[section Synopsis]
+
+``
+#define BOOST_TRY /*unspecified*/
+#define BOOST_CATCH(x) /*unspecified*/
+#define BOOST_CATCH_END /*unspecified*/
+#define BOOST_RETHROW /*unspecified*/
+``
+
+[endsect]
+
+[section Example Use]
+
+``
+void foo() {
+ BOOST_TRY {
+ ...
+ } BOOST_CATCH(const std::bad_alloc&) {
+ ...
+ BOOST_RETHROW
+ } BOOST_CATCH(const std::exception& e) {
+ ...
+ }
+ BOOST_CATCH_END
+}
+``
+
+With exception support enabled it will expand into:
+
+``
+void foo() {
+ { try {
+ ...
+ } catch (const std::bad_alloc&) {
+ ...
+ throw;
+ } catch (const std::exception& e) {
+ ...
+ }
+ }
+}
+``
+
+With exception support disabled it will expand into:
+
+``
+void foo() {
+ { if(true) {
+ ...
+ } else if (false) {
+ ...
+ } else if (false) {
+ ...
+ }
+ }
+}
+``
+
+[endsect]
+
+[endsect]
+
+[endsect]
diff --git a/doc/noncopyable.qbk b/doc/noncopyable.qbk
new file mode 100644
index 0000000..c5f7957
--- /dev/null
+++ b/doc/noncopyable.qbk
@@ -0,0 +1,72 @@
+[/
+ Copyright 1999-2003 Beman Dawes
+ Copyright 2014 Peter Dimov
+
+ 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
+]
+
+[section:noncopyable noncopyable]
+
+[simplesect Authors]
+
+* Dave Abrahams
+
+[endsimplesect]
+
+[section Header <boost/core/noncopyable.hpp>]
+
+The header `<boost/core/noncopyable.hpp>` defines the class
+`boost::noncopyable`. It is intended to be used as a private
+base class. `boost::noncopyable` has private (under C++03) or
+deleted (under C++11) copy constructor and a copy assignment
+operator and can't be copied or assigned; a class that derives
+from it inherits these properties.
+
+`boost::noncopyable` was originally contributed by Dave
+Abrahams.
+
+[section Synopsis]
+
+``
+namespace boost
+{
+ class noncopyable;
+}
+``
+
+[endsect]
+
+[section Example]
+
+``
+#include <boost/core/noncopyable.hpp>
+
+class X: private boost::noncopyable
+{
+};
+``
+
+[endsect]
+
+[section Rationale]
+
+Class noncopyable has protected constructor and destructor members to emphasize
+that it is to be used only as a base class. Dave Abrahams notes concern about
+the effect on compiler optimization of adding (even trivial inline) destructor
+declarations. He says:
+
+["Probably this concern is misplaced, because `noncopyable` will be used mostly
+for classes which own resources and thus have non-trivial destruction semantics.]
+
+With C++2011, using an optimized and trivial constructor and similar destructor
+can be enforced by declaring both and marking them `default`. This is done in
+the current implementation.
+
+[endsect]
+
+[endsect]
+
+[endsect]
diff --git a/doc/null_deleter.qbk b/doc/null_deleter.qbk
new file mode 100644
index 0000000..8de7f6b
--- /dev/null
+++ b/doc/null_deleter.qbk
@@ -0,0 +1,34 @@
+[/
+ / Copyright (c) 2014 Andrey Semashev
+ /
+ / 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)
+ /]
+
+[section:null_deleter null_deleter]
+
+[simplesect Authors]
+
+* Andrey Semashev
+
+[endsimplesect]
+
+[section Header <boost/core/null_deleter.hpp>]
+
+The header `<boost/core/null_deleter.hpp>` defines the `boost::null_deleter` function object,
+which can be used as a deleter with smart pointers such as `unique_ptr` or `shared_ptr`. The
+deleter doesn't do anything with the pointer provided upon deallocation, which makes it useful
+when the pointed object is deallocated elsewhere.
+
+[section Example]
+``
+std::shared_ptr< std::ostream > make_stream()
+{
+ return std::shared_ptr< std::ostream >(&std::cout, boost::null_deleter());
+}
+``
+[endsect]
+
+[endsect]
+
+[endsect]
diff --git a/doc/pointer_traits.qbk b/doc/pointer_traits.qbk
new file mode 100644
index 0000000..7b57e0d
--- /dev/null
+++ b/doc/pointer_traits.qbk
@@ -0,0 +1,150 @@
+[/
+Copyright 2017-2018 Glen Joseph Fernandes
+(glenjofe@gmail.com)
+
+Distributed under the Boost Software License, Version 1.0.
+(http://www.boost.org/LICENSE_1_0.txt)
+]
+
+[section:pointer_traits pointer_traits]
+
+[simplesect Authors]
+
+* Glen Fernandes
+
+[endsimplesect]
+
+[section Overview]
+
+The header <boost/core/pointer_traits.hpp> provides the class template
+`boost::pointer_traits` to facilitate use of pointer-like types. The C++11
+standard library introduced `std::pointer_traits` along with an allocator
+model which supported pointer-like types in addition to plain raw pointers.
+This implementation also supports C++98.
+
+It also provides the function template `boost::to_address` to obtain a raw
+pointer from an object of any pointer-like type.
+
+[endsect]
+
+[section Examples]
+
+The following example allocates storage and constructs an object in that
+storage using an allocator.
+
+```
+template<class Allocator>
+void function(Allocator& a)
+{
+ auto p = a.allocate(1);
+ std::allocator_traits<Allocator>::construct(a, boost::to_address(p));
+}
+```
+
+[endsect]
+
+[section Reference]
+
+```
+namespace boost {
+ template<class T> struct pointer_traits {
+ typedef T pointer;
+ typedef ``['see below]`` element_type;
+ typedef ``['see below]`` difference_type;
+
+ template<class U> struct rebind_to { typedef ``['see below]`` type; };
+ template<class U> using rebind = typename rebind_to<U>::type;
+
+ static pointer pointer_to(``['see below]`` v);
+ };
+
+ template<class T> struct pointer_traits<T*> {
+ typedef T* pointer;
+ typedef T element_type;
+ typedef std::ptrdiff_t difference_type;
+
+ template<class U> struct rebind_to { typedef U* type; };
+ template<class U> using rebind = typename rebind_to<U>::type;
+
+ static pointer pointer_to(``['see below]`` v) noexcept;
+ };
+
+ template<class T>
+ constexpr T* to_address(T* v) noexcept;
+
+ template<class T>
+ auto to_address(const T& v) noexcept;
+}
+```
+
+[section Member types]
+
+[variablelist
+[[`typedef` ['see below] `element_type;`]
+[`T::element_type` if such a type exists; otherwise `U` if `T` is a class
+ template instantiation of the form `Pointer<U, Args>`, where `Args` is zero
+ or more type arguments; otherwise the specialization is ill-formed.]]
+[[`typedef` ['see below] `difference_type;`]
+[`T::difference_type` if such a type exists; otherwise `std::ptrdiff_t`.]]
+[[`template<class U> struct rebind_to { typedef` ['see below] `type; };`]
+[`type` is `T::rebind<U>` if such a type exists; otherwise, `Pointer<V, Args>`
+ if `T` is a class template instantiation of the form `Pointer<T, Args>`,
+ where `Args` is zero or more type arguments; otherwise, the instantiation of
+ `rebind_to` is ill-formed.]]]
+
+[endsect]
+
+[section Member functions]
+
+[variablelist
+[[`static pointer pointer_traits::pointer_to(`['see below] `v);`]
+[[variablelist
+[[Remark]
+[If `element_type` is a void type, the type of `v` is unspecified; otherwise,
+ it is `element_type&`.]]
+[[Returns]
+[A pointer to `v` obtained by calling `T::pointer_to(v)`.]]]]]
+[[`static pointer pointer_traits<T*>::pointer_to(`['see below] `v) noexcept;`]
+[[variablelist
+[[Remark]
+[If `element_type` is a void type, the type of `v` is unspecified; otherwise,
+ it is `element_type&`.]]
+[[Returns] [`addressof(v)`.]]]]]]
+
+[endsect]
+
+[section Optional members]
+
+[variablelist
+[[`static element_type* to_address(pointer v) noexcept;`]
+[[variablelist
+[[Returns]
+[A pointer of type `element_type*` that references the same location as the
+ argument `p`.]]
+[[Note]
+[This function should be the inverse of `pointer_to`. If defined, it
+ customizes the behavior of the non-member function `to_address`.]]]]]]
+
+[endsect]
+
+[section Free functions]
+
+[variablelist
+[[`template<class T> constexpr T* to_address(T* v) noexcept;`]
+[[variablelist [[Returns] [`v`.]]]]]
+[[`template<class T> auto to_address(const T& v) noexcept;`]
+[[variablelist [[Returns] [`pointer_traits<T>::to_address(v)` if that
+ expression is well-formed, otherwise `to_address(v.operator->())`.]]]]]]
+
+[endsect]
+
+[endsect]
+
+[section Acknowledgments]
+
+Glen Fernandes implemented `pointer_traits` and `to_address` with reviews and
+guidance from Peter Dimov.
+
+[endsect]
+
+[endsect]
diff --git a/doc/ref.qbk b/doc/ref.qbk
new file mode 100644
index 0000000..454851b
--- /dev/null
+++ b/doc/ref.qbk
@@ -0,0 +1,82 @@
+[/
+ / Copyright (c) 2001, 2002, 2006 Peter Dimov
+ / Copyright (c) 2002 David Abrahams
+ / Copyright (c) 2002 Aleksey Gurtovoy
+ / Copyright (c) 2003, 2004 Douglas Gregor
+ / Copyright (c) 2009 Ronald Garcia
+ / Copyright (c) 2014 Glen Joseph Fernandes
+ /
+ / 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)
+ /]
+
+[section:ref ref]
+
+[simplesect Authors]
+
+* Jaakko J\u00E4rvi
+* Peter Dimov
+* Douglas Gregor
+* Dave Abrahams
+* Frank Mori Hess
+* Ronald Garcia
+
+[endsimplesect]
+
+[section Introduction]
+
+The Ref library is a small library that is useful for passing
+references to function templates (algorithms) that would
+usually take copies of their arguments. It defines the class
+template `boost::reference_wrapper<T>`, two functions
+`boost::ref` and `boost::cref` that return instances of
+`boost::reference_wrapper<T>`, a function `boost::unwrap_ref`
+that unwraps a `boost::reference_wrapper<T>` or returns a
+reference to any other type of object, and the two traits
+classes `boost::is_reference_wrapper<T>` and
+`boost::unwrap_reference<T>`.
+
+The purpose of `boost::reference_wrapper<T>` is to contain a
+reference to an object of type `T`. It is primarily used to
+"feed" references to function templates (algorithms) that take
+their parameter by value.
+
+To support this usage, `boost::reference_wrapper<T>` provides
+an implicit conversion to `T&`. This usually allows the
+function templates to work on references unmodified.
+
+`boost::reference_wrapper<T>` is both CopyConstructible and
+Assignable (ordinary references are not Assignable).
+
+The `expression boost::ref(x)` returns a
+`boost::reference_wrapper<X>(x)` where `X` is the type of `x`.
+Similarly, `boost::cref(x)` returns a
+`boost::reference_wrapper<X const>(x)`.
+
+The expression `boost::unwrap_ref(x)` returns a
+`boost::unwrap_reference<X>::type&` where `X` is the type of
+`x`.
+
+The expression `boost::is_reference_wrapper<T>::value` is
+`true` if `T` is a `reference_wrapper`, and `false` otherwise.
+
+The type-expression `boost::unwrap_reference<T>::type` is
+`T::type` if `T` is a `reference_wrapper`, `T` otherwise.
+
+[endsect]
+
+[xinclude ref_reference.xml]
+
+[section Acknowledgments]
+
+`ref` and `cref` were originally part of the Tuple library by
+Jaakko J\u00E4rvi. They were "promoted to `boost::` status" by
+Peter Dimov because they are generally useful. Douglas Gregor
+and Dave Abrahams contributed `is_reference_wrapper` and
+`unwrap_reference`. Frank Mori Hess and Ronald Garcia
+contributed `boost::unwrap_ref`.
+
+[endsect]
+
+[endsect]
diff --git a/doc/scoped_enum.qbk b/doc/scoped_enum.qbk
new file mode 100644
index 0000000..abe2c69
--- /dev/null
+++ b/doc/scoped_enum.qbk
@@ -0,0 +1,172 @@
+[/
+ / Copyright (c) 2009 Beman Dawes
+ / Copyright (c) 2011-2012 Vicente J. Botet Escriba
+ / Copyright (c) 2012 Anthony Williams
+ / Copyright (c) 2014 Andrey Semashev
+ /
+ / 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)
+ /]
+
+[section:scoped_enum scoped_enum]
+
+[simplesect Authors]
+
+* Beman Dawes
+* Vicente J. Botet Escriba
+* Anthony Williams
+
+[endsimplesect]
+
+[section Overview]
+
+The `boost/core/scoped_enum.hpp` header contains a number of macros that can be used to generate
+C++11 scoped enums (7.2 \[dcl.enum\]) if the feature is supported by the compiler, otherwise emulate
+it with C++03 constructs. The `BOOST_NO_CXX11_SCOPED_ENUMS` macro from Boost.Config is used to detect
+the feature support in the compiler.
+
+Some of the enumerations defined in the standard library are scoped enums.
+
+ enum class future_errc
+ {
+ broken_promise,
+ future_already_retrieved,
+ promise_already_satisfied,
+ no_state
+ };
+
+The user can portably declare such enumeration as follows:
+
+ BOOST_SCOPED_ENUM_DECLARE_BEGIN(future_errc)
+ {
+ broken_promise,
+ future_already_retrieved,
+ promise_already_satisfied,
+ no_state
+ }
+ BOOST_SCOPED_ENUM_DECLARE_END(future_errc)
+
+These macros allows to use `future_errc` in almost all the cases as an scoped enum.
+
+ future_errc ev = future_errc::no_state;
+
+It is possible to specify the underlying type of the enumeration:
+
+ BOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(future_errc, unsigned int)
+ {
+ broken_promise,
+ future_already_retrieved,
+ promise_already_satisfied,
+ no_state
+ }
+ BOOST_SCOPED_ENUM_DECLARE_END(future_errc)
+
+The enumeration supports explicit conversion from the underlying type.
+
+The enumeration can be forward declared:
+
+ BOOST_SCOPED_ENUM_FORWARD_DECLARE(future_errc);
+
+There are however some limitations. First, the emulated scoped enum is not a C++ enum, so `is_enum< future_errc >` will be `false_type`.
+
+Second, the emulated scoped enum can not be used in switch nor in template arguments. For these cases the user needs to use some helpers. Instead of
+
+ switch (ev)
+ {
+ case future_errc::broken_promise:
+ // ...
+
+use
+
+ switch (boost::native_value(ev))
+ {
+ case future_errc::broken_promise:
+ // ...
+
+and instead of
+
+ template <>
+ struct is_error_code_enum< future_errc > :
+ public true_type
+ {
+ };
+
+use
+
+ template <>
+ struct is_error_code_enum< BOOST_SCOPED_ENUM_NATIVE(future_errc) > :
+ public true_type
+ {
+ };
+
+Lastly, explicit conversion to the underlying type should be performed with `boost::underlying_cast` instead of `static_cast`:
+
+ unsigned int val = boost::underlying_cast< unsigned int >(ev);
+
+Here is usage example:
+
+ BOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(algae, char)
+ {
+ green,
+ red,
+ cyan
+ }
+ BOOST_SCOPED_ENUM_DECLARE_END(algae)
+ ...
+ algae sample( algae::red );
+ void foo( algae color );
+ ...
+ sample = algae::green;
+ foo( algae::cyan );
+
+[endsect]
+
+[section Deprecated syntax]
+
+In early versions of the header there were two ways to declare scoped enums, with different pros and cons to each.
+The other way used a different set of macros:
+
+ BOOST_SCOPED_ENUM_START(algae)
+ {
+ green,
+ red,
+ cyan
+ };
+ BOOST_SCOPED_ENUM_END
+ ...
+ BOOST_SCOPED_ENUM(algae) sample( algae::red );
+ void foo( BOOST_SCOPED_ENUM(algae) color );
+ ...
+ sample = algae::green;
+ foo( algae::cyan );
+
+Here `BOOST_SCOPED_ENUM_START` corresponds to `BOOST_SCOPED_ENUM_DECLARE_BEGIN`, `BOOST_SCOPED_ENUM_END` to `BOOST_SCOPED_ENUM_DECLARE_END`
+and `BOOST_SCOPED_ENUM` to `BOOST_SCOPED_ENUM_NATIVE`. Note also the semicolon before `BOOST_SCOPED_ENUM_END`.
+
+In the current version these macros produce equivalent result to the ones described above and are considered deprecated.
+
+[endsect]
+
+[section Acquiring the underlying type of the enum]
+
+The header `boost/core/underlying_type.hpp` defines the metafunction `boost::underlying_type` which can be used to
+obtain the underlying type of the scoped enum. This metafunction has support for emulated scoped enums declared with
+macros in `boost/core/scoped_enum.hpp`. When native scoped enums are supported by the compiler, this metafunction
+is equivalent to `std::underlying_type`.
+
+Unfortunately, there are configurations which implement scoped enums but not `std::underlying_type`. In this case
+`boost::underlying_type` has to be specialized by user. The macro `BOOST_NO_UNDERLYING_TYPE` is defined to indicate
+such cases.
+
+[endsect]
+
+[section Acknowledgments]
+
+This scoped enum emulation was developed by Beman Dawes, Vicente J. Botet Escriba and Anthony Williams.
+
+Helpful comments and suggestions were also made by Kjell Elster, Phil Endecott, Joel Falcou, Mathias Gaunard, Felipe Magno de Almeida,
+Matt Calabrese, Daniel James and Andrey Semashev.
+
+[endsect]
+
+[endsect]
diff --git a/doc/swap.qbk b/doc/swap.qbk
new file mode 100644
index 0000000..dc866fd
--- /dev/null
+++ b/doc/swap.qbk
@@ -0,0 +1,121 @@
+[/
+ / Copyright (c) 2008 Joseph Gauterin
+ / Copyright (c) 2008, 2009 Niels Dekker
+ / Copyright (c) 2014 Glen Fernandes
+ /
+ / 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)
+ / For more information, see http://www.boost.org
+ /]
+
+[section:swap swap]
+
+[simplesect Authors]
+
+* Niels Dekker
+* Joseph Gauterin
+* Steven Watanabe
+* Eric Niebler
+
+[endsimplesect]
+
+[section Header <boost/core/swap.hpp>]
+
+`template<class T> void swap(T& left, T& right);`
+
+[endsect]
+
+[section Introduction]
+
+The template function `boost::swap` allows the values of two
+variables to be swapped, using argument dependent lookup to
+select a specialized swap function if available. If no
+specialized swap function is available, `std::swap` is used.
+
+[endsect]
+
+[section Rationale]
+
+The generic `std::swap` function requires that the elements
+to be swapped are assignable and copy constructible. It is
+usually implemented using one copy construction and two
+assignments - this is often both unnecessarily restrictive and
+unnecessarily slow. In addition, where the generic swap
+implementation provides only the basic guarantee, specialized
+swap functions are often able to provide the no-throw exception
+guarantee (and it is considered best practice to do so where
+possible [footnote Scott Meyers, Effective C++ Third Edition,
+Item 25: "Consider support for a non-throwing swap"].
+
+The alternative to using argument dependent lookup in this
+situation is to provide a template specialization of
+`std::swap` for every type that requires a specialized swap.
+Although this is legal C++, no Boost libraries use this method,
+whereas many Boost libraries provide specialized swap functions
+in their own namespaces.
+
+`boost::swap` also supports swapping built-in arrays. Note that
+`std::swap` originally did not do so, but a request to add an
+overload of `std::swap` for built-in arrays has been accepted
+by the C++ Standards Committee[footnote
+ [@http://open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#809
+ LWG Defect Report 809: std::swap should be overloaded for array
+ types]].
+
+[endsect]
+
+[section Exception Safety]
+
+`boost::swap` provides the same exception guarantee as the
+underlying swap function used, with one exception; for an array
+of type `T[n]`, where `n > 1` and the underlying swap function
+for `T` provides the strong exception guarantee, `boost::swap`
+provides only the basic exception guarantee.
+
+[endsect]
+
+[section Requirements]
+
+Either:
+
+* T must be assignable
+* T must be copy constructible
+
+Or:
+
+* A function with the signature `swap(T&,T&)` is available via
+ argument dependent lookup
+
+Or:
+
+* A template specialization of `std::swap` exists for T
+
+Or:
+
+* T is a built-in array of swappable elements
+
+[endsect]
+
+[section Portability]
+
+Several older compilers do not support argument dependent
+lookup. On these compilers `boost::swap` will call
+`std::swap`, ignoring any specialized swap functions that
+could be found as a result of argument dependent lookup.
+
+[endsect]
+
+[section Credits]
+
+* *Niels Dekker* - for implementing and documenting support for
+ built-in arrays
+* *Joseph Gauterin* - for the initial idea, implementation,
+ tests, and documentation
+* *Steven Watanabe* - for the idea to make `boost::swap` less
+ specialized than `std::swap`, thereby allowing the function
+ to have the name 'swap' without introducing ambiguity
+
+[endsect]
+
+[endsect]
diff --git a/doc/typeinfo.qbk b/doc/typeinfo.qbk
new file mode 100644
index 0000000..304110e
--- /dev/null
+++ b/doc/typeinfo.qbk
@@ -0,0 +1,79 @@
+[/
+ Copyright 2014 Peter Dimov
+
+ 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
+]
+
+[section:typeinfo typeinfo]
+
+[simplesect Authors]
+
+* Peter Dimov
+
+[endsimplesect]
+
+[section Header <boost/core/typeinfo.hpp>]
+
+The header `<boost/core/typeinfo.hpp>` defines a class
+`boost::core::typeinfo`, which is an alias for `std::type_info`
+when RTTI is enabled, and is a reasonable substitute when RTTI
+is not supported.
+
+The macro `BOOST_CORE_TYPEID`, when applied to a type `T`, is the
+equivalent of `typeid(T)` and produces a reference to a const
+`typeinfo` object.
+
+The function `boost::core::demangled_name` takes a
+`boost::core::typeinfo const & ti` and either returns `ti.name()`,
+when that string doesn't need to be demangled, or
+`boost::core::demangle(ti.name())`, when it does. The return type
+of `boost::core::demangled_name` is `char const*` in the first case
+and `std::string` in the second.
+
+[section Synopsis]
+
+``
+namespace boost
+{
+
+namespace core
+{
+ class typeinfo;
+ /* char const* or std::string */ demangled_name( typeinfo const & ti );
+}
+
+}
+
+#define BOOST_CORE_TYPEID(T) /*unspecified*/
+``
+
+[endsect]
+
+[section Example]
+
+``
+#include <boost/core/typeinfo.hpp>
+#include <iostream>
+
+template<class T1, class T2> struct X
+{
+};
+
+int main()
+{
+ typedef X<void const*, void(*)(float)> T;
+
+ boost::core::typeinfo const & ti = BOOST_CORE_TYPEID(T);
+
+ std::cout << boost::core::demangled_name( ti ) << std::endl;
+}
+``
+
+[endsect]
+
+[endsect]
+
+[endsect]
diff --git a/include/boost/checked_delete.hpp b/include/boost/checked_delete.hpp
new file mode 100644
index 0000000..fb71c78
--- /dev/null
+++ b/include/boost/checked_delete.hpp
@@ -0,0 +1,17 @@
+/*
+ * Copyright (c) 2014 Glen Fernandes
+ *
+ * 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)
+ */
+
+#ifndef BOOST_CHECKED_DELETE_HPP
+#define BOOST_CHECKED_DELETE_HPP
+
+// The header file at this path is deprecated;
+// use boost/core/checked_delete.hpp instead.
+
+#include <boost/core/checked_delete.hpp>
+
+#endif
diff --git a/include/boost/core/addressof.hpp b/include/boost/core/addressof.hpp
new file mode 100644
index 0000000..f7eab06
--- /dev/null
+++ b/include/boost/core/addressof.hpp
@@ -0,0 +1,274 @@
+/*
+Copyright (C) 2002 Brad King (brad.king@kitware.com)
+ Douglas Gregor (gregod@cs.rpi.edu)
+
+Copyright (C) 2002, 2008, 2013 Peter Dimov
+
+Copyright (C) 2017 Glen Joseph Fernandes (glenjofe@gmail.com)
+
+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)
+*/
+
+#ifndef BOOST_CORE_ADDRESSOF_HPP
+#define BOOST_CORE_ADDRESSOF_HPP
+
+#include <boost/config.hpp>
+
+#if defined(BOOST_MSVC_FULL_VER) && BOOST_MSVC_FULL_VER >= 190024215
+#define BOOST_CORE_HAS_BUILTIN_ADDRESSOF
+#elif defined(BOOST_GCC) && BOOST_GCC >= 70000
+#define BOOST_CORE_HAS_BUILTIN_ADDRESSOF
+#elif defined(__has_builtin)
+#if __has_builtin(__builtin_addressof)
+#define BOOST_CORE_HAS_BUILTIN_ADDRESSOF
+#endif
+#endif
+
+#if defined(BOOST_CORE_HAS_BUILTIN_ADDRESSOF)
+#if defined(BOOST_NO_CXX11_CONSTEXPR)
+#define BOOST_CORE_NO_CONSTEXPR_ADDRESSOF
+#endif
+
+namespace boost {
+
+template<class T>
+BOOST_CONSTEXPR inline T*
+addressof(T& o) BOOST_NOEXCEPT
+{
+ return __builtin_addressof(o);
+}
+
+} /* boost */
+#else
+#include <boost/config/workaround.hpp>
+#include <cstddef>
+
+namespace boost {
+namespace detail {
+
+template<class T>
+class addrof_ref {
+public:
+ BOOST_FORCEINLINE addrof_ref(T& o) BOOST_NOEXCEPT
+ : o_(o) { }
+ BOOST_FORCEINLINE operator T&() const BOOST_NOEXCEPT {
+ return o_;
+ }
+private:
+ addrof_ref& operator=(const addrof_ref&);
+ T& o_;
+};
+
+template<class T>
+struct addrof {
+ static BOOST_FORCEINLINE T* get(T& o, long) BOOST_NOEXCEPT {
+ return reinterpret_cast<T*>(&
+ const_cast<char&>(reinterpret_cast<const volatile char&>(o)));
+ }
+ static BOOST_FORCEINLINE T* get(T* p, int) BOOST_NOEXCEPT {
+ return p;
+ }
+};
+
+#if !defined(BOOST_NO_CXX11_NULLPTR)
+#if !defined(BOOST_NO_CXX11_DECLTYPE) && \
+ (defined(__INTEL_COMPILER) || \
+ (defined(__clang__) && !defined(_LIBCPP_VERSION)))
+typedef decltype(nullptr) addrof_null_t;
+#else
+typedef std::nullptr_t addrof_null_t;
+#endif
+
+template<>
+struct addrof<addrof_null_t> {
+ typedef addrof_null_t type;
+ static BOOST_FORCEINLINE type* get(type& o, int) BOOST_NOEXCEPT {
+ return &o;
+ }
+};
+
+template<>
+struct addrof<const addrof_null_t> {
+ typedef const addrof_null_t type;
+ static BOOST_FORCEINLINE type* get(type& o, int) BOOST_NOEXCEPT {
+ return &o;
+ }
+};
+
+template<>
+struct addrof<volatile addrof_null_t> {
+ typedef volatile addrof_null_t type;
+ static BOOST_FORCEINLINE type* get(type& o, int) BOOST_NOEXCEPT {
+ return &o;
+ }
+};
+
+template<>
+struct addrof<const volatile addrof_null_t> {
+ typedef const volatile addrof_null_t type;
+ static BOOST_FORCEINLINE type* get(type& o, int) BOOST_NOEXCEPT {
+ return &o;
+ }
+};
+#endif
+
+} /* detail */
+
+#if defined(BOOST_NO_CXX11_SFINAE_EXPR) || \
+ defined(BOOST_NO_CXX11_CONSTEXPR) || \
+ defined(BOOST_NO_CXX11_DECLTYPE)
+#define BOOST_CORE_NO_CONSTEXPR_ADDRESSOF
+
+template<class T>
+BOOST_FORCEINLINE T*
+addressof(T& o) BOOST_NOEXCEPT
+{
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610)) || \
+ BOOST_WORKAROUND(__SUNPRO_CC, <= 0x5120)
+ return boost::detail::addrof<T>::get(o, 0);
+#else
+ return boost::detail::addrof<T>::get(boost::detail::addrof_ref<T>(o), 0);
+#endif
+}
+
+#if BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590))
+namespace detail {
+
+template<class T>
+struct addrof_result {
+ typedef T* type;
+};
+
+} /* detail */
+
+template<class T, std::size_t N>
+BOOST_FORCEINLINE typename boost::detail::addrof_result<T[N]>::type
+addressof(T (&o)[N]) BOOST_NOEXCEPT
+{
+ return &o;
+}
+#endif
+
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+template<class T, std::size_t N>
+BOOST_FORCEINLINE
+T (*addressof(T (&o)[N]) BOOST_NOEXCEPT)[N]
+{
+ return reinterpret_cast<T(*)[N]>(&o);
+}
+
+template<class T, std::size_t N>
+BOOST_FORCEINLINE
+const T (*addressof(const T (&o)[N]) BOOST_NOEXCEPT)[N]
+{
+ return reinterpret_cast<const T(*)[N]>(&o);
+}
+#endif
+#else
+namespace detail {
+
+template<class T>
+T addrof_declval() BOOST_NOEXCEPT;
+
+template<class>
+struct addrof_void {
+ typedef void type;
+};
+
+template<class T, class E = void>
+struct addrof_member_operator {
+ static constexpr bool value = false;
+};
+
+template<class T>
+struct addrof_member_operator<T, typename
+ addrof_void<decltype(addrof_declval<T&>().operator&())>::type> {
+ static constexpr bool value = true;
+};
+
+#if BOOST_WORKAROUND(BOOST_INTEL, < 1600)
+struct addrof_addressable { };
+
+addrof_addressable*
+operator&(addrof_addressable&) BOOST_NOEXCEPT;
+#endif
+
+template<class T, class E = void>
+struct addrof_non_member_operator {
+ static constexpr bool value = false;
+};
+
+template<class T>
+struct addrof_non_member_operator<T, typename
+ addrof_void<decltype(operator&(addrof_declval<T&>()))>::type> {
+ static constexpr bool value = true;
+};
+
+template<class T, class E = void>
+struct addrof_expression {
+ static constexpr bool value = false;
+};
+
+template<class T>
+struct addrof_expression<T,
+ typename addrof_void<decltype(&addrof_declval<T&>())>::type> {
+ static constexpr bool value = true;
+};
+
+template<class T>
+struct addrof_is_constexpr {
+ static constexpr bool value = addrof_expression<T>::value &&
+ !addrof_member_operator<T>::value &&
+ !addrof_non_member_operator<T>::value;
+};
+
+template<bool E, class T>
+struct addrof_if { };
+
+template<class T>
+struct addrof_if<true, T> {
+ typedef T* type;
+};
+
+template<class T>
+BOOST_FORCEINLINE
+typename addrof_if<!addrof_is_constexpr<T>::value, T>::type
+addressof(T& o) BOOST_NOEXCEPT
+{
+ return addrof<T>::get(addrof_ref<T>(o), 0);
+}
+
+template<class T>
+constexpr BOOST_FORCEINLINE
+typename addrof_if<addrof_is_constexpr<T>::value, T>::type
+addressof(T& o) BOOST_NOEXCEPT
+{
+ return &o;
+}
+
+} /* detail */
+
+template<class T>
+constexpr BOOST_FORCEINLINE T*
+addressof(T& o) BOOST_NOEXCEPT
+{
+ return boost::detail::addressof(o);
+}
+#endif
+
+} /* boost */
+#endif
+
+#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && \
+ !defined(BOOST_NO_CXX11_DELETED_FUNCTIONS)
+namespace boost {
+
+template<class T>
+const T* addressof(const T&&) = delete;
+
+} /* boost */
+#endif
+
+#endif
diff --git a/include/boost/core/checked_delete.hpp b/include/boost/core/checked_delete.hpp
new file mode 100644
index 0000000..b086e03
--- /dev/null
+++ b/include/boost/core/checked_delete.hpp
@@ -0,0 +1,69 @@
+#ifndef BOOST_CORE_CHECKED_DELETE_HPP
+#define BOOST_CORE_CHECKED_DELETE_HPP
+
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+//
+// boost/checked_delete.hpp
+//
+// Copyright (c) 2002, 2003 Peter Dimov
+// Copyright (c) 2003 Daniel Frey
+// Copyright (c) 2003 Howard Hinnant
+//
+// 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/core/doc/html/core/checked_delete.html for documentation.
+//
+
+namespace boost
+{
+
+// verify that types are complete for increased safety
+
+template<class T> inline void checked_delete(T * x)
+{
+ // intentionally complex - simplification causes regressions
+ typedef char type_must_be_complete[ sizeof(T)? 1: -1 ];
+ (void) sizeof(type_must_be_complete);
+ delete x;
+}
+
+template<class T> inline void checked_array_delete(T * x)
+{
+ typedef char type_must_be_complete[ sizeof(T)? 1: -1 ];
+ (void) sizeof(type_must_be_complete);
+ delete [] x;
+}
+
+template<class T> struct checked_deleter
+{
+ typedef void result_type;
+ typedef T * argument_type;
+
+ void operator()(T * x) const
+ {
+ // boost:: disables ADL
+ boost::checked_delete(x);
+ }
+};
+
+template<class T> struct checked_array_deleter
+{
+ typedef void result_type;
+ typedef T * argument_type;
+
+ void operator()(T * x) const
+ {
+ boost::checked_array_delete(x);
+ }
+};
+
+} // namespace boost
+
+#endif // #ifndef BOOST_CORE_CHECKED_DELETE_HPP
diff --git a/include/boost/core/demangle.hpp b/include/boost/core/demangle.hpp
new file mode 100644
index 0000000..dc714d8
--- /dev/null
+++ b/include/boost/core/demangle.hpp
@@ -0,0 +1,126 @@
+#ifndef BOOST_CORE_DEMANGLE_HPP_INCLUDED
+#define BOOST_CORE_DEMANGLE_HPP_INCLUDED
+
+// core::demangle
+//
+// Copyright 2014 Peter Dimov
+// Copyright 2014 Andrey Semashev
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+
+#include <boost/config.hpp>
+#include <string>
+
+#if defined(BOOST_HAS_PRAGMA_ONCE)
+# pragma once
+#endif
+
+// __has_include is currently supported by GCC and Clang. However GCC 4.9 may have issues and
+// returns 1 for 'defined( __has_include )', while '__has_include' is actually not supported:
+// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63662
+#if defined( __has_include ) && (!defined( BOOST_GCC ) || (__GNUC__ + 0) >= 5)
+# if __has_include(<cxxabi.h>)
+# define BOOST_CORE_HAS_CXXABI_H
+# endif
+#elif defined( __GLIBCXX__ ) || defined( __GLIBCPP__ )
+# define BOOST_CORE_HAS_CXXABI_H
+#endif
+
+#if defined( BOOST_CORE_HAS_CXXABI_H )
+# include <cxxabi.h>
+// For some archtectures (mips, mips64, x86, x86_64) cxxabi.h in Android NDK is implemented by gabi++ library
+// (https://android.googlesource.com/platform/ndk/+/master/sources/cxx-stl/gabi++/), which does not implement
+// abi::__cxa_demangle(). We detect this implementation by checking the include guard here.
+# if defined( __GABIXX_CXXABI_H__ )
+# undef BOOST_CORE_HAS_CXXABI_H
+# else
+# include <cstdlib>
+# include <cstddef>
+# endif
+#endif
+
+namespace boost
+{
+
+namespace core
+{
+
+inline char const * demangle_alloc( char const * name ) BOOST_NOEXCEPT;
+inline void demangle_free( char const * name ) BOOST_NOEXCEPT;
+
+class scoped_demangled_name
+{
+private:
+ char const * m_p;
+
+public:
+ explicit scoped_demangled_name( char const * name ) BOOST_NOEXCEPT :
+ m_p( demangle_alloc( name ) )
+ {
+ }
+
+ ~scoped_demangled_name() BOOST_NOEXCEPT
+ {
+ demangle_free( m_p );
+ }
+
+ char const * get() const BOOST_NOEXCEPT
+ {
+ return m_p;
+ }
+
+ BOOST_DELETED_FUNCTION(scoped_demangled_name( scoped_demangled_name const& ))
+ BOOST_DELETED_FUNCTION(scoped_demangled_name& operator= ( scoped_demangled_name const& ))
+};
+
+
+#if defined( BOOST_CORE_HAS_CXXABI_H )
+
+inline char const * demangle_alloc( char const * name ) BOOST_NOEXCEPT
+{
+ int status = 0;
+ std::size_t size = 0;
+ return abi::__cxa_demangle( name, NULL, &size, &status );
+}
+
+inline void demangle_free( char const * name ) BOOST_NOEXCEPT
+{
+ std::free( const_cast< char* >( name ) );
+}
+
+inline std::string demangle( char const * name )
+{
+ scoped_demangled_name demangled_name( name );
+ char const * p = demangled_name.get();
+ if( !p )
+ p = name;
+ return p;
+}
+
+#else
+
+inline char const * demangle_alloc( char const * name ) BOOST_NOEXCEPT
+{
+ return name;
+}
+
+inline void demangle_free( char const * ) BOOST_NOEXCEPT
+{
+}
+
+inline std::string demangle( char const * name )
+{
+ return name;
+}
+
+#endif
+
+} // namespace core
+
+} // namespace boost
+
+#undef BOOST_CORE_HAS_CXXABI_H
+
+#endif // #ifndef BOOST_CORE_DEMANGLE_HPP_INCLUDED
diff --git a/include/boost/core/enable_if.hpp b/include/boost/core/enable_if.hpp
new file mode 100644
index 0000000..5dcef1e
--- /dev/null
+++ b/include/boost/core/enable_if.hpp
@@ -0,0 +1,128 @@
+// Boost enable_if library
+
+// Copyright 2003 (c) The Trustees of Indiana University.
+
+// Use, modification, and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// Authors: Jaakko Jarvi (jajarvi at osl.iu.edu)
+// Jeremiah Willcock (jewillco at osl.iu.edu)
+// Andrew Lumsdaine (lums at osl.iu.edu)
+
+
+#ifndef BOOST_CORE_ENABLE_IF_HPP
+#define BOOST_CORE_ENABLE_IF_HPP
+
+#include "boost/config.hpp"
+
+// Even the definition of enable_if causes problems on some compilers,
+// so it's macroed out for all compilers that do not support SFINAE
+
+#ifndef BOOST_NO_SFINAE
+
+namespace boost
+{
+ template<typename T, typename R=void>
+ struct enable_if_has_type
+ {
+ typedef R type;
+ };
+
+ template <bool B, class T = void>
+ struct enable_if_c {
+ typedef T type;
+ };
+
+ template <class T>
+ struct enable_if_c<false, T> {};
+
+ template <class Cond, class T = void>
+ struct enable_if : public enable_if_c<Cond::value, T> {};
+
+ template <bool B, class T>
+ struct lazy_enable_if_c {
+ typedef typename T::type type;
+ };
+
+ template <class T>
+ struct lazy_enable_if_c<false, T> {};
+
+ template <class Cond, class T>
+ struct lazy_enable_if : public lazy_enable_if_c<Cond::value, T> {};
+
+
+ template <bool B, class T = void>
+ struct disable_if_c {
+ typedef T type;
+ };
+
+ template <class T>
+ struct disable_if_c<true, T> {};
+
+ template <class Cond, class T = void>
+ struct disable_if : public disable_if_c<Cond::value, T> {};
+
+ template <bool B, class T>
+ struct lazy_disable_if_c {
+ typedef typename T::type type;
+ };
+
+ template <class T>
+ struct lazy_disable_if_c<true, T> {};
+
+ template <class Cond, class T>
+ struct lazy_disable_if : public lazy_disable_if_c<Cond::value, T> {};
+
+} // namespace boost
+
+#else
+
+namespace boost {
+
+ namespace detail { typedef void enable_if_default_T; }
+
+ template <typename T>
+ struct enable_if_does_not_work_on_this_compiler;
+
+ template<typename T, typename R=void>
+ struct enable_if_has_type : enable_if_does_not_work_on_this_compiler<T>
+ { };
+
+ template <bool B, class T = detail::enable_if_default_T>
+ struct enable_if_c : enable_if_does_not_work_on_this_compiler<T>
+ { };
+
+ template <bool B, class T = detail::enable_if_default_T>
+ struct disable_if_c : enable_if_does_not_work_on_this_compiler<T>
+ { };
+
+ template <bool B, class T = detail::enable_if_default_T>
+ struct lazy_enable_if_c : enable_if_does_not_work_on_this_compiler<T>
+ { };
+
+ template <bool B, class T = detail::enable_if_default_T>
+ struct lazy_disable_if_c : enable_if_does_not_work_on_this_compiler<T>
+ { };
+
+ template <class Cond, class T = detail::enable_if_default_T>
+ struct enable_if : enable_if_does_not_work_on_this_compiler<T>
+ { };
+
+ template <class Cond, class T = detail::enable_if_default_T>
+ struct disable_if : enable_if_does_not_work_on_this_compiler<T>
+ { };
+
+ template <class Cond, class T = detail::enable_if_default_T>
+ struct lazy_enable_if : enable_if_does_not_work_on_this_compiler<T>
+ { };
+
+ template <class Cond, class T = detail::enable_if_default_T>
+ struct lazy_disable_if : enable_if_does_not_work_on_this_compiler<T>
+ { };
+
+} // namespace boost
+
+#endif // BOOST_NO_SFINAE
+
+#endif
diff --git a/include/boost/core/exchange.hpp b/include/boost/core/exchange.hpp
new file mode 100644
index 0000000..bc8a9fc
--- /dev/null
+++ b/include/boost/core/exchange.hpp
@@ -0,0 +1,49 @@
+/*
+Copyright 2018 Glen Joseph Fernandes
+(glenjofe@gmail.com)
+
+Distributed under the Boost Software License, Version 1.0.
+(http://www.boost.org/LICENSE_1_0.txt)
+*/
+#ifndef BOOST_CORE_EXCHANGE_HPP
+#define BOOST_CORE_EXCHANGE_HPP
+
+#include <boost/config.hpp>
+#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+#include <boost/config/workaround.hpp>
+#include <utility>
+#endif
+
+namespace boost {
+
+#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+template<class T, class U>
+inline T exchange(T& t, const U& u)
+{
+ T v = t;
+ t = u;
+ return v;
+}
+#else
+#if BOOST_WORKAROUND(BOOST_MSVC, < 1800)
+template<class T, class U>
+inline T exchange(T& t, U&& u)
+{
+ T v = std::move(t);
+ t = std::forward<U>(u);
+ return v;
+}
+#else
+template<class T, class U = T>
+BOOST_CXX14_CONSTEXPR inline T exchange(T& t, U&& u)
+{
+ T v = std::move(t);
+ t = std::forward<U>(u);
+ return v;
+}
+#endif
+#endif
+
+} /* boost */
+
+#endif
diff --git a/include/boost/core/explicit_operator_bool.hpp b/include/boost/core/explicit_operator_bool.hpp
new file mode 100644
index 0000000..a8936e2
--- /dev/null
+++ b/include/boost/core/explicit_operator_bool.hpp
@@ -0,0 +1,154 @@
+/*
+ * Copyright Andrey Semashev 2007 - 2013.
+ * 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)
+ */
+
+/*!
+ * \file explicit_operator_bool.hpp
+ * \author Andrey Semashev
+ * \date 08.03.2009
+ *
+ * This header defines a compatibility macro that implements an unspecified
+ * \c bool operator idiom, which is superseded with explicit conversion operators in
+ * C++11.
+ */
+
+#ifndef BOOST_CORE_EXPLICIT_OPERATOR_BOOL_HPP
+#define BOOST_CORE_EXPLICIT_OPERATOR_BOOL_HPP
+
+#include <boost/config.hpp>
+
+#ifdef BOOST_HAS_PRAGMA_ONCE
+#pragma once
+#endif
+
+#if !defined(BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS)
+
+/*!
+ * \brief The macro defines an explicit operator of conversion to \c bool
+ *
+ * The macro should be used inside the definition of a class that has to
+ * support the conversion. The class should also implement <tt>operator!</tt>,
+ * in terms of which the conversion operator will be implemented.
+ */
+#define BOOST_EXPLICIT_OPERATOR_BOOL()\
+ BOOST_FORCEINLINE explicit operator bool () const\
+ {\
+ return !this->operator! ();\
+ }
+
+/*!
+ * \brief The macro defines a noexcept explicit operator of conversion to \c bool
+ *
+ * The macro should be used inside the definition of a class that has to
+ * support the conversion. The class should also implement <tt>operator!</tt>,
+ * in terms of which the conversion operator will be implemented.
+ */
+#define BOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT()\
+ BOOST_FORCEINLINE explicit operator bool () const BOOST_NOEXCEPT\
+ {\
+ return !this->operator! ();\
+ }
+
+/*!
+ * \brief The macro defines a constexpr explicit operator of conversion to \c bool
+ *
+ * The macro should be used inside the definition of a class that has to
+ * support the conversion. The class should also implement <tt>operator!</tt>,
+ * in terms of which the conversion operator will be implemented.
+ */
+#define BOOST_CONSTEXPR_EXPLICIT_OPERATOR_BOOL()\
+ BOOST_FORCEINLINE BOOST_CONSTEXPR explicit operator bool () const BOOST_NOEXCEPT\
+ {\
+ return !this->operator! ();\
+ }
+
+#else // !defined(BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS)
+
+#if (defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x530)) && !defined(BOOST_NO_COMPILER_CONFIG)
+// Sun C++ 5.3 can't handle the safe_bool idiom, so don't use it
+#define BOOST_NO_UNSPECIFIED_BOOL
+#endif // (defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x530)) && !defined(BOOST_NO_COMPILER_CONFIG)
+
+#if !defined(BOOST_NO_UNSPECIFIED_BOOL)
+
+namespace boost {
+
+namespace detail {
+
+#if !defined(_MSC_VER) && !defined(__IBMCPP__)
+
+ struct unspecified_bool
+ {
+ // NOTE TO THE USER: If you see this in error messages then you tried
+ // to apply an unsupported operator on the object that supports
+ // explicit conversion to bool.
+ struct OPERATORS_NOT_ALLOWED;
+ static void true_value(OPERATORS_NOT_ALLOWED*) {}
+ };
+ typedef void (*unspecified_bool_type)(unspecified_bool::OPERATORS_NOT_ALLOWED*);
+
+#else
+
+ // MSVC and VACPP are too eager to convert pointer to function to void* even though they shouldn't
+ struct unspecified_bool
+ {
+ // NOTE TO THE USER: If you see this in error messages then you tried
+ // to apply an unsupported operator on the object that supports
+ // explicit conversion to bool.
+ struct OPERATORS_NOT_ALLOWED;
+ void true_value(OPERATORS_NOT_ALLOWED*) {}
+ };
+ typedef void (unspecified_bool::*unspecified_bool_type)(unspecified_bool::OPERATORS_NOT_ALLOWED*);
+
+#endif
+
+} // namespace detail
+
+} // namespace boost
+
+#define BOOST_EXPLICIT_OPERATOR_BOOL()\
+ BOOST_FORCEINLINE operator boost::detail::unspecified_bool_type () const\
+ {\
+ return (!this->operator! () ? &boost::detail::unspecified_bool::true_value : (boost::detail::unspecified_bool_type)0);\
+ }
+
+#define BOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT()\
+ BOOST_FORCEINLINE operator boost::detail::unspecified_bool_type () const BOOST_NOEXCEPT\
+ {\
+ return (!this->operator! () ? &boost::detail::unspecified_bool::true_value : (boost::detail::unspecified_bool_type)0);\
+ }
+
+#define BOOST_CONSTEXPR_EXPLICIT_OPERATOR_BOOL()\
+ BOOST_FORCEINLINE BOOST_CONSTEXPR operator boost::detail::unspecified_bool_type () const BOOST_NOEXCEPT\
+ {\
+ return (!this->operator! () ? &boost::detail::unspecified_bool::true_value : (boost::detail::unspecified_bool_type)0);\
+ }
+
+#else // !defined(BOOST_NO_UNSPECIFIED_BOOL)
+
+#define BOOST_EXPLICIT_OPERATOR_BOOL()\
+ BOOST_FORCEINLINE operator bool () const\
+ {\
+ return !this->operator! ();\
+ }
+
+#define BOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT()\
+ BOOST_FORCEINLINE operator bool () const BOOST_NOEXCEPT\
+ {\
+ return !this->operator! ();\
+ }
+
+#define BOOST_CONSTEXPR_EXPLICIT_OPERATOR_BOOL()\
+ BOOST_FORCEINLINE BOOST_CONSTEXPR operator bool () const BOOST_NOEXCEPT\
+ {\
+ return !this->operator! ();\
+ }
+
+#endif // !defined(BOOST_NO_UNSPECIFIED_BOOL)
+
+#endif // !defined(BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS)
+
+#endif // BOOST_CORE_EXPLICIT_OPERATOR_BOOL_HPP
diff --git a/include/boost/core/ignore_unused.hpp b/include/boost/core/ignore_unused.hpp
new file mode 100644
index 0000000..994e5f6
--- /dev/null
+++ b/include/boost/core/ignore_unused.hpp
@@ -0,0 +1,70 @@
+// Copyright (c) 2014 Adam Wulkiewicz, Lodz, Poland.
+//
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_CORE_IGNORE_UNUSED_HPP
+#define BOOST_CORE_IGNORE_UNUSED_HPP
+
+#include <boost/config.hpp>
+
+namespace boost {
+
+#ifndef BOOST_NO_CXX11_VARIADIC_TEMPLATES
+
+template <typename... Ts>
+BOOST_FORCEINLINE BOOST_CXX14_CONSTEXPR void ignore_unused(Ts const& ...)
+{}
+
+template <typename... Ts>
+BOOST_FORCEINLINE BOOST_CXX14_CONSTEXPR void ignore_unused()
+{}
+
+#else
+
+template <typename T1>
+BOOST_FORCEINLINE BOOST_CXX14_CONSTEXPR void ignore_unused(T1 const&)
+{}
+
+template <typename T1, typename T2>
+BOOST_FORCEINLINE BOOST_CXX14_CONSTEXPR void ignore_unused(T1 const&, T2 const&)
+{}
+
+template <typename T1, typename T2, typename T3>
+BOOST_FORCEINLINE BOOST_CXX14_CONSTEXPR void ignore_unused(T1 const&, T2 const&, T3 const&)
+{}
+
+template <typename T1, typename T2, typename T3, typename T4>
+BOOST_FORCEINLINE BOOST_CXX14_CONSTEXPR void ignore_unused(T1 const&, T2 const&, T3 const&, T4 const&)
+{}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5>
+BOOST_FORCEINLINE BOOST_CXX14_CONSTEXPR void ignore_unused(T1 const&, T2 const&, T3 const&, T4 const&, T5 const&)
+{}
+
+template <typename T1>
+BOOST_FORCEINLINE BOOST_CXX14_CONSTEXPR void ignore_unused()
+{}
+
+template <typename T1, typename T2>
+BOOST_FORCEINLINE BOOST_CXX14_CONSTEXPR void ignore_unused()
+{}
+
+template <typename T1, typename T2, typename T3>
+BOOST_FORCEINLINE BOOST_CXX14_CONSTEXPR void ignore_unused()
+{}
+
+template <typename T1, typename T2, typename T3, typename T4>
+BOOST_FORCEINLINE BOOST_CXX14_CONSTEXPR void ignore_unused()
+{}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5>
+BOOST_FORCEINLINE BOOST_CXX14_CONSTEXPR void ignore_unused()
+{}
+
+#endif
+
+} // namespace boost
+
+#endif // BOOST_CORE_IGNORE_UNUSED_HPP
diff --git a/include/boost/core/is_same.hpp b/include/boost/core/is_same.hpp
new file mode 100644
index 0000000..f373c65
--- /dev/null
+++ b/include/boost/core/is_same.hpp
@@ -0,0 +1,40 @@
+#ifndef BOOST_CORE_IS_SAME_HPP_INCLUDED
+#define BOOST_CORE_IS_SAME_HPP_INCLUDED
+
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+// is_same<T1,T2>::value is true when T1 == T2
+//
+// Copyright 2014 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+
+#include <boost/config.hpp>
+
+namespace boost
+{
+
+namespace core
+{
+
+template< class T1, class T2 > struct is_same
+{
+ BOOST_STATIC_CONSTANT( bool, value = false );
+};
+
+template< class T > struct is_same< T, T >
+{
+ BOOST_STATIC_CONSTANT( bool, value = true );
+};
+
+} // namespace core
+
+} // namespace boost
+
+#endif // #ifndef BOOST_CORE_IS_SAME_HPP_INCLUDED
diff --git a/include/boost/core/lightweight_test.hpp b/include/boost/core/lightweight_test.hpp
new file mode 100644
index 0000000..73557be
--- /dev/null
+++ b/include/boost/core/lightweight_test.hpp
@@ -0,0 +1,465 @@
+#ifndef BOOST_CORE_LIGHTWEIGHT_TEST_HPP
+#define BOOST_CORE_LIGHTWEIGHT_TEST_HPP
+
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+//
+// boost/core/lightweight_test.hpp - lightweight test library
+//
+// Copyright (c) 2002, 2009, 2014 Peter Dimov
+// Copyright (2) Beman Dawes 2010, 2011
+// Copyright (3) Ion Gaztanaga 2013
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <boost/core/no_exceptions_support.hpp>
+#include <boost/assert.hpp>
+#include <boost/current_function.hpp>
+#include <iostream>
+#include <iterator>
+#include <cstring>
+#include <cstddef>
+
+// IDE's like Visual Studio perform better if output goes to std::cout or
+// some other stream, so allow user to configure output stream:
+#ifndef BOOST_LIGHTWEIGHT_TEST_OSTREAM
+# define BOOST_LIGHTWEIGHT_TEST_OSTREAM std::cerr
+#endif
+
+namespace boost
+{
+
+namespace detail
+{
+
+struct report_errors_reminder
+{
+ bool called_report_errors_function;
+
+ report_errors_reminder() : called_report_errors_function(false) {}
+
+ ~report_errors_reminder()
+ {
+ BOOST_ASSERT(called_report_errors_function); // verify report_errors() was called
+ }
+};
+
+inline report_errors_reminder& report_errors_remind()
+{
+ static report_errors_reminder r;
+ return r;
+}
+
+inline int & test_errors()
+{
+ static int x = 0;
+ report_errors_remind();
+ return x;
+}
+
+inline void test_failed_impl(char const * expr, char const * file, int line, char const * function)
+{
+ BOOST_LIGHTWEIGHT_TEST_OSTREAM
+ << file << "(" << line << "): test '" << expr << "' failed in function '"
+ << function << "'" << std::endl;
+ ++test_errors();
+}
+
+inline void error_impl(char const * msg, char const * file, int line, char const * function)
+{
+ BOOST_LIGHTWEIGHT_TEST_OSTREAM
+ << file << "(" << line << "): " << msg << " in function '"
+ << function << "'" << std::endl;
+ ++test_errors();
+}
+
+inline void throw_failed_impl(char const * excep, char const * file, int line, char const * function)
+{
+ BOOST_LIGHTWEIGHT_TEST_OSTREAM
+ << file << "(" << line << "): Exception '" << excep << "' not thrown in function '"
+ << function << "'" << std::endl;
+ ++test_errors();
+}
+
+// In the comparisons below, it is possible that T and U are signed and unsigned integer types, which generates warnings in some compilers.
+// A cleaner fix would require common_type trait or some meta-programming, which would introduce a dependency on Boost.TypeTraits. To avoid
+// the dependency we just disable the warnings.
+#if defined(_MSC_VER)
+# pragma warning(push)
+# pragma warning(disable: 4389)
+#elif defined(__clang__) && defined(__has_warning)
+# if __has_warning("-Wsign-compare")
+# pragma clang diagnostic push
+# pragma clang diagnostic ignored "-Wsign-compare"
+# endif
+#elif defined(__GNUC__) && !(defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || defined(__ECC)) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 406
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wsign-compare"
+#endif
+
+// specialize test output for char pointers to avoid printing as cstring
+template <class T> inline const T& test_output_impl(const T& v) { return v; }
+inline const void* test_output_impl(const char* v) { return v; }
+inline const void* test_output_impl(const unsigned char* v) { return v; }
+inline const void* test_output_impl(const signed char* v) { return v; }
+inline const void* test_output_impl(char* v) { return v; }
+inline const void* test_output_impl(unsigned char* v) { return v; }
+inline const void* test_output_impl(signed char* v) { return v; }
+template<class T> inline const void* test_output_impl(T volatile* v) { return const_cast<T*>(v); }
+
+#if !defined( BOOST_NO_CXX11_NULLPTR )
+inline const void* test_output_impl(std::nullptr_t) { return nullptr; }
+#endif
+
+template<class T, class U> inline void test_eq_impl( char const * expr1, char const * expr2,
+ char const * file, int line, char const * function, T const & t, U const & u )
+{
+ if( t == u )
+ {
+ report_errors_remind();
+ }
+ else
+ {
+ BOOST_LIGHTWEIGHT_TEST_OSTREAM
+ << file << "(" << line << "): test '" << expr1 << " == " << expr2
+ << "' failed in function '" << function << "': "
+ << "'" << test_output_impl(t) << "' != '" << test_output_impl(u) << "'" << std::endl;
+ ++test_errors();
+ }
+}
+
+template<class T, class U> inline void test_ne_impl( char const * expr1, char const * expr2,
+ char const * file, int line, char const * function, T const & t, U const & u )
+{
+ if( t != u )
+ {
+ report_errors_remind();
+ }
+ else
+ {
+ BOOST_LIGHTWEIGHT_TEST_OSTREAM
+ << file << "(" << line << "): test '" << expr1 << " != " << expr2
+ << "' failed in function '" << function << "': "
+ << "'" << test_output_impl(t) << "' == '" << test_output_impl(u) << "'" << std::endl;
+ ++test_errors();
+ }
+}
+
+template<class T, class U> inline void test_lt_impl( char const * expr1, char const * expr2,
+ char const * file, int line, char const * function, T const & t, U const & u )
+{
+ if( t < u )
+ {
+ report_errors_remind();
+ }
+ else
+ {
+ BOOST_LIGHTWEIGHT_TEST_OSTREAM
+ << file << "(" << line << "): test '" << expr1 << " < " << expr2
+ << "' failed in function '" << function << "': "
+ << "'" << test_output_impl(t) << "' >= '" << test_output_impl(u) << "'" << std::endl;
+ ++test_errors();
+ }
+}
+
+template<class T, class U> inline void test_le_impl( char const * expr1, char const * expr2,
+ char const * file, int line, char const * function, T const & t, U const & u )
+{
+ if( t <= u )
+ {
+ report_errors_remind();
+ }
+ else
+ {
+ BOOST_LIGHTWEIGHT_TEST_OSTREAM
+ << file << "(" << line << "): test '" << expr1 << " <= " << expr2
+ << "' failed in function '" << function << "': "
+ << "'" << test_output_impl(t) << "' > '" << test_output_impl(u) << "'" << std::endl;
+ ++test_errors();
+ }
+}
+
+template<class T, class U> inline void test_gt_impl( char const * expr1, char const * expr2,
+ char const * file, int line, char const * function, T const & t, U const & u )
+{
+ if( t > u )
+ {
+ report_errors_remind();
+ }
+ else
+ {
+ BOOST_LIGHTWEIGHT_TEST_OSTREAM
+ << file << "(" << line << "): test '" << expr1 << " > " << expr2
+ << "' failed in function '" << function << "': "
+ << "'" << test_output_impl(t) << "' <= '" << test_output_impl(u) << "'" << std::endl;
+ ++test_errors();
+ }
+}
+
+template<class T, class U> inline void test_ge_impl( char const * expr1, char const * expr2,
+ char const * file, int line, char const * function, T const & t, U const & u )
+{
+ if( t >= u )
+ {
+ report_errors_remind();
+ }
+ else
+ {
+ BOOST_LIGHTWEIGHT_TEST_OSTREAM
+ << file << "(" << line << "): test '" << expr1 << " >= " << expr2
+ << "' failed in function '" << function << "': "
+ << "'" << test_output_impl(t) << "' < '" << test_output_impl(u) << "'" << std::endl;
+ ++test_errors();
+ }
+}
+
+inline void test_cstr_eq_impl( char const * expr1, char const * expr2,
+ char const * file, int line, char const * function, char const * const t, char const * const u )
+{
+ if( std::strcmp(t, u) == 0 )
+ {
+ report_errors_remind();
+ }
+ else
+ {
+ BOOST_LIGHTWEIGHT_TEST_OSTREAM
+ << file << "(" << line << "): test '" << expr1 << " == " << expr2
+ << "' failed in function '" << function << "': "
+ << "'" << t << "' != '" << u << "'" << std::endl;
+ ++test_errors();
+ }
+}
+
+inline void test_cstr_ne_impl( char const * expr1, char const * expr2,
+ char const * file, int line, char const * function, char const * const t, char const * const u )
+{
+ if( std::strcmp(t, u) != 0 )
+ {
+ report_errors_remind();
+ }
+ else
+ {
+ BOOST_LIGHTWEIGHT_TEST_OSTREAM
+ << file << "(" << line << "): test '" << expr1 << " == " << expr2
+ << "' failed in function '" << function << "': "
+ << "'" << t << "' == '" << u << "'" << std::endl;
+ ++test_errors();
+ }
+}
+
+template<class FormattedOutputFunction, class InputIterator1, class InputIterator2>
+void test_all_eq_impl(FormattedOutputFunction& output,
+ char const * file, int line, char const * function,
+ InputIterator1 first_begin, InputIterator1 first_end,
+ InputIterator2 second_begin, InputIterator2 second_end)
+{
+ InputIterator1 first_it = first_begin;
+ InputIterator2 second_it = second_begin;
+ typename std::iterator_traits<InputIterator1>::difference_type first_index = 0;
+ typename std::iterator_traits<InputIterator2>::difference_type second_index = 0;
+ std::size_t error_count = 0;
+ const std::size_t max_count = 8;
+ do
+ {
+ while ((first_it != first_end) && (second_it != second_end) && (*first_it == *second_it))
+ {
+ ++first_it;
+ ++second_it;
+ ++first_index;
+ ++second_index;
+ }
+ if ((first_it == first_end) || (second_it == second_end))
+ {
+ break; // do-while
+ }
+ if (error_count == 0)
+ {
+ output << file << "(" << line << "): Container contents differ in function '" << function << "':";
+ }
+ else if (error_count >= max_count)
+ {
+ output << " ...";
+ break;
+ }
+ output << " [" << first_index << "] '" << test_output_impl(*first_it) << "' != '" << test_output_impl(*second_it) << "'";
+ ++first_it;
+ ++second_it;
+ ++first_index;
+ ++second_index;
+ ++error_count;
+ } while (first_it != first_end);
+
+ first_index += std::distance(first_it, first_end);
+ second_index += std::distance(second_it, second_end);
+ if (first_index != second_index)
+ {
+ if (error_count == 0)
+ {
+ output << file << "(" << line << "): Container sizes differ in function '" << function << "': size(" << first_index << ") != size(" << second_index << ")";
+ }
+ else
+ {
+ output << " [*] size(" << first_index << ") != size(" << second_index << ")";
+ }
+ ++error_count;
+ }
+
+ if (error_count == 0)
+ {
+ boost::detail::report_errors_remind();
+ }
+ else
+ {
+ output << std::endl;
+ ++boost::detail::test_errors();
+ }
+}
+
+template<class FormattedOutputFunction, class InputIterator1, class InputIterator2, typename BinaryPredicate>
+void test_all_with_impl(FormattedOutputFunction& output,
+ char const * file, int line, char const * function,
+ InputIterator1 first_begin, InputIterator1 first_end,
+ InputIterator2 second_begin, InputIterator2 second_end,
+ BinaryPredicate predicate)
+{
+ InputIterator1 first_it = first_begin;
+ InputIterator2 second_it = second_begin;
+ typename std::iterator_traits<InputIterator1>::difference_type first_index = 0;
+ typename std::iterator_traits<InputIterator2>::difference_type second_index = 0;
+ std::size_t error_count = 0;
+ const std::size_t max_count = 8;
+ do
+ {
+ while ((first_it != first_end) && (second_it != second_end) && predicate(*first_it, *second_it))
+ {
+ ++first_it;
+ ++second_it;
+ ++first_index;
+ ++second_index;
+ }
+ if ((first_it == first_end) || (second_it == second_end))
+ {
+ break; // do-while
+ }
+ if (error_count == 0)
+ {
+ output << file << "(" << line << "): Container contents differ in function '" << function << "':";
+ }
+ else if (error_count >= max_count)
+ {
+ output << " ...";
+ break;
+ }
+ output << " [" << first_index << "]";
+ ++first_it;
+ ++second_it;
+ ++first_index;
+ ++second_index;
+ ++error_count;
+ } while (first_it != first_end);
+
+ first_index += std::distance(first_it, first_end);
+ second_index += std::distance(second_it, second_end);
+ if (first_index != second_index)
+ {
+ if (error_count == 0)
+ {
+ output << file << "(" << line << "): Container sizes differ in function '" << function << "': size(" << first_index << ") != size(" << second_index << ")";
+ }
+ else
+ {
+ output << " [*] size(" << first_index << ") != size(" << second_index << ")";
+ }
+ ++error_count;
+ }
+
+ if (error_count == 0)
+ {
+ report_errors_remind();
+ }
+ else
+ {
+ output << std::endl;
+ ++test_errors();
+ }
+}
+
+#if defined(_MSC_VER)
+# pragma warning(pop)
+#elif defined(__clang__) && defined(__has_warning)
+# if __has_warning("-Wsign-compare")
+# pragma clang diagnostic pop
+# endif
+#elif defined(__GNUC__) && !(defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || defined(__ECC)) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 406
+# pragma GCC diagnostic pop
+#endif
+
+} // namespace detail
+
+inline int report_errors()
+{
+ boost::detail::report_errors_remind().called_report_errors_function = true;
+
+ int errors = boost::detail::test_errors();
+
+ if( errors == 0 )
+ {
+ BOOST_LIGHTWEIGHT_TEST_OSTREAM
+ << "No errors detected." << std::endl;
+ return 0;
+ }
+ else
+ {
+ BOOST_LIGHTWEIGHT_TEST_OSTREAM
+ << errors << " error" << (errors == 1? "": "s") << " detected." << std::endl;
+ return 1;
+ }
+}
+
+} // namespace boost
+
+#define BOOST_TEST(expr) ((expr)? (void)0: ::boost::detail::test_failed_impl(#expr, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION))
+#define BOOST_TEST_NOT(expr) BOOST_TEST(!(expr))
+
+#define BOOST_ERROR(msg) ( ::boost::detail::error_impl(msg, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION) )
+
+#define BOOST_TEST_EQ(expr1,expr2) ( ::boost::detail::test_eq_impl(#expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2) )
+#define BOOST_TEST_NE(expr1,expr2) ( ::boost::detail::test_ne_impl(#expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2) )
+
+#define BOOST_TEST_LT(expr1,expr2) ( ::boost::detail::test_lt_impl(#expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2) )
+#define BOOST_TEST_LE(expr1,expr2) ( ::boost::detail::test_le_impl(#expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2) )
+#define BOOST_TEST_GT(expr1,expr2) ( ::boost::detail::test_gt_impl(#expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2) )
+#define BOOST_TEST_GE(expr1,expr2) ( ::boost::detail::test_ge_impl(#expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2) )
+
+#define BOOST_TEST_CSTR_EQ(expr1,expr2) ( ::boost::detail::test_cstr_eq_impl(#expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2) )
+#define BOOST_TEST_CSTR_NE(expr1,expr2) ( ::boost::detail::test_cstr_ne_impl(#expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2) )
+
+#define BOOST_TEST_ALL_EQ(begin1, end1, begin2, end2) ( ::boost::detail::test_all_eq_impl(BOOST_LIGHTWEIGHT_TEST_OSTREAM, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, begin1, end1, begin2, end2) )
+#define BOOST_TEST_ALL_WITH(begin1, end1, begin2, end2, predicate) ( ::boost::detail::test_all_with_impl(BOOST_LIGHTWEIGHT_TEST_OSTREAM, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, begin1, end1, begin2, end2, predicate) )
+
+#ifndef BOOST_NO_EXCEPTIONS
+ #define BOOST_TEST_THROWS( EXPR, EXCEP ) \
+ try { \
+ EXPR; \
+ ::boost::detail::throw_failed_impl \
+ (#EXCEP, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION); \
+ } \
+ catch(EXCEP const&) { \
+ } \
+ catch(...) { \
+ ::boost::detail::throw_failed_impl \
+ (#EXCEP, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION); \
+ } \
+ //
+#else
+ #define BOOST_TEST_THROWS( EXPR, EXCEP )
+#endif
+
+#endif // #ifndef BOOST_CORE_LIGHTWEIGHT_TEST_HPP
diff --git a/include/boost/core/lightweight_test_trait.hpp b/include/boost/core/lightweight_test_trait.hpp
new file mode 100644
index 0000000..0e2aab4
--- /dev/null
+++ b/include/boost/core/lightweight_test_trait.hpp
@@ -0,0 +1,56 @@
+#ifndef BOOST_CORE_LIGHTWEIGHT_TEST_TRAIT_HPP
+#define BOOST_CORE_LIGHTWEIGHT_TEST_TRAIT_HPP
+
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+// boost/core/lightweight_test_trait.hpp
+//
+// BOOST_TEST_TRAIT_TRUE, BOOST_TEST_TRAIT_FALSE
+//
+// Copyright 2014 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+
+#include <boost/core/lightweight_test.hpp>
+#include <boost/core/typeinfo.hpp>
+
+namespace boost
+{
+
+namespace detail
+{
+
+template< class T > inline void test_trait_impl( char const * trait, void (*)( T ),
+ bool expected, char const * file, int line, char const * function )
+{
+ if( T::value == expected )
+ {
+ report_errors_remind();
+ }
+ else
+ {
+ BOOST_LIGHTWEIGHT_TEST_OSTREAM
+ << file << "(" << line << "): predicate '" << trait << "' ["
+ << boost::core::demangled_name( BOOST_CORE_TYPEID(T) ) << "]"
+ << " test failed in function '" << function
+ << "' (should have been " << ( expected? "true": "false" ) << ")"
+ << std::endl;
+
+ ++test_errors();
+ }
+}
+
+} // namespace detail
+
+} // namespace boost
+
+#define BOOST_TEST_TRAIT_TRUE(type) ( ::boost::detail::test_trait_impl(#type, (void(*)type)0, true, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION) )
+#define BOOST_TEST_TRAIT_FALSE(type) ( ::boost::detail::test_trait_impl(#type, (void(*)type)0, false, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION) )
+
+#endif // #ifndef BOOST_CORE_LIGHTWEIGHT_TEST_TRAIT_HPP
diff --git a/include/boost/core/no_exceptions_support.hpp b/include/boost/core/no_exceptions_support.hpp
new file mode 100644
index 0000000..e2453d0
--- /dev/null
+++ b/include/boost/core/no_exceptions_support.hpp
@@ -0,0 +1,44 @@
+#ifndef BOOST_CORE_NO_EXCEPTIONS_SUPPORT_HPP
+#define BOOST_CORE_NO_EXCEPTIONS_SUPPORT_HPP
+
+#if defined(_MSC_VER)
+# pragma once
+#endif
+
+//----------------------------------------------------------------------
+// (C) Copyright 2004 Pavel Vozenilek.
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt
+// or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+//
+// This file contains helper macros used when exception support may be
+// disabled (as indicated by macro BOOST_NO_EXCEPTIONS).
+//
+// Before picking up these macros you may consider using RAII techniques
+// to deal with exceptions - their syntax can be always the same with
+// or without exception support enabled.
+//----------------------------------------------------------------------
+
+#include <boost/config.hpp>
+#include <boost/config/workaround.hpp>
+
+#if !(defined BOOST_NO_EXCEPTIONS)
+# define BOOST_TRY { try
+# define BOOST_CATCH(x) catch(x)
+# define BOOST_RETHROW throw;
+# define BOOST_CATCH_END }
+#else
+# if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+# define BOOST_TRY { if ("")
+# define BOOST_CATCH(x) else if (!"")
+# else
+# define BOOST_TRY { if (true)
+# define BOOST_CATCH(x) else if (false)
+# endif
+# define BOOST_RETHROW
+# define BOOST_CATCH_END }
+#endif
+
+
+#endif
diff --git a/include/boost/core/noncopyable.hpp b/include/boost/core/noncopyable.hpp
new file mode 100644
index 0000000..6ae8c24
--- /dev/null
+++ b/include/boost/core/noncopyable.hpp
@@ -0,0 +1,48 @@
+// Boost noncopyable.hpp header file --------------------------------------//
+
+// (C) Copyright Beman Dawes 1999-2003. 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/utility for documentation.
+
+#ifndef BOOST_CORE_NONCOPYABLE_HPP
+#define BOOST_CORE_NONCOPYABLE_HPP
+
+#include <boost/config.hpp>
+
+namespace boost {
+
+// Private copy constructor and copy assignment ensure classes derived from
+// class noncopyable cannot be copied.
+
+// Contributed by Dave Abrahams
+
+namespace noncopyable_ // protection from unintended ADL
+{
+ class noncopyable
+ {
+ protected:
+#if !defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) && !defined(BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS)
+ BOOST_CONSTEXPR noncopyable() = default;
+ ~noncopyable() = default;
+#else
+ noncopyable() {}
+ ~noncopyable() {}
+#endif
+#if !defined(BOOST_NO_CXX11_DELETED_FUNCTIONS)
+ noncopyable( const noncopyable& ) = delete;
+ noncopyable& operator=( const noncopyable& ) = delete;
+#else
+ private: // emphasize the following members are private
+ noncopyable( const noncopyable& );
+ noncopyable& operator=( const noncopyable& );
+#endif
+ };
+}
+
+typedef noncopyable_::noncopyable noncopyable;
+
+} // namespace boost
+
+#endif // BOOST_CORE_NONCOPYABLE_HPP
diff --git a/include/boost/core/null_deleter.hpp b/include/boost/core/null_deleter.hpp
new file mode 100644
index 0000000..f0af590
--- /dev/null
+++ b/include/boost/core/null_deleter.hpp
@@ -0,0 +1,44 @@
+/*
+ * Copyright Andrey Semashev 2007 - 2014.
+ * 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)
+ */
+/*!
+ * \file null_deleter.hpp
+ * \author Andrey Semashev
+ * \date 22.04.2007
+ *
+ * This header contains a \c null_deleter implementation. This is an empty
+ * function object that receives a pointer and does nothing with it.
+ * Such empty deletion strategy may be convenient, for example, when
+ * constructing <tt>shared_ptr</tt>s that point to some object that should not be
+ * deleted (i.e. a variable on the stack or some global singleton, like <tt>std::cout</tt>).
+ */
+
+#ifndef BOOST_CORE_NULL_DELETER_HPP
+#define BOOST_CORE_NULL_DELETER_HPP
+
+#include <boost/config.hpp>
+
+#ifdef BOOST_HAS_PRAGMA_ONCE
+#pragma once
+#endif
+
+namespace boost {
+
+//! A function object that does nothing and can be used as an empty deleter for \c shared_ptr
+struct null_deleter
+{
+ //! Function object result type
+ typedef void result_type;
+ /*!
+ * Does nothing
+ */
+ template< typename T >
+ void operator() (T*) const BOOST_NOEXCEPT {}
+};
+
+} // namespace boost
+
+#endif // BOOST_CORE_NULL_DELETER_HPP
diff --git a/include/boost/core/pointer_traits.hpp b/include/boost/core/pointer_traits.hpp
new file mode 100644
index 0000000..e0ebfb0
--- /dev/null
+++ b/include/boost/core/pointer_traits.hpp
@@ -0,0 +1,233 @@
+/*
+Copyright 2017-2018 Glen Joseph Fernandes
+(glenjofe@gmail.com)
+
+Distributed under the Boost Software License, Version 1.0.
+(http://www.boost.org/LICENSE_1_0.txt)
+*/
+#ifndef BOOST_CORE_POINTER_TRAITS_HPP
+#define BOOST_CORE_POINTER_TRAITS_HPP
+
+#include <boost/config.hpp>
+#if !defined(BOOST_NO_CXX11_POINTER_TRAITS)
+#include <memory>
+#else
+#include <boost/core/addressof.hpp>
+#endif
+
+namespace boost {
+
+#if !defined(BOOST_NO_CXX11_POINTER_TRAITS)
+template<class T>
+struct pointer_traits
+ : std::pointer_traits<T> {
+ template<class U>
+ struct rebind_to {
+ typedef typename std::pointer_traits<T>::template rebind<U> type;
+ };
+};
+
+template<class T>
+struct pointer_traits<T*>
+ : std::pointer_traits<T*> {
+ template<class U>
+ struct rebind_to {
+ typedef U* type;
+ };
+};
+#else
+namespace detail {
+
+template<class>
+struct ptr_void {
+ typedef void type;
+};
+
+template<class T>
+struct ptr_first;
+
+#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
+template<template<class, class...> class T, class U, class... Args>
+struct ptr_first<T<U, Args...> > {
+ typedef U type;
+};
+#else
+template<template<class> class T, class U>
+struct ptr_first<T<U> > {
+ typedef U type;
+};
+
+template<template<class, class> class T, class U1, class U2>
+struct ptr_first<T<U1, U2> > {
+ typedef U1 type;
+};
+
+template<template<class, class, class> class T, class U1, class U2, class U3>
+struct ptr_first<T<U1, U2, U3> > {
+ typedef U1 type;
+};
+#endif
+
+template<class T, class = void>
+struct ptr_element {
+ typedef typename ptr_first<T>::type type;
+};
+
+template<class T>
+struct ptr_element<T, typename ptr_void<typename T::element_type>::type> {
+ typedef typename T::element_type type;
+};
+
+template<class, class = void>
+struct ptr_difference {
+ typedef std::ptrdiff_t type;
+};
+
+template<class T>
+struct ptr_difference<T,
+ typename ptr_void<typename T::difference_type>::type> {
+ typedef typename T::difference_type type;
+};
+
+template<class T, class V>
+struct ptr_transform;
+
+#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
+template<template<class, class...> class T, class U, class... Args, class V>
+struct ptr_transform<T<U, Args...>, V> {
+ typedef T<V, Args...> type;
+};
+#else
+template<template<class> class T, class U, class V>
+struct ptr_transform<T<U>, V> {
+ typedef T<V> type;
+};
+
+template<template<class, class> class T, class U1, class U2, class V>
+struct ptr_transform<T<U1, U2>, V> {
+ typedef T<V, U2> type;
+};
+
+template<template<class, class, class> class T,
+ class U1, class U2, class U3, class V>
+struct ptr_transform<T<U1, U2, U3>, V> {
+ typedef T<V, U2, U3> type;
+};
+#endif
+
+template<class T, class U, class = void>
+struct ptr_rebind {
+ typedef typename ptr_transform<T, U>::type type;
+};
+
+#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
+template<class T, class U>
+struct ptr_rebind<T, U,
+ typename ptr_void<typename T::template rebind<U> >::type> {
+ typedef typename T::template rebind<U> type;
+};
+#endif
+
+template<class T>
+struct ptr_value {
+ typedef T type;
+};
+
+template<>
+struct ptr_value<void> {
+ typedef struct { } type;
+};
+
+} /* detail */
+
+template<class T>
+struct pointer_traits {
+ typedef T pointer;
+ typedef typename detail::ptr_element<T>::type element_type;
+ typedef typename detail::ptr_difference<T>::type difference_type;
+ template<class U>
+ struct rebind_to {
+ typedef typename detail::ptr_rebind<T, U>::type type;
+ };
+#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
+ template<class U>
+ using rebind = typename detail::ptr_rebind<T, U>::type;
+#endif
+ static pointer
+ pointer_to(typename detail::ptr_value<element_type>::type& v) {
+ return pointer::pointer_to(v);
+ }
+};
+
+template<class T>
+struct pointer_traits<T*> {
+ typedef T* pointer;
+ typedef T element_type;
+ typedef std::ptrdiff_t difference_type;
+ template<class U>
+ struct rebind_to {
+ typedef U* type;
+ };
+#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
+ template<class U>
+ using rebind = U*;
+#endif
+ static T*
+ pointer_to(typename detail::ptr_value<T>::type& v) BOOST_NOEXCEPT {
+ return boost::addressof(v);
+ }
+};
+#endif
+
+template<class T>
+BOOST_CONSTEXPR inline T*
+to_address(T* v) BOOST_NOEXCEPT
+{
+ return v;
+}
+
+#if !defined(BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION)
+namespace detail {
+
+template<class T>
+inline T*
+ptr_address(T* v, int) BOOST_NOEXCEPT
+{
+ return v;
+}
+
+template<class T>
+inline auto
+ptr_address(const T& v, int) BOOST_NOEXCEPT
+-> decltype(boost::pointer_traits<T>::to_address(v))
+{
+ return boost::pointer_traits<T>::to_address(v);
+}
+
+template<class T>
+inline auto
+ptr_address(const T& v, long) BOOST_NOEXCEPT
+{
+ return boost::detail::ptr_address(v.operator->(), 0);
+}
+
+} /* detail */
+
+template<class T>
+inline auto
+to_address(const T& v) BOOST_NOEXCEPT
+{
+ return boost::detail::ptr_address(v, 0);
+}
+#else
+template<class T>
+inline typename pointer_traits<T>::element_type*
+to_address(const T& v) BOOST_NOEXCEPT
+{
+ return boost::to_address(v.operator->());
+}
+#endif
+
+} /* boost */
+
+#endif
diff --git a/include/boost/core/ref.hpp b/include/boost/core/ref.hpp
new file mode 100644
index 0000000..7d768ff
--- /dev/null
+++ b/include/boost/core/ref.hpp
@@ -0,0 +1,301 @@
+#ifndef BOOST_CORE_REF_HPP
+#define BOOST_CORE_REF_HPP
+
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+#include <boost/config.hpp>
+#include <boost/config/workaround.hpp>
+#include <boost/core/addressof.hpp>
+
+//
+// ref.hpp - ref/cref, useful helper functions
+//
+// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
+// Copyright (C) 2001, 2002 Peter Dimov
+// Copyright (C) 2002 David Abrahams
+//
+// Copyright (C) 2014 Glen Joseph Fernandes
+// glenfe at live dot com
+// Copyright (C) 2014 Agustin Berge
+//
+// 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/core/doc/html/core/ref.html for documentation.
+//
+
+/**
+ @file
+*/
+
+/**
+ Boost namespace.
+*/
+namespace boost
+{
+
+#if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, == 1600 )
+
+ struct ref_workaround_tag {};
+
+#endif
+
+// reference_wrapper
+
+/**
+ @brief Contains a reference to an object of type `T`.
+
+ `reference_wrapper` is primarily used to "feed" references to
+ function templates (algorithms) that take their parameter by
+ value. It provides an implicit conversion to `T&`, which
+ usually allows the function templates to work on references
+ unmodified.
+*/
+template<class T> class reference_wrapper
+{
+public:
+ /**
+ Type `T`.
+ */
+ typedef T type;
+
+ /**
+ Constructs a `reference_wrapper` object that stores a
+ reference to `t`.
+
+ @remark Does not throw.
+ */
+ BOOST_FORCEINLINE explicit reference_wrapper(T& t): t_(boost::addressof(t)) {}
+
+#if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, == 1600 )
+
+ BOOST_FORCEINLINE explicit reference_wrapper( T & t, ref_workaround_tag ): t_( boost::addressof( t ) ) {}
+
+#endif
+
+#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+ /**
+ @remark Construction from a temporary object is disabled.
+ */
+ BOOST_DELETED_FUNCTION(reference_wrapper(T&& t))
+public:
+#endif
+
+ /**
+ @return The stored reference.
+ @remark Does not throw.
+ */
+ BOOST_FORCEINLINE operator T& () const { return *t_; }
+
+ /**
+ @return The stored reference.
+ @remark Does not throw.
+ */
+ BOOST_FORCEINLINE T& get() const { return *t_; }
+
+ /**
+ @return A pointer to the object referenced by the stored
+ reference.
+ @remark Does not throw.
+ */
+ BOOST_FORCEINLINE T* get_pointer() const { return t_; }
+
+private:
+
+ T* t_;
+};
+
+// ref
+
+/**
+ @cond
+*/
+#if defined( __BORLANDC__ ) && BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT(0x581) )
+# define BOOST_REF_CONST
+#else
+# define BOOST_REF_CONST const
+#endif
+/**
+ @endcond
+*/
+
+/**
+ @return `reference_wrapper<T>(t)`
+ @remark Does not throw.
+*/
+template<class T> BOOST_FORCEINLINE reference_wrapper<T> BOOST_REF_CONST ref( T & t )
+{
+#if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, == 1600 )
+
+ return reference_wrapper<T>( t, ref_workaround_tag() );
+
+#else
+
+ return reference_wrapper<T>( t );
+
+#endif
+}
+
+// cref
+
+/**
+ @return `reference_wrapper<T const>(t)`
+ @remark Does not throw.
+*/
+template<class T> BOOST_FORCEINLINE reference_wrapper<T const> BOOST_REF_CONST cref( T const & t )
+{
+ return reference_wrapper<T const>(t);
+}
+
+#undef BOOST_REF_CONST
+
+#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+
+/**
+ @cond
+*/
+#if defined(BOOST_NO_CXX11_DELETED_FUNCTIONS)
+# define BOOST_REF_DELETE
+#else
+# define BOOST_REF_DELETE = delete
+#endif
+/**
+ @endcond
+*/
+
+/**
+ @remark Construction from a temporary object is disabled.
+*/
+template<class T> void ref(T const&&) BOOST_REF_DELETE;
+
+/**
+ @remark Construction from a temporary object is disabled.
+*/
+template<class T> void cref(T const&&) BOOST_REF_DELETE;
+
+#undef BOOST_REF_DELETE
+
+#endif
+
+// is_reference_wrapper
+
+/**
+ @brief Determine if a type `T` is an instantiation of
+ `reference_wrapper`.
+
+ The value static constant will be true if the type `T` is a
+ specialization of `reference_wrapper`.
+*/
+template<typename T> struct is_reference_wrapper
+{
+ BOOST_STATIC_CONSTANT( bool, value = false );
+};
+
+/**
+ @cond
+*/
+template<typename T> struct is_reference_wrapper< reference_wrapper<T> >
+{
+ BOOST_STATIC_CONSTANT( bool, value = true );
+};
+
+#if !defined(BOOST_NO_CV_SPECIALIZATIONS)
+
+template<typename T> struct is_reference_wrapper< reference_wrapper<T> const >
+{
+ BOOST_STATIC_CONSTANT( bool, value = true );
+};
+
+template<typename T> struct is_reference_wrapper< reference_wrapper<T> volatile >
+{
+ BOOST_STATIC_CONSTANT( bool, value = true );
+};
+
+template<typename T> struct is_reference_wrapper< reference_wrapper<T> const volatile >
+{
+ BOOST_STATIC_CONSTANT( bool, value = true );
+};
+
+#endif // !defined(BOOST_NO_CV_SPECIALIZATIONS)
+
+/**
+ @endcond
+*/
+
+
+// unwrap_reference
+
+/**
+ @brief Find the type in a `reference_wrapper`.
+
+ The `typedef` type is `T::type` if `T` is a
+ `reference_wrapper`, `T` otherwise.
+*/
+template<typename T> struct unwrap_reference
+{
+ typedef T type;
+};
+
+/**
+ @cond
+*/
+template<typename T> struct unwrap_reference< reference_wrapper<T> >
+{
+ typedef T type;
+};
+
+#if !defined(BOOST_NO_CV_SPECIALIZATIONS)
+
+template<typename T> struct unwrap_reference< reference_wrapper<T> const >
+{
+ typedef T type;
+};
+
+template<typename T> struct unwrap_reference< reference_wrapper<T> volatile >
+{
+ typedef T type;
+};
+
+template<typename T> struct unwrap_reference< reference_wrapper<T> const volatile >
+{
+ typedef T type;
+};
+
+#endif // !defined(BOOST_NO_CV_SPECIALIZATIONS)
+
+/**
+ @endcond
+*/
+
+// unwrap_ref
+
+/**
+ @return `unwrap_reference<T>::type&(t)`
+ @remark Does not throw.
+*/
+template<class T> BOOST_FORCEINLINE typename unwrap_reference<T>::type& unwrap_ref( T & t )
+{
+ return t;
+}
+
+// get_pointer
+
+/**
+ @cond
+*/
+template<class T> BOOST_FORCEINLINE T* get_pointer( reference_wrapper<T> const & r )
+{
+ return r.get_pointer();
+}
+/**
+ @endcond
+*/
+
+} // namespace boost
+
+#endif // #ifndef BOOST_CORE_REF_HPP
diff --git a/include/boost/core/scoped_enum.hpp b/include/boost/core/scoped_enum.hpp
new file mode 100644
index 0000000..56dd0ed
--- /dev/null
+++ b/include/boost/core/scoped_enum.hpp
@@ -0,0 +1,194 @@
+// scoped_enum.hpp ---------------------------------------------------------//
+
+// Copyright Beman Dawes, 2009
+// Copyright (C) 2011-2012 Vicente J. Botet Escriba
+// Copyright (C) 2012 Anthony Williams
+
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+#ifndef BOOST_CORE_SCOPED_ENUM_HPP
+#define BOOST_CORE_SCOPED_ENUM_HPP
+
+#include <boost/config.hpp>
+
+#ifdef BOOST_HAS_PRAGMA_ONCE
+#pragma once
+#endif
+
+namespace boost
+{
+
+#ifdef BOOST_NO_CXX11_SCOPED_ENUMS
+
+ /**
+ * Meta-function to get the native enum type associated to an enum class or its emulation.
+ */
+ template <typename EnumType>
+ struct native_type
+ {
+ /**
+ * The member typedef type names the native enum type associated to the scoped enum,
+ * which is it self if the compiler supports scoped enums or EnumType::enum_type if it is an emulated scoped enum.
+ */
+ typedef typename EnumType::enum_type type;
+ };
+
+ /**
+ * Casts a scoped enum to its underlying type.
+ *
+ * This function is useful when working with scoped enum classes, which doens't implicitly convert to the underlying type.
+ * @param v A scoped enum.
+ * @returns The underlying type.
+ * @throws No-throws.
+ */
+ template <typename UnderlyingType, typename EnumType>
+ inline
+ BOOST_CONSTEXPR UnderlyingType underlying_cast(EnumType v) BOOST_NOEXCEPT
+ {
+ return v.get_underlying_value_();
+ }
+
+ /**
+ * Casts a scoped enum to its native enum type.
+ *
+ * This function is useful to make programs portable when the scoped enum emulation can not be use where native enums can.
+ *
+ * EnumType the scoped enum type
+ *
+ * @param v A scoped enum.
+ * @returns The native enum value.
+ * @throws No-throws.
+ */
+ template <typename EnumType>
+ inline
+ BOOST_CONSTEXPR typename EnumType::enum_type native_value(EnumType e) BOOST_NOEXCEPT
+ {
+ return e.get_native_value_();
+ }
+
+#else // BOOST_NO_CXX11_SCOPED_ENUMS
+
+ template <typename EnumType>
+ struct native_type
+ {
+ typedef EnumType type;
+ };
+
+ template <typename UnderlyingType, typename EnumType>
+ inline
+ BOOST_CONSTEXPR UnderlyingType underlying_cast(EnumType v) BOOST_NOEXCEPT
+ {
+ return static_cast<UnderlyingType>(v);
+ }
+
+ template <typename EnumType>
+ inline
+ BOOST_CONSTEXPR EnumType native_value(EnumType e) BOOST_NOEXCEPT
+ {
+ return e;
+ }
+
+#endif // BOOST_NO_CXX11_SCOPED_ENUMS
+}
+
+
+#ifdef BOOST_NO_CXX11_SCOPED_ENUMS
+
+#ifndef BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
+
+#define BOOST_SCOPED_ENUM_UT_DECLARE_CONVERSION_OPERATOR \
+ explicit BOOST_CONSTEXPR operator underlying_type() const BOOST_NOEXCEPT { return get_underlying_value_(); }
+
+#else
+
+#define BOOST_SCOPED_ENUM_UT_DECLARE_CONVERSION_OPERATOR
+
+#endif
+
+/**
+ * Start a declaration of a scoped enum.
+ *
+ * @param EnumType The new scoped enum.
+ * @param UnderlyingType The underlying type.
+ */
+#define BOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(EnumType, UnderlyingType) \
+ struct EnumType { \
+ typedef void is_boost_scoped_enum_tag; \
+ typedef UnderlyingType underlying_type; \
+ EnumType() BOOST_NOEXCEPT {} \
+ explicit BOOST_CONSTEXPR EnumType(underlying_type v) BOOST_NOEXCEPT : v_(v) {} \
+ BOOST_CONSTEXPR underlying_type get_underlying_value_() const BOOST_NOEXCEPT { return v_; } \
+ BOOST_SCOPED_ENUM_UT_DECLARE_CONVERSION_OPERATOR \
+ private: \
+ underlying_type v_; \
+ typedef EnumType self_type; \
+ public: \
+ enum enum_type
+
+#define BOOST_SCOPED_ENUM_DECLARE_END2() \
+ BOOST_CONSTEXPR enum_type get_native_value_() const BOOST_NOEXCEPT { return enum_type(v_); } \
+ friend BOOST_CONSTEXPR bool operator ==(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)==enum_type(rhs.v_); } \
+ friend BOOST_CONSTEXPR bool operator ==(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)==rhs; } \
+ friend BOOST_CONSTEXPR bool operator ==(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs==enum_type(rhs.v_); } \
+ friend BOOST_CONSTEXPR bool operator !=(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)!=enum_type(rhs.v_); } \
+ friend BOOST_CONSTEXPR bool operator !=(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)!=rhs; } \
+ friend BOOST_CONSTEXPR bool operator !=(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs!=enum_type(rhs.v_); } \
+ friend BOOST_CONSTEXPR bool operator <(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)<enum_type(rhs.v_); } \
+ friend BOOST_CONSTEXPR bool operator <(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)<rhs; } \
+ friend BOOST_CONSTEXPR bool operator <(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs<enum_type(rhs.v_); } \
+ friend BOOST_CONSTEXPR bool operator <=(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)<=enum_type(rhs.v_); } \
+ friend BOOST_CONSTEXPR bool operator <=(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)<=rhs; } \
+ friend BOOST_CONSTEXPR bool operator <=(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs<=enum_type(rhs.v_); } \
+ friend BOOST_CONSTEXPR bool operator >(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)>enum_type(rhs.v_); } \
+ friend BOOST_CONSTEXPR bool operator >(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)>rhs; } \
+ friend BOOST_CONSTEXPR bool operator >(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs>enum_type(rhs.v_); } \
+ friend BOOST_CONSTEXPR bool operator >=(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)>=enum_type(rhs.v_); } \
+ friend BOOST_CONSTEXPR bool operator >=(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)>=rhs; } \
+ friend BOOST_CONSTEXPR bool operator >=(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs>=enum_type(rhs.v_); } \
+ };
+
+#define BOOST_SCOPED_ENUM_DECLARE_END(EnumType) \
+ ; \
+ BOOST_CONSTEXPR EnumType(enum_type v) BOOST_NOEXCEPT : v_(v) {} \
+ BOOST_SCOPED_ENUM_DECLARE_END2()
+
+/**
+ * Starts a declaration of a scoped enum with the default int underlying type.
+ *
+ * @param EnumType The new scoped enum.
+ */
+#define BOOST_SCOPED_ENUM_DECLARE_BEGIN(EnumType) \
+ BOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(EnumType,int)
+
+/**
+ * Name of the native enum type.
+ *
+ * @param EnumType The new scoped enum.
+ */
+#define BOOST_SCOPED_ENUM_NATIVE(EnumType) EnumType::enum_type
+/**
+ * Forward declares an scoped enum.
+ *
+ * @param EnumType The scoped enum.
+ */
+#define BOOST_SCOPED_ENUM_FORWARD_DECLARE(EnumType) struct EnumType
+
+#else // BOOST_NO_CXX11_SCOPED_ENUMS
+
+#define BOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(EnumType,UnderlyingType) enum class EnumType : UnderlyingType
+#define BOOST_SCOPED_ENUM_DECLARE_BEGIN(EnumType) enum class EnumType
+#define BOOST_SCOPED_ENUM_DECLARE_END2()
+#define BOOST_SCOPED_ENUM_DECLARE_END(EnumType) ;
+
+#define BOOST_SCOPED_ENUM_NATIVE(EnumType) EnumType
+#define BOOST_SCOPED_ENUM_FORWARD_DECLARE(EnumType) enum class EnumType
+
+#endif // BOOST_NO_CXX11_SCOPED_ENUMS
+
+// Deprecated macros
+#define BOOST_SCOPED_ENUM_START(name) BOOST_SCOPED_ENUM_DECLARE_BEGIN(name)
+#define BOOST_SCOPED_ENUM_END BOOST_SCOPED_ENUM_DECLARE_END2()
+#define BOOST_SCOPED_ENUM(name) BOOST_SCOPED_ENUM_NATIVE(name)
+
+#endif // BOOST_CORE_SCOPED_ENUM_HPP
diff --git a/include/boost/core/swap.hpp b/include/boost/core/swap.hpp
new file mode 100644
index 0000000..baa1be9
--- /dev/null
+++ b/include/boost/core/swap.hpp
@@ -0,0 +1,60 @@
+// Copyright (C) 2007, 2008 Steven Watanabe, Joseph Gauterin, Niels Dekker
+//
+// 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)
+// For more information, see http://www.boost.org
+
+
+#ifndef BOOST_CORE_SWAP_HPP
+#define BOOST_CORE_SWAP_HPP
+
+// Note: the implementation of this utility contains various workarounds:
+// - swap_impl is put outside the boost namespace, to avoid infinite
+// recursion (causing stack overflow) when swapping objects of a primitive
+// type.
+// - swap_impl has a using-directive, rather than a using-declaration,
+// because some compilers (including MSVC 7.1, Borland 5.9.3, and
+// Intel 8.1) don't do argument-dependent lookup when it has a
+// using-declaration instead.
+// - boost::swap has two template arguments, instead of one, to
+// avoid ambiguity when swapping objects of a Boost type that does
+// not have its own boost::swap overload.
+
+#include <utility> //for std::swap (C++11)
+#include <algorithm> //for std::swap (C++98)
+#include <cstddef> //for std::size_t
+#include <boost/config.hpp>
+
+namespace boost_swap_impl
+{
+ template<class T>
+ BOOST_GPU_ENABLED
+ void swap_impl(T& left, T& right)
+ {
+ using namespace std;//use std::swap if argument dependent lookup fails
+ swap(left,right);
+ }
+
+ template<class T, std::size_t N>
+ BOOST_GPU_ENABLED
+ void swap_impl(T (& left)[N], T (& right)[N])
+ {
+ for (std::size_t i = 0; i < N; ++i)
+ {
+ ::boost_swap_impl::swap_impl(left[i], right[i]);
+ }
+ }
+}
+
+namespace boost
+{
+ template<class T1, class T2>
+ BOOST_GPU_ENABLED
+ void swap(T1& left, T2& right)
+ {
+ ::boost_swap_impl::swap_impl(left, right);
+ }
+}
+
+#endif
diff --git a/include/boost/core/typeinfo.hpp b/include/boost/core/typeinfo.hpp
new file mode 100644
index 0000000..e67b4a3
--- /dev/null
+++ b/include/boost/core/typeinfo.hpp
@@ -0,0 +1,151 @@
+#ifndef BOOST_CORE_TYPEINFO_HPP_INCLUDED
+#define BOOST_CORE_TYPEINFO_HPP_INCLUDED
+
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+// core::typeinfo, BOOST_CORE_TYPEID
+//
+// Copyright 2007, 2014 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#include <boost/config.hpp>
+
+#if defined( BOOST_NO_TYPEID )
+
+#include <boost/current_function.hpp>
+#include <functional>
+
+namespace boost
+{
+
+namespace core
+{
+
+class typeinfo
+{
+private:
+
+ typeinfo( typeinfo const& );
+ typeinfo& operator=( typeinfo const& );
+
+ char const * name_;
+
+public:
+
+ explicit typeinfo( char const * name ): name_( name )
+ {
+ }
+
+ bool operator==( typeinfo const& rhs ) const
+ {
+ return this == &rhs;
+ }
+
+ bool operator!=( typeinfo const& rhs ) const
+ {
+ return this != &rhs;
+ }
+
+ bool before( typeinfo const& rhs ) const
+ {
+ return std::less< typeinfo const* >()( this, &rhs );
+ }
+
+ char const* name() const
+ {
+ return name_;
+ }
+};
+
+inline char const * demangled_name( core::typeinfo const & ti )
+{
+ return ti.name();
+}
+
+} // namespace core
+
+namespace detail
+{
+
+template<class T> struct core_typeid_
+{
+ static boost::core::typeinfo ti_;
+
+ static char const * name()
+ {
+ return BOOST_CURRENT_FUNCTION;
+ }
+};
+
+#if defined(__SUNPRO_CC)
+// see #4199, the Sun Studio compiler gets confused about static initialization
+// constructor arguments. But an assignment works just fine.
+template<class T> boost::core::typeinfo core_typeid_< T >::ti_ = core_typeid_< T >::name();
+#else
+template<class T> boost::core::typeinfo core_typeid_< T >::ti_(core_typeid_< T >::name());
+#endif
+
+template<class T> struct core_typeid_< T & >: core_typeid_< T >
+{
+};
+
+template<class T> struct core_typeid_< T const >: core_typeid_< T >
+{
+};
+
+template<class T> struct core_typeid_< T volatile >: core_typeid_< T >
+{
+};
+
+template<class T> struct core_typeid_< T const volatile >: core_typeid_< T >
+{
+};
+
+} // namespace detail
+
+} // namespace boost
+
+#define BOOST_CORE_TYPEID(T) (boost::detail::core_typeid_<T>::ti_)
+
+#else
+
+#include <boost/core/demangle.hpp>
+#include <typeinfo>
+
+namespace boost
+{
+
+namespace core
+{
+
+#if defined( BOOST_NO_STD_TYPEINFO )
+
+typedef ::type_info typeinfo;
+
+#else
+
+typedef std::type_info typeinfo;
+
+#endif
+
+inline std::string demangled_name( core::typeinfo const & ti )
+{
+ return core::demangle( ti.name() );
+}
+
+} // namespace core
+
+} // namespace boost
+
+#define BOOST_CORE_TYPEID(T) typeid(T)
+
+#endif
+
+#endif // #ifndef BOOST_CORE_TYPEINFO_HPP_INCLUDED
diff --git a/include/boost/core/underlying_type.hpp b/include/boost/core/underlying_type.hpp
new file mode 100644
index 0000000..7ecba31
--- /dev/null
+++ b/include/boost/core/underlying_type.hpp
@@ -0,0 +1,79 @@
+// underlying_type.hpp ---------------------------------------------------------//
+
+// Copyright Beman Dawes, 2009
+// Copyright (C) 2011-2012 Vicente J. Botet Escriba
+// Copyright (C) 2012 Anthony Williams
+// Copyright (C) 2014 Andrey Semashev
+
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+#ifndef BOOST_CORE_UNDERLYING_TYPE_HPP
+#define BOOST_CORE_UNDERLYING_TYPE_HPP
+
+#include <boost/config.hpp>
+
+// GCC 4.7 and later seem to provide std::underlying_type
+#if !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS) || (defined(BOOST_GCC) && BOOST_GCC >= 40700 && defined(__GXX_EXPERIMENTAL_CXX0X__))
+#include <type_traits>
+#define BOOST_DETAIL_HAS_STD_UNDERLYING_TYPE
+#endif
+
+#ifdef BOOST_HAS_PRAGMA_ONCE
+#pragma once
+#endif
+
+namespace boost {
+
+namespace detail {
+
+template< typename EnumType, typename Void = void >
+struct underlying_type_impl;
+
+#if defined(BOOST_NO_CXX11_SCOPED_ENUMS)
+
+// Support for boost/core/scoped_enum.hpp
+template< typename EnumType >
+struct underlying_type_impl< EnumType, typename EnumType::is_boost_scoped_enum_tag >
+{
+ /**
+ * The member typedef type names the underlying type of EnumType. It is EnumType::underlying_type when the EnumType is an emulated scoped enum,
+ */
+ typedef typename EnumType::underlying_type type;
+};
+
+#endif
+
+#if defined(BOOST_DETAIL_HAS_STD_UNDERLYING_TYPE)
+
+template< typename EnumType, typename Void >
+struct underlying_type_impl
+{
+ typedef typename std::underlying_type< EnumType >::type type;
+};
+
+#endif
+
+} // namespace detail
+
+#if !defined(BOOST_NO_CXX11_SCOPED_ENUMS) && !defined(BOOST_DETAIL_HAS_STD_UNDERLYING_TYPE)
+#define BOOST_NO_UNDERLYING_TYPE
+#endif
+
+/**
+ * Meta-function to get the underlying type of a scoped enum.
+ *
+ * Requires EnumType must be an enum type or the emulation of a scoped enum.
+ * If BOOST_NO_UNDERLYING_TYPE is defined, the implementation will not be able
+ * to deduce the underlying type of enums. The user is expected to specialize
+ * this trait in this case.
+ */
+template< typename EnumType >
+struct underlying_type :
+ public detail::underlying_type_impl< EnumType >
+{
+};
+
+} // namespace boost
+
+#endif // BOOST_CORE_UNDERLYING_TYPE_HPP
diff --git a/include/boost/detail/iterator.hpp b/include/boost/detail/iterator.hpp
new file mode 100644
index 0000000..2498ef4
--- /dev/null
+++ b/include/boost/detail/iterator.hpp
@@ -0,0 +1,39 @@
+// (C) Copyright David Abrahams 2002.
+// 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)
+
+#ifndef ITERATOR_DWA122600_HPP_
+#define ITERATOR_DWA122600_HPP_
+
+// This header is obsolete and will be deprecated.
+
+#include <iterator>
+#if defined(__SUNPRO_CC) && (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION))
+#include <cstddef>
+#endif
+
+namespace boost
+{
+
+namespace detail
+{
+
+using std::iterator_traits;
+using std::distance;
+
+#if defined(__SUNPRO_CC) && (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION))
+// std::distance from stlport with Oracle compiler 12.4 and 12.5 fails to deduce template parameters
+// when one of the arguments is an array and the other one is a pointer.
+template< typename T, std::size_t N >
+inline typename std::iterator_traits< T* >::difference_type distance(T (&left)[N], T* right)
+{
+ return std::distance(static_cast< T* >(left), right);
+}
+#endif
+
+} // namespace detail
+
+} // namespace boost
+
+#endif // ITERATOR_DWA122600_HPP_
diff --git a/include/boost/detail/lightweight_test.hpp b/include/boost/detail/lightweight_test.hpp
new file mode 100644
index 0000000..9fece8a
--- /dev/null
+++ b/include/boost/detail/lightweight_test.hpp
@@ -0,0 +1,17 @@
+/*
+ * Copyright (c) 2014 Glen Fernandes
+ *
+ * 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)
+ */
+
+#ifndef BOOST_DETAIL_LIGHTWEIGHT_TEST_HPP
+#define BOOST_DETAIL_LIGHTWEIGHT_TEST_HPP
+
+// The header file at this path is deprecated;
+// use boost/core/lightweight_test.hpp instead.
+
+#include <boost/core/lightweight_test.hpp>
+
+#endif
diff --git a/include/boost/detail/no_exceptions_support.hpp b/include/boost/detail/no_exceptions_support.hpp
new file mode 100644
index 0000000..7d17454
--- /dev/null
+++ b/include/boost/detail/no_exceptions_support.hpp
@@ -0,0 +1,17 @@
+/*
+ * Copyright (c) 2014 Glen Fernandes
+ *
+ * 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)
+ */
+
+#ifndef BOOST_DETAIL_NO_EXCEPTIONS_SUPPORT_HPP
+#define BOOST_DETAIL_NO_EXCEPTIONS_SUPPORT_HPP
+
+// The header file at this path is deprecated;
+// use boost/core/no_exceptions_support.hpp instead.
+
+#include <boost/core/no_exceptions_support.hpp>
+
+#endif
diff --git a/include/boost/detail/scoped_enum_emulation.hpp b/include/boost/detail/scoped_enum_emulation.hpp
new file mode 100644
index 0000000..1c7bc23
--- /dev/null
+++ b/include/boost/detail/scoped_enum_emulation.hpp
@@ -0,0 +1,17 @@
+/*
+ * Copyright (c) 2014 Andrey Semashev
+ *
+ * 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)
+ */
+
+#ifndef BOOST_DETAIL_SCOPED_ENUM_EMULATION_HPP
+#define BOOST_DETAIL_SCOPED_ENUM_EMULATION_HPP
+
+// The header file at this path is deprecated;
+// use boost/core/scoped_enum.hpp instead.
+
+#include <boost/core/scoped_enum.hpp>
+
+#endif
diff --git a/include/boost/detail/sp_typeinfo.hpp b/include/boost/detail/sp_typeinfo.hpp
new file mode 100644
index 0000000..4e4de55
--- /dev/null
+++ b/include/boost/detail/sp_typeinfo.hpp
@@ -0,0 +1,36 @@
+#ifndef BOOST_DETAIL_SP_TYPEINFO_HPP_INCLUDED
+#define BOOST_DETAIL_SP_TYPEINFO_HPP_INCLUDED
+
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+// detail/sp_typeinfo.hpp
+//
+// Deprecated, please use boost/core/typeinfo.hpp
+//
+// Copyright 2007 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#include <boost/core/typeinfo.hpp>
+
+namespace boost
+{
+
+namespace detail
+{
+
+typedef boost::core::typeinfo sp_typeinfo;
+
+} // namespace detail
+
+} // namespace boost
+
+#define BOOST_SP_TYPEID(T) BOOST_CORE_TYPEID(T)
+
+#endif // #ifndef BOOST_DETAIL_SP_TYPEINFO_HPP_INCLUDED
diff --git a/include/boost/get_pointer.hpp b/include/boost/get_pointer.hpp
new file mode 100644
index 0000000..36e2cd7
--- /dev/null
+++ b/include/boost/get_pointer.hpp
@@ -0,0 +1,76 @@
+// Copyright Peter Dimov and David Abrahams 2002.
+// 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)
+#ifndef GET_POINTER_DWA20021219_HPP
+#define GET_POINTER_DWA20021219_HPP
+
+#include <boost/config.hpp>
+
+// In order to avoid circular dependencies with Boost.TR1
+// we make sure that our include of <memory> doesn't try to
+// pull in the TR1 headers: that's why we use this header
+// rather than including <memory> directly:
+#include <boost/config/no_tr1/memory.hpp> // std::auto_ptr
+
+namespace boost {
+
+// get_pointer(p) extracts a ->* capable pointer from p
+
+template<class T> T * get_pointer(T * p)
+{
+ return p;
+}
+
+// get_pointer(shared_ptr<T> const & p) has been moved to shared_ptr.hpp
+
+#if !defined( BOOST_NO_AUTO_PTR )
+
+#if defined( __GNUC__ ) && (defined( __GXX_EXPERIMENTAL_CXX0X__ ) || (__cplusplus >= 201103L))
+#if defined( BOOST_GCC )
+#if BOOST_GCC >= 40600
+#define BOOST_CORE_DETAIL_DISABLE_LIBSTDCXX_DEPRECATED_WARNINGS
+#endif // BOOST_GCC >= 40600
+#elif defined( __clang__ ) && defined( __has_warning )
+#if __has_warning("-Wdeprecated-declarations")
+#define BOOST_CORE_DETAIL_DISABLE_LIBSTDCXX_DEPRECATED_WARNINGS
+#endif // __has_warning("-Wdeprecated-declarations")
+#endif
+#endif // defined( __GNUC__ ) && (defined( __GXX_EXPERIMENTAL_CXX0X__ ) || (__cplusplus >= 201103L))
+
+#if defined( BOOST_CORE_DETAIL_DISABLE_LIBSTDCXX_DEPRECATED_WARNINGS )
+// Disable libstdc++ warnings about std::auto_ptr being deprecated in C++11 mode
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#define BOOST_CORE_DETAIL_DISABLED_DEPRECATED_WARNINGS
+#endif
+
+template<class T> T * get_pointer(std::auto_ptr<T> const& p)
+{
+ return p.get();
+}
+
+#if defined( BOOST_CORE_DETAIL_DISABLE_LIBSTDCXX_DEPRECATED_WARNINGS )
+#pragma GCC diagnostic pop
+#undef BOOST_CORE_DETAIL_DISABLE_LIBSTDCXX_DEPRECATED_WARNINGS
+#endif
+
+#endif // !defined( BOOST_NO_AUTO_PTR )
+
+#if !defined( BOOST_NO_CXX11_SMART_PTR )
+
+template<class T> T * get_pointer( std::unique_ptr<T> const& p )
+{
+ return p.get();
+}
+
+template<class T> T * get_pointer( std::shared_ptr<T> const& p )
+{
+ return p.get();
+}
+
+#endif
+
+} // namespace boost
+
+#endif // GET_POINTER_DWA20021219_HPP
diff --git a/include/boost/iterator.hpp b/include/boost/iterator.hpp
new file mode 100644
index 0000000..c9c6197
--- /dev/null
+++ b/include/boost/iterator.hpp
@@ -0,0 +1,20 @@
+// (C) Copyright Beman Dawes 2000. 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)
+
+#ifndef BOOST_ITERATOR_HPP
+#define BOOST_ITERATOR_HPP
+
+// This header is obsolete and will be deprecated.
+
+#include <iterator>
+#include <cstddef> // std::ptrdiff_t
+
+namespace boost
+{
+
+using std::iterator;
+
+} // namespace boost
+
+#endif // BOOST_ITERATOR_HPP
diff --git a/include/boost/non_type.hpp b/include/boost/non_type.hpp
new file mode 100644
index 0000000..896aed4
--- /dev/null
+++ b/include/boost/non_type.hpp
@@ -0,0 +1,27 @@
+// -------------------------------------
+//
+// (C) Copyright Gennaro Prota 2003.
+//
+// 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)
+//
+// ------------------------------------------------------
+
+#ifndef BOOST_NON_TYPE_HPP_GP_20030417
+#define BOOST_NON_TYPE_HPP_GP_20030417
+
+
+namespace boost {
+
+ // Just a simple "envelope" for non-type template parameters. Useful
+ // to work around some MSVC deficiencies.
+
+ template <typename T, T n>
+ struct non_type { };
+
+
+}
+
+
+#endif // include guard
diff --git a/include/boost/noncopyable.hpp b/include/boost/noncopyable.hpp
new file mode 100644
index 0000000..e998ee8
--- /dev/null
+++ b/include/boost/noncopyable.hpp
@@ -0,0 +1,17 @@
+/*
+ * Copyright (c) 2014 Glen Fernandes
+ *
+ * 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)
+ */
+
+#ifndef BOOST_NONCOPYABLE_HPP
+#define BOOST_NONCOPYABLE_HPP
+
+// The header file at this path is deprecated;
+// use boost/core/noncopyable.hpp instead.
+
+#include <boost/core/noncopyable.hpp>
+
+#endif
diff --git a/include/boost/ref.hpp b/include/boost/ref.hpp
new file mode 100644
index 0000000..17b56ec
--- /dev/null
+++ b/include/boost/ref.hpp
@@ -0,0 +1,17 @@
+/*
+ * Copyright (c) 2014 Glen Fernandes
+ *
+ * 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)
+ */
+
+#ifndef BOOST_REF_HPP
+#define BOOST_REF_HPP
+
+// The header file at this path is deprecated;
+// use boost/core/ref.hpp instead.
+
+#include <boost/core/ref.hpp>
+
+#endif
diff --git a/include/boost/swap.hpp b/include/boost/swap.hpp
new file mode 100644
index 0000000..55cafa4
--- /dev/null
+++ b/include/boost/swap.hpp
@@ -0,0 +1,17 @@
+/*
+ * Copyright (c) 2014 Glen Fernandes
+ *
+ * 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)
+ */
+
+#ifndef BOOST_SWAP_HPP
+#define BOOST_SWAP_HPP
+
+// The header file at this path is deprecated;
+// use boost/core/swap.hpp instead.
+
+#include <boost/core/swap.hpp>
+
+#endif
diff --git a/include/boost/type.hpp b/include/boost/type.hpp
new file mode 100644
index 0000000..ab81c91
--- /dev/null
+++ b/include/boost/type.hpp
@@ -0,0 +1,18 @@
+// (C) Copyright David Abrahams 2001.
+// 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)
+
+#ifndef BOOST_TYPE_DWA20010120_HPP
+# define BOOST_TYPE_DWA20010120_HPP
+
+namespace boost {
+
+ // Just a simple "type envelope". Useful in various contexts, mostly to work
+ // around some MSVC deficiencies.
+ template <class T>
+ struct type {};
+
+}
+
+#endif // BOOST_TYPE_DWA20010120_HPP
diff --git a/include/boost/utility/addressof.hpp b/include/boost/utility/addressof.hpp
new file mode 100644
index 0000000..db4da80
--- /dev/null
+++ b/include/boost/utility/addressof.hpp
@@ -0,0 +1,17 @@
+/*
+ * Copyright (c) 2014 Glen Fernandes
+ *
+ * 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)
+ */
+
+#ifndef BOOST_UTILITY_ADDRESSOF_HPP
+#define BOOST_UTILITY_ADDRESSOF_HPP
+
+// The header file at this path is deprecated;
+// use boost/core/addressof.hpp instead.
+
+#include <boost/core/addressof.hpp>
+
+#endif
diff --git a/include/boost/utility/enable_if.hpp b/include/boost/utility/enable_if.hpp
new file mode 100644
index 0000000..803bfca
--- /dev/null
+++ b/include/boost/utility/enable_if.hpp
@@ -0,0 +1,17 @@
+/*
+ * Copyright (c) 2014 Glen Fernandes
+ *
+ * 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)
+ */
+
+#ifndef BOOST_UTILITY_ENABLE_IF_HPP
+#define BOOST_UTILITY_ENABLE_IF_HPP
+
+// The header file at this path is deprecated;
+// use boost/core/enable_if.hpp instead.
+
+#include <boost/core/enable_if.hpp>
+
+#endif
diff --git a/include/boost/utility/explicit_operator_bool.hpp b/include/boost/utility/explicit_operator_bool.hpp
new file mode 100644
index 0000000..9b625cd
--- /dev/null
+++ b/include/boost/utility/explicit_operator_bool.hpp
@@ -0,0 +1,17 @@
+/*
+ * Copyright (c) 2014 Glen Fernandes
+ *
+ * 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)
+ */
+
+#ifndef BOOST_UTILITY_EXPLICIT_OPERATOR_BOOL_HPP
+#define BOOST_UTILITY_EXPLICIT_OPERATOR_BOOL_HPP
+
+// The header file at this path is deprecated;
+// use boost/core/explicit_operator_bool.hpp instead.
+
+#include <boost/core/explicit_operator_bool.hpp>
+
+#endif
diff --git a/include/boost/utility/swap.hpp b/include/boost/utility/swap.hpp
new file mode 100644
index 0000000..dd9ecd9
--- /dev/null
+++ b/include/boost/utility/swap.hpp
@@ -0,0 +1,17 @@
+/*
+ * Copyright (c) 2014 Glen Fernandes
+ *
+ * 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)
+ */
+
+#ifndef BOOST_UTILITY_SWAP_HPP
+#define BOOST_UTILITY_SWAP_HPP
+
+// The header file at this path is deprecated;
+// use boost/core/swap.hpp instead.
+
+#include <boost/core/swap.hpp>
+
+#endif
diff --git a/include/boost/visit_each.hpp b/include/boost/visit_each.hpp
new file mode 100644
index 0000000..6463ca9
--- /dev/null
+++ b/include/boost/visit_each.hpp
@@ -0,0 +1,27 @@
+// Boost.Signals library
+
+// Copyright Douglas Gregor 2001-2003. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// For more information, see http://www.boost.org/libs/signals
+
+#ifndef BOOST_VISIT_EACH_HPP
+#define BOOST_VISIT_EACH_HPP
+
+namespace boost {
+ template<typename Visitor, typename T>
+ inline void visit_each(Visitor& visitor, const T& t, long)
+ {
+ visitor(t);
+ }
+
+ template<typename Visitor, typename T>
+ inline void visit_each(Visitor& visitor, const T& t)
+ {
+ visit_each(visitor, t, 0);
+ }
+}
+
+#endif // BOOST_VISIT_EACH_HPP
diff --git a/index.html b/index.html
new file mode 100644
index 0000000..77a672b
--- /dev/null
+++ b/index.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Boost.Core</title>
+<meta charset="utf-8">
+<meta http-equiv="refresh" content="0; url=doc/html/index.html">
+<style>
+ body {
+ background: #fff;
+ color: #000;
+ }
+ a {
+ color: #00f;
+ text-decoration: none;
+ }
+</style>
+</head>
+<body>
+ <p>
+ Automatic redirection failed, please go to
+ <a href="doc/html/index.html">doc/html/index.html</a>
+ </p>
+ <p>
+ © 2014 Peter Dimov<br>
+ © 2014 Glen Fernandes<br>
+ © 2014 Andrey Semashev
+ </p>
+</body>
+</html>
diff --git a/meta/libraries.json b/meta/libraries.json
new file mode 100644
index 0000000..92370a2
--- /dev/null
+++ b/meta/libraries.json
@@ -0,0 +1,72 @@
+[
+ {
+ "key": "core",
+ "name": "Core",
+ "authors": [
+ "Peter Dimov",
+ "Glen Fernandes",
+ "Andrey Semashev"
+ ],
+ "maintainers": [
+ "Peter Dimov <pdimov -at- pdimov.com>",
+ "Glen Fernandes <glenfe -at- live.com>",
+ "Andrey Semashev <andrey.semashev -at- gmail.com>"
+ ],
+ "description": "A collection of simple core utilities with minimal dependencies.",
+ "category": [
+ "Miscellaneous"
+ ]
+ },
+ {
+ "key": "utility/enable_if",
+ "name": "Enable If",
+ "authors": [
+ "Jaakko J\u00e4rvi",
+ "Jeremiah Willcock",
+ "Andrew Lumsdaine"
+ ],
+ "description": "Selective inclusion of function template overloads.",
+ "documentation": "doc/html/core/enable_if.html",
+ "category": [
+ "Generic"
+ ],
+ "maintainers": [
+ "Jaakko Jarvi <jarvi -at- cs.tamu.edu>",
+ "Jeremiah Willcock <jewillco -at- osl.iu.edu>"
+ ]
+ },
+ {
+ "key": "utility/swap",
+ "boost-version": "1.38.0",
+ "name": "Swap",
+ "authors": [
+ "Joseph Gauterin"
+ ],
+ "description": "Enhanced generic swap function.",
+ "documentation": "swap.html",
+ "category": [
+ "Miscellaneous"
+ ],
+ "maintainers": [
+ "Joseph Gauterin <joseph.gauterin -at- googlemail.com>"
+ ]
+ },
+ {
+ "key": "bind/ref",
+ "name": "Ref",
+ "authors": [
+ "Jaako Järvi",
+ "Peter Dimov",
+ "Doug Gregor",
+ "Dave Abrahams"
+ ],
+ "description": "A utility library for passing references to generic functions.",
+ "documentation": "ref.html",
+ "std": [
+ "tr1"
+ ],
+ "category": [
+ "Function-objects"
+ ]
+ }
+]
diff --git a/ref.html b/ref.html
new file mode 100644
index 0000000..a816ca9
--- /dev/null
+++ b/ref.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Boost.Core</title>
+<meta charset="utf-8">
+<meta http-equiv="refresh" content="0; url=doc/html/core/ref.html">
+<style>
+ body {
+ background: #fff;
+ color: #000;
+ }
+ a {
+ color: #00f;
+ text-decoration: none;
+ }
+</style>
+</head>
+<body>
+ <p>
+ Automatic redirection failed, please go to
+ <a href="doc/html/core/ref.html">doc/html/core/ref.html</a>
+ </p>
+ <p>
+ © 2014 Peter Dimov<br>
+ © 2014 Glen Fernandes<br>
+ © 2014 Andrey Semashev
+ </p>
+</body>
+</html>
diff --git a/swap.html b/swap.html
new file mode 100644
index 0000000..0fcd0c3
--- /dev/null
+++ b/swap.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Boost.Core</title>
+<meta charset="utf-8">
+<meta http-equiv="refresh" content="0; url=doc/html/core/swap.html">
+<style>
+ body {
+ background: #fff;
+ color: #000;
+ }
+ a {
+ color: #00f;
+ text-decoration: none;
+ }
+</style>
+</head>
+<body>
+ <p>
+ Automatic redirection failed, please go to
+ <a href="doc/html/core/swap.html">doc/html/core/swap.html</a>
+ </p>
+ <p>
+ © 2014 Peter Dimov<br>
+ © 2014 Glen Fernandes<br>
+ © 2014 Andrey Semashev
+ </p>
+</body>
+</html>
diff --git a/test/Jamfile.v2 b/test/Jamfile.v2
new file mode 100644
index 0000000..ba801e6
--- /dev/null
+++ b/test/Jamfile.v2
@@ -0,0 +1,128 @@
+# Boost.Core Library test Jamfile
+#
+# Copyright (c) 2014, 2017 Peter Dimov
+#
+# 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
+
+import modules ;
+import testing ;
+
+# quick test (for CI)
+run quick.cpp ;
+
+# full test suite
+run addressof_test.cpp ;
+run addressof_test2.cpp ;
+run addressof_np_test.cpp ;
+run addressof_fn_test.cpp ;
+compile addressof_constexpr_test.cpp ;
+compile-fail addressof_fail_rvalue.cpp ;
+
+run checked_delete_test.cpp ;
+compile-fail checked_delete_fail.cpp ;
+compile-fail checked_delete_fail2.cpp ;
+
+compile ref_ct_test.cpp ;
+run ref_test.cpp ;
+run ref_ref_test.cpp ;
+run ref_fn_test.cpp ;
+compile-fail ref_rv_fail1.cpp ;
+compile-fail ref_rv_fail2.cpp ;
+compile-fail ref_rv_fail3.cpp ;
+compile-fail ref_rv_fail4.cpp ;
+compile-fail ref_rv_fail5.cpp ;
+compile-fail ref_implicit_fail.cpp ;
+compile-fail ref_implicit_fail2.cpp ;
+run ref_cv_test.cpp ;
+
+run eif_constructors.cpp ;
+run eif_dummy_arg_disambiguation.cpp ;
+run eif_lazy.cpp ;
+run eif_lazy_test.cpp ;
+run eif_member_templates.cpp ;
+run eif_namespace_disambiguation.cpp ;
+run eif_no_disambiguation.cpp ;
+run eif_partial_specializations.cpp ;
+
+compile-fail noncopyable_compile_fail.cpp ;
+
+run explicit_operator_bool.cpp ;
+run explicit_operator_bool_noexcept.cpp ;
+compile-fail explicit_operator_bool_compile_fail_conv_int.cpp ;
+compile-fail explicit_operator_bool_compile_fail_conv_pvoid.cpp ;
+compile-fail explicit_operator_bool_compile_fail_delete.cpp ;
+compile-fail explicit_operator_bool_compile_fail_shift.cpp ;
+
+compile ignore_unused_test.cpp : <toolset>gcc-4.8:<cxxflags>"-Wunused-variable -Wunused-local-typedefs -Werror"
+ <toolset>gcc:<cxxflags>"-Wunused-variable -Werror"
+ <toolset>clang:<cxxflags>"-Wunused-variable -Werror"
+ <toolset>msvc:<cxxflags>"/we4100 /we4101" ;
+run sp_typeinfo_test.cpp ;
+run sp_typeinfo_test.cpp : : : <rtti>off : sp_typeinfo_test_no_rtti ;
+
+run visit_each_test.cpp ;
+
+run get_pointer_test.cpp ;
+
+run lightweight_test_test.cpp ;
+run lightweight_test_test.cpp : : : <exception-handling>off : lightweight_test_test_no_except ;
+
+run lightweight_test_test2.cpp ;
+run lightweight_test_all_eq_test.cpp ;
+run lightweight_test_all_with_test.cpp ;
+run lightweight_test_all_with_fail.cpp ;
+run lightweight_test_lt_le_test.cpp ;
+run lightweight_test_gt_ge_test.cpp ;
+
+run lightweight_test_eq_nullptr.cpp ;
+
+run-fail lightweight_test_fail.cpp ;
+run-fail lightweight_test_fail2.cpp ;
+run-fail lightweight_test_fail3.cpp ;
+run-fail lightweight_test_fail4.cpp ;
+run-fail lightweight_test_fail5.cpp ;
+run-fail lightweight_test_fail6.cpp ;
+run-fail lightweight_test_fail7.cpp ;
+run-fail lightweight_test_fail7.cpp : : : <rtti>off : lightweight_test_fail7_no_rtti ;
+run-fail lightweight_test_fail8.cpp ;
+run-fail lightweight_test_fail8.cpp : : : <rtti>off : lightweight_test_fail8_no_rtti ;
+run-fail lightweight_test_fail9.cpp ;
+run-fail lightweight_test_fail10.cpp ;
+run-fail lightweight_test_lt_fail.cpp ;
+run-fail lightweight_test_le_fail.cpp ;
+run-fail lightweight_test_gt_fail.cpp ;
+run-fail lightweight_test_ge_fail.cpp ;
+
+run is_same_test.cpp ;
+
+run typeinfo_test.cpp ;
+run typeinfo_test.cpp : : : <rtti>off : typeinfo_test_no_rtti ;
+
+run iterator_test.cpp ;
+run detail_iterator_test.cpp ;
+
+run demangle_test.cpp : : : <test-info>always_show_run_output ;
+
+run demangled_name_test.cpp : : : <test-info>always_show_run_output ;
+run demangled_name_test.cpp : : : <rtti>off <test-info>always_show_run_output : demangled_name_test_no_rtti ;
+
+run scoped_enum.cpp ;
+compile-fail scoped_enum_compile_fail_conv_from_int.cpp ;
+compile-fail scoped_enum_compile_fail_conv_to_int.cpp ;
+
+run underlying_type.cpp ;
+
+run pointer_traits_pointer_test.cpp ;
+run pointer_traits_element_type_test.cpp ;
+run pointer_traits_difference_type_test.cpp ;
+run pointer_traits_rebind_test.cpp ;
+run pointer_traits_pointer_to_test.cpp ;
+run to_address_test.cpp ;
+
+run exchange_test.cpp ;
+run exchange_move_test.cpp ;
+
+use-project /boost/core/swap : ./swap ;
+build-project ./swap ;
diff --git a/test/addressof_constexpr_test.cpp b/test/addressof_constexpr_test.cpp
new file mode 100644
index 0000000..d7255a9
--- /dev/null
+++ b/test/addressof_constexpr_test.cpp
@@ -0,0 +1,20 @@
+/*
+Copyright 2017 Glen Joseph Fernandes
+(glenjofe@gmail.com)
+
+Distributed under the Boost Software License, Version 1.0.
+(http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+#include <boost/core/addressof.hpp>
+#include <boost/static_assert.hpp>
+
+#if !defined(BOOST_CORE_NO_CONSTEXPR_ADDRESSOF)
+struct Type { };
+
+static int v1 = 0;
+static Type v2 = { };
+
+BOOST_STATIC_ASSERT(boost::addressof(v1) == &v1);
+BOOST_STATIC_ASSERT(boost::addressof(v2) == &v2);
+#endif
diff --git a/test/addressof_fail_rvalue.cpp b/test/addressof_fail_rvalue.cpp
new file mode 100644
index 0000000..258eaaa
--- /dev/null
+++ b/test/addressof_fail_rvalue.cpp
@@ -0,0 +1,26 @@
+/*
+Copyright 2017 Glen Joseph Fernandes
+(glenjofe@gmail.com)
+
+Distributed under the Boost Software License, Version 1.0.
+(http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+#include <boost/core/addressof.hpp>
+
+#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && \
+ !defined(BOOST_NO_CXX11_DELETED_FUNCTIONS)
+struct type { };
+
+inline const type function()
+{
+ return type();
+}
+
+int main()
+{
+ (void)boost::addressof(function());
+}
+#else
+#error Requires rvalue references and deleted functions
+#endif
diff --git a/test/addressof_fn_test.cpp b/test/addressof_fn_test.cpp
new file mode 100644
index 0000000..0d043bf
--- /dev/null
+++ b/test/addressof_fn_test.cpp
@@ -0,0 +1,76 @@
+#include <boost/config.hpp>
+
+#if defined(BOOST_MSVC)
+#pragma warning(disable: 4786) // identifier truncated in debug info
+#pragma warning(disable: 4710) // function not inlined
+#pragma warning(disable: 4711) // function selected for automatic inline expansion
+#pragma warning(disable: 4514) // unreferenced inline removed
+#endif
+
+// addressof_fn_test.cpp: addressof( f )
+//
+// Copyright (c) 2008, 2009 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+
+#include <boost/utility/addressof.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+
+void f0()
+{
+}
+
+void f1(int)
+{
+}
+
+void f2(int, int)
+{
+}
+
+void f3(int, int, int)
+{
+}
+
+void f4(int, int, int, int)
+{
+}
+
+void f5(int, int, int, int, int)
+{
+}
+
+void f6(int, int, int, int, int, int)
+{
+}
+
+void f7(int, int, int, int, int, int, int)
+{
+}
+
+void f8(int, int, int, int, int, int, int, int)
+{
+}
+
+void f9(int, int, int, int, int, int, int, int, int)
+{
+}
+
+int main()
+{
+ BOOST_TEST( boost::addressof( f0 ) == &f0 );
+ BOOST_TEST( boost::addressof( f1 ) == &f1 );
+ BOOST_TEST( boost::addressof( f2 ) == &f2 );
+ BOOST_TEST( boost::addressof( f3 ) == &f3 );
+ BOOST_TEST( boost::addressof( f4 ) == &f4 );
+ BOOST_TEST( boost::addressof( f5 ) == &f5 );
+ BOOST_TEST( boost::addressof( f6 ) == &f6 );
+ BOOST_TEST( boost::addressof( f7 ) == &f7 );
+ BOOST_TEST( boost::addressof( f8 ) == &f8 );
+ BOOST_TEST( boost::addressof( f9 ) == &f9 );
+
+ return boost::report_errors();
+}
diff --git a/test/addressof_np_test.cpp b/test/addressof_np_test.cpp
new file mode 100644
index 0000000..9e155d4
--- /dev/null
+++ b/test/addressof_np_test.cpp
@@ -0,0 +1,50 @@
+//
+// Copyright 2013 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <boost/utility/addressof.hpp>
+#include <boost/detail/lightweight_test.hpp>
+#include <cstddef>
+
+#if defined( BOOST_NO_CXX11_NULLPTR )
+
+void nullptr_test()
+{
+}
+
+#else
+
+void nullptr_test()
+{
+ {
+ auto x = nullptr;
+ BOOST_TEST( boost::addressof(x) == &x );
+ }
+
+ {
+ auto const x = nullptr;
+ BOOST_TEST( boost::addressof(x) == &x );
+ }
+
+ {
+ auto volatile x = nullptr;
+ BOOST_TEST( boost::addressof(x) == &x );
+ }
+
+ {
+ auto const volatile x = nullptr;
+ BOOST_TEST( boost::addressof(x) == &x );
+ }
+}
+
+#endif
+
+int main()
+{
+ nullptr_test();
+ return boost::report_errors();
+}
diff --git a/test/addressof_test.cpp b/test/addressof_test.cpp
new file mode 100644
index 0000000..9619cc3
--- /dev/null
+++ b/test/addressof_test.cpp
@@ -0,0 +1,94 @@
+// Copyright (C) 2002 Brad King (brad.king@kitware.com)
+// Douglas Gregor (gregod@cs.rpi.edu)
+//
+// 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)
+
+// For more information, see http://www.boost.org
+
+
+#include <boost/utility/addressof.hpp>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(push, 3)
+#endif
+
+#include <iostream>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(pop)
+#endif
+
+#include <boost/detail/lightweight_test.hpp>
+
+template<class T> void scalar_test( T * = 0 )
+{
+ T* px = new T();
+
+ T& x = *px;
+ BOOST_TEST( boost::addressof(x) == px );
+
+ const T& cx = *px;
+ const T* pcx = boost::addressof(cx);
+ BOOST_TEST( pcx == px );
+
+ volatile T& vx = *px;
+ volatile T* pvx = boost::addressof(vx);
+ BOOST_TEST( pvx == px );
+
+ const volatile T& cvx = *px;
+ const volatile T* pcvx = boost::addressof(cvx);
+ BOOST_TEST( pcvx == px );
+
+ delete px;
+}
+
+template<class T> void array_test( T * = 0 )
+{
+ T nrg[3] = {1,2,3};
+ T (*pnrg)[3] = &nrg;
+ BOOST_TEST( boost::addressof(nrg) == pnrg );
+
+ T const cnrg[3] = {1,2,3};
+ T const (*pcnrg)[3] = &cnrg;
+ BOOST_TEST( boost::addressof(cnrg) == pcnrg );
+}
+
+struct addressable
+{
+ addressable( int = 0 )
+ {
+ }
+};
+
+struct useless_type {};
+
+class nonaddressable {
+public:
+
+ nonaddressable( int = 0 )
+ {
+ }
+
+ void dummy(); // Silence GCC warning: all member of class are private
+
+private:
+
+ useless_type operator&() const;
+};
+
+int main()
+{
+ scalar_test<char>();
+ scalar_test<int>();
+ scalar_test<addressable>();
+ scalar_test<nonaddressable>();
+
+ array_test<char>();
+ array_test<int>();
+ array_test<addressable>();
+ array_test<nonaddressable>();
+
+ return boost::report_errors();
+}
diff --git a/test/addressof_test2.cpp b/test/addressof_test2.cpp
new file mode 100644
index 0000000..b1c36f8
--- /dev/null
+++ b/test/addressof_test2.cpp
@@ -0,0 +1,95 @@
+// Copyright (C) 2002 Brad King (brad.king@kitware.com)
+// Douglas Gregor (gregod@cs.rpi.edu)
+//
+// Copyright 2009 Peter Dimov
+//
+// 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)
+
+// For more information, see http://www.boost.org
+
+
+#include <boost/utility/addressof.hpp>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(push, 3)
+#endif
+
+#include <iostream>
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+#pragma warning(pop)
+#endif
+
+#include <boost/detail/lightweight_test.hpp>
+
+template<class T> void scalar_test( T * = 0 )
+{
+ T* px = new T();
+
+ T& x = *px;
+ BOOST_TEST( boost::addressof(x) == px );
+
+ const T& cx = *px;
+ const T* pcx = boost::addressof(cx);
+ BOOST_TEST( pcx == px );
+
+ volatile T& vx = *px;
+ volatile T* pvx = boost::addressof(vx);
+ BOOST_TEST( pvx == px );
+
+ const volatile T& cvx = *px;
+ const volatile T* pcvx = boost::addressof(cvx);
+ BOOST_TEST( pcvx == px );
+
+ delete px;
+}
+
+template<class T> void array_test( T * = 0 )
+{
+ T nrg[3] = {1,2,3};
+ T (*pnrg)[3] = &nrg;
+ BOOST_TEST( boost::addressof(nrg) == pnrg );
+
+ T const cnrg[3] = {1,2,3};
+ T const (*pcnrg)[3] = &cnrg;
+ BOOST_TEST( boost::addressof(cnrg) == pcnrg );
+}
+
+class convertible {
+public:
+
+ convertible( int = 0 )
+ {
+ }
+
+ template<class U> operator U () const
+ {
+ return U();
+ }
+};
+
+class convertible2 {
+public:
+
+ convertible2( int = 0 )
+ {
+ }
+
+ operator convertible2* () const
+ {
+ return 0;
+ }
+};
+
+int main()
+{
+ scalar_test<convertible>();
+ scalar_test<convertible2>();
+
+ array_test<convertible>();
+ array_test<convertible2>();
+
+ return boost::report_errors();
+}
diff --git a/test/checked_delete_fail.cpp b/test/checked_delete_fail.cpp
new file mode 100644
index 0000000..76418db
--- /dev/null
+++ b/test/checked_delete_fail.cpp
@@ -0,0 +1,27 @@
+// Boost checked_delete test program ---------------------------------------//
+
+// Copyright Beman Dawes 2001. 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/utility for documentation.
+
+// Revision History
+// 21 May 01 Initial version (Beman Dawes)
+
+#include <boost/checked_delete.hpp> // for checked_delete
+
+// This program demonstrates compiler errors when trying to delete an
+// incomplete type.
+
+namespace
+{
+ class Incomplete;
+}
+
+int main()
+{
+ Incomplete * p = 0;
+ boost::checked_delete(p); // should cause compile time error
+ return 0;
+} // main
diff --git a/test/checked_delete_fail2.cpp b/test/checked_delete_fail2.cpp
new file mode 100644
index 0000000..f7362a9
--- /dev/null
+++ b/test/checked_delete_fail2.cpp
@@ -0,0 +1,27 @@
+// Boost checked_delete test program ---------------------------------------//
+
+// Copyright Beman Dawes 2001. 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/utility for documentation.
+
+// Revision History
+// 21 May 01 Initial version (Beman Dawes)
+
+#include <boost/checked_delete.hpp> // for checked_delete
+
+// This program demonstrates compiler errors when trying to delete an
+// incomplete type.
+
+namespace
+{
+ class Incomplete;
+}
+
+int main()
+{
+ Incomplete * p = 0;
+ boost::checked_array_delete(p); // should cause compile time error
+ return 0;
+} // main
diff --git a/test/checked_delete_test.cpp b/test/checked_delete_test.cpp
new file mode 100644
index 0000000..46c2aed
--- /dev/null
+++ b/test/checked_delete_test.cpp
@@ -0,0 +1,58 @@
+// Boost checked_delete test program
+
+// Copyright Beman Dawes 2001. Copyright 2014 Peter Dimov.
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+
+#include <boost/core/checked_delete.hpp>
+#include <boost/core/lightweight_test.hpp>
+
+struct X
+{
+ static int instances;
+
+ X()
+ {
+ ++instances;
+ }
+
+ ~X()
+ {
+ --instances;
+ }
+
+private:
+
+ X( X const & );
+ X & operator=( X const & );
+};
+
+int X::instances = 0;
+
+int main()
+{
+ BOOST_TEST( X::instances == 0 );
+
+ {
+ X * p = new X;
+
+ BOOST_TEST( X::instances == 1 );
+
+ boost::checked_delete( p );
+
+ BOOST_TEST( X::instances == 0 );
+ }
+
+ {
+ X * p = new X[ 3 ];
+
+ BOOST_TEST( X::instances == 3 );
+
+ boost::checked_array_delete( p );
+
+ BOOST_TEST( X::instances == 0 );
+ }
+
+ return boost::report_errors();
+}
diff --git a/test/demangle_test.cpp b/test/demangle_test.cpp
new file mode 100644
index 0000000..0656ed5
--- /dev/null
+++ b/test/demangle_test.cpp
@@ -0,0 +1,62 @@
+//
+// Trivial test for core::demangle
+//
+// Copyright (c) 2014 Peter Dimov
+// Copyright (c) 2014 Andrey Semashev
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <boost/core/demangle.hpp>
+#include <typeinfo>
+#include <iostream>
+
+template<class T1, class T2> struct Y1
+{
+};
+
+void test_demangle()
+{
+ typedef Y1<int, long> T;
+ std::cout << boost::core::demangle( typeid( T ).name() ) << std::endl;
+}
+
+void test_demangle_alloc()
+{
+ typedef Y1<int, long> T;
+ const char* p = boost::core::demangle_alloc( typeid( T ).name() );
+ if (p)
+ {
+ std::cout << p << std::endl;
+ boost::core::demangle_free(p);
+ }
+ else
+ {
+ std::cout << "[demangling failed]" << std::endl;
+ }
+}
+
+void test_scoped_demangled_name()
+{
+ typedef Y1<int, long> T;
+ boost::core::scoped_demangled_name demangled_name( typeid( T ).name() );
+ const char* p = demangled_name.get();
+ if (p)
+ {
+ std::cout << p << std::endl;
+ }
+ else
+ {
+ std::cout << "[demangling failed]" << std::endl;
+ }
+}
+
+int main()
+{
+ test_demangle();
+ test_demangle_alloc();
+ test_scoped_demangled_name();
+ return 0;
+}
diff --git a/test/demangled_name_test.cpp b/test/demangled_name_test.cpp
new file mode 100644
index 0000000..fce3283
--- /dev/null
+++ b/test/demangled_name_test.cpp
@@ -0,0 +1,23 @@
+//
+// Trivial test for core::demangled_name
+//
+// Copyright (c) 2014 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <boost/core/typeinfo.hpp>
+#include <iostream>
+
+template<class T1, class T2> struct Y1
+{
+};
+
+int main()
+{
+ typedef Y1<int, long> T;
+ std::cout << boost::core::demangled_name( BOOST_CORE_TYPEID( T ) );
+ return 0;
+}
diff --git a/test/detail_iterator_test.cpp b/test/detail_iterator_test.cpp
new file mode 100644
index 0000000..a6ca7d7
--- /dev/null
+++ b/test/detail_iterator_test.cpp
@@ -0,0 +1,148 @@
+//
+// Test for boost/detail/iterator.hpp
+//
+// Copyright 2014 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <boost/detail/iterator.hpp>
+#include <boost/core/is_same.hpp>
+#include <boost/core/lightweight_test_trait.hpp>
+#include <cstddef>
+#include <list>
+
+/*
+
+namespace boost {
+namespace detail {
+
+template <class Iterator> struct iterator_traits: std::iterator_traits<Iterator>
+{
+};
+
+using std::distance;
+
+} // namespace detail
+} // namespace boost
+
+*/
+
+// struct C {} doesn't wotk with libc++.
+typedef std::forward_iterator_tag C;
+
+struct T
+{
+};
+
+struct D
+{
+};
+
+struct P
+{
+};
+
+struct R
+{
+};
+
+template< class Category, class T, class Distance = std::ptrdiff_t, class Pointer = T*, class Reference = T& >
+struct iterator
+{
+ typedef T value_type;
+ typedef Distance difference_type;
+ typedef Pointer pointer;
+ typedef Reference reference;
+ typedef Category iterator_category;
+};
+
+int main()
+{
+ using boost::core::is_same;
+
+/*
+ template<class Iterator> struct iterator_traits {
+ typedef typename Iterator::difference_type difference_type;
+ typedef typename Iterator::value_type value_type;
+ typedef typename Iterator::pointer pointer;
+ typedef typename Iterator::reference reference;
+ typedef typename Iterator::iterator_category iterator_category;
+ };
+*/
+ {
+ typedef ::iterator<C,T,D,P,R> It;
+
+ BOOST_TEST_TRAIT_TRUE((is_same<boost::detail::iterator_traits<It>::iterator_category,C>));
+ BOOST_TEST_TRAIT_TRUE((is_same<boost::detail::iterator_traits<It>::value_type,T>));
+ BOOST_TEST_TRAIT_TRUE((is_same<boost::detail::iterator_traits<It>::difference_type,D>));
+ BOOST_TEST_TRAIT_TRUE((is_same<boost::detail::iterator_traits<It>::pointer,P>));
+ BOOST_TEST_TRAIT_TRUE((is_same<boost::detail::iterator_traits<It>::reference,R>));
+ }
+/*
+ template<class T> struct iterator_traits<T*> {
+ typedef ptrdiff_t difference_type;
+ typedef T value_type;
+ typedef T* pointer;
+ typedef T& reference;
+ typedef random_access_iterator_tag iterator_category;
+ };
+*/
+ {
+ typedef T* It;
+
+ BOOST_TEST_TRAIT_TRUE((is_same<boost::detail::iterator_traits<It>::iterator_category,std::random_access_iterator_tag>));
+ BOOST_TEST_TRAIT_TRUE((is_same<boost::detail::iterator_traits<It>::value_type,T>));
+ BOOST_TEST_TRAIT_TRUE((is_same<boost::detail::iterator_traits<It>::difference_type,std::ptrdiff_t>));
+ BOOST_TEST_TRAIT_TRUE((is_same<boost::detail::iterator_traits<It>::pointer,T*>));
+ BOOST_TEST_TRAIT_TRUE((is_same<boost::detail::iterator_traits<It>::reference,T&>));
+ }
+
+/*
+ template<class T> struct iterator_traits<const T*> {
+ typedef ptrdiff_t difference_type;
+ typedef T value_type;
+ typedef const T* pointer;
+ typedef const T& reference;
+ typedef random_access_iterator_tag iterator_category;
+ };
+*/
+ {
+ typedef T const* It;
+
+ BOOST_TEST_TRAIT_TRUE((is_same<boost::detail::iterator_traits<It>::iterator_category,std::random_access_iterator_tag>));
+ BOOST_TEST_TRAIT_TRUE((is_same<boost::detail::iterator_traits<It>::value_type,T>));
+ BOOST_TEST_TRAIT_TRUE((is_same<boost::detail::iterator_traits<It>::difference_type,std::ptrdiff_t>));
+ BOOST_TEST_TRAIT_TRUE((is_same<boost::detail::iterator_traits<It>::pointer,T const*>));
+ BOOST_TEST_TRAIT_TRUE((is_same<boost::detail::iterator_traits<It>::reference,T const&>));
+ }
+/*
+ template<class InputIterator>
+ typename iterator_traits<InputIterator>::difference_type
+ distance( InputIterator first, InputIterator last );
+*/
+ {
+ int const N = 5;
+ T x[ N ] = {};
+
+ BOOST_TEST_EQ( boost::detail::distance( x, x + N ), N );
+ }
+
+ {
+ int const N = 5;
+ T const x[ N ] = {};
+
+ BOOST_TEST_EQ( boost::detail::distance( x, x + N ), N );
+ }
+
+ {
+ int const N = 5;
+ std::list<T> x( N );
+
+ BOOST_TEST_EQ( boost::detail::distance( x.begin(), x.end() ), x.size() );
+ }
+
+ return boost::report_errors();
+}
diff --git a/test/eif_constructors.cpp b/test/eif_constructors.cpp
new file mode 100644
index 0000000..ea82b40
--- /dev/null
+++ b/test/eif_constructors.cpp
@@ -0,0 +1,61 @@
+// Boost enable_if library
+
+// Copyright 2003 (c) The Trustees of Indiana University.
+
+// Use, modification, and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// Authors: Jaakko Jarvi (jajarvi at osl.iu.edu)
+// Jeremiah Willcock (jewillco at osl.iu.edu)
+// Andrew Lumsdaine (lums at osl.iu.edu)
+
+#include <boost/utility/enable_if.hpp>
+#include <boost/type_traits.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+using boost::enable_if;
+using boost::disable_if;
+using boost::is_arithmetic;
+
+struct container {
+ bool my_value;
+
+ template <class T>
+ container(const T&, const typename enable_if<is_arithmetic<T>, T>::type * = 0):
+ my_value(true) {}
+
+ template <class T>
+ container(const T&, const typename disable_if<is_arithmetic<T>, T>::type * = 0):
+ my_value(false) {}
+};
+
+// example from Howard Hinnant (tests enable_if template members of a templated class)
+template <class charT>
+struct xstring
+{
+ template <class It>
+ xstring(It begin, It end, typename
+ disable_if<is_arithmetic<It> >::type* = 0)
+ : data(end-begin) {}
+
+ int data;
+};
+
+
+int main()
+{
+
+ BOOST_TEST(container(1).my_value);
+ BOOST_TEST(container(1.0).my_value);
+
+ BOOST_TEST(!container("1").my_value);
+ BOOST_TEST(!container(static_cast<void*>(0)).my_value);
+
+ char sa[] = "123456";
+ BOOST_TEST(xstring<char>(sa, sa+6).data == 6);
+
+
+ return boost::report_errors();
+}
+
diff --git a/test/eif_dummy_arg_disambiguation.cpp b/test/eif_dummy_arg_disambiguation.cpp
new file mode 100644
index 0000000..e72b158
--- /dev/null
+++ b/test/eif_dummy_arg_disambiguation.cpp
@@ -0,0 +1,45 @@
+// Boost enable_if library
+
+// Copyright 2003 (c) The Trustees of Indiana University.
+
+// Use, modification, and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// Authors: Jaakko Jarvi (jajarvi at osl.iu.edu)
+// Jeremiah Willcock (jewillco at osl.iu.edu)
+// Andrew Lumsdaine (lums at osl.iu.edu)
+
+#include <boost/utility/enable_if.hpp>
+#include <boost/type_traits/is_arithmetic.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+using boost::enable_if;
+using boost::disable_if;
+using boost::is_arithmetic;
+
+template <int N> struct dummy {
+ dummy(int) {};
+};
+
+template<class T>
+typename enable_if<is_arithmetic<T>, bool>::type
+arithmetic_object(T t, dummy<0> = 0) { return true; }
+
+template<class T>
+typename disable_if<is_arithmetic<T>, bool>::type
+arithmetic_object(T t, dummy<1> = 0) { return false; }
+
+
+int main()
+{
+
+ BOOST_TEST(arithmetic_object(1));
+ BOOST_TEST(arithmetic_object(1.0));
+
+ BOOST_TEST(!arithmetic_object("1"));
+ BOOST_TEST(!arithmetic_object(static_cast<void*>(0)));
+
+ return boost::report_errors();
+}
+
diff --git a/test/eif_lazy.cpp b/test/eif_lazy.cpp
new file mode 100644
index 0000000..029eca5
--- /dev/null
+++ b/test/eif_lazy.cpp
@@ -0,0 +1,81 @@
+// Boost enable_if library
+
+// Copyright 2003 (c) The Trustees of Indiana University.
+
+// Use, modification, and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// Authors: Jaakko Jarvi (jajarvi at osl.iu.edu)
+// Jeremiah Willcock (jewillco at osl.iu.edu)
+// Andrew Lumsdaine (lums at osl.iu.edu)
+
+#include <boost/utility/enable_if.hpp>
+#include <boost/type_traits/is_same.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+using boost::enable_if_c;
+using boost::lazy_enable_if_c;
+
+// This class provides a reduced example of a traits class for
+// computing the result of multiplying two types. The member typedef
+// 'type' in this traits class defines the return type of this
+// operator. The return type member is invalid unless both arguments
+// for mult_traits are values that mult_traits expects (ints in this
+// case). This kind of situation may arise if a traits class only
+// makes sense for some set of types, not all C++ types.
+
+template <class T> struct is_int {
+ BOOST_STATIC_CONSTANT(bool, value = (boost::is_same<T, int>::value));
+};
+
+template <class T, class U>
+struct mult_traits {
+ typedef typename T::does_not_exist type;
+};
+
+template <>
+struct mult_traits<int, int> {
+ typedef int type;
+};
+
+
+// Next, a forwarding function mult() is defined. It is enabled only
+// when both arguments are of type int. The first version, using
+// non-lazy enable_if_c does not work.
+
+#if 0
+template <class T, class U>
+typename enable_if_c<
+ is_int<T>::value && is_int<U>::value,
+ typename mult_traits<T, U>::type
+>::type
+mult(const T& x, const U& y) {return x * y;}
+#endif
+
+// A correct version uses lazy_enable_if_c.
+// This template removes compiler errors from invalid code used as an
+// argument to enable_if_c.
+
+#if 1
+template <class T, class U>
+typename lazy_enable_if_c<
+ is_int<T>::value & is_int<U>::value,
+ mult_traits<T, U>
+>::type
+mult(const T& x, const U& y) {return x * y;}
+#endif
+
+double mult(int i, double d) { return (double)i * d; }
+
+int main()
+{
+
+
+ BOOST_TEST(mult(1, 2) == 2);
+
+ BOOST_TEST(mult(1, 3.0) == 3.0);
+
+ return boost::report_errors();
+}
+
diff --git a/test/eif_lazy_test.cpp b/test/eif_lazy_test.cpp
new file mode 100644
index 0000000..6077759
--- /dev/null
+++ b/test/eif_lazy_test.cpp
@@ -0,0 +1,98 @@
+// Boost enable_if library
+
+// Copyright 2003 (c) The Trustees of Indiana University.
+
+// Use, modification, and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// Authors: Jaakko Jarvi (jajarvi at osl.iu.edu)
+// Jeremiah Willcock (jewillco at osl.iu.edu)
+// Andrew Lumsdaine (lums at osl.iu.edu)
+
+// Testing all variations of lazy_enable_if.
+
+#include <boost/utility/enable_if.hpp>
+#include <boost/type_traits/is_same.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+using boost::lazy_enable_if;
+using boost::lazy_disable_if;
+
+using boost::lazy_enable_if_c;
+using boost::lazy_disable_if_c;
+
+
+template <class T>
+struct is_int_or_double {
+ BOOST_STATIC_CONSTANT(bool,
+ value = (boost::is_same<T, int>::value ||
+ boost::is_same<T, double>::value));
+};
+
+template <class T>
+struct some_traits {
+ typedef typename T::does_not_exist type;
+};
+
+template <>
+struct some_traits<int> {
+ typedef bool type;
+};
+
+template <>
+struct some_traits<double> {
+ typedef bool type;
+};
+
+template <class T>
+struct make_bool {
+ typedef bool type;
+};
+
+template <>
+struct make_bool<int> {};
+
+template <>
+struct make_bool<double> {};
+
+namespace A {
+
+ template<class T>
+ typename lazy_enable_if<is_int_or_double<T>, some_traits<T> >::type
+ foo(T t) { return true; }
+
+ template<class T>
+ typename lazy_enable_if_c<is_int_or_double<T>::value, some_traits<T> >::type
+ foo2(T t) { return true; }
+}
+
+namespace B {
+ template<class T>
+ typename lazy_disable_if<is_int_or_double<T>, make_bool<T> >::type
+ foo(T t) { return false; }
+
+ template<class T>
+ typename lazy_disable_if_c<is_int_or_double<T>::value, make_bool<T> >::type
+ foo2(T t) { return false; }
+}
+
+int main()
+{
+ using namespace A;
+ using namespace B;
+ BOOST_TEST(foo(1));
+ BOOST_TEST(foo(1.0));
+
+ BOOST_TEST(!foo("1"));
+ BOOST_TEST(!foo(static_cast<void*>(0)));
+
+ BOOST_TEST(foo2(1));
+ BOOST_TEST(foo2(1.0));
+
+ BOOST_TEST(!foo2("1"));
+ BOOST_TEST(!foo2(static_cast<void*>(0)));
+
+ return boost::report_errors();
+}
+
diff --git a/test/eif_member_templates.cpp b/test/eif_member_templates.cpp
new file mode 100644
index 0000000..2f1eeb2
--- /dev/null
+++ b/test/eif_member_templates.cpp
@@ -0,0 +1,42 @@
+// Boost enable_if library
+
+// Copyright 2003 (c) The Trustees of Indiana University.
+
+// Use, modification, and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// Authors: Jaakko Jarvi (jajarvi at osl.iu.edu)
+// Jeremiah Willcock (jewillco at osl.iu.edu)
+// Andrew Lumsdaine (lums at osl.iu.edu)
+
+#include <boost/utility/enable_if.hpp>
+#include <boost/type_traits/is_arithmetic.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+using boost::enable_if;
+using boost::disable_if;
+using boost::is_arithmetic;
+
+struct container {
+ template <class T>
+ typename enable_if<is_arithmetic<T>, bool>::type
+ arithmetic_object(const T&, const int* /* disambiguate */ = 0) {return true;}
+
+ template <class T>
+ typename disable_if<is_arithmetic<T>, bool>::type
+ arithmetic_object(const T&) {return false;}
+};
+
+int main()
+{
+
+ BOOST_TEST(container().arithmetic_object(1));
+ BOOST_TEST(container().arithmetic_object(1.0));
+
+ BOOST_TEST(!container().arithmetic_object("1"));
+ BOOST_TEST(!container().arithmetic_object(static_cast<void*>(0)));
+
+ return boost::report_errors();
+}
+
diff --git a/test/eif_namespace_disambiguation.cpp b/test/eif_namespace_disambiguation.cpp
new file mode 100644
index 0000000..d190ee2
--- /dev/null
+++ b/test/eif_namespace_disambiguation.cpp
@@ -0,0 +1,50 @@
+// Boost enable_if library
+
+// Copyright 2003 (c) The Trustees of Indiana University.
+
+// Use, modification, and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// Authors: Jaakko Jarvi (jajarvi at osl.iu.edu)
+// Jeremiah Willcock (jewillco at osl.iu.edu)
+// Andrew Lumsdaine (lums at osl.iu.edu)
+
+#include <boost/config.hpp>
+#include <boost/utility/enable_if.hpp>
+#include <boost/type_traits/is_arithmetic.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+using boost::enable_if;
+using boost::is_arithmetic;
+
+template<class T> struct not_
+{
+ BOOST_STATIC_CONSTANT( bool, value = !T::value );
+};
+
+namespace A {
+ template<class T>
+ typename enable_if<is_arithmetic<T>, bool>::type
+ arithmetic_object(T t) { return true; }
+}
+
+namespace B {
+ template<class T>
+ typename enable_if<not_<is_arithmetic<T> >, bool>::type
+ arithmetic_object(T t) { return false; }
+}
+
+int main()
+{
+ using namespace A;
+ using namespace B;
+ BOOST_TEST(arithmetic_object(1));
+ BOOST_TEST(arithmetic_object(1.0));
+
+ BOOST_TEST(!arithmetic_object("1"));
+ BOOST_TEST(!arithmetic_object(static_cast<void*>(0)));
+
+ return boost::report_errors();
+}
+
diff --git a/test/eif_no_disambiguation.cpp b/test/eif_no_disambiguation.cpp
new file mode 100644
index 0000000..385451b
--- /dev/null
+++ b/test/eif_no_disambiguation.cpp
@@ -0,0 +1,46 @@
+// Boost enable_if library
+
+// Copyright 2003 (c) The Trustees of Indiana University.
+
+// Use, modification, and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// Authors: Jaakko Jarvi (jajarvi at osl.iu.edu)
+// Jeremiah Willcock (jewillco at osl.iu.edu)
+// Andrew Lumsdaine (lums at osl.iu.edu)
+
+#include <boost/config.hpp>
+#include <boost/utility/enable_if.hpp>
+#include <boost/type_traits/is_arithmetic.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+using boost::enable_if;
+using boost::is_arithmetic;
+
+template<class T> struct not_
+{
+ BOOST_STATIC_CONSTANT( bool, value = !T::value );
+};
+
+template<class T>
+typename enable_if<is_arithmetic<T>, bool>::type
+arithmetic_object(T t) { return true; }
+
+template<class T>
+typename enable_if<not_<is_arithmetic<T> >, bool>::type
+arithmetic_object(T t) { return false; }
+
+
+int main()
+{
+
+ BOOST_TEST(arithmetic_object(1));
+ BOOST_TEST(arithmetic_object(1.0));
+
+ BOOST_TEST(!arithmetic_object("1"));
+ BOOST_TEST(!arithmetic_object(static_cast<void*>(0)));
+
+ return boost::report_errors();
+}
+
diff --git a/test/eif_partial_specializations.cpp b/test/eif_partial_specializations.cpp
new file mode 100644
index 0000000..c323494
--- /dev/null
+++ b/test/eif_partial_specializations.cpp
@@ -0,0 +1,89 @@
+// Boost enable_if library
+
+// Copyright 2003 (c) The Trustees of Indiana University.
+
+// Use, modification, and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// Authors: Jaakko Jarvi (jajarvi at osl.iu.edu)
+// Jeremiah Willcock (jewillco at osl.iu.edu)
+// Andrew Lumsdaine (lums at osl.iu.edu)
+
+#include <boost/utility/enable_if.hpp>
+#include <boost/type_traits/is_arithmetic.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+using boost::enable_if_has_type;
+using boost::enable_if_c;
+using boost::disable_if_c;
+using boost::enable_if;
+using boost::disable_if;
+using boost::is_arithmetic;
+
+template <class T, class Enable = void>
+struct tester;
+
+template <class T>
+struct tester<T, typename enable_if_c<is_arithmetic<T>::value>::type> {
+ BOOST_STATIC_CONSTANT(bool, value = true);
+};
+
+template <class T>
+struct tester<T, typename disable_if_c<is_arithmetic<T>::value>::type> {
+ BOOST_STATIC_CONSTANT(bool, value = false);
+};
+
+template <class T, class Enable = void>
+struct tester2;
+
+template <class T>
+struct tester2<T, typename enable_if<is_arithmetic<T> >::type> {
+ BOOST_STATIC_CONSTANT(bool, value = true);
+};
+
+template <class T>
+struct tester2<T, typename disable_if<is_arithmetic<T> >::type> {
+ BOOST_STATIC_CONSTANT(bool, value = false);
+};
+
+template <class T, class Enable = void>
+struct tester3
+{
+ typedef T type;
+ BOOST_STATIC_CONSTANT(bool, value = false);
+};
+
+template <class T>
+struct tester3<T, typename enable_if_has_type<typename T::value_type>::type>
+{
+ typedef typename T::value_type type;
+ BOOST_STATIC_CONSTANT(bool, value = true);
+};
+
+struct sample_value_type
+{
+ typedef float***& value_type;
+};
+
+int main()
+{
+
+ BOOST_TEST(tester<int>::value);
+ BOOST_TEST(tester<double>::value);
+
+ BOOST_TEST(!tester<char*>::value);
+ BOOST_TEST(!tester<void*>::value);
+
+ BOOST_TEST(tester2<int>::value);
+ BOOST_TEST(tester2<double>::value);
+
+ BOOST_TEST(!tester2<char*>::value);
+ BOOST_TEST(!tester2<void*>::value);
+
+ BOOST_TEST(!tester3<char*>::value);
+ BOOST_TEST(tester3<sample_value_type>::value);
+
+ return boost::report_errors();
+}
+
diff --git a/test/exchange_move_test.cpp b/test/exchange_move_test.cpp
new file mode 100644
index 0000000..0ce20af
--- /dev/null
+++ b/test/exchange_move_test.cpp
@@ -0,0 +1,100 @@
+/*
+Copyright 2018 Glen Joseph Fernandes
+(glenjofe@gmail.com)
+
+Distributed under the Boost Software License, Version 1.0.
+(http://www.boost.org/LICENSE_1_0.txt)
+*/
+#include <boost/config.hpp>
+#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+#include <boost/core/exchange.hpp>
+#include <boost/core/lightweight_test.hpp>
+
+class C1 {
+public:
+ explicit C1(int i)
+ : i_(i) { }
+ C1(C1&& c)
+ : i_(c.i_) { }
+ C1& operator=(C1&& c) {
+ i_ = c.i_;
+ return *this;
+ }
+ int i() const {
+ return i_;
+ }
+private:
+ C1(const C1&);
+ C1& operator=(const C1&);
+ int i_;
+};
+
+void test1()
+{
+ C1 x(1);
+ BOOST_TEST(boost::exchange(x, C1(2)).i() == 1);
+ BOOST_TEST(x.i() == 2);
+}
+
+class C2 {
+public:
+ explicit C2(int i)
+ : i_(i) { }
+ operator C1() const {
+ return C1(i_);
+ }
+ int i() const {
+ return i_;
+ }
+private:
+ C2(const C2&);
+ C2& operator=(const C2&);
+ int i_;
+};
+
+void test2()
+{
+ C1 x(1);
+ BOOST_TEST(boost::exchange(x, C2(2)).i() == 1);
+ BOOST_TEST(x.i() == 2);
+}
+
+class C3 {
+public:
+ explicit C3(int i)
+ : i_(i) { }
+ C3(C3&& c)
+ : i_(c.i_) { }
+ C3& operator=(C1&& c) {
+ i_ = c.i();
+ return *this;
+ }
+ int i() const {
+ return i_;
+ }
+private:
+ C3(const C3&);
+ C3& operator=(const C3&);
+ int i_;
+};
+
+void test3()
+{
+ C3 x(1);
+ BOOST_TEST(boost::exchange(x, C1(2)).i() == 1);
+ BOOST_TEST(x.i() == 2);
+}
+
+int main()
+{
+ test1();
+ test2();
+ test3();
+ return boost::report_errors();
+}
+#else
+int main()
+{
+ return 0;
+}
+#endif
diff --git a/test/exchange_test.cpp b/test/exchange_test.cpp
new file mode 100644
index 0000000..524d5b7
--- /dev/null
+++ b/test/exchange_test.cpp
@@ -0,0 +1,89 @@
+/*
+Copyright 2018 Glen Joseph Fernandes
+(glenjofe@gmail.com)
+
+Distributed under the Boost Software License, Version 1.0.
+(http://www.boost.org/LICENSE_1_0.txt)
+*/
+#include <boost/core/exchange.hpp>
+#include <boost/core/lightweight_test.hpp>
+
+void test1()
+{
+ int i = 1;
+ BOOST_TEST(boost::exchange(i, 2) == 1);
+ BOOST_TEST(i == 2);
+}
+
+class C1 {
+public:
+ explicit C1(int i)
+ : i_(i) { }
+ int i() const {
+ return i_;
+ }
+private:
+ int i_;
+};
+
+void test2()
+{
+ C1 x(1);
+ BOOST_TEST(boost::exchange(x, C1(2)).i() == 1);
+ BOOST_TEST(x.i() == 2);
+}
+
+class C2 {
+public:
+ explicit C2(int i)
+ : i_(i) { }
+ operator C1() const {
+ return C1(i_);
+ }
+ int i() const {
+ return i_;
+ }
+private:
+ int i_;
+};
+
+void test3()
+{
+ C1 x(1);
+ BOOST_TEST(boost::exchange(x, C2(2)).i() == 1);
+ BOOST_TEST(x.i() == 2);
+}
+
+class C3 {
+public:
+ explicit C3(int i)
+ : i_(i) { }
+ C3(const C3& c)
+ : i_(c.i_) { }
+ C3& operator=(const C1& c) {
+ i_ = c.i();
+ return *this;
+ }
+ int i() const {
+ return i_;
+ }
+private:
+ C3& operator=(const C3&);
+ int i_;
+};
+
+void test4()
+{
+ C3 x(1);
+ BOOST_TEST(boost::exchange(x, C1(2)).i() == 1);
+ BOOST_TEST(x.i() == 2);
+}
+
+int main()
+{
+ test1();
+ test2();
+ test3();
+ test4();
+ return boost::report_errors();
+}
diff --git a/test/explicit_operator_bool.cpp b/test/explicit_operator_bool.cpp
new file mode 100644
index 0000000..5e85259
--- /dev/null
+++ b/test/explicit_operator_bool.cpp
@@ -0,0 +1,54 @@
+/*
+ * Copyright Andrey Semashev 2007 - 2013.
+ * 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)
+ */
+/*!
+ * \file explicit_operator_bool.cpp
+ * \author Andrey Semashev
+ * \date 17.07.2010
+ *
+ * \brief This test checks that explicit operator bool can be used in
+ * the valid contexts.
+ */
+
+#define BOOST_TEST_MODULE explicit_operator_bool
+
+#include <boost/utility/explicit_operator_bool.hpp>
+
+namespace {
+
+ // A test object that has the operator of explicit conversion to bool
+ struct checkable1
+ {
+ BOOST_EXPLICIT_OPERATOR_BOOL()
+ bool operator! () const
+ {
+ return false;
+ }
+ };
+
+ struct checkable2
+ {
+ BOOST_CONSTEXPR_EXPLICIT_OPERATOR_BOOL()
+ BOOST_CONSTEXPR bool operator! () const
+ {
+ return false;
+ }
+ };
+
+} // namespace
+
+int main(int, char*[])
+{
+ checkable1 val1;
+ if (val1)
+ {
+ checkable2 val2;
+ if (val2)
+ return 0;
+ }
+
+ return 1;
+}
diff --git a/test/explicit_operator_bool_compile_fail_conv_int.cpp b/test/explicit_operator_bool_compile_fail_conv_int.cpp
new file mode 100644
index 0000000..2664d5e
--- /dev/null
+++ b/test/explicit_operator_bool_compile_fail_conv_int.cpp
@@ -0,0 +1,41 @@
+/*
+ * Copyright Andrey Semashev 2007 - 2013.
+ * 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)
+ */
+/*!
+ * \file explicit_operator_bool_compile_fail_conv_int.cpp
+ * \author Andrey Semashev
+ * \date 17.07.2010
+ *
+ * \brief This test checks that explicit operator bool cannot be used in
+ * an unintended context.
+ */
+
+#define BOOST_TEST_MODULE explicit_operator_bool_compile_fail_conv_int
+
+#include <boost/utility/explicit_operator_bool.hpp>
+
+namespace {
+
+ // A test object that has the operator of explicit conversion to bool
+ struct checkable
+ {
+ BOOST_EXPLICIT_OPERATOR_BOOL()
+ bool operator! () const
+ {
+ return false;
+ }
+ };
+
+} // namespace
+
+int main(int, char*[])
+{
+ checkable val;
+ int n = val;
+ (void)n;
+
+ return 0;
+}
diff --git a/test/explicit_operator_bool_compile_fail_conv_pvoid.cpp b/test/explicit_operator_bool_compile_fail_conv_pvoid.cpp
new file mode 100644
index 0000000..b7e7e03
--- /dev/null
+++ b/test/explicit_operator_bool_compile_fail_conv_pvoid.cpp
@@ -0,0 +1,41 @@
+/*
+ * Copyright Andrey Semashev 2007 - 2013.
+ * 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)
+ */
+/*!
+ * \file explicit_operator_bool_compile_fail_conv_pvoid.cpp
+ * \author Andrey Semashev
+ * \date 17.07.2010
+ *
+ * \brief This test checks that explicit operator bool cannot be used in
+ * an unintended context.
+ */
+
+#define BOOST_TEST_MODULE explicit_operator_bool_compile_fail_conv_pvoid
+
+#include <boost/utility/explicit_operator_bool.hpp>
+
+namespace {
+
+ // A test object that has the operator of explicit conversion to bool
+ struct checkable
+ {
+ BOOST_EXPLICIT_OPERATOR_BOOL()
+ bool operator! () const
+ {
+ return false;
+ }
+ };
+
+} // namespace
+
+int main(int, char*[])
+{
+ checkable val;
+ void* p = val;
+ (void)p;
+
+ return 0;
+}
diff --git a/test/explicit_operator_bool_compile_fail_delete.cpp b/test/explicit_operator_bool_compile_fail_delete.cpp
new file mode 100644
index 0000000..d780f94
--- /dev/null
+++ b/test/explicit_operator_bool_compile_fail_delete.cpp
@@ -0,0 +1,40 @@
+/*
+ * Copyright Andrey Semashev 2007 - 2013.
+ * 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)
+ */
+/*!
+ * \file explicit_operator_bool_compile_fail_delete.cpp
+ * \author Andrey Semashev
+ * \date 17.07.2010
+ *
+ * \brief This test checks that explicit operator bool cannot be used in
+ * an unintended context.
+ */
+
+#define BOOST_TEST_MODULE util_explicit_operator_bool_delete
+
+#include <boost/utility/explicit_operator_bool.hpp>
+
+namespace {
+
+ // A test object that has the operator of explicit conversion to bool
+ struct checkable
+ {
+ BOOST_EXPLICIT_OPERATOR_BOOL()
+ bool operator! () const
+ {
+ return false;
+ }
+ };
+
+} // namespace
+
+int main(int, char*[])
+{
+ checkable val;
+ delete val;
+
+ return 0;
+}
diff --git a/test/explicit_operator_bool_compile_fail_shift.cpp b/test/explicit_operator_bool_compile_fail_shift.cpp
new file mode 100644
index 0000000..ce563a6
--- /dev/null
+++ b/test/explicit_operator_bool_compile_fail_shift.cpp
@@ -0,0 +1,40 @@
+/*
+ * Copyright Andrey Semashev 2007 - 2013.
+ * 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)
+ */
+/*!
+ * \file explicit_operator_bool_compile_fail_shift.cpp
+ * \author Andrey Semashev
+ * \date 17.07.2010
+ *
+ * \brief This test checks that explicit operator bool cannot be used in
+ * an unintended context.
+ */
+
+#define BOOST_TEST_MODULE explicit_operator_bool_compile_fail_shift
+
+#include <boost/utility/explicit_operator_bool.hpp>
+
+namespace {
+
+ // A test object that has the operator of explicit conversion to bool
+ struct checkable
+ {
+ BOOST_EXPLICIT_OPERATOR_BOOL()
+ bool operator! () const
+ {
+ return false;
+ }
+ };
+
+} // namespace
+
+int main(int, char*[])
+{
+ checkable val;
+ val << 2;
+
+ return 0;
+}
diff --git a/test/explicit_operator_bool_noexcept.cpp b/test/explicit_operator_bool_noexcept.cpp
new file mode 100644
index 0000000..c645cca
--- /dev/null
+++ b/test/explicit_operator_bool_noexcept.cpp
@@ -0,0 +1,89 @@
+/*
+ * Copyright Andrey Semashev 2007 - 2013.
+ * 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)
+ */
+/*!
+ * \file explicit_operator_bool_noexcept.cpp
+ * \author Andrey Semashev
+ * \date 26.04.2014
+ *
+ * \brief This test checks that explicit operator bool is noexcept when possible.
+ */
+
+#define BOOST_TEST_MODULE explicit_operator_bool_noexcept
+
+#include <boost/config.hpp>
+
+#if !defined(BOOST_NO_CXX11_NOEXCEPT)
+
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/utility/explicit_operator_bool.hpp>
+
+namespace {
+
+ struct checkable1
+ {
+ BOOST_EXPLICIT_OPERATOR_BOOL()
+ bool operator! () const
+ {
+ return false;
+ }
+ };
+
+ struct checkable2
+ {
+ BOOST_CONSTEXPR_EXPLICIT_OPERATOR_BOOL()
+ BOOST_CONSTEXPR bool operator! () const
+ {
+ return false;
+ }
+ };
+
+ struct noexcept_checkable1
+ {
+ BOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT()
+ bool operator! () const noexcept
+ {
+ return false;
+ }
+ };
+
+ struct noexcept_checkable2
+ {
+ BOOST_CONSTEXPR_EXPLICIT_OPERATOR_BOOL()
+ BOOST_CONSTEXPR bool operator! () const noexcept
+ {
+ return false;
+ }
+ };
+
+} // namespace
+
+int main(int, char*[])
+{
+ checkable1 val1;
+ checkable2 val2;
+
+ noexcept_checkable1 noexcept_val1;
+ noexcept_checkable2 noexcept_val2;
+
+ BOOST_TEST(!noexcept(static_cast< bool >(val1)));
+ // constexpr functions are implicitly noexcept
+ BOOST_TEST(noexcept(static_cast< bool >(val2)));
+
+ BOOST_TEST(noexcept(static_cast< bool >(noexcept_val1)));
+ BOOST_TEST(noexcept(static_cast< bool >(noexcept_val2)));
+
+ return boost::report_errors();
+}
+
+#else
+
+int main(int, char*[])
+{
+ return 0;
+}
+
+#endif
diff --git a/test/get_pointer_test.cpp b/test/get_pointer_test.cpp
new file mode 100644
index 0000000..1ddf3be
--- /dev/null
+++ b/test/get_pointer_test.cpp
@@ -0,0 +1,74 @@
+//
+// get_pointer_test.cpp
+//
+// Copyright 2014, 2017 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <boost/get_pointer.hpp>
+#include <boost/core/lightweight_test.hpp>
+#include <memory>
+
+struct X
+{
+};
+
+int main()
+{
+ using boost::get_pointer;
+
+ {
+ X * p = new X;
+ BOOST_TEST( get_pointer( p ) == p );
+
+ delete p;
+ }
+
+ {
+ X * p = 0;
+ BOOST_TEST( get_pointer( p ) == 0 );
+ }
+
+#if !defined( BOOST_NO_AUTO_PTR )
+
+ {
+ std::auto_ptr< X > p( new X );
+ BOOST_TEST( get_pointer( p ) == p.get() );
+ }
+
+ {
+ std::auto_ptr< X > p;
+ BOOST_TEST( get_pointer( p ) == 0 );
+ }
+
+#endif
+
+#if !defined( BOOST_NO_CXX11_SMART_PTR )
+
+ {
+ std::unique_ptr< X > p( new X );
+ BOOST_TEST( get_pointer( p ) == p.get() );
+ }
+
+ {
+ std::unique_ptr< X > p;
+ BOOST_TEST( get_pointer( p ) == 0 );
+ }
+
+ {
+ std::shared_ptr< X > p( new X );
+ BOOST_TEST( get_pointer( p ) == p.get() );
+ }
+
+ {
+ std::shared_ptr< X > p;
+ BOOST_TEST( get_pointer( p ) == 0 );
+ }
+
+#endif
+
+ return boost::report_errors();
+}
diff --git a/test/ignore_unused_test.cpp b/test/ignore_unused_test.cpp
new file mode 100644
index 0000000..67bdd80
--- /dev/null
+++ b/test/ignore_unused_test.cpp
@@ -0,0 +1,75 @@
+// Copyright (c) 2014 Adam Wulkiewicz, Lodz, Poland.
+//
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#include <boost/core/ignore_unused.hpp>
+
+BOOST_CXX14_CONSTEXPR int test_fun(int a)
+{
+ boost::ignore_unused(a);
+ return 0;
+}
+
+int main()
+{
+ {
+ int a;
+ boost::ignore_unused(a);
+ }
+ {
+ int a, b;
+ boost::ignore_unused(a, b);
+ }
+ {
+ int a, b, c;
+ boost::ignore_unused(a, b, c);
+ }
+ {
+ int a, b, c, d;
+ boost::ignore_unused(a, b, c, d);
+ }
+ {
+ int a, b, c, d, e;
+ boost::ignore_unused(a, b, c, d, e);
+ }
+
+ {
+ typedef int a;
+ boost::ignore_unused<a>();
+ }
+ {
+ typedef int a;
+ typedef int b;
+ boost::ignore_unused<a, b>();
+ }
+ {
+ typedef int a;
+ typedef int b;
+ typedef int c;
+ boost::ignore_unused<a, b, c>();
+ }
+ {
+ typedef int a;
+ typedef int b;
+ typedef int c;
+ typedef int d;
+ boost::ignore_unused<a, b, c, d>();
+ }
+ {
+ typedef int a;
+ typedef int b;
+ typedef int c;
+ typedef int d;
+ typedef int e;
+ boost::ignore_unused<a, b, c, d, e>();
+ }
+
+ {
+ BOOST_CXX14_CONSTEXPR const int a = test_fun(0);
+ boost::ignore_unused(a);
+ }
+
+ return 0;
+}
diff --git a/test/is_same_test.cpp b/test/is_same_test.cpp
new file mode 100644
index 0000000..838db22
--- /dev/null
+++ b/test/is_same_test.cpp
@@ -0,0 +1,38 @@
+//
+// Test for core::is_same<T1,T2>
+//
+// Copyright 2014 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <boost/core/is_same.hpp>
+#include <boost/core/lightweight_test_trait.hpp>
+
+struct X
+{
+};
+
+struct Y
+{
+};
+
+int main()
+{
+ BOOST_TEST_TRAIT_TRUE(( boost::core::is_same<X, X> ));
+ BOOST_TEST_TRAIT_TRUE(( boost::core::is_same<Y, Y> ));
+ BOOST_TEST_TRAIT_TRUE(( boost::core::is_same<void, void> ));
+ BOOST_TEST_TRAIT_TRUE(( boost::core::is_same<int, int> ));
+ BOOST_TEST_TRAIT_TRUE(( boost::core::is_same<void const volatile, void const volatile> ));
+
+ BOOST_TEST_TRAIT_FALSE(( boost::core::is_same<X, Y> ));
+ BOOST_TEST_TRAIT_FALSE(( boost::core::is_same<X, X const> ));
+ BOOST_TEST_TRAIT_FALSE(( boost::core::is_same<X, void> ));
+ BOOST_TEST_TRAIT_FALSE(( boost::core::is_same<X, int> ));
+ BOOST_TEST_TRAIT_FALSE(( boost::core::is_same<int, void> ));
+ BOOST_TEST_TRAIT_FALSE(( boost::core::is_same<void, void const volatile> ));
+
+ return boost::report_errors();
+}
diff --git a/test/iterator_test.cpp b/test/iterator_test.cpp
new file mode 100644
index 0000000..3eb2902
--- /dev/null
+++ b/test/iterator_test.cpp
@@ -0,0 +1,69 @@
+//
+// Test for boost/iterator.hpp
+//
+// Copyright 2014 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <boost/iterator.hpp>
+#include <boost/core/is_same.hpp>
+#include <boost/core/lightweight_test_trait.hpp>
+
+/*
+
+template< class Category, class T,
+ class Distance = ptrdiff_t,
+ class Pointer = T*,
+ class Reference = T&>
+struct iterator
+{
+ typedef T value_type;
+ typedef Distance difference_type;
+ typedef Pointer pointer;
+ typedef Reference reference;
+ typedef Category iterator_category;
+};
+
+*/
+
+struct C
+{
+};
+
+struct T
+{
+};
+
+struct D
+{
+};
+
+struct P
+{
+};
+
+struct R
+{
+};
+
+int main()
+{
+ using boost::core::is_same;
+
+ BOOST_TEST_TRAIT_TRUE((is_same<boost::iterator<C,T,D,P,R>::iterator_category,C>));
+ BOOST_TEST_TRAIT_TRUE((is_same<boost::iterator<C,T,D,P,R>::value_type,T>));
+ BOOST_TEST_TRAIT_TRUE((is_same<boost::iterator<C,T,D,P,R>::difference_type,D>));
+ BOOST_TEST_TRAIT_TRUE((is_same<boost::iterator<C,T,D,P,R>::pointer,P>));
+ BOOST_TEST_TRAIT_TRUE((is_same<boost::iterator<C,T,D,P,R>::reference,R>));
+
+ BOOST_TEST_TRAIT_TRUE((is_same<boost::iterator<C,T>::iterator_category,C>));
+ BOOST_TEST_TRAIT_TRUE((is_same<boost::iterator<C,T>::value_type,T>));
+ BOOST_TEST_TRAIT_TRUE((is_same<boost::iterator<C,T>::difference_type,std::ptrdiff_t>));
+ BOOST_TEST_TRAIT_TRUE((is_same<boost::iterator<C,T>::pointer,T*>));
+ BOOST_TEST_TRAIT_TRUE((is_same<boost::iterator<C,T>::reference,T&>));
+
+ return boost::report_errors();
+}
diff --git a/test/lightweight_test_all_eq_test.cpp b/test/lightweight_test_all_eq_test.cpp
new file mode 100644
index 0000000..0fb0fb9
--- /dev/null
+++ b/test/lightweight_test_all_eq_test.cpp
@@ -0,0 +1,126 @@
+//
+// Negative test for BOOST_TEST_ALL_EQ
+//
+// Copyright (c) 2017 Bjorn Reese
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <vector>
+#include <set>
+#include <boost/core/lightweight_test.hpp>
+
+int main()
+{
+ int test_cases = 0;
+
+ // Array
+
+ {
+ int x[] = { 1 };
+ int y[] = { 1, 2 };
+ BOOST_TEST_ALL_EQ( x, x + sizeof(x)/sizeof(x[0]), y, y + sizeof(y)/sizeof(y[0]) );
+ ++test_cases;
+ }
+
+ {
+ int x[] = { 1, 2 };
+ int y[] = { 1 };
+ BOOST_TEST_ALL_EQ( x, x + sizeof(x)/sizeof(x[0]), y, y + sizeof(y)/sizeof(y[0]) );
+ ++test_cases;
+ }
+
+ {
+ int x[] = { 2 };
+ int y[] = { 1, 2 };
+ BOOST_TEST_ALL_EQ( x, x + sizeof(x)/sizeof(x[0]), y, y + sizeof(y)/sizeof(y[0]) );
+ ++test_cases;
+ }
+
+ {
+ int x[] = { 1, 2, 3, 4 };
+ int y[] = { 1, 3, 2, 4 };
+ BOOST_TEST_ALL_EQ( x, x + sizeof(x)/sizeof(x[0]), y, y + sizeof(y)/sizeof(y[0]) );
+ ++test_cases;
+ }
+
+ // Vector
+
+ {
+ std::vector<int> x, y;
+ x.push_back( 1 );
+ BOOST_TEST_ALL_EQ( x.begin(), x.end(), y.begin(), y.end() );
+ ++test_cases;
+ }
+
+ {
+ std::vector<int> x, y;
+ y.push_back( 1 );
+ BOOST_TEST_ALL_EQ( x.begin(), x.end(), y.begin(), y.end() );
+ ++test_cases;
+ }
+
+ {
+ std::vector<int> x, y;
+ x.push_back( 1 ); x.push_back( 2 ); x.push_back( 3 ); x.push_back( 4 );
+ y.push_back( 1 ); y.push_back( 3 ); y.push_back( 2 ); y.push_back( 4 );
+ BOOST_TEST_ALL_EQ( x.begin(), x.end(), y.begin(), y.end() );
+ ++test_cases;
+ }
+
+ {
+ std::vector<float> x, y;
+ x.push_back( 1.0f ); x.push_back( 2.0f ); x.push_back( 3.0f ); x.push_back( 4.0f );
+ y.push_back( 4.0f ); y.push_back( 2.0f ); y.push_back( 3.0f ); y.push_back( 1.0f );
+ BOOST_TEST_ALL_EQ( x.begin(), x.end(), y.begin(), y.end() );
+ ++test_cases;
+ }
+
+ {
+ std::vector<int> x, y;
+ x.push_back( 1 ); x.push_back( 2 ); x.push_back( 3 );
+ y.push_back( 1 ); y.push_back( 3 ); y.push_back( 2 ); y.push_back( 4 );
+ BOOST_TEST_ALL_EQ( x.begin(), x.end(), y.begin(), y.end() );
+ ++test_cases;
+ }
+
+ {
+ std::vector<int> x, y;
+ x.push_back( 1 ); x.push_back( 2 ); x.push_back( 3 ); x.push_back( 4 );
+ y.push_back( 1 ); y.push_back( 3 ); y.push_back( 2 );;
+ BOOST_TEST_ALL_EQ( x.begin(), x.end(), y.begin(), y.end() );
+ ++test_cases;
+ }
+
+ // Set
+
+ {
+ std::set<int> x, y;
+ x.insert(1);
+ y.insert(1); y.insert(3);
+ BOOST_TEST_ALL_EQ( x.begin(), x.end(), y.begin(), y.end() );
+ ++test_cases;
+ }
+
+ {
+ std::set<int> x, y;
+ x.insert(1); x.insert(2);
+ y.insert(1);
+ BOOST_TEST_ALL_EQ( x.begin(), x.end(), y.begin(), y.end() );
+ ++test_cases;
+ }
+
+ {
+ std::set<int> x, y;
+ x.insert(1); x.insert(2);
+ y.insert(1); y.insert(3);
+ BOOST_TEST_ALL_EQ( x.begin(), x.end(), y.begin(), y.end() );
+ ++test_cases;
+ }
+
+ boost::report_errors();
+
+ return boost::detail::test_errors() != test_cases;
+}
diff --git a/test/lightweight_test_all_with_fail.cpp b/test/lightweight_test_all_with_fail.cpp
new file mode 100644
index 0000000..b51d64d
--- /dev/null
+++ b/test/lightweight_test_all_with_fail.cpp
@@ -0,0 +1,107 @@
+//
+// Negative est for BOOST_TEST_ALL_WITH
+//
+// Copyright (c) 2017 Bjorn Reese
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <cmath>
+#include <functional>
+#include <vector>
+#include <boost/core/lightweight_test.hpp>
+
+int fail_vector()
+{
+ int test_cases = 0;
+
+ {
+ std::vector<int> x, y;
+ x.push_back( 1 );
+ BOOST_TEST_ALL_WITH( x.begin(), x.end(), y.begin(), y.end(), std::equal_to<int>() );
+ ++test_cases;
+ }
+
+ {
+ std::vector<int> x, y;
+ y.push_back( 1 );
+ BOOST_TEST_ALL_WITH( x.begin(), x.end(), y.begin(), y.end(), std::equal_to<int>() );
+ ++test_cases;
+ }
+
+ {
+ std::vector<int> x, y;
+ x.push_back( 1 ); x.push_back( 2 ); x.push_back( 3 ); x.push_back( 4 );
+ y.push_back( 1 ); y.push_back( 2 ); y.push_back( 3 );
+ BOOST_TEST_ALL_WITH( x.begin(), x.end(), y.begin(), y.end(), std::equal_to<int>() );
+ ++test_cases;
+ }
+
+ {
+ std::vector<int> x, y;
+ x.push_back( 1 ); x.push_back( 2 ); x.push_back( 3 );
+ y.push_back( 1 ); y.push_back( 2 ); y.push_back( 3 ); y.push_back( 4 );
+ BOOST_TEST_ALL_WITH( x.begin(), x.end(), y.begin(), y.end(), std::equal_to<int>() );
+ ++test_cases;
+ }
+
+ {
+ std::vector<int> x, y;
+ x.push_back( 1 ); x.push_back( 2 ); x.push_back( 3 ); x.push_back( 4 );
+ y.push_back( 1 ); y.push_back( 3 ); y.push_back( 2 ); y.push_back( 4 );
+ BOOST_TEST_ALL_WITH( x.begin(), x.end(), y.begin(), y.end(), std::equal_to<int>() );
+ ++test_cases;
+ }
+
+ {
+ std::vector<int> x, y;
+ x.push_back( 1 ); x.push_back( 2 ); x.push_back( 3 ); x.push_back( 4 );
+ y.push_back( 1 ); y.push_back( 3 ); y.push_back( 2 ); y.push_back( 4 );
+ BOOST_TEST_ALL_WITH( x.begin(), x.end(), y.begin(), y.end(), std::less<int>() );
+ ++test_cases;
+ }
+
+ return test_cases;
+}
+
+template <typename T>
+struct with_tolerance
+{
+ with_tolerance(T tolerance) : tolerance(tolerance) {}
+ bool operator()(T lhs, T rhs)
+ {
+ return (std::abs(lhs - rhs) <= tolerance);
+ }
+
+private:
+ T tolerance;
+};
+
+int fail_tolerance_predicate()
+{
+ int test_cases = 0;
+
+ {
+ std::vector<double> x, y;
+ x.push_back( 1.0 ); x.push_back( 1.0 );
+ y.push_back( 1.0 - 1e-4 ); y.push_back( 1.0 + 1e-4 );
+ BOOST_TEST_ALL_WITH( x.begin(), x.end(), y.begin(), y.end(), with_tolerance<double>(1e-5) );
+ ++test_cases;
+ }
+
+ return test_cases;
+}
+
+int main()
+{
+ int test_cases = 0;
+
+ test_cases += fail_vector();
+ test_cases += fail_tolerance_predicate();
+
+ boost::report_errors();
+
+ return boost::detail::test_errors() != test_cases;
+}
diff --git a/test/lightweight_test_all_with_test.cpp b/test/lightweight_test_all_with_test.cpp
new file mode 100644
index 0000000..bc078a4
--- /dev/null
+++ b/test/lightweight_test_all_with_test.cpp
@@ -0,0 +1,76 @@
+//
+// Test for BOOST_TEST_ALL_WITH
+//
+// Copyright (c) 2017 Bjorn Reese
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <cmath>
+#include <functional>
+#include <vector>
+#include <boost/core/lightweight_test.hpp>
+
+void test_vector()
+{
+ {
+ std::vector<int> x, y;
+ x.push_back( 1 ); x.push_back( 2 ); x.push_back( 3 ); x.push_back( 4 );
+ y.push_back( 1 ); y.push_back( 2 ); y.push_back( 3 ); y.push_back( 4 );
+ BOOST_TEST_ALL_WITH( x.begin(), x.end(), y.begin(), y.end(), std::equal_to<int>() );
+ }
+
+ {
+ std::vector<int> x, y;
+ x.push_back( 1 ); x.push_back( 2 ); x.push_back( 3 ); x.push_back( 4 );
+ y.push_back( 2 ); y.push_back( 3 ); y.push_back( 4 ); y.push_back( 5 );
+ BOOST_TEST_ALL_WITH( x.begin(), x.end(), y.begin(), y.end(), std::not_equal_to<int>() );
+ }
+
+ {
+ std::vector<int> x, y;
+ x.push_back( 1 ); x.push_back( 2 ); x.push_back( 3 ); x.push_back( 4 );
+ y.push_back( 2 ); y.push_back( 3 ); y.push_back( 4 ); y.push_back( 5 );
+ BOOST_TEST_ALL_WITH( x.begin(), x.end(), y.begin(), y.end(), std::less<int>() );
+ }
+}
+
+template <typename T>
+struct with_tolerance
+{
+ with_tolerance(T tolerance) : tolerance(tolerance) {}
+ bool operator()(T lhs, T rhs)
+ {
+ return (std::abs(lhs - rhs) <= tolerance);
+ }
+
+private:
+ T tolerance;
+};
+
+void test_tolerance_predicate()
+{
+ {
+ std::vector<double> x, y;
+ x.push_back( 1.0 ); x.push_back( 2.0 ); x.push_back( 3.0 ); x.push_back( 4.0 );
+ y.push_back( 1.0 ); y.push_back( 2.0 ); y.push_back( 3.0 ); y.push_back( 4.0 );
+ BOOST_TEST_ALL_WITH( x.begin(), x.end(), y.begin(), y.end(), with_tolerance<double>(1e-5) );
+ }
+
+ {
+ std::vector<double> x, y;
+ x.push_back( 1.0 ); x.push_back( 1.0 );
+ y.push_back( 1.0 - 1e-6 ); y.push_back( 1.0 + 1e-6 );
+ BOOST_TEST_ALL_WITH( x.begin(), x.end(), y.begin(), y.end(), with_tolerance<double>(1e-5) );
+ }
+}
+
+int main()
+{
+ test_vector();
+ test_tolerance_predicate();
+
+ return boost::report_errors();
+}
diff --git a/test/lightweight_test_eq_nullptr.cpp b/test/lightweight_test_eq_nullptr.cpp
new file mode 100644
index 0000000..519d4d8
--- /dev/null
+++ b/test/lightweight_test_eq_nullptr.cpp
@@ -0,0 +1,28 @@
+//
+// Test BOOST_TEST_EQ( p, nullptr )
+//
+// Copyright 2017 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <boost/config.hpp>
+#include <boost/core/lightweight_test.hpp>
+
+int main()
+{
+#if !defined( BOOST_NO_CXX11_NULLPTR )
+
+ int x = 0;
+ int* p1 = 0;
+ int* p2 = &x;
+
+ BOOST_TEST_EQ( p1, nullptr );
+ BOOST_TEST_NE( p2, nullptr );
+
+#endif
+
+ return boost::report_errors();
+}
diff --git a/test/lightweight_test_fail.cpp b/test/lightweight_test_fail.cpp
new file mode 100644
index 0000000..ec329b3
--- /dev/null
+++ b/test/lightweight_test_fail.cpp
@@ -0,0 +1,20 @@
+//
+// Negative test for BOOST_TEST
+//
+// Copyright (c) 2014 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <boost/detail/lightweight_test.hpp>
+
+int main()
+{
+ int x = 0;
+
+ BOOST_TEST( x == 1 ); // will fail
+
+ return boost::report_errors();
+}
diff --git a/test/lightweight_test_fail10.cpp b/test/lightweight_test_fail10.cpp
new file mode 100644
index 0000000..388c47e
--- /dev/null
+++ b/test/lightweight_test_fail10.cpp
@@ -0,0 +1,18 @@
+//
+// Negative test for BOOST_TEST_EQ on const char*
+//
+// Copyright (c) 2017 Hans Dembinski
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <boost/core/lightweight_test.hpp>
+
+int main()
+{
+ BOOST_TEST_EQ("xab"+1 , "yab"+1); // compares addresses, not cstrings
+
+ return boost::report_errors();
+}
diff --git a/test/lightweight_test_fail2.cpp b/test/lightweight_test_fail2.cpp
new file mode 100644
index 0000000..dcab724
--- /dev/null
+++ b/test/lightweight_test_fail2.cpp
@@ -0,0 +1,18 @@
+//
+// Test for BOOST_ERROR
+//
+// Copyright (c) 2014 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <boost/detail/lightweight_test.hpp>
+
+int main()
+{
+ BOOST_ERROR( "expected failure" );
+
+ return boost::report_errors();
+}
diff --git a/test/lightweight_test_fail3.cpp b/test/lightweight_test_fail3.cpp
new file mode 100644
index 0000000..1e20842
--- /dev/null
+++ b/test/lightweight_test_fail3.cpp
@@ -0,0 +1,20 @@
+//
+// Negative test for BOOST_TEST_EQ
+//
+// Copyright (c) 2014 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <boost/detail/lightweight_test.hpp>
+
+int main()
+{
+ int x = 0;
+
+ BOOST_TEST_EQ( x, 1 );
+
+ return boost::report_errors();
+}
diff --git a/test/lightweight_test_fail4.cpp b/test/lightweight_test_fail4.cpp
new file mode 100644
index 0000000..492699a
--- /dev/null
+++ b/test/lightweight_test_fail4.cpp
@@ -0,0 +1,20 @@
+//
+// Negative test for BOOST_TEST_NE
+//
+// Copyright (c) 2014 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <boost/detail/lightweight_test.hpp>
+
+int main()
+{
+ int x = 0;
+
+ BOOST_TEST_NE( x, 0 );
+
+ return boost::report_errors();
+}
diff --git a/test/lightweight_test_fail5.cpp b/test/lightweight_test_fail5.cpp
new file mode 100644
index 0000000..5cc4659
--- /dev/null
+++ b/test/lightweight_test_fail5.cpp
@@ -0,0 +1,26 @@
+//
+// Negative test for BOOST_TEST_THROWS
+//
+// Copyright (c) 2014 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <boost/detail/lightweight_test.hpp>
+
+struct X
+{
+};
+
+void f()
+{
+}
+
+int main()
+{
+ BOOST_TEST_THROWS( f(), X );
+
+ return boost::report_errors();
+}
diff --git a/test/lightweight_test_fail6.cpp b/test/lightweight_test_fail6.cpp
new file mode 100644
index 0000000..10544ab
--- /dev/null
+++ b/test/lightweight_test_fail6.cpp
@@ -0,0 +1,27 @@
+//
+// Negative test for BOOST_TEST_THROWS
+//
+// Copyright (c) 2014 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <boost/detail/lightweight_test.hpp>
+
+struct X
+{
+};
+
+void f()
+{
+ throw 5;
+}
+
+int main()
+{
+ BOOST_TEST_THROWS( f(), X );
+
+ return boost::report_errors();
+}
diff --git a/test/lightweight_test_fail7.cpp b/test/lightweight_test_fail7.cpp
new file mode 100644
index 0000000..ed393e6
--- /dev/null
+++ b/test/lightweight_test_fail7.cpp
@@ -0,0 +1,38 @@
+//
+// Negative test for BOOST_TEST_TRAIT_TRUE
+//
+// Copyright (c) 2014 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <boost/core/lightweight_test_trait.hpp>
+
+template<class T1, class T2> struct Y1
+{
+ enum { value = 1 };
+};
+
+template<class T1, class T2> struct Y2
+{
+ enum { value = 0 };
+};
+
+struct X1
+{
+ typedef int type;
+};
+
+struct X2
+{
+ typedef int type;
+};
+
+int main()
+{
+ BOOST_TEST_TRAIT_TRUE(( Y2<X1::type, X2::type> ));
+
+ return boost::report_errors();
+}
diff --git a/test/lightweight_test_fail8.cpp b/test/lightweight_test_fail8.cpp
new file mode 100644
index 0000000..7b6d486
--- /dev/null
+++ b/test/lightweight_test_fail8.cpp
@@ -0,0 +1,38 @@
+//
+// Negative test for BOOST_TEST_TRAIT_FALSE
+//
+// Copyright (c) 2014 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <boost/core/lightweight_test_trait.hpp>
+
+template<class T1, class T2> struct Y1
+{
+ enum { value = 1 };
+};
+
+template<class T1, class T2> struct Y2
+{
+ enum { value = 0 };
+};
+
+struct X1
+{
+ typedef int type;
+};
+
+struct X2
+{
+ typedef int type;
+};
+
+int main()
+{
+ BOOST_TEST_TRAIT_FALSE(( Y1<X1::type, X2::type> ));
+
+ return boost::report_errors();
+}
diff --git a/test/lightweight_test_fail9.cpp b/test/lightweight_test_fail9.cpp
new file mode 100644
index 0000000..a87a4f1
--- /dev/null
+++ b/test/lightweight_test_fail9.cpp
@@ -0,0 +1,18 @@
+//
+// Negative test for BOOST_TEST_CSTR_EQ
+//
+// Copyright (c) 2017 Hans Dembinski
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <boost/core/lightweight_test.hpp>
+
+int main()
+{
+ BOOST_TEST_CSTR_EQ("x" , "y");
+
+ return boost::report_errors();
+}
diff --git a/test/lightweight_test_ge_fail.cpp b/test/lightweight_test_ge_fail.cpp
new file mode 100644
index 0000000..6671215
--- /dev/null
+++ b/test/lightweight_test_ge_fail.cpp
@@ -0,0 +1,20 @@
+//
+// Negative test for BOOST_TEST_GE
+//
+// Copyright 2017 Kohei Takahashi
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <boost/core/lightweight_test.hpp>
+
+int main()
+{
+ int x = 0;
+
+ BOOST_TEST_GE( x, 1 );
+
+ return boost::report_errors();
+}
diff --git a/test/lightweight_test_gt_fail.cpp b/test/lightweight_test_gt_fail.cpp
new file mode 100644
index 0000000..3a0bd3c
--- /dev/null
+++ b/test/lightweight_test_gt_fail.cpp
@@ -0,0 +1,20 @@
+//
+// Negative test for BOOST_TEST_GT
+//
+// Copyright 2017 Kohei Takahashi
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <boost/core/lightweight_test.hpp>
+
+int main()
+{
+ int x = 0;
+
+ BOOST_TEST_GT( x, 0 );
+
+ return boost::report_errors();
+}
diff --git a/test/lightweight_test_gt_ge_test.cpp b/test/lightweight_test_gt_ge_test.cpp
new file mode 100644
index 0000000..d935a0a
--- /dev/null
+++ b/test/lightweight_test_gt_ge_test.cpp
@@ -0,0 +1,34 @@
+//
+// Test for BOOST_TEST_GT, BOOST_TEST_GE
+//
+// Copyright 2017 Kohei Takahashi
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <boost/core/lightweight_test.hpp>
+
+int main()
+{
+ int x = 0;
+
+ BOOST_TEST_GT( x, -1 );
+ BOOST_TEST_GT( ++x, 0 );
+ BOOST_TEST_GT( x++, 0 );
+
+ BOOST_TEST_GE( x, 2 );
+ BOOST_TEST_GE( ++x, 3 );
+ BOOST_TEST_GE( x++, 3 );
+
+ int y = 5;
+
+ BOOST_TEST_GT( ++y, ++x );
+ BOOST_TEST_GT( y++, x++ );
+
+ BOOST_TEST_GE( ++y, x );
+ BOOST_TEST_GE( y++, x++ );
+
+ return boost::report_errors();
+}
diff --git a/test/lightweight_test_le_fail.cpp b/test/lightweight_test_le_fail.cpp
new file mode 100644
index 0000000..9706be4
--- /dev/null
+++ b/test/lightweight_test_le_fail.cpp
@@ -0,0 +1,20 @@
+//
+// Negative test for BOOST_TEST_LE
+//
+// Copyright 2017 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <boost/core/lightweight_test.hpp>
+
+int main()
+{
+ int x = 1;
+
+ BOOST_TEST_LE( x, 0 );
+
+ return boost::report_errors();
+}
diff --git a/test/lightweight_test_lt_fail.cpp b/test/lightweight_test_lt_fail.cpp
new file mode 100644
index 0000000..ba6d243
--- /dev/null
+++ b/test/lightweight_test_lt_fail.cpp
@@ -0,0 +1,20 @@
+//
+// Negative test for BOOST_TEST_LT
+//
+// Copyright 2014, 2017 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <boost/core/lightweight_test.hpp>
+
+int main()
+{
+ int x = 0;
+
+ BOOST_TEST_LT( x, 0 );
+
+ return boost::report_errors();
+}
diff --git a/test/lightweight_test_lt_le_test.cpp b/test/lightweight_test_lt_le_test.cpp
new file mode 100644
index 0000000..7f08783
--- /dev/null
+++ b/test/lightweight_test_lt_le_test.cpp
@@ -0,0 +1,34 @@
+//
+// Test for BOOST_TEST_LT, BOOST_TEST_LE
+//
+// Copyright 2014, 2017 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <boost/core/lightweight_test.hpp>
+
+int main()
+{
+ int x = 0;
+
+ BOOST_TEST_LT( x, 1 );
+ BOOST_TEST_LT( ++x, 2 );
+ BOOST_TEST_LT( x++, 3 );
+
+ BOOST_TEST_LE( x, 2 );
+ BOOST_TEST_LE( ++x, 3 );
+ BOOST_TEST_LE( x++, 4 );
+
+ int y = 3;
+
+ BOOST_TEST_LT( ++y, ++x );
+ BOOST_TEST_LT( y++, x++ );
+
+ BOOST_TEST_LE( ++y, x );
+ BOOST_TEST_LE( y++, x++ );
+
+ return boost::report_errors();
+}
diff --git a/test/lightweight_test_test.cpp b/test/lightweight_test_test.cpp
new file mode 100644
index 0000000..bfef152
--- /dev/null
+++ b/test/lightweight_test_test.cpp
@@ -0,0 +1,96 @@
+//
+// Test for lightweight_test.hpp
+//
+// Copyright (c) 2014 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <vector>
+#include <boost/detail/lightweight_test.hpp>
+
+struct X
+{
+};
+
+#if !defined( BOOST_NO_EXCEPTIONS )
+# define LWT_THROW( x ) throw x
+#else
+# define LWT_THROW( x ) ((void)(x))
+#endif
+
+void f( bool x )
+{
+ if( x )
+ {
+ LWT_THROW( X() );
+ }
+ else
+ {
+ LWT_THROW( 5 );
+ }
+}
+
+int main()
+{
+ int x = 0;
+
+ // BOOST_TEST
+
+ BOOST_TEST( x == 0 );
+ BOOST_TEST( ++x == 1 );
+ BOOST_TEST( x++ == 1 );
+ BOOST_TEST( x == 2? true: false );
+ BOOST_TEST( x == 2? &x: 0 );
+
+ // BOOST_TEST_NOT
+
+ BOOST_TEST_NOT( x == 1 );
+ BOOST_TEST_NOT( ++x == 2 );
+ BOOST_TEST_NOT( x++ == 2 );
+ BOOST_TEST_NOT( --x == 2 );
+ BOOST_TEST_NOT( x-- == 2 );
+ BOOST_TEST_NOT( x == 2? false: true );
+ BOOST_TEST_NOT( x == 2? 0: &x );
+
+ // BOOST_TEST_EQ
+
+ BOOST_TEST_EQ( x, 2 );
+ BOOST_TEST_EQ( ++x, 3 );
+ BOOST_TEST_EQ( x++, 3 );
+
+ int y = 4;
+
+ BOOST_TEST_EQ( ++x, ++y );
+ BOOST_TEST_EQ( x++, y++ );
+ BOOST_TEST_CSTR_EQ("xabc"+1, "yabc"+1); // equal cstrings, different addresses
+ BOOST_TEST_EQ( &y, &y );
+
+ // BOOST_TEST_NE
+
+ BOOST_TEST_NE( ++x, y );
+ BOOST_TEST_NE( &x, &y );
+ BOOST_TEST_NE("xabc"+1, "yabc"+1); // equal cstrings, different addresses
+ BOOST_TEST_CSTR_NE("x", "y");
+
+ // BOOST_TEST_ALL_EQ
+ {
+ std::vector<int> xarray;
+ xarray.push_back(1);
+ xarray.push_back(2);
+ std::vector<int> yarray(xarray);
+ BOOST_TEST_ALL_EQ(xarray.begin(), xarray.end(), yarray.begin(), yarray.end());
+ }
+
+ // BOOST_TEST_THROWS
+
+ BOOST_TEST_THROWS( throw X(), X );
+ BOOST_TEST_THROWS( throw 1, int );
+
+ BOOST_TEST_THROWS( f(true), X );
+ BOOST_TEST_THROWS( f(false), int );
+
+ return boost::report_errors();
+}
diff --git a/test/lightweight_test_test2.cpp b/test/lightweight_test_test2.cpp
new file mode 100644
index 0000000..c60fecc
--- /dev/null
+++ b/test/lightweight_test_test2.cpp
@@ -0,0 +1,44 @@
+//
+// Test for lightweight_test_trait.hpp
+//
+// Copyright (c) 2014 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <boost/core/lightweight_test_trait.hpp>
+
+template<class T1, class T2> struct Y1
+{
+ enum { value = 1 };
+};
+
+template<class T1, class T2> struct Y2
+{
+ enum { value = 0 };
+};
+
+struct X1
+{
+ typedef int type;
+};
+
+struct X2
+{
+ typedef int type;
+};
+
+int main()
+{
+ // BOOST_TEST_TRAIT_TRUE
+
+ BOOST_TEST_TRAIT_TRUE(( Y1<X1::type, X2::type> ));
+
+ // BOOST_TEST_TRAIT_FALSE
+
+ BOOST_TEST_TRAIT_FALSE(( Y2<X1::type, X2::type> ));
+
+ return boost::report_errors();
+}
diff --git a/test/noncopyable_compile_fail.cpp b/test/noncopyable_compile_fail.cpp
new file mode 100644
index 0000000..f1f0293
--- /dev/null
+++ b/test/noncopyable_compile_fail.cpp
@@ -0,0 +1,36 @@
+// boost class noncopyable test program ------------------------------------//
+
+// (C) Copyright Beman Dawes 1999. 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 for most recent version including documentation.
+
+// Revision History
+// 9 Jun 99 Add unnamed namespace
+// 2 Jun 99 Initial Version
+
+#include <boost/noncopyable.hpp>
+#include <iostream>
+
+// This program demonstrates compiler errors resulting from trying to copy
+// construct or copy assign a class object derived from class noncopyable.
+
+namespace
+{
+ class DontTreadOnMe : private boost::noncopyable
+ {
+ public:
+ DontTreadOnMe() { std::cout << "defanged!" << std::endl; }
+ }; // DontTreadOnMe
+
+} // unnamed namespace
+
+int main()
+{
+ DontTreadOnMe object1;
+ DontTreadOnMe object2(object1);
+ object1 = object2;
+ return 0;
+} // main
+
diff --git a/test/pointer_traits_difference_type_test.cpp b/test/pointer_traits_difference_type_test.cpp
new file mode 100644
index 0000000..e9d0b09
--- /dev/null
+++ b/test/pointer_traits_difference_type_test.cpp
@@ -0,0 +1,41 @@
+/*
+Copyright 2017 Glen Joseph Fernandes
+(glenjofe@gmail.com)
+
+Distributed under the Boost Software License, Version 1.0.
+(http://www.boost.org/LICENSE_1_0.txt)
+*/
+#include <boost/core/pointer_traits.hpp>
+#include <boost/core/is_same.hpp>
+#include <boost/core/lightweight_test_trait.hpp>
+
+template<class T>
+struct P { };
+
+template<class T>
+struct E {
+ typedef long difference_type;
+};
+
+int main()
+{
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<std::ptrdiff_t,
+ boost::pointer_traits<int*>::difference_type>));
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<std::ptrdiff_t,
+ boost::pointer_traits<P<int> >::difference_type>));
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<long,
+ boost::pointer_traits<E<int> >::difference_type>));
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<std::ptrdiff_t,
+ boost::pointer_traits<void*>::difference_type>));
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<std::ptrdiff_t,
+ boost::pointer_traits<P<void> >::difference_type>));
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<long,
+ boost::pointer_traits<E<void> >::difference_type>));
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<std::ptrdiff_t,
+ boost::pointer_traits<const int*>::difference_type>));
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<std::ptrdiff_t,
+ boost::pointer_traits<P<const int> >::difference_type>));
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<long,
+ boost::pointer_traits<E<const int> >::difference_type>));
+ return boost::report_errors();
+}
diff --git a/test/pointer_traits_element_type_test.cpp b/test/pointer_traits_element_type_test.cpp
new file mode 100644
index 0000000..a20733e
--- /dev/null
+++ b/test/pointer_traits_element_type_test.cpp
@@ -0,0 +1,83 @@
+/*
+Copyright 2017 Glen Joseph Fernandes
+(glenjofe@gmail.com)
+
+Distributed under the Boost Software License, Version 1.0.
+(http://www.boost.org/LICENSE_1_0.txt)
+*/
+#include <boost/core/pointer_traits.hpp>
+#include <boost/core/is_same.hpp>
+#include <boost/core/lightweight_test_trait.hpp>
+
+template<class T>
+struct P1 { };
+
+template<class T1, class T2>
+struct P2 { };
+
+template<class T1, class T2, class T3>
+struct P3 { };
+
+template<class T>
+struct E1 {
+ typedef bool element_type;
+};
+
+template<class T1, class T2>
+struct E2 {
+ typedef bool element_type;
+};
+
+template<class T1, class T2, class T3>
+struct E3 {
+ typedef bool element_type;
+};
+
+#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
+template<class T, class... U>
+struct P { };
+
+template<class T, class... U>
+struct E {
+ typedef bool element_type;
+};
+#endif
+
+int main()
+{
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<int,
+ boost::pointer_traits<int*>::element_type>));
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<int,
+ boost::pointer_traits<P1<int> >::element_type>));
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<int,
+ boost::pointer_traits<P2<int, char> >::element_type>));
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<int,
+ boost::pointer_traits<P3<int, char, char> >::element_type>));
+#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<int,
+ boost::pointer_traits<P<int, char, char, char> >::element_type>));
+#endif
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<bool,
+ boost::pointer_traits<E1<int> >::element_type>));
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<bool,
+ boost::pointer_traits<E2<int, int> >::element_type>));
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<bool,
+ boost::pointer_traits<E3<int, int, int> >::element_type>));
+#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<bool,
+ boost::pointer_traits<E<int, int, int, int> >::element_type>));
+#endif
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<void,
+ boost::pointer_traits<void*>::element_type>));
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<void,
+ boost::pointer_traits<P1<void> >::element_type>));
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<bool,
+ boost::pointer_traits<E1<void> >::element_type>));
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<const int,
+ boost::pointer_traits<const int*>::element_type>));
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<const int,
+ boost::pointer_traits<P1<const int> >::element_type>));
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<bool,
+ boost::pointer_traits<E1<const int> >::element_type>));
+ return boost::report_errors();
+}
diff --git a/test/pointer_traits_pointer_test.cpp b/test/pointer_traits_pointer_test.cpp
new file mode 100644
index 0000000..a98eb4d
--- /dev/null
+++ b/test/pointer_traits_pointer_test.cpp
@@ -0,0 +1,30 @@
+/*
+Copyright 2017 Glen Joseph Fernandes
+(glenjofe@gmail.com)
+
+Distributed under the Boost Software License, Version 1.0.
+(http://www.boost.org/LICENSE_1_0.txt)
+*/
+#include <boost/core/pointer_traits.hpp>
+#include <boost/core/is_same.hpp>
+#include <boost/core/lightweight_test_trait.hpp>
+
+template<class T>
+struct P { };
+
+int main()
+{
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<int*,
+ boost::pointer_traits<int*>::pointer>));
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<P<int>,
+ boost::pointer_traits<P<int> >::pointer>));
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<void*,
+ boost::pointer_traits<void*>::pointer>));
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<P<void>,
+ boost::pointer_traits<P<void> >::pointer>));
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<const int*,
+ boost::pointer_traits<const int*>::pointer>));
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<P<const int>,
+ boost::pointer_traits<P<const int> >::pointer>));
+ return boost::report_errors();
+}
diff --git a/test/pointer_traits_pointer_to_test.cpp b/test/pointer_traits_pointer_to_test.cpp
new file mode 100644
index 0000000..33e21ad
--- /dev/null
+++ b/test/pointer_traits_pointer_to_test.cpp
@@ -0,0 +1,63 @@
+/*
+Copyright 2017 Glen Joseph Fernandes
+(glenjofe@gmail.com)
+
+Distributed under the Boost Software License, Version 1.0.
+(http://www.boost.org/LICENSE_1_0.txt)
+*/
+#include <boost/core/pointer_traits.hpp>
+#include <boost/core/lightweight_test.hpp>
+
+template<class T>
+class pointer {
+public:
+ typedef typename boost::pointer_traits<T>::element_type element_type;
+ pointer(T value)
+ : value_(value) { }
+ T get() const BOOST_NOEXCEPT {
+ return value_;
+ }
+ static pointer<T> pointer_to(element_type& value) {
+ return pointer<T>(&value);
+ }
+private:
+ T value_;
+};
+
+template<class T>
+inline bool
+operator==(const pointer<T>& lhs, const pointer<T>& rhs) BOOST_NOEXCEPT
+{
+ return lhs.get() == rhs.get();
+}
+
+int main()
+{
+ int i = 0;
+ {
+ typedef int* type;
+ type p = &i;
+ BOOST_TEST(boost::pointer_traits<type>::pointer_to(i) == p);
+ }
+ {
+ typedef pointer<int*> type;
+ type p(&i);
+ BOOST_TEST(boost::pointer_traits<type>::pointer_to(i) == p);
+ }
+ {
+ typedef pointer<pointer<int*> > type;
+ type p(&i);
+ BOOST_TEST(boost::pointer_traits<type>::pointer_to(i) == p);
+ }
+ {
+ typedef const int* type;
+ type p = &i;
+ BOOST_TEST(boost::pointer_traits<type>::pointer_to(i) == p);
+ }
+ {
+ typedef pointer<const int*> type;
+ type p(&i);
+ BOOST_TEST(boost::pointer_traits<type>::pointer_to(i) == p);
+ }
+ return boost::report_errors();
+}
diff --git a/test/pointer_traits_rebind_test.cpp b/test/pointer_traits_rebind_test.cpp
new file mode 100644
index 0000000..999d195
--- /dev/null
+++ b/test/pointer_traits_rebind_test.cpp
@@ -0,0 +1,107 @@
+/*
+Copyright 2017 Glen Joseph Fernandes
+(glenjofe@gmail.com)
+
+Distributed under the Boost Software License, Version 1.0.
+(http://www.boost.org/LICENSE_1_0.txt)
+*/
+#include <boost/core/pointer_traits.hpp>
+#include <boost/core/is_same.hpp>
+#include <boost/core/lightweight_test_trait.hpp>
+
+template<class T>
+struct P1 { };
+
+template<class T1, class T2>
+struct P2 { };
+
+template<class T1, class T2, class T3>
+struct P3 { };
+
+#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
+template<class T>
+struct E1 {
+ template<class U>
+ using rebind = E1<bool>;
+};
+
+template<class T1, class T2>
+struct E2 {
+ template<class U>
+ using rebind = E2<bool, T2>;
+};
+
+template<class T1, class T2, class T3>
+struct E3 {
+ template<class U>
+ using rebind = E3<bool, T2, T3>;
+};
+#endif
+
+#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
+template<class T, class... U>
+struct P { };
+
+#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
+template<class T, class... U>
+struct E {
+ template<class V>
+ using rebind = E<bool, U...>;
+};
+#endif
+#endif
+
+struct R { };
+
+int main()
+{
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<char*,
+ boost::pointer_traits<R*>::rebind_to<char>::type>));
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<P1<char>,
+ boost::pointer_traits<P1<R> >::rebind_to<char>::type>));
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<P2<char, R>,
+ boost::pointer_traits<P2<R, R> >::rebind_to<char>::type>));
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<P3<char, R, R>,
+ boost::pointer_traits<P3<R, R, R> >::rebind_to<char>::type>));
+#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<P<char, R, R, R>,
+ boost::pointer_traits<P<R, R, R, R> >::rebind_to<char>::type>));
+#endif
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<void*,
+ boost::pointer_traits<R*>::rebind_to<void>::type>));
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<P1<void>,
+ boost::pointer_traits<P1<R> >::rebind_to<void>::type>));
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<R*,
+ boost::pointer_traits<void*>::rebind_to<R>::type>));
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<P1<R>,
+ boost::pointer_traits<P1<void> >::rebind_to<R>::type>));
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<const int*,
+ boost::pointer_traits<R*>::rebind_to<const int>::type>));
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<P1<const int>,
+ boost::pointer_traits<P1<R> >::rebind_to<const int>::type>));
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<int*,
+ boost::pointer_traits<const R*>::rebind_to<int>::type>));
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<P1<int>,
+ boost::pointer_traits<P1<const R> >::rebind_to<int>::type>));
+#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<E1<bool>,
+ boost::pointer_traits<E1<R> >::rebind_to<char>::type>));
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<E2<bool, R>,
+ boost::pointer_traits<E2<R, R> >::rebind_to<char>::type>));
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<E3<bool, R, R>,
+ boost::pointer_traits<E3<R, R, R> >::rebind_to<char>::type>));
+#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<E<bool, R, R, R>,
+ boost::pointer_traits<E<R, R, R, R> >::rebind_to<char>::type>));
+#endif
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<E1<bool>,
+ boost::pointer_traits<E1<R> >::rebind_to<void>::type>));
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<E1<bool>,
+ boost::pointer_traits<E1<void> >::rebind_to<R>::type>));
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<E1<bool>,
+ boost::pointer_traits<E1<R> >::rebind_to<const int>::type>));
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same<E1<bool>,
+ boost::pointer_traits<E1<const R> >::rebind_to<int>::type>));
+#endif
+ return boost::report_errors();
+}
diff --git a/test/quick.cpp b/test/quick.cpp
new file mode 100644
index 0000000..c043f69
--- /dev/null
+++ b/test/quick.cpp
@@ -0,0 +1,34 @@
+//
+// quick.cpp - a quick (CI) test for Boost.Core
+//
+// Copyright 2017 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+//
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <boost/core/addressof.hpp>
+#include <boost/core/checked_delete.hpp>
+#include <boost/core/demangle.hpp>
+#include <boost/detail/iterator.hpp>
+#include <boost/core/enable_if.hpp>
+#include <boost/core/explicit_operator_bool.hpp>
+#include <boost/get_pointer.hpp>
+#include <boost/core/ignore_unused.hpp>
+#include <boost/core/is_same.hpp>
+#include <boost/core/lightweight_test.hpp>
+#include <boost/noncopyable.hpp>
+#include <boost/core/null_deleter.hpp>
+#include <boost/core/pointer_traits.hpp>
+#include <boost/ref.hpp>
+#include <boost/core/scoped_enum.hpp>
+#include <boost/detail/sp_typeinfo.hpp>
+#include <boost/core/typeinfo.hpp>
+#include <boost/core/underlying_type.hpp>
+#include <boost/visit_each.hpp>
+
+int main()
+{
+}
diff --git a/test/ref_ct_test.cpp b/test/ref_ct_test.cpp
new file mode 100644
index 0000000..731d62d
--- /dev/null
+++ b/test/ref_ct_test.cpp
@@ -0,0 +1,121 @@
+// Copyright David Abrahams and Aleksey Gurtovoy
+// 2002-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)
+
+// compile-time test for "boost/ref.hpp" header content
+// see 'ref_test.cpp' for run-time part
+
+#include <boost/ref.hpp>
+#include <boost/core/is_same.hpp>
+#include <boost/static_assert.hpp>
+#include <boost/detail/workaround.hpp>
+
+namespace {
+
+template< typename T, typename U >
+void ref_test(boost::reference_wrapper<U>)
+{
+ typedef typename boost::reference_wrapper<U>::type type;
+ BOOST_STATIC_ASSERT((boost::core::is_same<U,type>::value));
+ BOOST_STATIC_ASSERT((boost::core::is_same<T,type>::value));
+}
+
+template< typename T >
+void assignable_test(T x)
+{
+ x = x;
+}
+
+template< bool R, typename T >
+void is_reference_wrapper_test(T)
+{
+ BOOST_STATIC_ASSERT(boost::is_reference_wrapper<T>::value == R);
+}
+
+template< typename R, typename Ref >
+void cxx_reference_test(Ref)
+{
+ BOOST_STATIC_ASSERT((boost::core::is_same<R,Ref>::value));
+}
+
+template< typename R, typename Ref >
+void unwrap_reference_test(Ref)
+{
+ typedef typename boost::unwrap_reference<Ref>::type type;
+ BOOST_STATIC_ASSERT((boost::core::is_same<R,type>::value));
+}
+
+} // namespace
+
+int main()
+{
+ int i = 0;
+ int& ri = i;
+
+ int const ci = 0;
+ int const& rci = ci;
+
+ // 'ref/cref' functions test
+ ref_test<int>(boost::ref(i));
+ ref_test<int>(boost::ref(ri));
+ ref_test<int const>(boost::ref(ci));
+ ref_test<int const>(boost::ref(rci));
+
+ ref_test<int const>(boost::cref(i));
+ ref_test<int const>(boost::cref(ri));
+ ref_test<int const>(boost::cref(ci));
+ ref_test<int const>(boost::cref(rci));
+
+ // test 'assignable' requirement
+ assignable_test(boost::ref(i));
+ assignable_test(boost::ref(ri));
+ assignable_test(boost::cref(i));
+ assignable_test(boost::cref(ci));
+ assignable_test(boost::cref(rci));
+
+ // 'is_reference_wrapper' test
+ is_reference_wrapper_test<true>(boost::ref(i));
+ is_reference_wrapper_test<true>(boost::ref(ri));
+ is_reference_wrapper_test<true>(boost::cref(i));
+ is_reference_wrapper_test<true>(boost::cref(ci));
+ is_reference_wrapper_test<true>(boost::cref(rci));
+
+ is_reference_wrapper_test<false>(i);
+ is_reference_wrapper_test<false, int&>(ri);
+ is_reference_wrapper_test<false>(ci);
+ is_reference_wrapper_test<false, int const&>(rci);
+
+ // ordinary references/function template arguments deduction test
+ cxx_reference_test<int>(i);
+ cxx_reference_test<int>(ri);
+ cxx_reference_test<int>(ci);
+ cxx_reference_test<int>(rci);
+
+ cxx_reference_test<int&, int&>(i);
+ cxx_reference_test<int&, int&>(ri);
+ cxx_reference_test<int const&, int const&>(i);
+ cxx_reference_test<int const&, int const&>(ri);
+ cxx_reference_test<int const&, int const&>(ci);
+ cxx_reference_test<int const&, int const&>(rci);
+
+ // 'unwrap_reference' test
+ unwrap_reference_test<int>(boost::ref(i));
+ unwrap_reference_test<int>(boost::ref(ri));
+ unwrap_reference_test<int const>(boost::cref(i));
+ unwrap_reference_test<int const>(boost::cref(ci));
+ unwrap_reference_test<int const>(boost::cref(rci));
+
+ unwrap_reference_test<int>(i);
+ unwrap_reference_test<int>(ri);
+ unwrap_reference_test<int>(ci);
+ unwrap_reference_test<int>(rci);
+ unwrap_reference_test<int&, int&>(i);
+ unwrap_reference_test<int&, int&>(ri);
+ unwrap_reference_test<int const&, int const&>(i);
+ unwrap_reference_test<int const&, int const&>(ri);
+ unwrap_reference_test<int const&, int const&>(ci);
+ unwrap_reference_test<int const&, int const&>(rci);
+
+ return 0;
+}
diff --git a/test/ref_cv_test.cpp b/test/ref_cv_test.cpp
new file mode 100644
index 0000000..734d9b3
--- /dev/null
+++ b/test/ref_cv_test.cpp
@@ -0,0 +1,35 @@
+// ref_cv_test.cpp: ref( x ) where x is of a cv-qualified type
+//
+// Copyright (c) 2017 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+
+#include <boost/ref.hpp>
+#include <boost/core/lightweight_test.hpp>
+
+#define BOOST_TEST_REF( x ) BOOST_TEST( &boost::ref( x ).get() == &x )
+#define BOOST_TEST_CREF( x ) BOOST_TEST( &boost::cref( x ).get() == &x )
+
+int main()
+{
+ int x1 = 1;
+ int const x2 = 2;
+ int volatile x3 = 3;
+ int const volatile x4 = 4;
+
+ BOOST_TEST_REF( x1 );
+ BOOST_TEST_CREF( x1 );
+
+ BOOST_TEST_REF( x2 );
+ BOOST_TEST_CREF( x2 );
+
+ BOOST_TEST_REF( x3 );
+ BOOST_TEST_CREF( x3 );
+
+ BOOST_TEST_REF( x4 );
+ BOOST_TEST_CREF( x4 );
+
+ return boost::report_errors();
+}
diff --git a/test/ref_fn_test.cpp b/test/ref_fn_test.cpp
new file mode 100644
index 0000000..aec54e8
--- /dev/null
+++ b/test/ref_fn_test.cpp
@@ -0,0 +1,81 @@
+#include <boost/config.hpp>
+
+#if defined(BOOST_MSVC)
+#pragma warning(disable: 4786) // identifier truncated in debug info
+#pragma warning(disable: 4710) // function not inlined
+#pragma warning(disable: 4711) // function selected for automatic inline expansion
+#pragma warning(disable: 4514) // unreferenced inline removed
+#endif
+
+// ref_fn_test.cpp: ref( f )
+//
+// Copyright (c) 2008 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+
+#include <boost/ref.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+
+void f0()
+{
+}
+
+void f1(int)
+{
+}
+
+void f2(int, int)
+{
+}
+
+void f3(int, int, int)
+{
+}
+
+void f4(int, int, int, int)
+{
+}
+
+void f5(int, int, int, int, int)
+{
+}
+
+void f6(int, int, int, int, int, int)
+{
+}
+
+void f7(int, int, int, int, int, int, int)
+{
+}
+
+void f8(int, int, int, int, int, int, int, int)
+{
+}
+
+void f9(int, int, int, int, int, int, int, int, int)
+{
+}
+
+#define BOOST_TEST_REF( f ) BOOST_TEST( &boost::ref( f ).get() == &f )
+
+int main()
+{
+ int v = 0;
+ BOOST_TEST_REF( v );
+
+ BOOST_TEST_REF( f0 );
+ BOOST_TEST_REF( f1 );
+ BOOST_TEST_REF( f2 );
+ BOOST_TEST_REF( f3 );
+ BOOST_TEST_REF( f4 );
+ BOOST_TEST_REF( f5 );
+ BOOST_TEST_REF( f6 );
+ BOOST_TEST_REF( f7 );
+ BOOST_TEST_REF( f8 );
+ BOOST_TEST_REF( f9 );
+
+ return boost::report_errors();
+}
diff --git a/test/ref_implicit_fail.cpp b/test/ref_implicit_fail.cpp
new file mode 100644
index 0000000..a012f52
--- /dev/null
+++ b/test/ref_implicit_fail.cpp
@@ -0,0 +1,20 @@
+//
+// Rvalues should not implicitly convert to a reference_wrapper
+//
+// Copyright 2014 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <boost/ref.hpp>
+
+void f( boost::reference_wrapper< int > )
+{
+}
+
+int main()
+{
+ f( 1 ); // should fail
+}
diff --git a/test/ref_implicit_fail2.cpp b/test/ref_implicit_fail2.cpp
new file mode 100644
index 0000000..ff67630
--- /dev/null
+++ b/test/ref_implicit_fail2.cpp
@@ -0,0 +1,20 @@
+//
+// Rvalues should not implicitly convert to a reference_wrapper
+//
+// Copyright 2014 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <boost/ref.hpp>
+
+void f( boost::reference_wrapper< int const > )
+{
+}
+
+int main()
+{
+ f( 1 ); // should fail
+}
diff --git a/test/ref_ref_test.cpp b/test/ref_ref_test.cpp
new file mode 100644
index 0000000..46be561
--- /dev/null
+++ b/test/ref_ref_test.cpp
@@ -0,0 +1,64 @@
+//
+// Test that ref(ref(x)) does NOT collapse to ref(x)
+//
+// This irregularity of std::ref is questionable and breaks
+// existing Boost code such as proto::make_expr
+//
+// Copyright 2014 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <boost/ref.hpp>
+#include <boost/core/lightweight_test.hpp>
+
+template<class T> void test( T const & t )
+{
+ {
+ boost::reference_wrapper< T const > r = boost::ref( t );
+ BOOST_TEST_EQ( &r.get(), &t );
+ }
+
+ {
+ boost::reference_wrapper< T const > r = boost::cref( t );
+ BOOST_TEST_EQ( &r.get(), &t );
+ }
+}
+
+template<class T> void test_nonconst( T & t )
+{
+ {
+ boost::reference_wrapper< T > r = boost::ref( t );
+ BOOST_TEST_EQ( &r.get(), &t );
+ }
+
+ {
+ boost::reference_wrapper< T const > r = boost::cref( t );
+ BOOST_TEST_EQ( &r.get(), &t );
+ }
+}
+
+int main()
+{
+ int x = 0;
+
+ test( x );
+ test( boost::ref( x ) );
+ test( boost::cref( x ) );
+
+ test_nonconst( x );
+
+ {
+ boost::reference_wrapper< int > r = boost::ref( x );
+ test_nonconst( r );
+ }
+
+ {
+ boost::reference_wrapper< int const > r = boost::cref( x );
+ test_nonconst( r );
+ }
+
+ return boost::report_errors();
+}
diff --git a/test/ref_rv_fail1.cpp b/test/ref_rv_fail1.cpp
new file mode 100644
index 0000000..1c0a2e6
--- /dev/null
+++ b/test/ref_rv_fail1.cpp
@@ -0,0 +1,23 @@
+//
+// Test that a reference_wrapper can't be constructed from an rvalue
+//
+// Copyright 2014 Agustin Berge
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <boost/ref.hpp>
+
+#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+
+int main()
+{
+ boost::reference_wrapper<int const> r( 1 ); // this should produce an ERROR
+ (void)r;
+}
+
+#else
+# error To fail, this test requires rvalue references
+#endif
diff --git a/test/ref_rv_fail2.cpp b/test/ref_rv_fail2.cpp
new file mode 100644
index 0000000..8ce2680
--- /dev/null
+++ b/test/ref_rv_fail2.cpp
@@ -0,0 +1,17 @@
+//
+// Test that an rvalue can't be passed to ref()
+//
+// Copyright 2014 Agustin Berge
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <boost/ref.hpp>
+
+int main()
+{
+ boost::reference_wrapper<int> r = boost::ref( 2 ); // this should produce an ERROR
+ (void)r;
+}
diff --git a/test/ref_rv_fail3.cpp b/test/ref_rv_fail3.cpp
new file mode 100644
index 0000000..14b39b8
--- /dev/null
+++ b/test/ref_rv_fail3.cpp
@@ -0,0 +1,27 @@
+//
+// Test that a const rvalue can't be passed to ref()
+//
+// Copyright 2014 Agustin Berge
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <boost/ref.hpp>
+
+#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+
+struct X {};
+
+X const crv() { return X(); }
+
+int main()
+{
+ boost::reference_wrapper<X const> r = boost::ref( crv() ); // this should produce an ERROR
+ (void)r;
+}
+
+#else
+# error To fail, this test requires rvalue references
+#endif
diff --git a/test/ref_rv_fail4.cpp b/test/ref_rv_fail4.cpp
new file mode 100644
index 0000000..899de7b
--- /dev/null
+++ b/test/ref_rv_fail4.cpp
@@ -0,0 +1,24 @@
+//
+// Test that an rvalue can't be passed to cref()
+//
+// Copyright 2014 Agustin Berge
+// Copyright 2014 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <boost/ref.hpp>
+
+#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+
+int main()
+{
+ boost::reference_wrapper<int const> r = boost::cref( 2 ); // should fail
+ (void)r;
+}
+
+#else
+# error To fail, this test requires rvalue references.
+#endif
diff --git a/test/ref_rv_fail5.cpp b/test/ref_rv_fail5.cpp
new file mode 100644
index 0000000..ed18edf
--- /dev/null
+++ b/test/ref_rv_fail5.cpp
@@ -0,0 +1,28 @@
+//
+// Test that a const rvalue can't be passed to cref()
+//
+// Copyright 2014 Agustin Berge
+// Copyright 2014 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <boost/ref.hpp>
+
+#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+
+struct X {};
+
+X const crv() { return X(); }
+
+int main()
+{
+ boost::reference_wrapper<X const> r = boost::cref( crv() ); // must fail
+ (void)r;
+}
+
+#else
+# error To fail, this test requires rvalue references.
+#endif
diff --git a/test/ref_test.cpp b/test/ref_test.cpp
new file mode 100644
index 0000000..a8f5bd7
--- /dev/null
+++ b/test/ref_test.cpp
@@ -0,0 +1,101 @@
+// Copyright David Abrahams and Aleksey Gurtovoy
+// 2002-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)
+
+// run-time test for "boost/ref.hpp" header content
+// see 'ref_ct_test.cpp' for compile-time part
+
+#include <boost/ref.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+namespace {
+using namespace boost;
+
+template <class T>
+struct ref_wrapper
+{
+ // Used to verify implicit conversion
+ static T* get_pointer(T& x)
+ {
+ return &x;
+ }
+
+ static T const* get_const_pointer(T const& x)
+ {
+ return &x;
+ }
+
+ template <class Arg>
+ static T* passthru(Arg x)
+ {
+ return get_pointer(x);
+ }
+
+ template <class Arg>
+ static T const* cref_passthru(Arg x)
+ {
+ return get_const_pointer(x);
+ }
+
+ static void test(T x)
+ {
+ BOOST_TEST(passthru(ref(x)) == &x);
+ BOOST_TEST(&ref(x).get() == &x);
+
+ BOOST_TEST(cref_passthru(cref(x)) == &x);
+ BOOST_TEST(&cref(x).get() == &x);
+ }
+};
+
+struct copy_counter {
+ static int count_;
+ copy_counter(copy_counter const& /*other*/) {
+ ++count_;
+ }
+ copy_counter() {}
+ static void reset() { count_ = 0; }
+ static int count() { return copy_counter::count_; }
+};
+
+int copy_counter::count_ = 0;
+
+} // namespace unnamed
+
+template <class T>
+void do_unwrap(T t) {
+
+ /* typename unwrap_reference<T>::type& lt = */
+ unwrap_ref(t);
+
+}
+
+void unwrap_test() {
+
+ int i = 3;
+ const int ci = 2;
+
+ do_unwrap(i);
+ do_unwrap(ci);
+ do_unwrap(ref(i));
+ do_unwrap(cref(ci));
+ do_unwrap(ref(ci));
+
+ copy_counter cc;
+ BOOST_TEST(cc.count() == 0);
+
+ do_unwrap(cc);
+ do_unwrap(ref(cc));
+ do_unwrap(cref(cc));
+
+ BOOST_TEST(cc.count() == 1);
+ BOOST_TEST(unwrap_ref(ref(cc)).count() == 1);
+}
+
+int main()
+{
+ ref_wrapper<int>::test(1);
+ ref_wrapper<int const>::test(1);
+ unwrap_test();
+ return boost::report_errors();
+}
diff --git a/test/scoped_enum.cpp b/test/scoped_enum.cpp
new file mode 100644
index 0000000..2a83749
--- /dev/null
+++ b/test/scoped_enum.cpp
@@ -0,0 +1,157 @@
+/*
+ * Copyright Andrey Semashev 2014.
+ * 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)
+ */
+/*!
+ * \file scoped_enum.cpp
+ * \author Andrey Semashev
+ * \date 06.06.2014
+ *
+ * \brief This test checks that scoped enum emulation works similar to C++11 scoped enums.
+ */
+
+#include <boost/core/scoped_enum.hpp>
+#include <boost/core/lightweight_test.hpp>
+
+BOOST_SCOPED_ENUM_DECLARE_BEGIN(namespace_enum1)
+{
+ value0,
+ value1,
+ value2
+}
+BOOST_SCOPED_ENUM_DECLARE_END(namespace_enum1)
+
+BOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(namespace_enum2, unsigned char)
+{
+ // Checks that enum value names do not clash
+ value0 = 10,
+ value1 = 20,
+ value2 = 30
+}
+BOOST_SCOPED_ENUM_DECLARE_END(namespace_enum2)
+
+struct my_struct
+{
+ // Checks that declarations are valid in class scope
+ BOOST_SCOPED_ENUM_DECLARE_BEGIN(color)
+ {
+ red,
+ green,
+ blue
+ }
+ BOOST_SCOPED_ENUM_DECLARE_END(color)
+
+ color m_color;
+
+ explicit my_struct(color col) : m_color(col)
+ {
+ }
+
+ color get_color() const
+ {
+ return m_color;
+ }
+};
+
+void check_operators()
+{
+ namespace_enum1 enum1 = namespace_enum1::value0;
+ BOOST_TEST(enum1 == namespace_enum1::value0);
+ BOOST_TEST(enum1 != namespace_enum1::value1);
+ BOOST_TEST(enum1 != namespace_enum1::value2);
+
+ enum1 = namespace_enum1::value1;
+ BOOST_TEST(enum1 != namespace_enum1::value0);
+ BOOST_TEST(enum1 == namespace_enum1::value1);
+ BOOST_TEST(enum1 != namespace_enum1::value2);
+
+ BOOST_TEST(!(enum1 < namespace_enum1::value0));
+ BOOST_TEST(!(enum1 <= namespace_enum1::value0));
+ BOOST_TEST(enum1 >= namespace_enum1::value0);
+ BOOST_TEST(enum1 > namespace_enum1::value0);
+
+ BOOST_TEST(!(enum1 < namespace_enum1::value1));
+ BOOST_TEST(enum1 <= namespace_enum1::value1);
+ BOOST_TEST(enum1 >= namespace_enum1::value1);
+ BOOST_TEST(!(enum1 > namespace_enum1::value1));
+
+ namespace_enum1 enum2 = namespace_enum1::value0;
+ BOOST_TEST(enum1 != enum2);
+
+ enum2 = enum1;
+ BOOST_TEST(enum1 == enum2);
+}
+
+void check_argument_passing()
+{
+ my_struct str(my_struct::color::green);
+ BOOST_TEST(str.get_color() == my_struct::color::green);
+}
+
+void check_switch_case()
+{
+ my_struct str(my_struct::color::blue);
+
+ switch (boost::native_value(str.get_color()))
+ {
+ case my_struct::color::blue:
+ break;
+ default:
+ BOOST_ERROR("Unexpected color value in switch/case");
+ }
+}
+
+template< typename T >
+struct my_trait
+{
+ enum _ { value = 0 };
+};
+
+template< >
+struct my_trait< BOOST_SCOPED_ENUM_NATIVE(namespace_enum2) >
+{
+ enum _ { value = 1 };
+};
+
+template< typename T >
+void native_type_helper(T)
+{
+ BOOST_TEST(my_trait< T >::value != 0);
+}
+
+void check_native_type()
+{
+ BOOST_TEST(my_trait< int >::value == 0);
+ BOOST_TEST(my_trait< BOOST_SCOPED_ENUM_NATIVE(namespace_enum2) >::value != 0);
+ BOOST_TEST(my_trait< boost::native_type< namespace_enum2 >::type >::value != 0);
+
+ namespace_enum2 enum1 = namespace_enum2::value0;
+ native_type_helper(boost::native_value(enum1));
+}
+
+void check_underlying_cast()
+{
+ namespace_enum2 enum1 = namespace_enum2::value1;
+ BOOST_TEST(boost::underlying_cast< unsigned char >(enum1) == 20);
+}
+
+void check_underlying_type()
+{
+ // The real check for the type is in the underlying_type trait test.
+ namespace_enum2 enum1 = namespace_enum2::value1;
+ BOOST_TEST(sizeof(enum1) == sizeof(unsigned char));
+}
+
+int main(int, char*[])
+{
+ check_operators();
+ check_argument_passing();
+ check_switch_case();
+ check_native_type();
+ check_underlying_cast();
+ check_underlying_type();
+
+ return boost::report_errors();
+}
diff --git a/test/scoped_enum_compile_fail_conv_from_int.cpp b/test/scoped_enum_compile_fail_conv_from_int.cpp
new file mode 100644
index 0000000..2ff144f
--- /dev/null
+++ b/test/scoped_enum_compile_fail_conv_from_int.cpp
@@ -0,0 +1,30 @@
+/*
+ * Copyright Andrey Semashev 2014.
+ * 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)
+ */
+/*!
+ * \file scoped_enum_compile_fail_conv_from_int.cpp
+ * \author Andrey Semashev
+ * \date 06.06.2014
+ *
+ * \brief This test checks that scoped enum emulation prohibits implicit conversions from int
+ */
+
+#include <boost/core/scoped_enum.hpp>
+
+BOOST_SCOPED_ENUM_DECLARE_BEGIN(color)
+{
+ red,
+ green,
+ blue
+}
+BOOST_SCOPED_ENUM_DECLARE_END(color)
+
+int main(int, char*[])
+{
+ color col = 2;
+
+ return boost::native_value(col);
+}
diff --git a/test/scoped_enum_compile_fail_conv_to_int.cpp b/test/scoped_enum_compile_fail_conv_to_int.cpp
new file mode 100644
index 0000000..699e0bb
--- /dev/null
+++ b/test/scoped_enum_compile_fail_conv_to_int.cpp
@@ -0,0 +1,31 @@
+/*
+ * Copyright Andrey Semashev 2014.
+ * 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)
+ */
+/*!
+ * \file scoped_enum_compile_fail_conv_to_int.cpp
+ * \author Andrey Semashev
+ * \date 06.06.2014
+ *
+ * \brief This test checks that scoped enum emulation prohibits implicit conversions to int
+ */
+
+#include <boost/core/scoped_enum.hpp>
+
+BOOST_SCOPED_ENUM_DECLARE_BEGIN(color)
+{
+ red,
+ green,
+ blue
+}
+BOOST_SCOPED_ENUM_DECLARE_END(color)
+
+int main(int, char*[])
+{
+ color col = color::red;
+ int n = col;
+
+ return n;
+}
diff --git a/test/sp_typeinfo_test.cpp b/test/sp_typeinfo_test.cpp
new file mode 100644
index 0000000..e29e576
--- /dev/null
+++ b/test/sp_typeinfo_test.cpp
@@ -0,0 +1,51 @@
+//
+// sp_typeinfo_test.cpp
+//
+// Copyright (c) 2009 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <boost/detail/sp_typeinfo.hpp>
+#include <boost/detail/lightweight_test.hpp>
+#include <iostream>
+
+int main()
+{
+ BOOST_TEST( BOOST_SP_TYPEID( int ) == BOOST_SP_TYPEID( int ) );
+ BOOST_TEST( BOOST_SP_TYPEID( int ) != BOOST_SP_TYPEID( long ) );
+ BOOST_TEST( BOOST_SP_TYPEID( int ) != BOOST_SP_TYPEID( void ) );
+
+ boost::detail::sp_typeinfo const & ti = BOOST_SP_TYPEID( int );
+
+ boost::detail::sp_typeinfo const * pti = &BOOST_SP_TYPEID( int );
+ BOOST_TEST( *pti == ti );
+
+ BOOST_TEST( ti == ti );
+ BOOST_TEST( !( ti != ti ) );
+ BOOST_TEST( !ti.before( ti ) );
+
+ char const * nti = ti.name();
+ std::cout << nti << std::endl;
+
+ boost::detail::sp_typeinfo const & tv = BOOST_SP_TYPEID( void );
+
+ boost::detail::sp_typeinfo const * ptv = &BOOST_SP_TYPEID( void );
+ BOOST_TEST( *ptv == tv );
+
+ BOOST_TEST( tv == tv );
+ BOOST_TEST( !( tv != tv ) );
+ BOOST_TEST( !tv.before( tv ) );
+
+ char const * ntv = tv.name();
+ std::cout << ntv << std::endl;
+
+ BOOST_TEST( ti != tv );
+ BOOST_TEST( !( ti == tv ) );
+
+ BOOST_TEST( ti.before( tv ) != tv.before( ti ) );
+
+ return boost::report_errors();
+}
diff --git a/test/swap/Jamfile.v2 b/test/swap/Jamfile.v2
new file mode 100644
index 0000000..8384c93
--- /dev/null
+++ b/test/swap/Jamfile.v2
@@ -0,0 +1,62 @@
+# Copyright (c) 2007, 2008 Joseph Gauterin
+#
+# 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)
+
+# bring in rules for testing
+import testing ;
+
+local compile_tests =
+ root_header_1.cpp
+ root_header_2.cpp
+ lib_header_1.cpp
+ lib_header_2.cpp
+ mixed_headers_1.cpp
+ mixed_headers_2.cpp
+ ;
+
+local run_tests =
+ primitive.cpp
+ specialized_in_boost.cpp
+ specialized_in_global.cpp
+ specialized_in_other.cpp
+ specialized_in_std.cpp
+ specialized_in_boost_and_other.cpp
+ std_bitset.cpp
+ std_dateorder.cpp
+ std_string.cpp
+ std_typeinfo_ptr.cpp
+ std_vector_of_boost.cpp
+ std_vector_of_global.cpp
+ std_vector_of_other.cpp
+ no_ambiguity_in_boost.cpp
+ array_of_array_of_class.cpp
+ array_of_array_of_int.cpp
+ array_of_class.cpp
+ array_of_int.cpp
+ array_of_template.cpp
+ ;
+
+rule test_all
+{
+ local all_rules ;
+ local file ;
+
+ for file in $(compile_tests)
+ {
+ local test_name = [ MATCH "([^.]*).cpp$" : $(file) ] ;
+ all_rules += [ compile $(file) : : "swap-$(test_name)" ] ;
+ }
+
+ for file in $(run_tests)
+ {
+ local test_name = [ MATCH "([^.]*).cpp$" : $(file) ] ;
+ all_rules += [ run $(file) : : : : "swap-$(test_name)" ] ;
+ }
+
+ #ECHO All rules: $(all_rules) ;
+ return $(all_rules) ;
+}
+
+test-suite core/swap : [ test_all r ] ;
diff --git a/test/swap/array_of_array_of_class.cpp b/test/swap/array_of_array_of_class.cpp
new file mode 100644
index 0000000..67541d3
--- /dev/null
+++ b/test/swap/array_of_array_of_class.cpp
@@ -0,0 +1,70 @@
+// Copyright (c) 2008 Joseph Gauterin, Niels Dekker
+//
+// 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)
+
+// Tests swapping an array of arrays of swap_test_class objects by means of boost::swap.
+
+#include <boost/utility/swap.hpp>
+#include <boost/core/lightweight_test.hpp>
+#define BOOST_CHECK BOOST_TEST
+#define BOOST_CHECK_EQUAL BOOST_TEST_EQ
+
+//Put test class in the global namespace
+#include "./swap_test_class.hpp"
+
+#include <algorithm> //for std::copy and std::equal
+#include <cstddef> //for std::size_t
+
+//Provide swap function in both the namespace of swap_test_class
+//(which is the global namespace), and the std namespace.
+//It's common to provide a swap function for a class in both
+//namespaces. Scott Meyers recommends doing so: Effective C++,
+//Third Edition, item 25, "Consider support for a non-throwing swap".
+void swap(swap_test_class& left, swap_test_class& right)
+{
+ left.swap(right);
+}
+
+namespace std
+{
+ template <>
+ void swap(swap_test_class& left, swap_test_class& right)
+ {
+ left.swap(right);
+ }
+}
+
+
+int main()
+{
+ const std::size_t first_dimension = 3;
+ const std::size_t second_dimension = 4;
+ const std::size_t number_of_elements = first_dimension * second_dimension;
+
+ swap_test_class array1[first_dimension][second_dimension];
+ swap_test_class array2[first_dimension][second_dimension];
+
+ swap_test_class* const ptr1 = array1[0];
+ swap_test_class* const ptr2 = array2[0];
+
+ for (std::size_t i = 0; i < number_of_elements; ++i)
+ {
+ ptr1[i].set_data( static_cast<int>(i) );
+ ptr2[i].set_data( static_cast<int>(i + number_of_elements) );
+ }
+
+ boost::swap(array1, array2);
+
+ for (std::size_t i = 0; i < number_of_elements; ++i)
+ {
+ BOOST_CHECK_EQUAL(ptr1[i].get_data(), static_cast<int>(i + number_of_elements) );
+ BOOST_CHECK_EQUAL(ptr2[i].get_data(), static_cast<int>(i) );
+ }
+
+ BOOST_CHECK_EQUAL(swap_test_class::swap_count(), number_of_elements);
+ BOOST_CHECK_EQUAL(swap_test_class::copy_count(), 0);
+
+ return boost::report_errors();
+}
diff --git a/test/swap/array_of_array_of_int.cpp b/test/swap/array_of_array_of_int.cpp
new file mode 100644
index 0000000..3f9b239
--- /dev/null
+++ b/test/swap/array_of_array_of_int.cpp
@@ -0,0 +1,44 @@
+// Copyright (c) 2008 Joseph Gauterin, Niels Dekker
+//
+// 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)
+
+// Tests swapping an array of arrays of integers by means of boost::swap.
+
+#include <boost/utility/swap.hpp>
+#include <boost/core/lightweight_test.hpp>
+#define BOOST_CHECK BOOST_TEST
+#define BOOST_CHECK_EQUAL BOOST_TEST_EQ
+
+#include <algorithm> //for std::copy and std::equal
+#include <cstddef> //for std::size_t
+
+int main()
+{
+ const std::size_t first_dimension = 3;
+ const std::size_t second_dimension = 4;
+ const std::size_t number_of_elements = first_dimension * second_dimension;
+
+ int array1[first_dimension][second_dimension];
+ int array2[first_dimension][second_dimension];
+
+ int* const ptr1 = array1[0];
+ int* const ptr2 = array2[0];
+
+ for (std::size_t i = 0; i < number_of_elements; ++i)
+ {
+ ptr1[i] = static_cast<int>(i);
+ ptr2[i] = static_cast<int>(i + number_of_elements);
+ }
+
+ boost::swap(array1, array2);
+
+ for (std::size_t i = 0; i < number_of_elements; ++i)
+ {
+ BOOST_CHECK_EQUAL(ptr1[i], static_cast<int>(i + number_of_elements) );
+ BOOST_CHECK_EQUAL(ptr2[i], static_cast<int>(i) );
+ }
+
+ return boost::report_errors();
+}
diff --git a/test/swap/array_of_class.cpp b/test/swap/array_of_class.cpp
new file mode 100644
index 0000000..ef7327e
--- /dev/null
+++ b/test/swap/array_of_class.cpp
@@ -0,0 +1,62 @@
+// Copyright (c) 2008 Joseph Gauterin, Niels Dekker
+//
+// 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)
+
+// Tests swapping an array of arrays of swap_test_class objects by means of boost::swap.
+
+#include <boost/utility/swap.hpp>
+#include <boost/core/lightweight_test.hpp>
+#define BOOST_CHECK BOOST_TEST
+#define BOOST_CHECK_EQUAL BOOST_TEST_EQ
+
+//Put test class in the global namespace
+#include "./swap_test_class.hpp"
+
+#include <algorithm> //for std::copy and std::equal
+#include <cstddef> //for std::size_t
+
+//Provide swap function in both the namespace of swap_test_class
+//(which is the global namespace), and the std namespace.
+//It's common to provide a swap function for a class in both
+//namespaces. Scott Meyers recommends doing so: Effective C++,
+//Third Edition, item 25, "Consider support for a non-throwing swap".
+void swap(swap_test_class& left, swap_test_class& right)
+{
+ left.swap(right);
+}
+
+namespace std
+{
+ template <>
+ void swap(swap_test_class& left, swap_test_class& right)
+ {
+ left.swap(right);
+ }
+}
+
+
+int main()
+{
+ const std::size_t array_size = 2;
+ const swap_test_class initial_array1[array_size] = { swap_test_class(1), swap_test_class(2) };
+ const swap_test_class initial_array2[array_size] = { swap_test_class(3), swap_test_class(4) };
+
+ swap_test_class array1[array_size];
+ swap_test_class array2[array_size];
+
+ std::copy(initial_array1, initial_array1 + array_size, array1);
+ std::copy(initial_array2, initial_array2 + array_size, array2);
+
+ swap_test_class::reset();
+ boost::swap(array1, array2);
+
+ BOOST_CHECK(std::equal(array1, array1 + array_size, initial_array2));
+ BOOST_CHECK(std::equal(array2, array2 + array_size, initial_array1));
+
+ BOOST_CHECK_EQUAL(swap_test_class::swap_count(), array_size);
+ BOOST_CHECK_EQUAL(swap_test_class::copy_count(), 0);
+
+ return boost::report_errors();
+}
diff --git a/test/swap/array_of_int.cpp b/test/swap/array_of_int.cpp
new file mode 100644
index 0000000..e8285e0
--- /dev/null
+++ b/test/swap/array_of_int.cpp
@@ -0,0 +1,36 @@
+// Copyright (c) 2008 Joseph Gauterin, Niels Dekker
+//
+// 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)
+
+// Tests swapping an array of integers by means of boost::swap.
+
+#include <boost/utility/swap.hpp>
+#include <boost/core/lightweight_test.hpp>
+#define BOOST_CHECK BOOST_TEST
+#define BOOST_CHECK_EQUAL BOOST_TEST_EQ
+
+#include <algorithm> //for std::copy and std::equal
+#include <cstddef> //for std::size_t
+
+
+int main()
+{
+ const std::size_t array_size = 3;
+ const int initial_array1[array_size] = { 1, 2, 3 };
+ const int initial_array2[array_size] = { 4, 5, 6 };
+
+ int array1[array_size];
+ int array2[array_size];
+
+ std::copy(initial_array1, initial_array1 + array_size, array1);
+ std::copy(initial_array2, initial_array2 + array_size, array2);
+
+ boost::swap(array1, array2);
+
+ BOOST_CHECK(std::equal(array1, array1 + array_size, initial_array2));
+ BOOST_CHECK(std::equal(array2, array2 + array_size, initial_array1));
+
+ return boost::report_errors();
+}
diff --git a/test/swap/array_of_template.cpp b/test/swap/array_of_template.cpp
new file mode 100644
index 0000000..c0e76e3
--- /dev/null
+++ b/test/swap/array_of_template.cpp
@@ -0,0 +1,72 @@
+// Copyright (c) 2008 Joseph Gauterin, Niels Dekker
+//
+// 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)
+
+// Tests swapping an array of swap_test_template<int> objects by means of boost::swap.
+
+#include <boost/utility/swap.hpp>
+#include <boost/core/lightweight_test.hpp>
+#define BOOST_CHECK BOOST_TEST
+#define BOOST_CHECK_EQUAL BOOST_TEST_EQ
+
+//Put test class in the global namespace
+#include "./swap_test_class.hpp"
+
+#include <algorithm> //for std::copy and std::equal
+#include <cstddef> //for std::size_t
+
+template <class T>
+class swap_test_template
+{
+public:
+ typedef T template_argument;
+ swap_test_class swap_test_object;
+};
+
+template <class T>
+inline bool operator==(const swap_test_template<T> & lhs, const swap_test_template<T> & rhs)
+{
+ return lhs.swap_test_object == rhs.swap_test_object;
+}
+
+template <class T>
+inline bool operator!=(const swap_test_template<T> & lhs, const swap_test_template<T> & rhs)
+{
+ return !(lhs == rhs);
+}
+
+//Provide swap function in the namespace of swap_test_template
+//(which is the global namespace). Note that it isn't allowed to put
+//an overload of this function within the std namespace.
+template <class T>
+void swap(swap_test_template<T>& left, swap_test_template<T>& right)
+{
+ left.swap_test_object.swap(right.swap_test_object);
+}
+
+
+int main()
+{
+ const std::size_t array_size = 2;
+ const swap_test_template<int> initial_array1[array_size] = { swap_test_class(1), swap_test_class(2) };
+ const swap_test_template<int> initial_array2[array_size] = { swap_test_class(3), swap_test_class(4) };
+
+ swap_test_template<int> array1[array_size];
+ swap_test_template<int> array2[array_size];
+
+ std::copy(initial_array1, initial_array1 + array_size, array1);
+ std::copy(initial_array2, initial_array2 + array_size, array2);
+
+ swap_test_class::reset();
+ boost::swap(array1, array2);
+
+ BOOST_CHECK(std::equal(array1, array1 + array_size, initial_array2));
+ BOOST_CHECK(std::equal(array2, array2 + array_size, initial_array1));
+
+ BOOST_CHECK_EQUAL(swap_test_class::swap_count(), array_size);
+ BOOST_CHECK_EQUAL(swap_test_class::copy_count(), 0);
+
+ return boost::report_errors();
+}
diff --git a/test/swap/lib_header_1.cpp b/test/swap/lib_header_1.cpp
new file mode 100644
index 0000000..923dea6
--- /dev/null
+++ b/test/swap/lib_header_1.cpp
@@ -0,0 +1,10 @@
+// Copyright (c) 2007 Joseph Gauterin
+//
+// 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)
+
+// Tests that the swap header compiles as a standalone translation unit
+
+#include <boost/utility/swap.hpp>
+
diff --git a/test/swap/lib_header_2.cpp b/test/swap/lib_header_2.cpp
new file mode 100644
index 0000000..e88909d
--- /dev/null
+++ b/test/swap/lib_header_2.cpp
@@ -0,0 +1,11 @@
+// Copyright (c) 2007 Joseph Gauterin
+//
+// 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)
+
+// Tests that the swap header include guards work correctly
+
+#include <boost/utility/swap.hpp>
+#include <boost/utility/swap.hpp>
+
diff --git a/test/swap/mixed_headers_1.cpp b/test/swap/mixed_headers_1.cpp
new file mode 100644
index 0000000..cdb9fe5
--- /dev/null
+++ b/test/swap/mixed_headers_1.cpp
@@ -0,0 +1,11 @@
+// Copyright (c) 2007 Joseph Gauterin
+//
+// 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)
+
+// Tests that the swap headers work when both are included
+
+#include <boost/swap.hpp>
+#include <boost/utility/swap.hpp>
+
diff --git a/test/swap/mixed_headers_2.cpp b/test/swap/mixed_headers_2.cpp
new file mode 100644
index 0000000..94e9d87
--- /dev/null
+++ b/test/swap/mixed_headers_2.cpp
@@ -0,0 +1,12 @@
+// Copyright (c) 2007 Joseph Gauterin
+//
+// 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)
+
+// Tests that the swap headers work when both are included
+
+#include <boost/utility/swap.hpp>
+#include <boost/swap.hpp>
+
+
diff --git a/test/swap/no_ambiguity_in_boost.cpp b/test/swap/no_ambiguity_in_boost.cpp
new file mode 100644
index 0000000..795ffe3
--- /dev/null
+++ b/test/swap/no_ambiguity_in_boost.cpp
@@ -0,0 +1,45 @@
+// Copyright (c) 2008 Joseph Gauterin, Niels Dekker
+//
+// 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)
+
+// boost::swap internally does an unqualified function call to swap.
+// This could have led to ambiguity or infinite recursion, when the
+// objects to be swapped would themselves be from the boost namespace.
+// If so, boost::swap itself might be found by argument dependent lookup.
+// The implementation of boost::swap resolves this issue by giving
+// boost::swap two template argumetns, thereby making it less specialized
+// than std::swap.
+
+#include <boost/utility/swap.hpp>
+#include <boost/core/lightweight_test.hpp>
+#define BOOST_CHECK BOOST_TEST
+#define BOOST_CHECK_EQUAL BOOST_TEST_EQ
+
+//Put test class in namespace boost
+namespace boost
+{
+ #include "./swap_test_class.hpp"
+}
+
+
+int main()
+{
+ const boost::swap_test_class initial_value1(1);
+ const boost::swap_test_class initial_value2(2);
+
+ boost::swap_test_class object1 = initial_value1;
+ boost::swap_test_class object2 = initial_value2;
+
+ boost::swap_test_class::reset();
+ boost::swap(object1,object2);
+
+ BOOST_CHECK(object1 == initial_value2);
+ BOOST_CHECK(object2 == initial_value1);
+ BOOST_CHECK_EQUAL(boost::swap_test_class::swap_count(),0);
+ BOOST_CHECK_EQUAL(boost::swap_test_class::copy_count(),3);
+
+ return boost::report_errors();
+}
+
diff --git a/test/swap/primitive.cpp b/test/swap/primitive.cpp
new file mode 100644
index 0000000..a996f01
--- /dev/null
+++ b/test/swap/primitive.cpp
@@ -0,0 +1,24 @@
+// Copyright (c) 2007 Joseph Gauterin
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#include <boost/utility/swap.hpp>
+#include <boost/core/lightweight_test.hpp>
+#define BOOST_CHECK BOOST_TEST
+#define BOOST_CHECK_EQUAL BOOST_TEST_EQ
+
+int main()
+{
+ int object1 = 1;
+ int object2 = 2;
+
+ boost::swap(object1,object2);
+
+ BOOST_CHECK_EQUAL(object1,2);
+ BOOST_CHECK_EQUAL(object2,1);
+
+ return boost::report_errors();
+}
+
diff --git a/test/swap/root_header_1.cpp b/test/swap/root_header_1.cpp
new file mode 100644
index 0000000..575d2cb
--- /dev/null
+++ b/test/swap/root_header_1.cpp
@@ -0,0 +1,10 @@
+// Copyright (c) 2007 Joseph Gauterin
+//
+// 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)
+
+// Tests that the swap header compiles as a standalone translation unit
+
+#include <boost/swap.hpp>
+
diff --git a/test/swap/root_header_2.cpp b/test/swap/root_header_2.cpp
new file mode 100644
index 0000000..d26b3a6
--- /dev/null
+++ b/test/swap/root_header_2.cpp
@@ -0,0 +1,11 @@
+// Copyright (c) 2007 Joseph Gauterin
+//
+// 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)
+
+// Tests that the swap header include guards work correctly
+
+#include <boost/swap.hpp>
+#include <boost/swap.hpp>
+
diff --git a/test/swap/specialized_in_boost.cpp b/test/swap/specialized_in_boost.cpp
new file mode 100644
index 0000000..dcb015d
--- /dev/null
+++ b/test/swap/specialized_in_boost.cpp
@@ -0,0 +1,46 @@
+// Copyright (c) 2007 Joseph Gauterin
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#include <boost/utility/swap.hpp>
+#include <boost/core/lightweight_test.hpp>
+#define BOOST_CHECK BOOST_TEST
+#define BOOST_CHECK_EQUAL BOOST_TEST_EQ
+
+//Put test class in namespace boost
+namespace boost
+{
+ #include "./swap_test_class.hpp"
+}
+
+//Provide swap function in namespace boost
+namespace boost
+{
+ void swap(swap_test_class& left, swap_test_class& right)
+ {
+ left.swap(right);
+ }
+}
+
+int main()
+{
+ const boost::swap_test_class initial_value1(1);
+ const boost::swap_test_class initial_value2(2);
+
+ boost::swap_test_class object1 = initial_value1;
+ boost::swap_test_class object2 = initial_value2;
+
+ boost::swap_test_class::reset();
+ boost::swap(object1,object2);
+
+ BOOST_CHECK(object1 == initial_value2);
+ BOOST_CHECK(object2 == initial_value1);
+
+ BOOST_CHECK_EQUAL(boost::swap_test_class::swap_count(),1);
+ BOOST_CHECK_EQUAL(boost::swap_test_class::copy_count(),0);
+
+ return boost::report_errors();
+}
+
diff --git a/test/swap/specialized_in_boost_and_other.cpp b/test/swap/specialized_in_boost_and_other.cpp
new file mode 100644
index 0000000..d596775
--- /dev/null
+++ b/test/swap/specialized_in_boost_and_other.cpp
@@ -0,0 +1,65 @@
+// Copyright (c) 2008 Joseph Gauterin, Niels Dekker
+//
+// 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)
+
+// Tests whether instances of a class from a namespace other than boost are
+// properly swapped, when both boost and the other namespace have a custom
+// swap function for that class. Note that it shouldn't be necessary for a class
+// in an other namespace to have a custom swap function in boost, because the
+// boost::swap utility should find the swap function in the other namespace, by
+// argument dependent lookup (ADL). Unfortunately ADL isn't fully implemented
+// by some specific compiler versions, including Intel C++ 8.1, MSVC 7.1, and
+// Borland 5.9.3. Users of those compilers might consider adding a swap overload
+// to the boost namespace.
+
+#include <boost/utility/swap.hpp>
+#include <boost/core/lightweight_test.hpp>
+#define BOOST_CHECK BOOST_TEST
+#define BOOST_CHECK_EQUAL BOOST_TEST_EQ
+
+//Put test class in namespace other
+namespace other
+{
+ #include "./swap_test_class.hpp"
+}
+
+//Provide swap function in namespace boost
+namespace boost
+{
+ void swap(::other::swap_test_class& left, ::other::swap_test_class& right)
+ {
+ left.swap(right);
+ }
+}
+
+//Provide swap function in namespace other
+namespace other
+{
+ void swap(swap_test_class& left, swap_test_class& right)
+ {
+ left.swap(right);
+ }
+}
+
+int main()
+{
+ const other::swap_test_class initial_value1(1);
+ const other::swap_test_class initial_value2(2);
+
+ other::swap_test_class object1 = initial_value1;
+ other::swap_test_class object2 = initial_value2;
+
+ other::swap_test_class::reset();
+ boost::swap(object1,object2);
+
+ BOOST_CHECK(object1 == initial_value2);
+ BOOST_CHECK(object2 == initial_value1);
+
+ BOOST_CHECK_EQUAL(other::swap_test_class::swap_count(),1);
+ BOOST_CHECK_EQUAL(other::swap_test_class::copy_count(),0);
+
+ return boost::report_errors();
+}
+
diff --git a/test/swap/specialized_in_global.cpp b/test/swap/specialized_in_global.cpp
new file mode 100644
index 0000000..8b0f10a
--- /dev/null
+++ b/test/swap/specialized_in_global.cpp
@@ -0,0 +1,40 @@
+// Copyright (c) 2007 Joseph Gauterin
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#include <boost/utility/swap.hpp>
+#include <boost/core/lightweight_test.hpp>
+#define BOOST_CHECK BOOST_TEST
+#define BOOST_CHECK_EQUAL BOOST_TEST_EQ
+
+//Put test class in the global namespace
+#include "./swap_test_class.hpp"
+
+//Provide swap function in gloabl namespace
+void swap(swap_test_class& left, swap_test_class& right)
+{
+ left.swap(right);
+}
+
+int main()
+{
+ const swap_test_class initial_value1(1);
+ const swap_test_class initial_value2(2);
+
+ swap_test_class object1 = initial_value1;
+ swap_test_class object2 = initial_value2;
+
+ swap_test_class::reset();
+ boost::swap(object1,object2);
+
+ BOOST_CHECK(object1 == initial_value2);
+ BOOST_CHECK(object2 == initial_value1);
+
+ BOOST_CHECK_EQUAL(swap_test_class::swap_count(),1);
+ BOOST_CHECK_EQUAL(swap_test_class::copy_count(),0);
+
+ return boost::report_errors();
+}
+
diff --git a/test/swap/specialized_in_other.cpp b/test/swap/specialized_in_other.cpp
new file mode 100644
index 0000000..016cc8a
--- /dev/null
+++ b/test/swap/specialized_in_other.cpp
@@ -0,0 +1,46 @@
+// Copyright (c) 2007 Joseph Gauterin
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#include <boost/utility/swap.hpp>
+#include <boost/core/lightweight_test.hpp>
+#define BOOST_CHECK BOOST_TEST
+#define BOOST_CHECK_EQUAL BOOST_TEST_EQ
+
+//Put test class in namespace other
+namespace other
+{
+ #include "./swap_test_class.hpp"
+}
+
+//Provide swap function in namespace other
+namespace other
+{
+ void swap(swap_test_class& left, swap_test_class& right)
+ {
+ left.swap(right);
+ }
+}
+
+int main()
+{
+ const other::swap_test_class initial_value1(1);
+ const other::swap_test_class initial_value2(2);
+
+ other::swap_test_class object1 = initial_value1;
+ other::swap_test_class object2 = initial_value2;
+
+ other::swap_test_class::reset();
+ boost::swap(object1,object2);
+
+ BOOST_CHECK(object1 == initial_value2);
+ BOOST_CHECK(object2 == initial_value1);
+
+ BOOST_CHECK_EQUAL(other::swap_test_class::swap_count(),1);
+ BOOST_CHECK_EQUAL(other::swap_test_class::copy_count(),0);
+
+ return boost::report_errors();
+}
+
diff --git a/test/swap/specialized_in_std.cpp b/test/swap/specialized_in_std.cpp
new file mode 100644
index 0000000..62d4ee4
--- /dev/null
+++ b/test/swap/specialized_in_std.cpp
@@ -0,0 +1,45 @@
+// Copyright (c) 2007 Joseph Gauterin
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#include <boost/utility/swap.hpp>
+#include <boost/core/lightweight_test.hpp>
+#define BOOST_CHECK BOOST_TEST
+#define BOOST_CHECK_EQUAL BOOST_TEST_EQ
+
+//Put test class in the global namespace
+#include "./swap_test_class.hpp"
+
+
+//Provide swap function in namespace std
+namespace std
+{
+ template <>
+ void swap(swap_test_class& left, swap_test_class& right)
+ {
+ left.swap(right);
+ }
+}
+
+int main()
+{
+ const swap_test_class initial_value1(1);
+ const swap_test_class initial_value2(2);
+
+ swap_test_class object1 = initial_value1;
+ swap_test_class object2 = initial_value2;
+
+ swap_test_class::reset();
+ boost::swap(object1,object2);
+
+ BOOST_CHECK(object1 == initial_value2);
+ BOOST_CHECK(object2 == initial_value1);
+
+ BOOST_CHECK_EQUAL(swap_test_class::swap_count(),1);
+ BOOST_CHECK_EQUAL(swap_test_class::copy_count(),0);
+
+ return boost::report_errors();
+}
+
diff --git a/test/swap/std_bitset.cpp b/test/swap/std_bitset.cpp
new file mode 100644
index 0000000..6fc3ecb
--- /dev/null
+++ b/test/swap/std_bitset.cpp
@@ -0,0 +1,34 @@
+// Copyright (c) 2008 - 2010 Joseph Gauterin, Niels Dekker
+//
+// 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)
+
+// Tests swapping std::bitset<T> objects by means of boost::swap.
+// Unlike most other Standard C++ Library template classes,
+// std::bitset<T> does not have its own std::swap overload.
+
+#include <boost/utility/swap.hpp>
+#include <boost/core/lightweight_test.hpp>
+#define BOOST_CHECK BOOST_TEST
+#define BOOST_CHECK_EQUAL BOOST_TEST_EQ
+
+#include <bitset>
+
+int main()
+{
+ typedef std::bitset<8> bitset_type;
+ const bitset_type initial_value1 = 1;
+ const bitset_type initial_value2 = 2;
+
+ bitset_type object1 = initial_value1;
+ bitset_type object2 = initial_value2;
+
+ boost::swap(object1,object2);
+
+ BOOST_CHECK_EQUAL(object1,initial_value2);
+ BOOST_CHECK_EQUAL(object2,initial_value1);
+
+ return boost::report_errors();
+}
+
diff --git a/test/swap/std_dateorder.cpp b/test/swap/std_dateorder.cpp
new file mode 100644
index 0000000..7f6df73
--- /dev/null
+++ b/test/swap/std_dateorder.cpp
@@ -0,0 +1,33 @@
+// Copyright (c) 2008 Joseph Gauterin, Niels Dekker
+//
+// 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)
+
+// Tests swapping std::time_base::dateorder objects by means of boost::swap.
+// std::time_base::dateorder is an enumerated type. It does not have an
+// std::swap overload or template specialization.
+
+#include <boost/utility/swap.hpp>
+#include <boost/core/lightweight_test.hpp>
+#define BOOST_CHECK BOOST_TEST
+#define BOOST_CHECK_EQUAL BOOST_TEST_EQ
+
+#include <locale>
+
+int main()
+{
+ const std::time_base::dateorder initial_value1 = std::time_base::dmy;
+ const std::time_base::dateorder initial_value2 = std::time_base::mdy;
+
+ std::time_base::dateorder object1 = initial_value1;
+ std::time_base::dateorder object2 = initial_value2;
+
+ boost::swap(object1,object2);
+
+ BOOST_CHECK_EQUAL(object1,initial_value2);
+ BOOST_CHECK_EQUAL(object2,initial_value1);
+
+ return boost::report_errors();
+}
+
diff --git a/test/swap/std_string.cpp b/test/swap/std_string.cpp
new file mode 100644
index 0000000..128f3b5
--- /dev/null
+++ b/test/swap/std_string.cpp
@@ -0,0 +1,32 @@
+// Copyright (c) 2008 Joseph Gauterin, Niels Dekker
+//
+// 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)
+
+// Tests swapping std::string objects by means of boost::swap.
+// std::string has its own std::swap overload.
+
+#include <boost/utility/swap.hpp>
+#include <boost/core/lightweight_test.hpp>
+#define BOOST_CHECK BOOST_TEST
+#define BOOST_CHECK_EQUAL BOOST_TEST_EQ
+
+#include <string>
+
+int main()
+{
+ const std::string initial_value1 = "one";
+ const std::string initial_value2 = "two";
+
+ std::string object1 = initial_value1;
+ std::string object2 = initial_value2;
+
+ boost::swap(object1,object2);
+
+ BOOST_CHECK_EQUAL(object1,initial_value2);
+ BOOST_CHECK_EQUAL(object2,initial_value1);
+
+ return boost::report_errors();
+}
+
diff --git a/test/swap/std_typeinfo_ptr.cpp b/test/swap/std_typeinfo_ptr.cpp
new file mode 100644
index 0000000..10fd6e5
--- /dev/null
+++ b/test/swap/std_typeinfo_ptr.cpp
@@ -0,0 +1,33 @@
+// Copyright (c) 2008 Joseph Gauterin, Niels Dekker
+//
+// 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)
+
+// Tests swapping std::type_info pointers by means of boost::swap.
+// There is no std::swap overload or template specialization
+// for std::type_info pointers.
+
+#include <boost/utility/swap.hpp>
+#include <boost/core/lightweight_test.hpp>
+#define BOOST_CHECK BOOST_TEST
+#define BOOST_CHECK_EQUAL BOOST_TEST_EQ
+
+#include <typeinfo>
+
+int main()
+{
+ const std::type_info * const initial_value1 = 0;
+ const std::type_info * const initial_value2 = &typeid(double);
+
+ const std::type_info * ptr1 = initial_value1;
+ const std::type_info * ptr2 = initial_value2;
+
+ boost::swap(ptr1,ptr2);
+
+ BOOST_CHECK_EQUAL(ptr1,initial_value2);
+ BOOST_CHECK_EQUAL(ptr2,initial_value1);
+
+ return boost::report_errors();
+}
+
diff --git a/test/swap/std_vector_of_boost.cpp b/test/swap/std_vector_of_boost.cpp
new file mode 100644
index 0000000..93d5d61
--- /dev/null
+++ b/test/swap/std_vector_of_boost.cpp
@@ -0,0 +1,61 @@
+// Copyright (c) 2008 Joseph Gauterin, Niels Dekker
+//
+// 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)
+
+// Tests swapping std::vector objects by means of boost::swap,
+// having boost::swap_test_class as vector element type.
+
+#include <boost/utility/swap.hpp>
+#include <boost/core/lightweight_test.hpp>
+#define BOOST_CHECK BOOST_TEST
+#define BOOST_CHECK_EQUAL BOOST_TEST_EQ
+
+#include <vector>
+
+//Put test class in namespace boost
+namespace boost
+{
+ #include "./swap_test_class.hpp"
+}
+
+//Provide swap function in namespace boost
+namespace boost
+{
+ void swap(swap_test_class& left, swap_test_class& right)
+ {
+ left.swap(right);
+ }
+}
+
+int main()
+{
+ typedef boost::swap_test_class swap_test_class_type;
+ typedef std::vector<swap_test_class_type> vector_type;
+
+ const vector_type::size_type initial_size1 = 1;
+ const vector_type::size_type initial_size2 = 2;
+
+ const vector_type initial_value1(initial_size1, swap_test_class_type(1));
+ const vector_type initial_value2(initial_size2, swap_test_class_type(2));
+
+ vector_type object1 = initial_value1;
+ vector_type object2 = initial_value2;
+
+ swap_test_class_type::reset();
+
+ boost::swap(object1,object2);
+
+ BOOST_CHECK_EQUAL(object1.size(),initial_size2);
+ BOOST_CHECK_EQUAL(object2.size(),initial_size1);
+
+ BOOST_CHECK(object1 == initial_value2);
+ BOOST_CHECK(object2 == initial_value1);
+
+ BOOST_CHECK_EQUAL(swap_test_class_type::swap_count(),0);
+ BOOST_CHECK_EQUAL(swap_test_class_type::copy_count(),0);
+
+ return boost::report_errors();
+}
+
diff --git a/test/swap/std_vector_of_global.cpp b/test/swap/std_vector_of_global.cpp
new file mode 100644
index 0000000..08d6974
--- /dev/null
+++ b/test/swap/std_vector_of_global.cpp
@@ -0,0 +1,54 @@
+// Copyright (c) 2008 Joseph Gauterin, Niels Dekker
+//
+// 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)
+
+// Tests swapping std::vector objects by means of boost::swap,
+// having ::swap_test_class as vector element type.
+
+#include <boost/utility/swap.hpp>
+#include <boost/core/lightweight_test.hpp>
+#define BOOST_CHECK BOOST_TEST
+#define BOOST_CHECK_EQUAL BOOST_TEST_EQ
+
+#include <vector>
+
+//Put test class in the global namespace
+#include "./swap_test_class.hpp"
+
+//Provide swap function in the global namespace
+void swap(swap_test_class& left, swap_test_class& right)
+{
+ left.swap(right);
+}
+
+int main()
+{
+ typedef std::vector<swap_test_class> vector_type;
+
+ const vector_type::size_type initial_size1 = 1;
+ const vector_type::size_type initial_size2 = 2;
+
+ const vector_type initial_value1(initial_size1, swap_test_class(1));
+ const vector_type initial_value2(initial_size2, swap_test_class(2));
+
+ vector_type object1 = initial_value1;
+ vector_type object2 = initial_value2;
+
+ swap_test_class::reset();
+
+ boost::swap(object1,object2);
+
+ BOOST_CHECK_EQUAL(object1.size(),initial_size2);
+ BOOST_CHECK_EQUAL(object2.size(),initial_size1);
+
+ BOOST_CHECK(object1 == initial_value2);
+ BOOST_CHECK(object2 == initial_value1);
+
+ BOOST_CHECK_EQUAL(swap_test_class::swap_count(),0);
+ BOOST_CHECK_EQUAL(swap_test_class::copy_count(),0);
+
+ return boost::report_errors();
+}
+
diff --git a/test/swap/std_vector_of_other.cpp b/test/swap/std_vector_of_other.cpp
new file mode 100644
index 0000000..77a3525
--- /dev/null
+++ b/test/swap/std_vector_of_other.cpp
@@ -0,0 +1,61 @@
+// Copyright (c) 2008 Joseph Gauterin, Niels Dekker
+//
+// 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)
+
+// Tests swapping std::vector objects by means of boost::swap,
+// having other::swap_test_class as vector element type.
+
+#include <boost/utility/swap.hpp>
+#include <boost/core/lightweight_test.hpp>
+#define BOOST_CHECK BOOST_TEST
+#define BOOST_CHECK_EQUAL BOOST_TEST_EQ
+
+#include <vector>
+
+//Put test class in namespace other
+namespace other
+{
+ #include "./swap_test_class.hpp"
+}
+
+//Provide swap function in namespace other
+namespace other
+{
+ void swap(swap_test_class& left, swap_test_class& right)
+ {
+ left.swap(right);
+ }
+}
+
+int main()
+{
+ typedef other::swap_test_class swap_test_class_type;
+ typedef std::vector<swap_test_class_type> vector_type;
+
+ const vector_type::size_type initial_size1 = 1;
+ const vector_type::size_type initial_size2 = 2;
+
+ const vector_type initial_value1(initial_size1, swap_test_class_type(1));
+ const vector_type initial_value2(initial_size2, swap_test_class_type(2));
+
+ vector_type object1 = initial_value1;
+ vector_type object2 = initial_value2;
+
+ swap_test_class_type::reset();
+
+ boost::swap(object1,object2);
+
+ BOOST_CHECK_EQUAL(object1.size(),initial_size2);
+ BOOST_CHECK_EQUAL(object2.size(),initial_size1);
+
+ BOOST_CHECK(object1 == initial_value2);
+ BOOST_CHECK(object2 == initial_value1);
+
+ BOOST_CHECK_EQUAL(swap_test_class_type::swap_count(),0);
+ BOOST_CHECK_EQUAL(swap_test_class_type::copy_count(),0);
+
+ return boost::report_errors();
+}
+
diff --git a/test/swap/swap_test_class.hpp b/test/swap/swap_test_class.hpp
new file mode 100644
index 0000000..a25dbbd
--- /dev/null
+++ b/test/swap/swap_test_class.hpp
@@ -0,0 +1,114 @@
+// Copyright (c) 2007-2008 Joseph Gauterin
+//
+// 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)
+
+// Tests class used by the Boost.Swap tests
+
+#ifndef BOOST_UTILITY_SWAP_TEST_CLASS_HPP
+#define BOOST_UTILITY_SWAP_TEST_CLASS_HPP
+
+
+class swap_test_class
+{
+ int m_data;
+public:
+ explicit swap_test_class(int arg = 0)
+ :
+ m_data(arg)
+ {
+ ++constructCount();
+ }
+
+ ~swap_test_class()
+ {
+ ++destructCount();
+ }
+
+ swap_test_class(const swap_test_class& arg)
+ :
+ m_data(arg.m_data)
+ {
+ ++copyCount();
+ ++destructCount();
+ }
+
+ swap_test_class& operator=(const swap_test_class& arg)
+ {
+ m_data = arg.m_data;
+ ++copyCount();
+ return *this;
+ }
+
+ void swap(swap_test_class& other)
+ {
+ const int temp = m_data;
+ m_data = other.m_data;
+ other.m_data = temp;
+
+ ++swapCount();
+ }
+
+ int get_data() const
+ {
+ return m_data;
+ }
+
+ void set_data(int arg)
+ {
+ m_data = arg;
+ }
+
+ static unsigned int swap_count(){ return swapCount(); }
+ static unsigned int copy_count(){ return copyCount(); }
+ static unsigned int construct_count(){ return constructCount(); }
+ static unsigned int destruct_count(){ return destructCount(); }
+
+ static void reset()
+ {
+ swapCount() = 0;
+ copyCount() = 0;
+ constructCount() = 0;
+ destructCount() = 0;
+ }
+
+private:
+ static unsigned int& swapCount()
+ {
+ static unsigned int value = 0;
+ return value;
+ }
+
+ static unsigned int& copyCount()
+ {
+ static unsigned int value = 0;
+ return value;
+ }
+
+ static unsigned int& constructCount()
+ {
+ static unsigned int value = 0;
+ return value;
+ }
+
+ static unsigned int& destructCount()
+ {
+ static unsigned int value = 0;
+ return value;
+ }
+
+};
+
+
+inline bool operator==(const swap_test_class & lhs, const swap_test_class & rhs)
+{
+ return lhs.get_data() == rhs.get_data();
+}
+
+inline bool operator!=(const swap_test_class & lhs, const swap_test_class & rhs)
+{
+ return !(lhs == rhs);
+}
+
+#endif
diff --git a/test/to_address_test.cpp b/test/to_address_test.cpp
new file mode 100644
index 0000000..e1b55c4
--- /dev/null
+++ b/test/to_address_test.cpp
@@ -0,0 +1,158 @@
+/*
+Copyright 2017-2018 Glen Joseph Fernandes
+(glenjofe@gmail.com)
+
+Distributed under the Boost Software License, Version 1.0.
+(http://www.boost.org/LICENSE_1_0.txt)
+*/
+#include <boost/core/pointer_traits.hpp>
+#include <boost/core/lightweight_test.hpp>
+
+template<class T>
+class P1 {
+public:
+ explicit P1(T* p)
+ : p_(p) { }
+ T* operator->() const BOOST_NOEXCEPT {
+ return p_;
+ }
+private:
+ T* p_;
+};
+
+template<class T>
+class P2 {
+public:
+ explicit P2(T* p)
+ : p_(p) { }
+ P1<T> operator->() const BOOST_NOEXCEPT {
+ return p_;
+ }
+private:
+ P1<T> p_;
+};
+
+#if !defined(BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION)
+template<class T>
+class P3 {
+public:
+ explicit P3(T* p)
+ : p_(p) { }
+ T* get() const BOOST_NOEXCEPT {
+ return p_;
+ }
+private:
+ T* p_;
+};
+
+namespace boost {
+template<class T>
+struct pointer_traits<P3<T> > {
+ static T* to_address(const P3<T>& p) BOOST_NOEXCEPT {
+ return p.get();
+ }
+};
+} /* boost */
+
+template<class T>
+class P4 {
+public:
+ explicit P4(T* p)
+ : p_(p) { }
+ T* operator->() const BOOST_NOEXCEPT {
+ return 0;
+ }
+ T* get() const BOOST_NOEXCEPT {
+ return p_;
+ }
+private:
+ int* p_;
+};
+
+namespace boost {
+template<class T>
+struct pointer_traits<P4<T> > {
+ static T* to_address(const P4<T>& p) BOOST_NOEXCEPT {
+ return p.get();
+ }
+};
+} /* boost */
+
+#if !defined(BOOST_NO_CXX11_POINTER_TRAITS)
+template<class T>
+class P5 {
+public:
+ explicit P5(T* p)
+ : p_(p) { }
+ T* get() const BOOST_NOEXCEPT {
+ return p_;
+ }
+private:
+ T* p_;
+};
+
+namespace std {
+template<class T>
+struct pointer_traits<P5<T> > {
+ static T* to_address(const P5<T>& p) BOOST_NOEXCEPT {
+ return p.get();
+ }
+};
+} /* std */
+
+template<class T>
+class P6 {
+public:
+ explicit P6(T* p)
+ : p_(p) { }
+ T* get() const BOOST_NOEXCEPT {
+ return p_;
+ }
+private:
+ T* p_;
+};
+
+namespace boost {
+template<class T>
+struct pointer_traits<P6<T> > {
+ static T* to_address(const P6<T>& p) BOOST_NOEXCEPT {
+ return p.get();
+ }
+};
+} /* boost */
+
+namespace std {
+template<class T>
+struct pointer_traits<P6<T> > {
+ static T* to_address(const P6<T>& p) BOOST_NOEXCEPT {
+ return 0;
+ }
+};
+} /* std */
+#endif
+#endif
+
+int main()
+{
+ int i = 0;
+ BOOST_TEST(boost::to_address(&i) == &i);
+ int* p = &i;
+ BOOST_TEST(boost::to_address(p) == &i);
+ P1<int> p1(&i);
+ BOOST_TEST(boost::to_address(p1) == &i);
+ P2<int> p2(&i);
+ BOOST_TEST(boost::to_address(p2) == &i);
+#if !defined(BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION)
+ P3<int> p3(&i);
+ BOOST_TEST(boost::to_address(p3) == &i);
+ P4<int> p4(&i);
+ BOOST_TEST(boost::to_address(p4) == &i);
+#if !defined(BOOST_NO_CXX11_POINTER_TRAITS)
+ P5<int> p5(&i);
+ BOOST_TEST(boost::to_address(p5) == &i);
+ P6<int> p6(&i);
+ BOOST_TEST(boost::to_address(p6) == &i);
+#endif
+#endif
+ return boost::report_errors();
+}
diff --git a/test/typeinfo_test.cpp b/test/typeinfo_test.cpp
new file mode 100644
index 0000000..3e122bb
--- /dev/null
+++ b/test/typeinfo_test.cpp
@@ -0,0 +1,51 @@
+//
+// typeinfo_test.cpp
+//
+// Copyright (c) 2009 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <boost/core/typeinfo.hpp>
+#include <boost/core/lightweight_test.hpp>
+#include <iostream>
+
+int main()
+{
+ BOOST_TEST( BOOST_CORE_TYPEID( int ) == BOOST_CORE_TYPEID( int ) );
+ BOOST_TEST( BOOST_CORE_TYPEID( int ) != BOOST_CORE_TYPEID( long ) );
+ BOOST_TEST( BOOST_CORE_TYPEID( int ) != BOOST_CORE_TYPEID( void ) );
+
+ boost::core::typeinfo const & ti = BOOST_CORE_TYPEID( int );
+
+ boost::core::typeinfo const * pti = &BOOST_CORE_TYPEID( int );
+ BOOST_TEST( *pti == ti );
+
+ BOOST_TEST( ti == ti );
+ BOOST_TEST( !( ti != ti ) );
+ BOOST_TEST( !ti.before( ti ) );
+
+ char const * nti = ti.name();
+ std::cout << nti << std::endl;
+
+ boost::core::typeinfo const & tv = BOOST_CORE_TYPEID( void );
+
+ boost::core::typeinfo const * ptv = &BOOST_CORE_TYPEID( void );
+ BOOST_TEST( *ptv == tv );
+
+ BOOST_TEST( tv == tv );
+ BOOST_TEST( !( tv != tv ) );
+ BOOST_TEST( !tv.before( tv ) );
+
+ char const * ntv = tv.name();
+ std::cout << ntv << std::endl;
+
+ BOOST_TEST( ti != tv );
+ BOOST_TEST( !( ti == tv ) );
+
+ BOOST_TEST( ti.before( tv ) != tv.before( ti ) );
+
+ return boost::report_errors();
+}
diff --git a/test/underlying_type.cpp b/test/underlying_type.cpp
new file mode 100644
index 0000000..0823f58
--- /dev/null
+++ b/test/underlying_type.cpp
@@ -0,0 +1,68 @@
+/*
+ * Copyright Andrey Semashev 2014.
+ * 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)
+ */
+/*!
+ * \file underlying_type.cpp
+ * \author Andrey Semashev
+ * \date 06.06.2014
+ *
+ * \brief This test checks that underlying_type trait works.
+ */
+
+#include <boost/core/underlying_type.hpp>
+#include <boost/core/scoped_enum.hpp>
+#include <boost/core/lightweight_test_trait.hpp>
+#include <boost/core/is_same.hpp>
+#include <boost/config.hpp>
+
+BOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(emulated_enum, unsigned char)
+{
+ value0,
+ value1,
+ value2
+}
+BOOST_SCOPED_ENUM_DECLARE_END(emulated_enum)
+
+#if !defined(BOOST_NO_CXX11_SCOPED_ENUMS)
+
+enum class native_enum : unsigned short
+{
+ value0,
+ value1,
+ value2
+};
+
+#endif
+
+#if defined(BOOST_NO_UNDERLYING_TYPE)
+namespace boost {
+
+template< >
+struct underlying_type< emulated_enum >
+{
+ typedef unsigned char type;
+};
+
+#if !defined(BOOST_NO_CXX11_SCOPED_ENUMS)
+template< >
+struct underlying_type< native_enum >
+{
+ typedef unsigned short type;
+};
+#endif
+
+} // namespace boost
+#endif
+
+int main(int, char*[])
+{
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same< boost::underlying_type< emulated_enum >::type, unsigned char >));
+#if !defined(BOOST_NO_CXX11_SCOPED_ENUMS)
+ BOOST_TEST_TRAIT_TRUE((boost::core::is_same< boost::underlying_type< native_enum >::type, unsigned short >));
+#endif
+
+ return boost::report_errors();
+}
diff --git a/test/visit_each_test.cpp b/test/visit_each_test.cpp
new file mode 100644
index 0000000..726188e
--- /dev/null
+++ b/test/visit_each_test.cpp
@@ -0,0 +1,65 @@
+//
+// visit_each_test.cpp
+//
+// Copyright 2014 Peter Dimov
+//
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+
+#include <boost/visit_each.hpp>
+#include <boost/core/lightweight_test.hpp>
+#include <string>
+
+struct X
+{
+ int v;
+ std::string w;
+};
+
+template<class Visitor> inline void visit_each( Visitor & visitor, X const & x )
+{
+ using boost::visit_each;
+
+ visit_each( visitor, x.v );
+ visit_each( visitor, x.w );
+}
+
+struct V
+{
+ int s_;
+
+ V(): s_( 0 )
+ {
+ }
+
+ template< class T > void operator()( T const & t )
+ {
+ }
+
+ void operator()( int const & v )
+ {
+ s_ = s_ * 10 + v;
+ }
+
+ void operator()( std::string const & w )
+ {
+ s_ = s_ * 10 + w.size();
+ }
+};
+
+int main()
+{
+ X x = { 5, "test" };
+ V v;
+
+ {
+ using boost::visit_each;
+ visit_each( v, x );
+ }
+
+ BOOST_TEST( v.s_ == 54 );
+
+ return boost::report_errors();
+}