forked from boostorg/core
Move headers to core; add quickbook documentation
This commit is contained in:
@@ -1,24 +0,0 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title><boost/utility/addressof.hpp> Header Documentation</title>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
||||||
</head>
|
|
||||||
<body bgcolor="white" style="MARGIN-LEFT: 5%; MARGIN-RIGHT: 5%">
|
|
||||||
<p><a href="../../index.htm"> <img src="../../boost.png" alt="boost.png (6897 bytes)" width="277" height="86" border="0" /></a></p>
|
|
||||||
<h1><code><boost/utility/addressof.hpp></code></h1>
|
|
||||||
<p>
|
|
||||||
The header <code><boost/utility/addressof.hpp></code> defines the function template <code>boost::addressof</code>.
|
|
||||||
<code>boost::addressof(x)</code> returns the address of <code>x</code>. Ordinarily, this address can be obtained by
|
|
||||||
<code>&x</code>, but the unary <code>&</code> operator can be overloaded.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<code>boost::addressof</code> was originally contributed by Brad King based on ideas from discussion with Doug Gregor.
|
|
||||||
</p>
|
|
||||||
<hr />
|
|
||||||
<p>
|
|
||||||
<small>Copyright <20> 2014 by Peter Dimov. Distributed under the Boost Software License, Version
|
|
||||||
1.0. See accompanying file <a href="../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or
|
|
||||||
copy at <a href="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</a>.</small></p>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@@ -1,62 +1,19 @@
|
|||||||
|
# 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)
|
||||||
|
|
||||||
# Copyright John Maddock 2005. Use, modification, and distribution are
|
import quickbook ;
|
||||||
# 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)
|
|
||||||
|
|
||||||
project : requirements
|
xml core : core.qbk ;
|
||||||
# Path for links to Boost:
|
|
||||||
<xsl:param>boost.root=../../../..
|
|
||||||
|
|
||||||
# Some general style settings:
|
boostbook standalone
|
||||||
<xsl:param>table.footnote.number.format=1
|
:
|
||||||
<xsl:param>footnote.number.format=1
|
core
|
||||||
|
:
|
||||||
# HTML options first:
|
<xsl:param>boost.root=http://boost.org/doc/libs/master
|
||||||
# Use graphics not text for navigation:
|
<xsl:param>generate.section.toc.level=1
|
||||||
<xsl:param>navig.graphics=1
|
<xsl:param>toc.max.depth=1
|
||||||
# PDF Options:
|
;
|
||||||
# TOC Generation: this is needed for FOP-0.9 and later:
|
|
||||||
<xsl:param>fop1.extensions=0
|
|
||||||
<xsl:param>xep.extensions=1
|
|
||||||
# TOC generation: this is needed for FOP 0.2, but must not be set to zero for FOP-0.9!
|
|
||||||
<xsl:param>fop.extensions=0
|
|
||||||
# No indent on body text:
|
|
||||||
<xsl:param>body.start.indent=0pt
|
|
||||||
# Margin size:
|
|
||||||
<xsl:param>page.margin.inner=0.5in
|
|
||||||
# Margin size:
|
|
||||||
<xsl:param>page.margin.outer=0.5in
|
|
||||||
# Paper type = A4
|
|
||||||
<xsl:param>paper.type=A4
|
|
||||||
# Yes, we want graphics for admonishments:
|
|
||||||
<xsl:param>admon.graphics=1
|
|
||||||
# Set this one for PDF generation *only*:
|
|
||||||
# default pnd graphics are awful in PDF form,
|
|
||||||
# better use SVG's instead:
|
|
||||||
<format>pdf:<xsl:param>admon.graphics.extension=".svg"
|
|
||||||
<format>pdf:<xsl:param>admon.graphics.path=$(boost-images)/
|
|
||||||
<format>pdf:<xsl:param>boost.url.prefix=http://www.boost.org/doc/libs/release/libs/core/doc/html
|
|
||||||
;
|
|
||||||
|
|
||||||
using quickbook ;
|
|
||||||
|
|
||||||
path-constant boost-images : ../../../doc/src/images ;
|
|
||||||
|
|
||||||
xml explicit_operator_bool : explicit_operator_bool.qbk ;
|
|
||||||
boostbook standalone_explicit_operator_bool
|
|
||||||
:
|
|
||||||
explicit_operator_bool
|
|
||||||
:
|
|
||||||
# File name of HTML output:
|
|
||||||
<xsl:param>root.filename=explicit_operator_bool
|
|
||||||
# How far down we chunk nested sections, basically all of them:
|
|
||||||
<xsl:param>chunk.section.depth=0
|
|
||||||
# Don't put the first section on the same page as the TOC:
|
|
||||||
<xsl:param>chunk.first.sections=0
|
|
||||||
# How far down sections get TOC's
|
|
||||||
<xsl:param>toc.section.depth=1
|
|
||||||
# Max depth in each TOC:
|
|
||||||
<xsl:param>toc.max.depth=1
|
|
||||||
# How far down we go with TOC's
|
|
||||||
<xsl:param>generate.section.toc.level=1
|
|
||||||
;
|
|
||||||
|
11
doc/addressof.qbk
Normal file
11
doc/addressof.qbk
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
[section:addressof 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` was originally contributed by Brad King
|
||||||
|
based on ideas from discussion with Doug Gregor.
|
||||||
|
|
||||||
|
[endsect]
|
79
doc/core.qbk
Normal file
79
doc/core.qbk
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
[library Boost.Core
|
||||||
|
[quickbook 1.5]
|
||||||
|
[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].
|
||||||
|
]
|
||||||
|
]
|
||||||
|
|
||||||
|
[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.
|
||||||
|
|
||||||
|
Currently, the Core library contains:
|
||||||
|
|
||||||
|
[table
|
||||||
|
[[Component][Utilities]]
|
||||||
|
[
|
||||||
|
[[link core.addressof addressof]]
|
||||||
|
[`boost::addressof`]
|
||||||
|
]
|
||||||
|
[
|
||||||
|
[[@../../checked_delete.html checked_delete]]
|
||||||
|
[`boost::checked_delete`]
|
||||||
|
]
|
||||||
|
[
|
||||||
|
[[@../../enable_if.html enable_if]]
|
||||||
|
[`boost::enable_if`]
|
||||||
|
]
|
||||||
|
[
|
||||||
|
[[link core.lightweight_test lightweight_test]]
|
||||||
|
[`BOOST_TEST, BOOST_ERROR, BOOST_TEST_EQ, BOOST_TEST_NE,
|
||||||
|
BOOST_TEST_THROWS, boost::report_errors`]
|
||||||
|
]
|
||||||
|
[
|
||||||
|
[[link core.no_exceptions_support no_exceptions_support]]
|
||||||
|
[`BOOST_TRY, BOOST_CATCH, BOOST_CATCH_END, BOOST_RETHROW`]
|
||||||
|
]
|
||||||
|
[
|
||||||
|
[[link core.noncopyable noncopyable]]
|
||||||
|
[`boost::noncopyable`]
|
||||||
|
]
|
||||||
|
[
|
||||||
|
[ref]
|
||||||
|
[`boost::ref`]
|
||||||
|
]
|
||||||
|
[
|
||||||
|
[[@../../swap.html swap]]
|
||||||
|
[`boost::swap`]
|
||||||
|
]
|
||||||
|
[
|
||||||
|
[null_deleter]
|
||||||
|
[`boost::null_deleter`]
|
||||||
|
]
|
||||||
|
[
|
||||||
|
[[link core.explicit_operator_bool explicit_operator_bool]]
|
||||||
|
[`BOOST_EXPLICIT_OPERATOR_BOOL,
|
||||||
|
BOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT,
|
||||||
|
BOOST_CONSTEXPR_EXPLICIT_OPERATOR_BOOL`]
|
||||||
|
]
|
||||||
|
]
|
||||||
|
|
||||||
|
[endsect]
|
||||||
|
|
||||||
|
[include:core addressof.qbk]
|
||||||
|
[include:core explicit_operator_bool.qbk]
|
||||||
|
[include:core lightweight_test.qbk]
|
||||||
|
[include:core no_exceptions_support.qbk]
|
||||||
|
[include:core noncopyable.qbk]
|
@@ -1,3 +1,5 @@
|
|||||||
|
[section:explicit_operator_bool Header <boost/core/explicit_operator_bool.hpp>]
|
||||||
|
|
||||||
[/
|
[/
|
||||||
/ Copyright (c) 2013 Andrey Semashev
|
/ Copyright (c) 2013 Andrey Semashev
|
||||||
/
|
/
|
||||||
@@ -5,17 +7,6 @@
|
|||||||
/ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
/ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
/]
|
/]
|
||||||
|
|
||||||
[article BOOST_EXPLICIT_OPERATOR_BOOL, BOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT and BOOST_CONSTEXPR_EXPLICIT_OPERATOR_BOOL
|
|
||||||
[quickbook 1.5]
|
|
||||||
[authors [Semashev, Andrey]]
|
|
||||||
[copyright 2013 Andrey Semashev]
|
|
||||||
[license
|
|
||||||
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 Overview]
|
[section Overview]
|
||||||
[/===============]
|
[/===============]
|
||||||
@@ -24,7 +15,6 @@
|
|||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
|
|
||||||
|
|
||||||
[/===============]
|
[/===============]
|
||||||
[section Examples]
|
[section Examples]
|
||||||
[/===============]
|
[/===============]
|
||||||
@@ -62,3 +52,5 @@ Now `my_ptr` can be used in conditional expressions, similarly to a regular poin
|
|||||||
* The macro was extracted from Boost.Log.
|
* The macro was extracted from Boost.Log.
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
|
|
||||||
|
[endsect]
|
||||||
|
48
doc/lightweight_test.qbk
Normal file
48
doc/lightweight_test.qbk
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
[section:lightweight_test Header <boost/core/lightweight_test.hpp>]
|
||||||
|
|
||||||
|
If expression is false increases the error count and outputs a
|
||||||
|
message containing `expression`.
|
||||||
|
|
||||||
|
``
|
||||||
|
BOOST_TEST(expression)
|
||||||
|
``
|
||||||
|
|
||||||
|
Increases error count and outputs a message containing
|
||||||
|
`message`.
|
||||||
|
|
||||||
|
``
|
||||||
|
BOOST_ERROR(message)
|
||||||
|
``
|
||||||
|
|
||||||
|
If `expr1` != `expr2` increases the error count and outputs a
|
||||||
|
message containing both expressions.
|
||||||
|
|
||||||
|
``
|
||||||
|
BOOST_TEST_EQ(expr1, expr2)
|
||||||
|
``
|
||||||
|
|
||||||
|
If `expr1` == `expr2` increases the error count and outputs a
|
||||||
|
message containing both expressions.
|
||||||
|
|
||||||
|
``
|
||||||
|
BOOST_TEST_NE(expr1, expr2)
|
||||||
|
``
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
``
|
||||||
|
BOOST_TEST_THROWS(expr, excep)
|
||||||
|
``
|
||||||
|
|
||||||
|
Returns the error count.
|
||||||
|
|
||||||
|
``
|
||||||
|
int boost::report_errors()
|
||||||
|
``
|
||||||
|
|
||||||
|
[endsect]
|
50
doc/no_exceptions_support.qbk
Normal file
50
doc/no_exceptions_support.qbk
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
[section:no_exceptions_support Header <boost/core/no_exceptions_support.hpp>]
|
||||||
|
|
||||||
|
Example of 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]
|
13
doc/noncopyable.qbk
Normal file
13
doc/noncopyable.qbk
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
[section:noncopyable Header <boost/core/noncopyable.hpp>]
|
||||||
|
|
||||||
|
The header `<boost/noncopyable.hpp>` defines the class
|
||||||
|
`boost::noncopyable`. It is intended to be used as a private
|
||||||
|
base. `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.
|
||||||
|
|
||||||
|
[endsect]
|
@@ -1,69 +1,9 @@
|
|||||||
#ifndef BOOST_CHECKED_DELETE_HPP_INCLUDED
|
#ifndef BOOST_CHECKED_DELETE_HPP
|
||||||
#define BOOST_CHECKED_DELETE_HPP_INCLUDED
|
#define BOOST_CHECKED_DELETE_HPP
|
||||||
|
|
||||||
// MS compatible compilers support #pragma once
|
// The header file at this path is deprecated;
|
||||||
|
// use boost/core/checked_delete.hpp instead.
|
||||||
|
|
||||||
|
#include <boost/core/checked_delete.hpp>
|
||||||
|
|
||||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
|
||||||
# pragma once
|
|
||||||
#endif
|
#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/utility/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_CHECKED_DELETE_HPP_INCLUDED
|
|
||||||
|
162
include/boost/core/addressof.hpp
Normal file
162
include/boost/core/addressof.hpp
Normal file
@@ -0,0 +1,162 @@
|
|||||||
|
// Copyright (C) 2002 Brad King (brad.king@kitware.com)
|
||||||
|
// Douglas Gregor (gregod@cs.rpi.edu)
|
||||||
|
//
|
||||||
|
// Copyright (C) 2002, 2008, 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)
|
||||||
|
|
||||||
|
// For more information, see http://www.boost.org
|
||||||
|
|
||||||
|
#ifndef BOOST_CORE_ADDRESSOF_HPP
|
||||||
|
#define BOOST_CORE_ADDRESSOF_HPP
|
||||||
|
|
||||||
|
# include <boost/config.hpp>
|
||||||
|
# include <boost/detail/workaround.hpp>
|
||||||
|
# include <cstddef>
|
||||||
|
|
||||||
|
namespace boost
|
||||||
|
{
|
||||||
|
|
||||||
|
namespace detail
|
||||||
|
{
|
||||||
|
|
||||||
|
template<class T> struct addr_impl_ref
|
||||||
|
{
|
||||||
|
T & v_;
|
||||||
|
|
||||||
|
BOOST_FORCEINLINE addr_impl_ref( T & v ): v_( v ) {}
|
||||||
|
BOOST_FORCEINLINE operator T& () const { return v_; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
addr_impl_ref & operator=(const addr_impl_ref &);
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class T> struct addressof_impl
|
||||||
|
{
|
||||||
|
static BOOST_FORCEINLINE T * f( T & v, long )
|
||||||
|
{
|
||||||
|
return reinterpret_cast<T*>(
|
||||||
|
&const_cast<char&>(reinterpret_cast<const volatile char &>(v)));
|
||||||
|
}
|
||||||
|
|
||||||
|
static BOOST_FORCEINLINE T * f( T * v, int )
|
||||||
|
{
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#if !defined( BOOST_NO_CXX11_NULLPTR )
|
||||||
|
|
||||||
|
#if defined( __clang__ ) && !defined( _LIBCPP_VERSION ) && !defined( BOOST_NO_CXX11_DECLTYPE )
|
||||||
|
|
||||||
|
typedef decltype(nullptr) addr_nullptr_t;
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
typedef std::nullptr_t addr_nullptr_t;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template<> struct addressof_impl< addr_nullptr_t >
|
||||||
|
{
|
||||||
|
typedef addr_nullptr_t T;
|
||||||
|
|
||||||
|
static BOOST_FORCEINLINE T * f( T & v, int )
|
||||||
|
{
|
||||||
|
return &v;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template<> struct addressof_impl< addr_nullptr_t const >
|
||||||
|
{
|
||||||
|
typedef addr_nullptr_t const T;
|
||||||
|
|
||||||
|
static BOOST_FORCEINLINE T * f( T & v, int )
|
||||||
|
{
|
||||||
|
return &v;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template<> struct addressof_impl< addr_nullptr_t volatile >
|
||||||
|
{
|
||||||
|
typedef addr_nullptr_t volatile T;
|
||||||
|
|
||||||
|
static BOOST_FORCEINLINE T * f( T & v, int )
|
||||||
|
{
|
||||||
|
return &v;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template<> struct addressof_impl< addr_nullptr_t const volatile >
|
||||||
|
{
|
||||||
|
typedef addr_nullptr_t const volatile T;
|
||||||
|
|
||||||
|
static BOOST_FORCEINLINE T * f( T & v, int )
|
||||||
|
{
|
||||||
|
return &v;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
} // namespace detail
|
||||||
|
|
||||||
|
template<class T>
|
||||||
|
BOOST_FORCEINLINE
|
||||||
|
T * addressof( T & v )
|
||||||
|
{
|
||||||
|
#if (defined( __BORLANDC__ ) && BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT( 0x610 ) ) ) || defined( __SUNPRO_CC )
|
||||||
|
|
||||||
|
return boost::detail::addressof_impl<T>::f( v, 0 );
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
return boost::detail::addressof_impl<T>::f( boost::detail::addr_impl_ref<T>( v ), 0 );
|
||||||
|
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined( __SUNPRO_CC ) && BOOST_WORKAROUND( __SUNPRO_CC, BOOST_TESTED_AT( 0x590 ) )
|
||||||
|
|
||||||
|
namespace detail
|
||||||
|
{
|
||||||
|
|
||||||
|
template<class T> struct addressof_addp
|
||||||
|
{
|
||||||
|
typedef T * type;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace detail
|
||||||
|
|
||||||
|
template< class T, std::size_t N >
|
||||||
|
BOOST_FORCEINLINE
|
||||||
|
typename detail::addressof_addp< T[N] >::type addressof( T (&t)[N] )
|
||||||
|
{
|
||||||
|
return &t;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Borland doesn't like casting an array reference to a char reference
|
||||||
|
// but these overloads work around the problem.
|
||||||
|
#if defined( __BORLANDC__ ) && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||||
|
template<typename T,std::size_t N>
|
||||||
|
BOOST_FORCEINLINE
|
||||||
|
T (*addressof(T (&t)[N]))[N]
|
||||||
|
{
|
||||||
|
return reinterpret_cast<T(*)[N]>(&t);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T,std::size_t N>
|
||||||
|
BOOST_FORCEINLINE
|
||||||
|
const T (*addressof(const T (&t)[N]))[N]
|
||||||
|
{
|
||||||
|
return reinterpret_cast<const T(*)[N]>(&t);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
} // namespace boost
|
||||||
|
|
||||||
|
#endif // BOOST_CORE_ADDRESSOF_HPP
|
69
include/boost/core/checked_delete.hpp
Normal file
69
include/boost/core/checked_delete.hpp
Normal file
@@ -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/utility/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
|
42
include/boost/core/empty_deleter.hpp
Normal file
42
include/boost/core/empty_deleter.hpp
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
/*
|
||||||
|
* 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 empty_deleter.hpp
|
||||||
|
* \author Andrey Semashev
|
||||||
|
* \date 22.04.2007
|
||||||
|
*
|
||||||
|
* This header contains an \c empty_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_EMPTY_DELETER_HPP
|
||||||
|
#define BOOST_CORE_EMPTY_DELETER_HPP
|
||||||
|
|
||||||
|
#include <boost/config.hpp>
|
||||||
|
#include <boost/core/null_deleter.hpp>
|
||||||
|
|
||||||
|
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||||
|
#pragma once
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(__GNUC__)
|
||||||
|
#pragma message "This header is deprecated, use boost/utility/null_deleter.hpp instead."
|
||||||
|
#elif defined(_MSC_VER)
|
||||||
|
#pragma message("This header is deprecated, use boost/utility/null_deleter.hpp instead.")
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace boost {
|
||||||
|
|
||||||
|
//! A deprecated name for \c null_deleter
|
||||||
|
typedef null_deleter empty_deleter;
|
||||||
|
|
||||||
|
} // namespace boost
|
||||||
|
|
||||||
|
#endif // BOOST_CORE_EMPTY_DELETER_HPP
|
119
include/boost/core/enable_if.hpp
Normal file
119
include/boost/core/enable_if.hpp
Normal file
@@ -0,0 +1,119 @@
|
|||||||
|
// 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 <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 <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
|
154
include/boost/core/explicit_operator_bool.hpp
Normal file
154
include/boost/core/explicit_operator_bool.hpp
Normal file
@@ -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
|
164
include/boost/core/lightweight_test.hpp
Normal file
164
include/boost/core/lightweight_test.hpp
Normal file
@@ -0,0 +1,164 @@
|
|||||||
|
#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 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/assert.hpp>
|
||||||
|
#include <boost/current_function.hpp>
|
||||||
|
#include <boost/core/no_exceptions_support.hpp>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
// 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();
|
||||||
|
}
|
||||||
|
|
||||||
|
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 )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
BOOST_LIGHTWEIGHT_TEST_OSTREAM
|
||||||
|
<< file << "(" << line << "): test '" << expr1 << " == " << expr2
|
||||||
|
<< "' failed in function '" << function << "': "
|
||||||
|
<< "'" << t << "' != '" << 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 )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
BOOST_LIGHTWEIGHT_TEST_OSTREAM
|
||||||
|
<< file << "(" << line << "): test '" << expr1 << " != " << expr2
|
||||||
|
<< "' failed in function '" << function << "': "
|
||||||
|
<< "'" << t << "' == '" << u << "'" << std::endl;
|
||||||
|
++test_errors();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace detail
|
||||||
|
|
||||||
|
inline int report_errors()
|
||||||
|
{
|
||||||
|
detail::report_errors_remind().called_report_errors_function = true;
|
||||||
|
|
||||||
|
int errors = 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_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) )
|
||||||
|
#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
|
44
include/boost/core/no_exceptions_support.hpp
Normal file
44
include/boost/core/no_exceptions_support.hpp
Normal file
@@ -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/detail/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
|
48
include/boost/core/noncopyable.hpp
Normal file
48
include/boost/core/noncopyable.hpp
Normal file
@@ -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
|
44
include/boost/core/null_deleter.hpp
Normal file
44
include/boost/core/null_deleter.hpp
Normal file
@@ -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
|
151
include/boost/core/ref.hpp
Normal file
151
include/boost/core/ref.hpp
Normal file
@@ -0,0 +1,151 @@
|
|||||||
|
#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/utility/addressof.hpp>
|
||||||
|
#include <boost/detail/workaround.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
|
||||||
|
//
|
||||||
|
// 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/bind/ref.html for documentation.
|
||||||
|
//
|
||||||
|
|
||||||
|
namespace boost
|
||||||
|
{
|
||||||
|
|
||||||
|
// reference_wrapper
|
||||||
|
|
||||||
|
template<class T> class reference_wrapper
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef T type;
|
||||||
|
|
||||||
|
BOOST_FORCEINLINE explicit reference_wrapper(T& t): t_(boost::addressof(t)) {}
|
||||||
|
|
||||||
|
BOOST_FORCEINLINE operator T& () const { return *t_; }
|
||||||
|
|
||||||
|
BOOST_FORCEINLINE T& get() const { return *t_; }
|
||||||
|
|
||||||
|
BOOST_FORCEINLINE T* get_pointer() const { return t_; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
T* t_;
|
||||||
|
};
|
||||||
|
|
||||||
|
// ref
|
||||||
|
|
||||||
|
# if defined( __BORLANDC__ ) && BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT(0x581) )
|
||||||
|
# define BOOST_REF_CONST
|
||||||
|
# else
|
||||||
|
# define BOOST_REF_CONST const
|
||||||
|
# endif
|
||||||
|
|
||||||
|
template<class T> BOOST_FORCEINLINE reference_wrapper<T> BOOST_REF_CONST ref( T & t )
|
||||||
|
{
|
||||||
|
return reference_wrapper<T>(t);
|
||||||
|
}
|
||||||
|
|
||||||
|
// cref
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
// is_reference_wrapper
|
||||||
|
|
||||||
|
template<typename T> struct is_reference_wrapper
|
||||||
|
{
|
||||||
|
BOOST_STATIC_CONSTANT( bool, value = false );
|
||||||
|
};
|
||||||
|
|
||||||
|
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)
|
||||||
|
|
||||||
|
// unwrap_reference
|
||||||
|
|
||||||
|
template<typename T> struct unwrap_reference
|
||||||
|
{
|
||||||
|
typedef T type;
|
||||||
|
};
|
||||||
|
|
||||||
|
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)
|
||||||
|
|
||||||
|
// unwrap_ref
|
||||||
|
|
||||||
|
template<class T> BOOST_FORCEINLINE typename unwrap_reference<T>::type& unwrap_ref( T & t )
|
||||||
|
{
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
// get_pointer
|
||||||
|
|
||||||
|
template<class T> BOOST_FORCEINLINE T* get_pointer( reference_wrapper<T> const & r )
|
||||||
|
{
|
||||||
|
return r.get_pointer();
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace boost
|
||||||
|
|
||||||
|
#endif // #ifndef BOOST_CORE_REF_HPP
|
60
include/boost/core/swap.hpp
Normal file
60
include/boost/core/swap.hpp
Normal file
@@ -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
|
@@ -1,208 +1,9 @@
|
|||||||
#ifndef BOOST_DETAIL_LIGHTWEIGHT_TEST_HPP_INCLUDED
|
#ifndef BOOST_DETAIL_LIGHTWEIGHT_TEST_HPP
|
||||||
#define BOOST_DETAIL_LIGHTWEIGHT_TEST_HPP_INCLUDED
|
#define BOOST_DETAIL_LIGHTWEIGHT_TEST_HPP
|
||||||
|
|
||||||
// MS compatible compilers support #pragma once
|
// The header file at this path is deprecated;
|
||||||
|
// use boost/core/lightweight_test.hpp instead.
|
||||||
|
|
||||||
|
#include <boost/core/lightweight_test.hpp>
|
||||||
|
|
||||||
#if defined(_MSC_VER)
|
|
||||||
# pragma once
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//
|
|
||||||
// boost/detail/lightweight_test.hpp - lightweight test library
|
|
||||||
//
|
|
||||||
// Copyright (c) 2002, 2009 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
|
|
||||||
//
|
|
||||||
// ---------------
|
|
||||||
//
|
|
||||||
// If expression is false increases the error count
|
|
||||||
// and outputs a message containing 'expression'
|
|
||||||
//
|
|
||||||
// BOOST_TEST(expression)
|
|
||||||
//
|
|
||||||
// ---------------
|
|
||||||
//
|
|
||||||
// Increases error count and outputs a message containing 'message'
|
|
||||||
//
|
|
||||||
// BOOST_ERROR(message)
|
|
||||||
//
|
|
||||||
// ---------------
|
|
||||||
//
|
|
||||||
// If 'expr1' != 'expr2' increases the error count
|
|
||||||
// and outputs a message containing both expressions
|
|
||||||
//
|
|
||||||
// BOOST_TEST_EQ(expr1, expr2)
|
|
||||||
//
|
|
||||||
// ---------------
|
|
||||||
//
|
|
||||||
// If 'expr1' == 'expr2' increases the error count
|
|
||||||
// and outputs a message containing both expressions
|
|
||||||
//
|
|
||||||
// BOOST_TEST_NE(expr1, expr2)
|
|
||||||
//
|
|
||||||
// ---------------
|
|
||||||
//
|
|
||||||
// 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.
|
|
||||||
//
|
|
||||||
// BOOST_TEST_THROWS(expr, excep)
|
|
||||||
//
|
|
||||||
// ---------------
|
|
||||||
//
|
|
||||||
// Returns the error count
|
|
||||||
//
|
|
||||||
// int boost::report_errors()
|
|
||||||
//
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include <boost/current_function.hpp>
|
|
||||||
#include <boost/assert.hpp>
|
|
||||||
#include <boost/detail/no_exceptions_support.hpp>
|
|
||||||
|
|
||||||
// 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();
|
|
||||||
}
|
|
||||||
|
|
||||||
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 )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
BOOST_LIGHTWEIGHT_TEST_OSTREAM
|
|
||||||
<< file << "(" << line << "): test '" << expr1 << " == " << expr2
|
|
||||||
<< "' failed in function '" << function << "': "
|
|
||||||
<< "'" << t << "' != '" << 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 )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
BOOST_LIGHTWEIGHT_TEST_OSTREAM
|
|
||||||
<< file << "(" << line << "): test '" << expr1 << " != " << expr2
|
|
||||||
<< "' failed in function '" << function << "': "
|
|
||||||
<< "'" << t << "' == '" << u << "'" << std::endl;
|
|
||||||
++test_errors();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace detail
|
|
||||||
|
|
||||||
inline int report_errors()
|
|
||||||
{
|
|
||||||
detail::report_errors_remind().called_report_errors_function = true;
|
|
||||||
|
|
||||||
int errors = 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_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) )
|
|
||||||
#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_DETAIL_LIGHTWEIGHT_TEST_HPP_INCLUDED
|
|
||||||
|
@@ -1,87 +1,9 @@
|
|||||||
#ifndef BOOST_DETAIL_NO_EXCEPTIONS_SUPPORT_HPP_
|
#ifndef BOOST_DETAIL_NO_EXCEPTIONS_SUPPORT_HPP
|
||||||
#define 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>
|
||||||
|
|
||||||
#if defined(_MSC_VER)
|
|
||||||
# pragma once
|
|
||||||
#endif
|
#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.
|
|
||||||
//
|
|
||||||
|
|
||||||
/* Example of 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) {
|
|
||||||
...
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
|
|
||||||
#include <boost/config.hpp>
|
|
||||||
#include <boost/detail/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
|
|
||||||
|
@@ -1,48 +1,9 @@
|
|||||||
// Boost noncopyable.hpp header file --------------------------------------//
|
#ifndef BOOST_NONCOPYABLE_HPP
|
||||||
|
#define BOOST_NONCOPYABLE_HPP
|
||||||
|
|
||||||
// (C) Copyright Beman Dawes 1999-2003. Distributed under the Boost
|
// The header file at this path is deprecated;
|
||||||
// Software License, Version 1.0. (See accompanying file
|
// use boost/core/noncopyable.hpp instead.
|
||||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
|
|
||||||
// See http://www.boost.org/libs/utility for documentation.
|
#include <boost/core/noncopyable.hpp>
|
||||||
|
|
||||||
#ifndef BOOST_NONCOPYABLE_HPP_INCLUDED
|
|
||||||
#define BOOST_NONCOPYABLE_HPP_INCLUDED
|
|
||||||
|
|
||||||
#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
|
#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_NONCOPYABLE_HPP_INCLUDED
|
|
||||||
|
@@ -1,151 +1,9 @@
|
|||||||
#ifndef BOOST_REF_HPP_INCLUDED
|
#ifndef BOOST_REF_HPP
|
||||||
#define BOOST_REF_HPP_INCLUDED
|
#define BOOST_REF_HPP
|
||||||
|
|
||||||
// MS compatible compilers support #pragma once
|
// The header file at this path is deprecated;
|
||||||
|
// use boost/core/ref.hpp instead.
|
||||||
|
|
||||||
|
#include <boost/core/ref.hpp>
|
||||||
|
|
||||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
|
||||||
# pragma once
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <boost/config.hpp>
|
|
||||||
#include <boost/utility/addressof.hpp>
|
|
||||||
#include <boost/detail/workaround.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
|
|
||||||
//
|
|
||||||
// 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/bind/ref.html for documentation.
|
|
||||||
//
|
|
||||||
|
|
||||||
namespace boost
|
|
||||||
{
|
|
||||||
|
|
||||||
// reference_wrapper
|
|
||||||
|
|
||||||
template<class T> class reference_wrapper
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
typedef T type;
|
|
||||||
|
|
||||||
BOOST_FORCEINLINE explicit reference_wrapper(T& t): t_(boost::addressof(t)) {}
|
|
||||||
|
|
||||||
BOOST_FORCEINLINE operator T& () const { return *t_; }
|
|
||||||
|
|
||||||
BOOST_FORCEINLINE T& get() const { return *t_; }
|
|
||||||
|
|
||||||
BOOST_FORCEINLINE T* get_pointer() const { return t_; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
T* t_;
|
|
||||||
};
|
|
||||||
|
|
||||||
// ref
|
|
||||||
|
|
||||||
# if defined( __BORLANDC__ ) && BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT(0x581) )
|
|
||||||
# define BOOST_REF_CONST
|
|
||||||
# else
|
|
||||||
# define BOOST_REF_CONST const
|
|
||||||
# endif
|
|
||||||
|
|
||||||
template<class T> BOOST_FORCEINLINE reference_wrapper<T> BOOST_REF_CONST ref( T & t )
|
|
||||||
{
|
|
||||||
return reference_wrapper<T>(t);
|
|
||||||
}
|
|
||||||
|
|
||||||
// cref
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
// is_reference_wrapper
|
|
||||||
|
|
||||||
template<typename T> struct is_reference_wrapper
|
|
||||||
{
|
|
||||||
BOOST_STATIC_CONSTANT( bool, value = false );
|
|
||||||
};
|
|
||||||
|
|
||||||
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)
|
|
||||||
|
|
||||||
// unwrap_reference
|
|
||||||
|
|
||||||
template<typename T> struct unwrap_reference
|
|
||||||
{
|
|
||||||
typedef T type;
|
|
||||||
};
|
|
||||||
|
|
||||||
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)
|
|
||||||
|
|
||||||
// unwrap_ref
|
|
||||||
|
|
||||||
template<class T> BOOST_FORCEINLINE typename unwrap_reference<T>::type& unwrap_ref( T & t )
|
|
||||||
{
|
|
||||||
return t;
|
|
||||||
}
|
|
||||||
|
|
||||||
// get_pointer
|
|
||||||
|
|
||||||
template<class T> BOOST_FORCEINLINE T* get_pointer( reference_wrapper<T> const & r )
|
|
||||||
{
|
|
||||||
return r.get_pointer();
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace boost
|
|
||||||
|
|
||||||
#endif // #ifndef BOOST_REF_HPP_INCLUDED
|
|
||||||
|
@@ -1,12 +1,9 @@
|
|||||||
// 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)
|
|
||||||
|
|
||||||
#ifndef BOOST_SWAP_HPP
|
#ifndef BOOST_SWAP_HPP
|
||||||
#define BOOST_SWAP_HPP
|
#define BOOST_SWAP_HPP
|
||||||
|
|
||||||
#include "boost/utility/swap.hpp"
|
// The header file at this path is deprecated;
|
||||||
|
// use boost/core/swap.hpp instead.
|
||||||
|
|
||||||
|
#include <boost/core/swap.hpp>
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -1,162 +1,9 @@
|
|||||||
// Copyright (C) 2002 Brad King (brad.king@kitware.com)
|
|
||||||
// Douglas Gregor (gregod@cs.rpi.edu)
|
|
||||||
//
|
|
||||||
// Copyright (C) 2002, 2008, 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)
|
|
||||||
|
|
||||||
// For more information, see http://www.boost.org
|
|
||||||
|
|
||||||
#ifndef BOOST_UTILITY_ADDRESSOF_HPP
|
#ifndef BOOST_UTILITY_ADDRESSOF_HPP
|
||||||
# define BOOST_UTILITY_ADDRESSOF_HPP
|
#define BOOST_UTILITY_ADDRESSOF_HPP
|
||||||
|
|
||||||
# include <boost/config.hpp>
|
// The header file at this path is deprecated;
|
||||||
# include <boost/detail/workaround.hpp>
|
// use boost/core/addressof.hpp instead.
|
||||||
# include <cstddef>
|
|
||||||
|
|
||||||
namespace boost
|
#include <boost/core/addressof.hpp>
|
||||||
{
|
|
||||||
|
|
||||||
namespace detail
|
|
||||||
{
|
|
||||||
|
|
||||||
template<class T> struct addr_impl_ref
|
|
||||||
{
|
|
||||||
T & v_;
|
|
||||||
|
|
||||||
BOOST_FORCEINLINE addr_impl_ref( T & v ): v_( v ) {}
|
|
||||||
BOOST_FORCEINLINE operator T& () const { return v_; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
addr_impl_ref & operator=(const addr_impl_ref &);
|
|
||||||
};
|
|
||||||
|
|
||||||
template<class T> struct addressof_impl
|
|
||||||
{
|
|
||||||
static BOOST_FORCEINLINE T * f( T & v, long )
|
|
||||||
{
|
|
||||||
return reinterpret_cast<T*>(
|
|
||||||
&const_cast<char&>(reinterpret_cast<const volatile char &>(v)));
|
|
||||||
}
|
|
||||||
|
|
||||||
static BOOST_FORCEINLINE T * f( T * v, int )
|
|
||||||
{
|
|
||||||
return v;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_NULLPTR )
|
|
||||||
|
|
||||||
#if defined( __clang__ ) && !defined( _LIBCPP_VERSION ) && !defined( BOOST_NO_CXX11_DECLTYPE )
|
|
||||||
|
|
||||||
typedef decltype(nullptr) addr_nullptr_t;
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
typedef std::nullptr_t addr_nullptr_t;
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
template<> struct addressof_impl< addr_nullptr_t >
|
|
||||||
{
|
|
||||||
typedef addr_nullptr_t T;
|
|
||||||
|
|
||||||
static BOOST_FORCEINLINE T * f( T & v, int )
|
|
||||||
{
|
|
||||||
return &v;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
template<> struct addressof_impl< addr_nullptr_t const >
|
|
||||||
{
|
|
||||||
typedef addr_nullptr_t const T;
|
|
||||||
|
|
||||||
static BOOST_FORCEINLINE T * f( T & v, int )
|
|
||||||
{
|
|
||||||
return &v;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
template<> struct addressof_impl< addr_nullptr_t volatile >
|
|
||||||
{
|
|
||||||
typedef addr_nullptr_t volatile T;
|
|
||||||
|
|
||||||
static BOOST_FORCEINLINE T * f( T & v, int )
|
|
||||||
{
|
|
||||||
return &v;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
template<> struct addressof_impl< addr_nullptr_t const volatile >
|
|
||||||
{
|
|
||||||
typedef addr_nullptr_t const volatile T;
|
|
||||||
|
|
||||||
static BOOST_FORCEINLINE T * f( T & v, int )
|
|
||||||
{
|
|
||||||
return &v;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
} // namespace detail
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
BOOST_FORCEINLINE
|
|
||||||
T * addressof( T & v )
|
|
||||||
{
|
|
||||||
#if (defined( __BORLANDC__ ) && BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT( 0x610 ) ) ) || defined( __SUNPRO_CC )
|
|
||||||
|
|
||||||
return boost::detail::addressof_impl<T>::f( v, 0 );
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
return boost::detail::addressof_impl<T>::f( boost::detail::addr_impl_ref<T>( v ), 0 );
|
|
||||||
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#if defined( __SUNPRO_CC ) && BOOST_WORKAROUND( __SUNPRO_CC, BOOST_TESTED_AT( 0x590 ) )
|
|
||||||
|
|
||||||
namespace detail
|
|
||||||
{
|
|
||||||
|
|
||||||
template<class T> struct addressof_addp
|
|
||||||
{
|
|
||||||
typedef T * type;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace detail
|
|
||||||
|
|
||||||
template< class T, std::size_t N >
|
|
||||||
BOOST_FORCEINLINE
|
|
||||||
typename detail::addressof_addp< T[N] >::type addressof( T (&t)[N] )
|
|
||||||
{
|
|
||||||
return &t;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Borland doesn't like casting an array reference to a char reference
|
|
||||||
// but these overloads work around the problem.
|
|
||||||
#if defined( __BORLANDC__ ) && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
|
||||||
template<typename T,std::size_t N>
|
|
||||||
BOOST_FORCEINLINE
|
|
||||||
T (*addressof(T (&t)[N]))[N]
|
|
||||||
{
|
|
||||||
return reinterpret_cast<T(*)[N]>(&t);
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T,std::size_t N>
|
|
||||||
BOOST_FORCEINLINE
|
|
||||||
const T (*addressof(const T (&t)[N]))[N]
|
|
||||||
{
|
|
||||||
return reinterpret_cast<const T(*)[N]>(&t);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
} // namespace boost
|
|
||||||
|
|
||||||
#endif // BOOST_UTILITY_ADDRESSOF_HPP
|
|
||||||
|
@@ -1,42 +1,9 @@
|
|||||||
/*
|
#ifndef BOOST_UTILITY_EMPTY_DELETER_HPP
|
||||||
* Copyright Andrey Semashev 2007 - 2013.
|
#define BOOST_UTILITY_EMPTY_DELETER_HPP
|
||||||
* 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 empty_deleter.hpp
|
|
||||||
* \author Andrey Semashev
|
|
||||||
* \date 22.04.2007
|
|
||||||
*
|
|
||||||
* This header contains an \c empty_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_UTILITY_EMPTY_DELETER_HPP_INCLUDED_
|
// The header file at this path is deprecated;
|
||||||
#define BOOST_UTILITY_EMPTY_DELETER_HPP_INCLUDED_
|
// use boost/core/empty_deleter.hpp instead.
|
||||||
|
|
||||||
#include <boost/config.hpp>
|
#include <boost/core/empty_deleter.hpp>
|
||||||
#include <boost/utility/null_deleter.hpp>
|
|
||||||
|
|
||||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
|
||||||
#pragma once
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__)
|
|
||||||
#pragma message "This header is deprecated, use boost/utility/null_deleter.hpp instead."
|
|
||||||
#elif defined(_MSC_VER)
|
|
||||||
#pragma message("This header is deprecated, use boost/utility/null_deleter.hpp instead.")
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace boost {
|
|
||||||
|
|
||||||
//! A deprecated name for \c null_deleter
|
|
||||||
typedef null_deleter empty_deleter;
|
|
||||||
|
|
||||||
} // namespace boost
|
|
||||||
|
|
||||||
#endif // BOOST_UTILITY_EMPTY_DELETER_HPP_INCLUDED_
|
|
||||||
|
@@ -1,119 +1,9 @@
|
|||||||
// 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_UTILITY_ENABLE_IF_HPP
|
#ifndef BOOST_UTILITY_ENABLE_IF_HPP
|
||||||
#define BOOST_UTILITY_ENABLE_IF_HPP
|
#define BOOST_UTILITY_ENABLE_IF_HPP
|
||||||
|
|
||||||
#include "boost/config.hpp"
|
// The header file at this path is deprecated;
|
||||||
|
// use boost/core/enable_if.hpp instead.
|
||||||
|
|
||||||
// Even the definition of enable_if causes problems on some compilers,
|
#include <boost/core/enable_if.hpp>
|
||||||
// so it's macroed out for all compilers that do not support SFINAE
|
|
||||||
|
|
||||||
#ifndef BOOST_NO_SFINAE
|
|
||||||
|
|
||||||
namespace boost
|
|
||||||
{
|
|
||||||
|
|
||||||
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 <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
|
#endif
|
||||||
|
@@ -1,153 +1,9 @@
|
|||||||
/*
|
#ifndef BOOST_UTILITY_EXPLICIT_OPERATOR_BOOL_HPP
|
||||||
* Copyright Andrey Semashev 2007 - 2013.
|
#define BOOST_UTILITY_EXPLICIT_OPERATOR_BOOL_HPP
|
||||||
* 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_UTILITY_EXPLICIT_OPERATOR_BOOL_HPP_INCLUDED_
|
// The header file at this path is deprecated;
|
||||||
#define BOOST_UTILITY_EXPLICIT_OPERATOR_BOOL_HPP_INCLUDED_
|
// use boost/core/explicit_operator_bool.hpp instead.
|
||||||
|
|
||||||
#include <boost/config.hpp>
|
#include <boost/core/explicit_operator_bool.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
|
#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_UTILITY_EXPLICIT_OPERATOR_BOOL_HPP_INCLUDED_
|
|
||||||
|
@@ -1,44 +1,9 @@
|
|||||||
/*
|
#ifndef BOOST_UTILITY_NULL_DELETER_HPP
|
||||||
* Copyright Andrey Semashev 2007 - 2014.
|
#define BOOST_UTILITY_NULL_DELETER_HPP
|
||||||
* 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_UTILITY_NULL_DELETER_HPP_INCLUDED_
|
// The header file at this path is deprecated;
|
||||||
#define BOOST_UTILITY_NULL_DELETER_HPP_INCLUDED_
|
// use boost/core/null_deleter.hpp instead.
|
||||||
|
|
||||||
#include <boost/config.hpp>
|
#include <boost/core/null_deleter.hpp>
|
||||||
|
|
||||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
|
||||||
#pragma once
|
|
||||||
#endif
|
#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_UTILITY_NULL_DELETER_HPP_INCLUDED_
|
|
||||||
|
@@ -1,60 +1,9 @@
|
|||||||
// 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_UTILITY_SWAP_HPP
|
#ifndef BOOST_UTILITY_SWAP_HPP
|
||||||
#define BOOST_UTILITY_SWAP_HPP
|
#define BOOST_UTILITY_SWAP_HPP
|
||||||
|
|
||||||
// Note: the implementation of this utility contains various workarounds:
|
// The header file at this path is deprecated;
|
||||||
// - swap_impl is put outside the boost namespace, to avoid infinite
|
// use boost/core/swap.hpp instead.
|
||||||
// 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 <boost/core/swap.hpp>
|
||||||
#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
|
#endif
|
||||||
|
63
index.html
63
index.html
@@ -1,38 +1,29 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Boost.Core Library Documentation</title>
|
<title>Boost.Core</title>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
<meta charset="utf-8">
|
||||||
</head>
|
<meta http-equiv="refresh" content="0; url=../../doc/html/core.html">
|
||||||
<body bgcolor="white" style="MARGIN-LEFT: 5%; MARGIN-RIGHT: 5%">
|
<style>
|
||||||
<p><a href="../../index.htm"> <img src="../../boost.png" alt="boost.png (6897 bytes)" width="277" height="86" border="0" /></a></p>
|
body {
|
||||||
<h1>Boost.Core</h1>
|
background: #fff;
|
||||||
<p>
|
color: #000;
|
||||||
The Boost.Core library is a collection of core utilities. The criteria for inclusion is
|
}
|
||||||
that the utility component be
|
a {
|
||||||
</p>
|
color: #00f;
|
||||||
<ul>
|
text-decoration: none;
|
||||||
<li>simple,</li>
|
}
|
||||||
<li>used by other Boost libraries, and</li>
|
</style>
|
||||||
<li>not dependent on any other Boost modules except Core itself, Config, Assert, Static Assert, or Predef.</li>
|
</head>
|
||||||
</ul>
|
<body>
|
||||||
<p>
|
<p>
|
||||||
Currently, the Core library contains
|
Automatic redirection failed, please go to
|
||||||
</p>
|
<a href="../../doc/html/core.html">../../doc/html/core.html</a>
|
||||||
<ul>
|
</p>
|
||||||
<li><code><a href="addressof.html">boost::addressof</a></code></li>
|
<p>
|
||||||
<li><code><a href="checked_delete.html">boost::checked_delete</a></code></li>
|
© 2014 Peter Dimov<br>
|
||||||
<li><code><a href="enable_if.html">boost::enable_if</a></code></li>
|
© 2014 Glen Fernandes<br>
|
||||||
<li><code><a href="noncopyable.html">boost::noncopyable</a></code></li>
|
© 2013 Andrey Semashev
|
||||||
<li><code>boost::ref</code></li>
|
</p>
|
||||||
<li><code><a href="swap.html">boost::swap</a></code></li>
|
</body>
|
||||||
<li><code>boost::null_deleter</code></li>
|
|
||||||
<li><code><a href="doc/html/explicit_operator_bool.html">BOOST_EXPLICIT_OPERATOR_BOOL, BOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT and BOOST_CONSTEXPR_EXPLICIT_OPERATOR_BOOL</a></code></li>
|
|
||||||
</ul>
|
|
||||||
<hr />
|
|
||||||
<p>
|
|
||||||
<small>Copyright <20> 2014 by Peter Dimov. Distributed under the Boost Software License, Version
|
|
||||||
1.0. See accompanying file <a href="../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or
|
|
||||||
copy at <a href="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</a>.</small></p>
|
|
||||||
</body>
|
|
||||||
</html>
|
</html>
|
||||||
|
@@ -1,25 +0,0 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title><boost/noncopyable.hpp> Header Documentation</title>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
||||||
</head>
|
|
||||||
<body bgcolor="white" style="MARGIN-LEFT: 5%; MARGIN-RIGHT: 5%">
|
|
||||||
<p><a href="../../index.htm"> <img src="../../boost.png" alt="boost.png (6897 bytes)" width="277" height="86" border="0" /></a></p>
|
|
||||||
<h1><code><boost/noncopyable.hpp></code></h1>
|
|
||||||
<p>
|
|
||||||
The header <code><boost/noncopyable.hpp></code> defines the class <code>boost::noncopyable</code>. It is intended
|
|
||||||
to be used as a private base. <code>boost::noncopyable</code> 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.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<code>boost::noncopyable</code> was originally contributed by Dave Abrahams.
|
|
||||||
</p>
|
|
||||||
<hr />
|
|
||||||
<p>
|
|
||||||
<small>Copyright <20> 2014 by Peter Dimov. Distributed under the Boost Software License, Version
|
|
||||||
1.0. See accompanying file <a href="../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or
|
|
||||||
copy at <a href="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</a>.</small></p>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
Reference in New Issue
Block a user