mirror of
https://github.com/sam-astro/Z-Sharp.git
synced 2025-12-11 16:22:12 +00:00
Revert "Included boost libraries"
This reverts commit 79994b09112c8ad598611045f72ad029531cf6e7.
This commit is contained in:
parent
6c56a339d3
commit
ebeaf65513
@ -7,7 +7,7 @@
|
||||
#include <algorithm>
|
||||
#include <cstdlib>
|
||||
#include <sstream>
|
||||
#include "./boost/any.hpp"
|
||||
#include <boost/any.hpp>
|
||||
#include <unordered_map>
|
||||
#include <stdio.h>
|
||||
#include <codecvt>
|
||||
|
||||
@ -1,22 +0,0 @@
|
||||
/*
|
||||
Copyright 2014-2015 Glen Joseph Fernandes
|
||||
(glenjofe@gmail.com)
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
#ifndef BOOST_ALIGN_HPP
|
||||
#define BOOST_ALIGN_HPP
|
||||
|
||||
#include <boost/align/align.hpp>
|
||||
#include <boost/align/align_down.hpp>
|
||||
#include <boost/align/align_up.hpp>
|
||||
#include <boost/align/aligned_alloc.hpp>
|
||||
#include <boost/align/aligned_allocator.hpp>
|
||||
#include <boost/align/aligned_allocator_adaptor.hpp>
|
||||
#include <boost/align/aligned_delete.hpp>
|
||||
#include <boost/align/alignment_of.hpp>
|
||||
#include <boost/align/assume_aligned.hpp>
|
||||
#include <boost/align/is_aligned.hpp>
|
||||
|
||||
#endif
|
||||
@ -1,18 +0,0 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// boost aligned_storage.hpp header file
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright (c) 2002-2003
|
||||
// Eric Friedman, Itay Maman
|
||||
//
|
||||
// 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_ALIGNED_STORAGE_HPP
|
||||
#define BOOST_ALIGNED_STORAGE_HPP
|
||||
|
||||
#include <boost/type_traits/aligned_storage.hpp>
|
||||
|
||||
#endif // BOOST_ALIGNED_STORAGE_HPP
|
||||
@ -1,344 +0,0 @@
|
||||
// See http://www.boost.org/libs/any for Documentation.
|
||||
|
||||
#ifndef BOOST_ANY_INCLUDED
|
||||
#define BOOST_ANY_INCLUDED
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
// what: variant type boost::any
|
||||
// who: contributed by Kevlin Henney,
|
||||
// with features contributed and bugs found by
|
||||
// Antony Polukhin, Ed Brey, Mark Rodgers,
|
||||
// Peter Dimov, and James Curran
|
||||
// when: July 2001, April 2013 - 2020
|
||||
|
||||
#include <boost/any/bad_any_cast.hpp>
|
||||
#include <boost/any/fwd.hpp>
|
||||
#include <boost/type_index.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
#include <boost/type_traits/decay.hpp>
|
||||
#include <boost/type_traits/remove_cv.hpp>
|
||||
#include <boost/type_traits/add_reference.hpp>
|
||||
#include <boost/type_traits/is_reference.hpp>
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
#include <boost/core/addressof.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#include <boost/type_traits/conditional.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
class any
|
||||
{
|
||||
public: // structors
|
||||
|
||||
BOOST_CONSTEXPR any() BOOST_NOEXCEPT
|
||||
: content(0)
|
||||
{
|
||||
}
|
||||
|
||||
template<typename ValueType>
|
||||
any(const ValueType & value)
|
||||
: content(new holder<
|
||||
BOOST_DEDUCED_TYPENAME remove_cv<BOOST_DEDUCED_TYPENAME decay<const ValueType>::type>::type
|
||||
>(value))
|
||||
{
|
||||
BOOST_STATIC_ASSERT_MSG(
|
||||
!anys::detail::is_basic_any<ValueType>::value,
|
||||
"boost::any shall not be constructed from boost::anys::basic_any"
|
||||
);
|
||||
}
|
||||
|
||||
any(const any & other)
|
||||
: content(other.content ? other.content->clone() : 0)
|
||||
{
|
||||
}
|
||||
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
// Move constructor
|
||||
any(any&& other) BOOST_NOEXCEPT
|
||||
: content(other.content)
|
||||
{
|
||||
other.content = 0;
|
||||
}
|
||||
|
||||
// Perfect forwarding of ValueType
|
||||
template<typename ValueType>
|
||||
any(ValueType&& value
|
||||
, typename boost::disable_if<boost::is_same<any&, ValueType> >::type* = 0 // disable if value has type `any&`
|
||||
, typename boost::disable_if<boost::is_const<ValueType> >::type* = 0) // disable if value has type `const ValueType&&`
|
||||
: content(new holder< typename decay<ValueType>::type >(static_cast<ValueType&&>(value)))
|
||||
{
|
||||
BOOST_STATIC_ASSERT_MSG(
|
||||
!anys::detail::is_basic_any<typename boost::decay<ValueType>::type>::value,
|
||||
"boost::any shall not be constructed from boost::anys::basic_any"
|
||||
);
|
||||
}
|
||||
#endif
|
||||
|
||||
~any() BOOST_NOEXCEPT
|
||||
{
|
||||
delete content;
|
||||
}
|
||||
|
||||
public: // modifiers
|
||||
|
||||
any & swap(any & rhs) BOOST_NOEXCEPT
|
||||
{
|
||||
placeholder* tmp = content;
|
||||
content = rhs.content;
|
||||
rhs.content = tmp;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
template<typename ValueType>
|
||||
any & operator=(const ValueType & rhs)
|
||||
{
|
||||
BOOST_STATIC_ASSERT_MSG(
|
||||
!anys::detail::is_basic_any<ValueType>::value,
|
||||
"boost::anys::basic_any shall not be assigned into boost::any"
|
||||
);
|
||||
any(rhs).swap(*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
any & operator=(any rhs)
|
||||
{
|
||||
rhs.swap(*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
#else
|
||||
any & operator=(const any& rhs)
|
||||
{
|
||||
any(rhs).swap(*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
// move assignment
|
||||
any & operator=(any&& rhs) BOOST_NOEXCEPT
|
||||
{
|
||||
rhs.swap(*this);
|
||||
any().swap(rhs);
|
||||
return *this;
|
||||
}
|
||||
|
||||
// Perfect forwarding of ValueType
|
||||
template <class ValueType>
|
||||
any & operator=(ValueType&& rhs)
|
||||
{
|
||||
BOOST_STATIC_ASSERT_MSG(
|
||||
!anys::detail::is_basic_any<typename boost::decay<ValueType>::type>::value,
|
||||
"boost::anys::basic_any shall not be assigned into boost::any"
|
||||
);
|
||||
any(static_cast<ValueType&&>(rhs)).swap(*this);
|
||||
return *this;
|
||||
}
|
||||
#endif
|
||||
|
||||
public: // queries
|
||||
|
||||
bool empty() const BOOST_NOEXCEPT
|
||||
{
|
||||
return !content;
|
||||
}
|
||||
|
||||
void clear() BOOST_NOEXCEPT
|
||||
{
|
||||
any().swap(*this);
|
||||
}
|
||||
|
||||
const boost::typeindex::type_info& type() const BOOST_NOEXCEPT
|
||||
{
|
||||
return content ? content->type() : boost::typeindex::type_id<void>().type_info();
|
||||
}
|
||||
|
||||
#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
private: // types
|
||||
#else
|
||||
public: // types (public so any_cast can be non-friend)
|
||||
#endif
|
||||
|
||||
class BOOST_SYMBOL_VISIBLE placeholder
|
||||
{
|
||||
public: // structors
|
||||
|
||||
virtual ~placeholder()
|
||||
{
|
||||
}
|
||||
|
||||
public: // queries
|
||||
|
||||
virtual const boost::typeindex::type_info& type() const BOOST_NOEXCEPT = 0;
|
||||
|
||||
virtual placeholder * clone() const = 0;
|
||||
|
||||
};
|
||||
|
||||
template<typename ValueType>
|
||||
class holder
|
||||
#ifndef BOOST_NO_CXX11_FINAL
|
||||
final
|
||||
#endif
|
||||
: public placeholder
|
||||
{
|
||||
public: // structors
|
||||
|
||||
holder(const ValueType & value)
|
||||
: held(value)
|
||||
{
|
||||
}
|
||||
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
holder(ValueType&& value)
|
||||
: held(static_cast< ValueType&& >(value))
|
||||
{
|
||||
}
|
||||
#endif
|
||||
public: // queries
|
||||
|
||||
const boost::typeindex::type_info& type() const BOOST_NOEXCEPT BOOST_OVERRIDE
|
||||
{
|
||||
return boost::typeindex::type_id<ValueType>().type_info();
|
||||
}
|
||||
|
||||
placeholder * clone() const BOOST_OVERRIDE
|
||||
{
|
||||
return new holder(held);
|
||||
}
|
||||
|
||||
public: // representation
|
||||
|
||||
ValueType held;
|
||||
|
||||
private: // intentionally left unimplemented
|
||||
holder & operator=(const holder &);
|
||||
};
|
||||
|
||||
#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
|
||||
private: // representation
|
||||
|
||||
template<typename ValueType>
|
||||
friend ValueType * any_cast(any *) BOOST_NOEXCEPT;
|
||||
|
||||
template<typename ValueType>
|
||||
friend ValueType * unsafe_any_cast(any *) BOOST_NOEXCEPT;
|
||||
|
||||
#else
|
||||
|
||||
public: // representation (public so any_cast can be non-friend)
|
||||
|
||||
#endif
|
||||
|
||||
placeholder * content;
|
||||
|
||||
};
|
||||
|
||||
inline void swap(any & lhs, any & rhs) BOOST_NOEXCEPT
|
||||
{
|
||||
lhs.swap(rhs);
|
||||
}
|
||||
|
||||
template<typename ValueType>
|
||||
ValueType * any_cast(any * operand) BOOST_NOEXCEPT
|
||||
{
|
||||
return operand && operand->type() == boost::typeindex::type_id<ValueType>()
|
||||
? boost::addressof(
|
||||
static_cast<any::holder<BOOST_DEDUCED_TYPENAME remove_cv<ValueType>::type> *>(operand->content)->held
|
||||
)
|
||||
: 0;
|
||||
}
|
||||
|
||||
template<typename ValueType>
|
||||
inline const ValueType * any_cast(const any * operand) BOOST_NOEXCEPT
|
||||
{
|
||||
return any_cast<ValueType>(const_cast<any *>(operand));
|
||||
}
|
||||
|
||||
template<typename ValueType>
|
||||
ValueType any_cast(any & operand)
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME remove_reference<ValueType>::type nonref;
|
||||
|
||||
|
||||
nonref * result = any_cast<nonref>(boost::addressof(operand));
|
||||
if(!result)
|
||||
boost::throw_exception(bad_any_cast());
|
||||
|
||||
// Attempt to avoid construction of a temporary object in cases when
|
||||
// `ValueType` is not a reference. Example:
|
||||
// `static_cast<std::string>(*result);`
|
||||
// which is equal to `std::string(*result);`
|
||||
typedef BOOST_DEDUCED_TYPENAME boost::conditional<
|
||||
boost::is_reference<ValueType>::value,
|
||||
ValueType,
|
||||
BOOST_DEDUCED_TYPENAME boost::add_reference<ValueType>::type
|
||||
>::type ref_type;
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable: 4172) // "returning address of local variable or temporary" but *result is not local!
|
||||
#endif
|
||||
return static_cast<ref_type>(*result);
|
||||
#ifdef BOOST_MSVC
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
}
|
||||
|
||||
template<typename ValueType>
|
||||
inline ValueType any_cast(const any & operand)
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME remove_reference<ValueType>::type nonref;
|
||||
return any_cast<const nonref &>(const_cast<any &>(operand));
|
||||
}
|
||||
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
template<typename ValueType>
|
||||
inline ValueType any_cast(any&& operand)
|
||||
{
|
||||
BOOST_STATIC_ASSERT_MSG(
|
||||
boost::is_rvalue_reference<ValueType&&>::value /*true if ValueType is rvalue or just a value*/
|
||||
|| boost::is_const< typename boost::remove_reference<ValueType>::type >::value,
|
||||
"boost::any_cast shall not be used for getting nonconst references to temporary objects"
|
||||
);
|
||||
return any_cast<ValueType>(operand);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
// Note: The "unsafe" versions of any_cast are not part of the
|
||||
// public interface and may be removed at any time. They are
|
||||
// required where we know what type is stored in the any and can't
|
||||
// use typeid() comparison, e.g., when our types may travel across
|
||||
// different shared libraries.
|
||||
template<typename ValueType>
|
||||
inline ValueType * unsafe_any_cast(any * operand) BOOST_NOEXCEPT
|
||||
{
|
||||
return boost::addressof(
|
||||
static_cast<any::holder<ValueType> *>(operand->content)->held
|
||||
);
|
||||
}
|
||||
|
||||
template<typename ValueType>
|
||||
inline const ValueType * unsafe_any_cast(const any * operand) BOOST_NOEXCEPT
|
||||
{
|
||||
return unsafe_any_cast<ValueType>(const_cast<any *>(operand));
|
||||
}
|
||||
}
|
||||
|
||||
// Copyright Kevlin Henney, 2000, 2001, 2002. All rights reserved.
|
||||
// Copyright Antony Polukhin, 2013-2021.
|
||||
//
|
||||
// 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)
|
||||
|
||||
#endif
|
||||
@ -1,43 +0,0 @@
|
||||
// Copyright Antony Polukhin, 2020-2021.
|
||||
//
|
||||
// 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/any for Documentation.
|
||||
|
||||
#ifndef BOOST_ANYS_BAD_ANY_CAST_HPP_INCLUDED
|
||||
#define BOOST_ANYS_BAD_ANY_CAST_HPP_INCLUDED
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_NO_RTTI
|
||||
#include <typeinfo>
|
||||
#endif
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
namespace boost {
|
||||
|
||||
class BOOST_SYMBOL_VISIBLE bad_any_cast :
|
||||
#ifndef BOOST_NO_RTTI
|
||||
public std::bad_cast
|
||||
#else
|
||||
public std::exception
|
||||
#endif
|
||||
{
|
||||
public:
|
||||
const char * what() const BOOST_NOEXCEPT_OR_NOTHROW BOOST_OVERRIDE
|
||||
{
|
||||
return "boost::bad_any_cast: "
|
||||
"failed conversion using boost::any_cast";
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
|
||||
#endif // #ifndef BOOST_ANYS_BAD_ANY_CAST_HPP_INCLUDED
|
||||
@ -1,480 +0,0 @@
|
||||
// Copyright Ruslan Arutyunyan, 2019-2021.
|
||||
// Copyright Antony Polukhin, 2021.
|
||||
//
|
||||
// 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)
|
||||
|
||||
// Contributed by Ruslan Arutyunyan
|
||||
|
||||
#ifndef BOOST_ANYS_BASIC_ANY_HPP_INCLUDED
|
||||
#define BOOST_ANYS_BASIC_ANY_HPP_INCLUDED
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/any/bad_any_cast.hpp>
|
||||
#include <boost/any/fwd.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/aligned_storage.hpp>
|
||||
#include <boost/type_index.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
#include <boost/type_traits/decay.hpp>
|
||||
#include <boost/type_traits/remove_cv.hpp>
|
||||
#include <boost/type_traits/add_reference.hpp>
|
||||
#include <boost/type_traits/is_reference.hpp>
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
#include <boost/type_traits/is_nothrow_move_constructible.hpp>
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
#include <boost/core/addressof.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#include <boost/type_traits/conditional.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace anys {
|
||||
|
||||
template <std::size_t OptimizeForSize, std::size_t OptimizeForAlignment>
|
||||
class basic_any
|
||||
{
|
||||
BOOST_STATIC_ASSERT_MSG(OptimizeForSize > 0 && OptimizeForAlignment > 0, "Size and Align shall be positive values");
|
||||
BOOST_STATIC_ASSERT_MSG(OptimizeForSize >= OptimizeForAlignment, "Size shall non less than Align");
|
||||
BOOST_STATIC_ASSERT_MSG((OptimizeForAlignment & (OptimizeForAlignment - 1)) == 0, "Align shall be a power of 2");
|
||||
BOOST_STATIC_ASSERT_MSG(OptimizeForSize % OptimizeForAlignment == 0, "Size shall be multiple of alignment");
|
||||
private:
|
||||
enum operation
|
||||
{
|
||||
Destroy,
|
||||
Move,
|
||||
Copy,
|
||||
AnyCast,
|
||||
UnsafeCast,
|
||||
Typeinfo
|
||||
};
|
||||
|
||||
template <typename ValueType>
|
||||
static void* small_manager(operation op, basic_any& left, const basic_any* right, const boost::typeindex::type_info* info)
|
||||
{
|
||||
switch (op)
|
||||
{
|
||||
case Destroy:
|
||||
BOOST_ASSERT(!left.empty());
|
||||
reinterpret_cast<ValueType*>(&left.content.small_value)->~ValueType();
|
||||
break;
|
||||
case Move: {
|
||||
BOOST_ASSERT(left.empty());
|
||||
BOOST_ASSERT(right);
|
||||
BOOST_ASSERT(!right->empty());
|
||||
BOOST_ASSERT(right->type() == boost::typeindex::type_id<ValueType>());
|
||||
ValueType* value = reinterpret_cast<ValueType*>(&const_cast<basic_any*>(right)->content.small_value);
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
new (&left.content.small_value) ValueType(std::move(*value));
|
||||
#else
|
||||
new (&left.content.small_value) ValueType(*value);
|
||||
#endif
|
||||
left.man = right->man;
|
||||
reinterpret_cast<ValueType const*>(&right->content.small_value)->~ValueType();
|
||||
const_cast<basic_any*>(right)->man = 0;
|
||||
|
||||
};
|
||||
break;
|
||||
|
||||
case Copy:
|
||||
BOOST_ASSERT(left.empty());
|
||||
BOOST_ASSERT(right);
|
||||
BOOST_ASSERT(!right->empty());
|
||||
BOOST_ASSERT(right->type() == boost::typeindex::type_id<ValueType>());
|
||||
new (&left.content.small_value) ValueType(*reinterpret_cast<const ValueType*>(&right->content.small_value));
|
||||
left.man = right->man;
|
||||
break;
|
||||
case AnyCast:
|
||||
BOOST_ASSERT(info);
|
||||
BOOST_ASSERT(!left.empty());
|
||||
return boost::typeindex::type_id<ValueType>() == *info ?
|
||||
reinterpret_cast<typename remove_cv<ValueType>::type *>(&left.content.small_value) : 0;
|
||||
case UnsafeCast:
|
||||
BOOST_ASSERT(!left.empty());
|
||||
return reinterpret_cast<typename remove_cv<ValueType>::type *>(&left.content.small_value);
|
||||
case Typeinfo:
|
||||
return const_cast<void*>(static_cast<const void*>(&boost::typeindex::type_id<ValueType>().type_info()));
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
template <typename ValueType>
|
||||
static void* large_manager(operation op, basic_any& left, const basic_any* right, const boost::typeindex::type_info* info)
|
||||
{
|
||||
switch (op)
|
||||
{
|
||||
case Destroy:
|
||||
BOOST_ASSERT(!left.empty());
|
||||
delete static_cast<ValueType*>(left.content.large_value);
|
||||
break;
|
||||
case Move:
|
||||
BOOST_ASSERT(left.empty());
|
||||
BOOST_ASSERT(right);
|
||||
BOOST_ASSERT(!right->empty());
|
||||
BOOST_ASSERT(right->type() == boost::typeindex::type_id<ValueType>());
|
||||
left.content.large_value = right->content.large_value;
|
||||
left.man = right->man;
|
||||
const_cast<basic_any*>(right)->content.large_value = 0;
|
||||
const_cast<basic_any*>(right)->man = 0;
|
||||
break;
|
||||
case Copy:
|
||||
BOOST_ASSERT(left.empty());
|
||||
BOOST_ASSERT(right);
|
||||
BOOST_ASSERT(!right->empty());
|
||||
BOOST_ASSERT(right->type() == boost::typeindex::type_id<ValueType>());
|
||||
left.content.large_value = new ValueType(*static_cast<const ValueType*>(right->content.large_value));
|
||||
left.man = right->man;
|
||||
break;
|
||||
case AnyCast:
|
||||
BOOST_ASSERT(info);
|
||||
BOOST_ASSERT(!left.empty());
|
||||
return boost::typeindex::type_id<ValueType>() == *info ?
|
||||
static_cast<typename remove_cv<ValueType>::type *>(left.content.large_value) : 0;
|
||||
case UnsafeCast:
|
||||
BOOST_ASSERT(!left.empty());
|
||||
return reinterpret_cast<typename remove_cv<ValueType>::type *>(left.content.large_value);
|
||||
case Typeinfo:
|
||||
return const_cast<void*>(static_cast<const void*>(&boost::typeindex::type_id<ValueType>().type_info()));
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
template <typename ValueType>
|
||||
struct is_small_object : boost::integral_constant<bool, sizeof(ValueType) <= OptimizeForSize &&
|
||||
boost::alignment_of<ValueType>::value <= OptimizeForAlignment &&
|
||||
boost::is_nothrow_move_constructible<ValueType>::value>
|
||||
{};
|
||||
|
||||
template <typename ValueType>
|
||||
static void create(basic_any& any, const ValueType& value, boost::true_type)
|
||||
{
|
||||
typedef typename boost::decay<const ValueType>::type DecayedType;
|
||||
|
||||
any.man = &small_manager<DecayedType>;
|
||||
new (&any.content.small_value) ValueType(value);
|
||||
}
|
||||
|
||||
template <typename ValueType>
|
||||
static void create(basic_any& any, const ValueType& value, boost::false_type)
|
||||
{
|
||||
typedef typename boost::decay<const ValueType>::type DecayedType;
|
||||
|
||||
any.man = &large_manager<DecayedType>;
|
||||
any.content.large_value = new DecayedType(value);
|
||||
}
|
||||
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
template <typename ValueType>
|
||||
static void create(basic_any& any, ValueType&& value, boost::true_type)
|
||||
{
|
||||
typedef typename boost::decay<const ValueType>::type DecayedType;
|
||||
any.man = &small_manager<DecayedType>;
|
||||
new (&any.content.small_value) DecayedType(static_cast<ValueType&&>(value));
|
||||
}
|
||||
|
||||
template <typename ValueType>
|
||||
static void create(basic_any& any, ValueType&& value, boost::false_type)
|
||||
{
|
||||
typedef typename boost::decay<const ValueType>::type DecayedType;
|
||||
any.man = &large_manager<DecayedType>;
|
||||
any.content.large_value = new DecayedType(static_cast<ValueType&&>(value));
|
||||
}
|
||||
#endif
|
||||
public: // non-type template parameters accessors
|
||||
static BOOST_CONSTEXPR_OR_CONST std::size_t buffer_size = OptimizeForSize;
|
||||
static BOOST_CONSTEXPR_OR_CONST std::size_t buffer_align = OptimizeForAlignment;
|
||||
|
||||
public: // structors
|
||||
|
||||
BOOST_CONSTEXPR basic_any() BOOST_NOEXCEPT
|
||||
: man(0), content()
|
||||
{
|
||||
}
|
||||
|
||||
template<typename ValueType>
|
||||
basic_any(const ValueType & value)
|
||||
: man(0), content()
|
||||
{
|
||||
BOOST_STATIC_ASSERT_MSG(
|
||||
!(boost::is_same<ValueType, boost::any>::value),
|
||||
"boost::anys::basic_any shall not be constructed from boost::any"
|
||||
);
|
||||
BOOST_STATIC_ASSERT_MSG(
|
||||
!anys::detail::is_basic_any<ValueType>::value,
|
||||
"boost::anys::basic_any<A, B> shall not be constructed from boost::anys::basic_any<C, D>"
|
||||
);
|
||||
create(*this, value, is_small_object<ValueType>());
|
||||
}
|
||||
|
||||
basic_any(const basic_any & other)
|
||||
: man(0), content()
|
||||
{
|
||||
if (other.man)
|
||||
{
|
||||
other.man(Copy, *this, &other, 0);
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
// Move constructor
|
||||
basic_any(basic_any&& other) BOOST_NOEXCEPT
|
||||
: man(0), content()
|
||||
{
|
||||
if (other.man)
|
||||
{
|
||||
other.man(Move, *this, &other, 0);
|
||||
}
|
||||
}
|
||||
|
||||
// Perfect forwarding of ValueType
|
||||
template<typename ValueType>
|
||||
basic_any(ValueType&& value
|
||||
, typename boost::disable_if<boost::is_same<basic_any&, ValueType> >::type* = 0 // disable if value has type `basic_any&`
|
||||
, typename boost::disable_if<boost::is_const<ValueType> >::type* = 0) // disable if value has type `const ValueType&&`
|
||||
: man(0), content()
|
||||
{
|
||||
typedef typename boost::decay<ValueType>::type DecayedType;
|
||||
BOOST_STATIC_ASSERT_MSG(
|
||||
!(boost::is_same<DecayedType, boost::any>::value),
|
||||
"boost::anys::basic_any shall not be constructed from boost::any"
|
||||
);
|
||||
BOOST_STATIC_ASSERT_MSG(
|
||||
!anys::detail::is_basic_any<DecayedType>::value,
|
||||
"boost::anys::basic_any<A, B> shall not be constructed from boost::anys::basic_any<C, D>"
|
||||
);
|
||||
create(*this, static_cast<ValueType&&>(value), is_small_object<DecayedType>());
|
||||
}
|
||||
#endif
|
||||
|
||||
~basic_any() BOOST_NOEXCEPT
|
||||
{
|
||||
if (man)
|
||||
{
|
||||
man(Destroy, *this, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public: // modifiers
|
||||
|
||||
basic_any & swap(basic_any & rhs) BOOST_NOEXCEPT
|
||||
{
|
||||
if (this == &rhs)
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
if (man && rhs.man)
|
||||
{
|
||||
basic_any tmp;
|
||||
rhs.man(Move, tmp, &rhs, 0);
|
||||
man(Move, rhs, this, 0);
|
||||
tmp.man(Move, *this, &tmp, 0);
|
||||
}
|
||||
else if (man)
|
||||
{
|
||||
man(Move, rhs, this, 0);
|
||||
}
|
||||
else if (rhs.man)
|
||||
{
|
||||
rhs.man(Move, *this, &rhs, 0);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
template<typename ValueType>
|
||||
basic_any & operator=(const ValueType & rhs)
|
||||
{
|
||||
BOOST_STATIC_ASSERT_MSG(
|
||||
!(boost::is_same<ValueType, boost::any>::value),
|
||||
"boost::any shall not be assigned into boost::anys::basic_any"
|
||||
);
|
||||
BOOST_STATIC_ASSERT_MSG(
|
||||
!anys::detail::is_basic_any<ValueType>::value,
|
||||
"boost::anys::basic_any<A, B> shall not be assigned into boost::anys::basic_any<C, D>"
|
||||
);
|
||||
basic_any(rhs).swap(*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
basic_any & operator=(basic_any rhs)
|
||||
{
|
||||
rhs.swap(*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
#else
|
||||
basic_any & operator=(const basic_any& rhs)
|
||||
{
|
||||
basic_any(rhs).swap(*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
// move assignment
|
||||
basic_any & operator=(basic_any&& rhs) BOOST_NOEXCEPT
|
||||
{
|
||||
rhs.swap(*this);
|
||||
basic_any().swap(rhs);
|
||||
return *this;
|
||||
}
|
||||
|
||||
// Perfect forwarding of ValueType
|
||||
template <class ValueType>
|
||||
basic_any & operator=(ValueType&& rhs)
|
||||
{
|
||||
typedef typename boost::decay<ValueType>::type DecayedType;
|
||||
BOOST_STATIC_ASSERT_MSG(
|
||||
!(boost::is_same<DecayedType, boost::any>::value),
|
||||
"boost::any shall not be assigned into boost::anys::basic_any"
|
||||
);
|
||||
BOOST_STATIC_ASSERT_MSG(
|
||||
(!anys::detail::is_basic_any<DecayedType>::value || boost::is_same<DecayedType, basic_any>::value),
|
||||
"boost::anys::basic_any<A, B> shall not be assigned into boost::anys::basic_any<C, D>"
|
||||
);
|
||||
basic_any(static_cast<ValueType&&>(rhs)).swap(*this);
|
||||
return *this;
|
||||
}
|
||||
#endif
|
||||
|
||||
public: // queries
|
||||
|
||||
bool empty() const BOOST_NOEXCEPT
|
||||
{
|
||||
return !man;
|
||||
}
|
||||
|
||||
void clear() BOOST_NOEXCEPT
|
||||
{
|
||||
basic_any().swap(*this);
|
||||
}
|
||||
|
||||
const boost::typeindex::type_info& type() const BOOST_NOEXCEPT
|
||||
{
|
||||
return man
|
||||
? *static_cast<const boost::typeindex::type_info*>(man(Typeinfo, const_cast<basic_any&>(*this), 0, 0))
|
||||
: boost::typeindex::type_id<void>().type_info();
|
||||
}
|
||||
|
||||
private: // representation
|
||||
|
||||
template<typename ValueType, std::size_t Size, std::size_t Alignment>
|
||||
friend ValueType * any_cast(basic_any<Size, Alignment> *) BOOST_NOEXCEPT;
|
||||
|
||||
template<typename ValueType, std::size_t Size, std::size_t Alignment>
|
||||
friend ValueType * unsafe_any_cast(basic_any<Size, Alignment> *) BOOST_NOEXCEPT;
|
||||
|
||||
typedef void*(*manager)(operation op, basic_any& left, const basic_any* right, const boost::typeindex::type_info* info);
|
||||
|
||||
manager man;
|
||||
|
||||
union content {
|
||||
void * large_value;
|
||||
typename boost::aligned_storage<OptimizeForSize, OptimizeForAlignment>::type small_value;
|
||||
} content;
|
||||
};
|
||||
|
||||
template<std::size_t OptimizeForSize, std::size_t OptimizeForAlignment>
|
||||
void swap(basic_any<OptimizeForSize, OptimizeForAlignment>& lhs, basic_any<OptimizeForSize, OptimizeForAlignment>& rhs) BOOST_NOEXCEPT
|
||||
{
|
||||
lhs.swap(rhs);
|
||||
}
|
||||
|
||||
template<typename ValueType, std::size_t Size, std::size_t Alignment>
|
||||
ValueType * any_cast(basic_any<Size, Alignment> * operand) BOOST_NOEXCEPT
|
||||
{
|
||||
return operand->man ?
|
||||
static_cast<typename remove_cv<ValueType>::type *>(operand->man(basic_any<Size, Alignment>::AnyCast, *operand, 0, &boost::typeindex::type_id<ValueType>().type_info()))
|
||||
: 0;
|
||||
}
|
||||
|
||||
template<typename ValueType, std::size_t OptimizeForSize, std::size_t OptimizeForAlignment>
|
||||
inline const ValueType * any_cast(const basic_any<OptimizeForSize, OptimizeForAlignment> * operand) BOOST_NOEXCEPT
|
||||
{
|
||||
return any_cast<ValueType>(const_cast<basic_any<OptimizeForSize, OptimizeForAlignment> *>(operand));
|
||||
}
|
||||
|
||||
template<typename ValueType, std::size_t OptimizeForSize, std::size_t OptimizeForAlignment>
|
||||
ValueType any_cast(basic_any<OptimizeForSize, OptimizeForAlignment> & operand)
|
||||
{
|
||||
typedef typename remove_reference<ValueType>::type nonref;
|
||||
|
||||
nonref * result = any_cast<nonref>(boost::addressof(operand));
|
||||
if(!result)
|
||||
boost::throw_exception(bad_any_cast());
|
||||
|
||||
// Attempt to avoid construction of a temporary object in cases when
|
||||
// `ValueType` is not a reference. Example:
|
||||
// `static_cast<std::string>(*result);`
|
||||
// which is equal to `std::string(*result);`
|
||||
typedef typename boost::conditional<
|
||||
boost::is_reference<ValueType>::value,
|
||||
ValueType,
|
||||
typename boost::add_reference<ValueType>::type
|
||||
>::type ref_type;
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable: 4172) // "returning address of local variable or temporary" but *result is not local!
|
||||
#endif
|
||||
return static_cast<ref_type>(*result);
|
||||
#ifdef BOOST_MSVC
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
}
|
||||
|
||||
template<typename ValueType, std::size_t OptimizeForSize, std::size_t OptimizeForAlignment>
|
||||
inline ValueType any_cast(const basic_any<OptimizeForSize, OptimizeForAlignment> & operand)
|
||||
{
|
||||
typedef typename remove_reference<ValueType>::type nonref;
|
||||
return any_cast<const nonref &>(const_cast<basic_any<OptimizeForSize, OptimizeForAlignment> &>(operand));
|
||||
}
|
||||
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
template<typename ValueType, std::size_t OptimizeForSize, std::size_t OptimizeForAlignment>
|
||||
inline ValueType any_cast(basic_any<OptimizeForSize, OptimizeForAlignment>&& operand)
|
||||
{
|
||||
BOOST_STATIC_ASSERT_MSG(
|
||||
boost::is_rvalue_reference<ValueType&&>::value /*true if ValueType is rvalue or just a value*/
|
||||
|| boost::is_const< typename boost::remove_reference<ValueType>::type >::value,
|
||||
"boost::any_cast shall not be used for getting nonconst references to temporary objects"
|
||||
);
|
||||
return any_cast<ValueType>(operand);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
// Note: The "unsafe" versions of any_cast are not part of the
|
||||
// public interface and may be removed at any time. They are
|
||||
// required where we know what type is stored in the any and can't
|
||||
// use typeid() comparison, e.g., when our types may travel across
|
||||
// different shared libraries.
|
||||
template<typename ValueType, std::size_t OptimizedForSize, std::size_t OptimizeForAlignment>
|
||||
inline ValueType * unsafe_any_cast(basic_any<OptimizedForSize, OptimizeForAlignment> * operand) BOOST_NOEXCEPT
|
||||
{
|
||||
return static_cast<ValueType*>(operand->man(basic_any<OptimizedForSize, OptimizeForAlignment>::UnsafeCast, *operand, 0, 0));
|
||||
}
|
||||
|
||||
template<typename ValueType, std::size_t OptimizeForSize, std::size_t OptimizeForAlignment>
|
||||
inline const ValueType * unsafe_any_cast(const basic_any<OptimizeForSize, OptimizeForAlignment> * operand) BOOST_NOEXCEPT
|
||||
{
|
||||
return unsafe_any_cast<ValueType>(const_cast<basic_any<OptimizeForSize, OptimizeForAlignment> *>(operand));
|
||||
}
|
||||
|
||||
} // namespace anys
|
||||
|
||||
using boost::anys::any_cast;
|
||||
using boost::anys::unsafe_any_cast;
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_ANYS_BASIC_ANY_HPP_INCLUDED
|
||||
@ -1,40 +0,0 @@
|
||||
// Copyright Antony Polukhin, 2021.
|
||||
//
|
||||
// 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)
|
||||
|
||||
// Contributed by Ruslan Arutyunyan
|
||||
#ifndef BOOST_ANY_ANYS_FWD_HPP
|
||||
#define BOOST_ANY_ANYS_FWD_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/type_traits/alignment_of.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
class any;
|
||||
|
||||
namespace anys {
|
||||
|
||||
template<std::size_t OptimizeForSize = sizeof(void*), std::size_t OptimizeForAlignment = boost::alignment_of<void*>::value>
|
||||
class basic_any;
|
||||
|
||||
namespace detail {
|
||||
template <class T>
|
||||
struct is_basic_any: public false_type {};
|
||||
|
||||
|
||||
template<std::size_t OptimizeForSize, std::size_t OptimizeForAlignment>
|
||||
struct is_basic_any<boost::anys::basic_any<OptimizeForSize, OptimizeForAlignment> > : public true_type {};
|
||||
} // namespace detail
|
||||
|
||||
} // namespace anys
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_ANY_ANYS_FWD_HPP
|
||||
@ -1,456 +0,0 @@
|
||||
/* The following code declares class array,
|
||||
* an STL container (as wrapper) for arrays of constant size.
|
||||
*
|
||||
* See
|
||||
* http://www.boost.org/libs/array/
|
||||
* for documentation.
|
||||
*
|
||||
* The original author site is at: http://www.josuttis.com/
|
||||
*
|
||||
* (C) Copyright Nicolai M. Josuttis 2001.
|
||||
*
|
||||
* Distributed under the Boost Software License, Version 1.0. (See
|
||||
* accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
*
|
||||
* 9 Jan 2013 - (mtc) Added constexpr
|
||||
* 14 Apr 2012 - (mtc) Added support for boost::hash
|
||||
* 28 Dec 2010 - (mtc) Added cbegin and cend (and crbegin and crend) for C++Ox compatibility.
|
||||
* 10 Mar 2010 - (mtc) fill method added, matching resolution of the standard library working group.
|
||||
* See <http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#776> or Trac issue #3168
|
||||
* Eventually, we should remove "assign" which is now a synonym for "fill" (Marshall Clow)
|
||||
* 10 Mar 2010 - added workaround for SUNCC and !STLPort [trac #3893] (Marshall Clow)
|
||||
* 29 Jan 2004 - c_array() added, BOOST_NO_PRIVATE_IN_AGGREGATE removed (Nico Josuttis)
|
||||
* 23 Aug 2002 - fix for Non-MSVC compilers combined with MSVC libraries.
|
||||
* 05 Aug 2001 - minor update (Nico Josuttis)
|
||||
* 20 Jan 2001 - STLport fix (Beman Dawes)
|
||||
* 29 Sep 2000 - Initial Revision (Nico Josuttis)
|
||||
*
|
||||
* Jan 29, 2004
|
||||
*/
|
||||
#ifndef BOOST_ARRAY_HPP
|
||||
#define BOOST_ARRAY_HPP
|
||||
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable:4996) // 'std::equal': Function call with parameters that may be unsafe
|
||||
# pragma warning(disable:4510) // boost::array<T,N>' : default constructor could not be generated
|
||||
# pragma warning(disable:4610) // warning C4610: class 'boost::array<T,N>' can never be instantiated - user defined constructor required
|
||||
#endif
|
||||
|
||||
#include <cstddef>
|
||||
#include <iterator>
|
||||
#include <stdexcept>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/swap.hpp>
|
||||
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <algorithm>
|
||||
|
||||
// FIXES for broken compilers
|
||||
#include <boost/config.hpp>
|
||||
|
||||
|
||||
namespace boost {
|
||||
|
||||
template<class T, std::size_t N>
|
||||
class array {
|
||||
public:
|
||||
T elems[N]; // fixed-size array of elements of type T
|
||||
|
||||
public:
|
||||
// type definitions
|
||||
typedef T value_type;
|
||||
typedef T* iterator;
|
||||
typedef const T* const_iterator;
|
||||
typedef T& reference;
|
||||
typedef const T& const_reference;
|
||||
typedef std::size_t size_type;
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
|
||||
// iterator support
|
||||
iterator begin() { return elems; }
|
||||
const_iterator begin() const { return elems; }
|
||||
const_iterator cbegin() const { return elems; }
|
||||
|
||||
iterator end() { return elems+N; }
|
||||
const_iterator end() const { return elems+N; }
|
||||
const_iterator cend() const { return elems+N; }
|
||||
|
||||
// reverse iterator support
|
||||
#if !defined(BOOST_MSVC_STD_ITERATOR) && !defined(BOOST_NO_STD_ITERATOR_TRAITS)
|
||||
typedef std::reverse_iterator<iterator> reverse_iterator;
|
||||
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||
#elif defined(_RWSTD_NO_CLASS_PARTIAL_SPEC)
|
||||
typedef std::reverse_iterator<iterator, std::random_access_iterator_tag,
|
||||
value_type, reference, iterator, difference_type> reverse_iterator;
|
||||
typedef std::reverse_iterator<const_iterator, std::random_access_iterator_tag,
|
||||
value_type, const_reference, const_iterator, difference_type> const_reverse_iterator;
|
||||
#else
|
||||
// workaround for broken reverse_iterator implementations
|
||||
typedef std::reverse_iterator<iterator,T> reverse_iterator;
|
||||
typedef std::reverse_iterator<const_iterator,T> const_reverse_iterator;
|
||||
#endif
|
||||
|
||||
reverse_iterator rbegin() { return reverse_iterator(end()); }
|
||||
const_reverse_iterator rbegin() const {
|
||||
return const_reverse_iterator(end());
|
||||
}
|
||||
const_reverse_iterator crbegin() const {
|
||||
return const_reverse_iterator(end());
|
||||
}
|
||||
|
||||
reverse_iterator rend() { return reverse_iterator(begin()); }
|
||||
const_reverse_iterator rend() const {
|
||||
return const_reverse_iterator(begin());
|
||||
}
|
||||
const_reverse_iterator crend() const {
|
||||
return const_reverse_iterator(begin());
|
||||
}
|
||||
|
||||
// operator[]
|
||||
reference operator[](size_type i)
|
||||
{
|
||||
return BOOST_ASSERT_MSG( i < N, "out of range" ), elems[i];
|
||||
}
|
||||
|
||||
/*BOOST_CONSTEXPR*/ const_reference operator[](size_type i) const
|
||||
{
|
||||
return BOOST_ASSERT_MSG( i < N, "out of range" ), elems[i];
|
||||
}
|
||||
|
||||
// at() with range check
|
||||
reference at(size_type i) { return rangecheck(i), elems[i]; }
|
||||
/*BOOST_CONSTEXPR*/ const_reference at(size_type i) const { return rangecheck(i), elems[i]; }
|
||||
|
||||
// front() and back()
|
||||
reference front()
|
||||
{
|
||||
return elems[0];
|
||||
}
|
||||
|
||||
BOOST_CONSTEXPR const_reference front() const
|
||||
{
|
||||
return elems[0];
|
||||
}
|
||||
|
||||
reference back()
|
||||
{
|
||||
return elems[N-1];
|
||||
}
|
||||
|
||||
BOOST_CONSTEXPR const_reference back() const
|
||||
{
|
||||
return elems[N-1];
|
||||
}
|
||||
|
||||
// size is constant
|
||||
static BOOST_CONSTEXPR size_type size() { return N; }
|
||||
static BOOST_CONSTEXPR bool empty() { return false; }
|
||||
static BOOST_CONSTEXPR size_type max_size() { return N; }
|
||||
enum { static_size = N };
|
||||
|
||||
// swap (note: linear complexity)
|
||||
void swap (array<T,N>& y) {
|
||||
for (size_type i = 0; i < N; ++i)
|
||||
boost::swap(elems[i],y.elems[i]);
|
||||
}
|
||||
|
||||
// direct access to data (read-only)
|
||||
const T* data() const { return elems; }
|
||||
T* data() { return elems; }
|
||||
|
||||
// use array as C array (direct read/write access to data)
|
||||
T* c_array() { return elems; }
|
||||
|
||||
// assignment with type conversion
|
||||
template <typename T2>
|
||||
array<T,N>& operator= (const array<T2,N>& rhs) {
|
||||
std::copy(rhs.begin(),rhs.end(), begin());
|
||||
return *this;
|
||||
}
|
||||
|
||||
// assign one value to all elements
|
||||
void assign (const T& value) { fill ( value ); } // A synonym for fill
|
||||
void fill (const T& value)
|
||||
{
|
||||
std::fill_n(begin(),size(),value);
|
||||
}
|
||||
|
||||
// check range (may be private because it is static)
|
||||
static BOOST_CONSTEXPR bool rangecheck (size_type i) {
|
||||
return i >= size() ? boost::throw_exception(std::out_of_range ("array<>: index out of range")), true : true;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
template< class T >
|
||||
class array< T, 0 > {
|
||||
|
||||
public:
|
||||
// type definitions
|
||||
typedef T value_type;
|
||||
typedef T* iterator;
|
||||
typedef const T* const_iterator;
|
||||
typedef T& reference;
|
||||
typedef const T& const_reference;
|
||||
typedef std::size_t size_type;
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
|
||||
// iterator support
|
||||
iterator begin() { return iterator( reinterpret_cast< T * >( this ) ); }
|
||||
const_iterator begin() const { return const_iterator( reinterpret_cast< const T * >( this ) ); }
|
||||
const_iterator cbegin() const { return const_iterator( reinterpret_cast< const T * >( this ) ); }
|
||||
|
||||
iterator end() { return begin(); }
|
||||
const_iterator end() const { return begin(); }
|
||||
const_iterator cend() const { return cbegin(); }
|
||||
|
||||
// reverse iterator support
|
||||
#if !defined(BOOST_MSVC_STD_ITERATOR) && !defined(BOOST_NO_STD_ITERATOR_TRAITS)
|
||||
typedef std::reverse_iterator<iterator> reverse_iterator;
|
||||
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||
#elif defined(_RWSTD_NO_CLASS_PARTIAL_SPEC)
|
||||
typedef std::reverse_iterator<iterator, std::random_access_iterator_tag,
|
||||
value_type, reference, iterator, difference_type> reverse_iterator;
|
||||
typedef std::reverse_iterator<const_iterator, std::random_access_iterator_tag,
|
||||
value_type, const_reference, const_iterator, difference_type> const_reverse_iterator;
|
||||
#else
|
||||
// workaround for broken reverse_iterator implementations
|
||||
typedef std::reverse_iterator<iterator,T> reverse_iterator;
|
||||
typedef std::reverse_iterator<const_iterator,T> const_reverse_iterator;
|
||||
#endif
|
||||
|
||||
reverse_iterator rbegin() { return reverse_iterator(end()); }
|
||||
const_reverse_iterator rbegin() const {
|
||||
return const_reverse_iterator(end());
|
||||
}
|
||||
const_reverse_iterator crbegin() const {
|
||||
return const_reverse_iterator(end());
|
||||
}
|
||||
|
||||
reverse_iterator rend() { return reverse_iterator(begin()); }
|
||||
const_reverse_iterator rend() const {
|
||||
return const_reverse_iterator(begin());
|
||||
}
|
||||
const_reverse_iterator crend() const {
|
||||
return const_reverse_iterator(begin());
|
||||
}
|
||||
|
||||
// operator[]
|
||||
reference operator[](size_type /*i*/)
|
||||
{
|
||||
return failed_rangecheck();
|
||||
}
|
||||
|
||||
/*BOOST_CONSTEXPR*/ const_reference operator[](size_type /*i*/) const
|
||||
{
|
||||
return failed_rangecheck();
|
||||
}
|
||||
|
||||
// at() with range check
|
||||
reference at(size_type /*i*/) { return failed_rangecheck(); }
|
||||
/*BOOST_CONSTEXPR*/ const_reference at(size_type /*i*/) const { return failed_rangecheck(); }
|
||||
|
||||
// front() and back()
|
||||
reference front()
|
||||
{
|
||||
return failed_rangecheck();
|
||||
}
|
||||
|
||||
BOOST_CONSTEXPR const_reference front() const
|
||||
{
|
||||
return failed_rangecheck();
|
||||
}
|
||||
|
||||
reference back()
|
||||
{
|
||||
return failed_rangecheck();
|
||||
}
|
||||
|
||||
BOOST_CONSTEXPR const_reference back() const
|
||||
{
|
||||
return failed_rangecheck();
|
||||
}
|
||||
|
||||
// size is constant
|
||||
static BOOST_CONSTEXPR size_type size() { return 0; }
|
||||
static BOOST_CONSTEXPR bool empty() { return true; }
|
||||
static BOOST_CONSTEXPR size_type max_size() { return 0; }
|
||||
enum { static_size = 0 };
|
||||
|
||||
void swap (array<T,0>& /*y*/) {
|
||||
}
|
||||
|
||||
// direct access to data (read-only)
|
||||
const T* data() const { return 0; }
|
||||
T* data() { return 0; }
|
||||
|
||||
// use array as C array (direct read/write access to data)
|
||||
T* c_array() { return 0; }
|
||||
|
||||
// assignment with type conversion
|
||||
template <typename T2>
|
||||
array<T,0>& operator= (const array<T2,0>& ) {
|
||||
return *this;
|
||||
}
|
||||
|
||||
// assign one value to all elements
|
||||
void assign (const T& value) { fill ( value ); }
|
||||
void fill (const T& ) {}
|
||||
|
||||
// check range (may be private because it is static)
|
||||
static reference failed_rangecheck () {
|
||||
std::out_of_range e("attempt to access element of an empty array");
|
||||
boost::throw_exception(e);
|
||||
#if defined(BOOST_NO_EXCEPTIONS) || (!defined(BOOST_MSVC) && !defined(__PATHSCALE__))
|
||||
//
|
||||
// We need to return something here to keep
|
||||
// some compilers happy: however we will never
|
||||
// actually get here....
|
||||
//
|
||||
static T placeholder;
|
||||
return placeholder;
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
// comparisons
|
||||
template<class T, std::size_t N>
|
||||
bool operator== (const array<T,N>& x, const array<T,N>& y) {
|
||||
return std::equal(x.begin(), x.end(), y.begin());
|
||||
}
|
||||
template<class T, std::size_t N>
|
||||
bool operator< (const array<T,N>& x, const array<T,N>& y) {
|
||||
return std::lexicographical_compare(x.begin(),x.end(),y.begin(),y.end());
|
||||
}
|
||||
template<class T, std::size_t N>
|
||||
bool operator!= (const array<T,N>& x, const array<T,N>& y) {
|
||||
return !(x==y);
|
||||
}
|
||||
template<class T, std::size_t N>
|
||||
bool operator> (const array<T,N>& x, const array<T,N>& y) {
|
||||
return y<x;
|
||||
}
|
||||
template<class T, std::size_t N>
|
||||
bool operator<= (const array<T,N>& x, const array<T,N>& y) {
|
||||
return !(y<x);
|
||||
}
|
||||
template<class T, std::size_t N>
|
||||
bool operator>= (const array<T,N>& x, const array<T,N>& y) {
|
||||
return !(x<y);
|
||||
}
|
||||
|
||||
// global swap()
|
||||
template<class T, std::size_t N>
|
||||
inline void swap (array<T,N>& x, array<T,N>& y) {
|
||||
x.swap(y);
|
||||
}
|
||||
|
||||
#if defined(__SUNPRO_CC)
|
||||
// Trac ticket #4757; the Sun Solaris compiler can't handle
|
||||
// syntax like 'T(&get_c_array(boost::array<T,N>& arg))[N]'
|
||||
//
|
||||
// We can't just use this for all compilers, because the
|
||||
// borland compilers can't handle this form.
|
||||
namespace detail {
|
||||
template <typename T, std::size_t N> struct c_array
|
||||
{
|
||||
typedef T type[N];
|
||||
};
|
||||
}
|
||||
|
||||
// Specific for boost::array: simply returns its elems data member.
|
||||
template <typename T, std::size_t N>
|
||||
typename detail::c_array<T,N>::type& get_c_array(boost::array<T,N>& arg)
|
||||
{
|
||||
return arg.elems;
|
||||
}
|
||||
|
||||
// Specific for boost::array: simply returns its elems data member.
|
||||
template <typename T, std::size_t N>
|
||||
typename detail::c_array<T,N>::type const& get_c_array(const boost::array<T,N>& arg)
|
||||
{
|
||||
return arg.elems;
|
||||
}
|
||||
#else
|
||||
// Specific for boost::array: simply returns its elems data member.
|
||||
template <typename T, std::size_t N>
|
||||
T(&get_c_array(boost::array<T,N>& arg))[N]
|
||||
{
|
||||
return arg.elems;
|
||||
}
|
||||
|
||||
// Const version.
|
||||
template <typename T, std::size_t N>
|
||||
const T(&get_c_array(const boost::array<T,N>& arg))[N]
|
||||
{
|
||||
return arg.elems;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
// Overload for std::array, assuming that std::array will have
|
||||
// explicit conversion functions as discussed at the WG21 meeting
|
||||
// in Summit, March 2009.
|
||||
template <typename T, std::size_t N>
|
||||
T(&get_c_array(std::array<T,N>& arg))[N]
|
||||
{
|
||||
return static_cast<T(&)[N]>(arg);
|
||||
}
|
||||
|
||||
// Const version.
|
||||
template <typename T, std::size_t N>
|
||||
const T(&get_c_array(const std::array<T,N>& arg))[N]
|
||||
{
|
||||
return static_cast<T(&)[N]>(arg);
|
||||
}
|
||||
#endif
|
||||
|
||||
template <class It> std::size_t hash_range(It, It);
|
||||
|
||||
template<class T, std::size_t N>
|
||||
std::size_t hash_value(const array<T,N>& arr)
|
||||
{
|
||||
return boost::hash_range(arr.begin(), arr.end());
|
||||
}
|
||||
|
||||
template <size_t Idx, typename T, size_t N>
|
||||
T &get(boost::array<T,N> &arr) BOOST_NOEXCEPT {
|
||||
BOOST_STATIC_ASSERT_MSG ( Idx < N, "boost::get<>(boost::array &) index out of range" );
|
||||
return arr[Idx];
|
||||
}
|
||||
|
||||
template <size_t Idx, typename T, size_t N>
|
||||
const T &get(const boost::array<T,N> &arr) BOOST_NOEXCEPT {
|
||||
BOOST_STATIC_ASSERT_MSG ( Idx < N, "boost::get<>(const boost::array &) index out of range" );
|
||||
return arr[Idx];
|
||||
}
|
||||
|
||||
} /* namespace boost */
|
||||
|
||||
#ifndef BOOST_NO_CXX11_HDR_ARRAY
|
||||
// If we don't have std::array, I'm assuming that we don't have std::get
|
||||
namespace std {
|
||||
template <size_t Idx, typename T, size_t N>
|
||||
T &get(boost::array<T,N> &arr) BOOST_NOEXCEPT {
|
||||
BOOST_STATIC_ASSERT_MSG ( Idx < N, "std::get<>(boost::array &) index out of range" );
|
||||
return arr[Idx];
|
||||
}
|
||||
|
||||
template <size_t Idx, typename T, size_t N>
|
||||
const T &get(const boost::array<T,N> &arr) BOOST_NOEXCEPT {
|
||||
BOOST_STATIC_ASSERT_MSG ( Idx < N, "std::get<>(const boost::array &) index out of range" );
|
||||
return arr[Idx];
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#endif /*BOOST_ARRAY_HPP*/
|
||||
@ -1,200 +0,0 @@
|
||||
//
|
||||
// asio.hpp
|
||||
// ~~~~~~~~
|
||||
//
|
||||
// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// See www.boost.org/libs/asio for documentation.
|
||||
//
|
||||
|
||||
#ifndef BOOST_ASIO_HPP
|
||||
#define BOOST_ASIO_HPP
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
|
||||
# pragma once
|
||||
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
|
||||
|
||||
#include <boost/asio/associated_allocator.hpp>
|
||||
#include <boost/asio/associated_executor.hpp>
|
||||
#include <boost/asio/associated_cancellation_slot.hpp>
|
||||
#include <boost/asio/associator.hpp>
|
||||
#include <boost/asio/async_result.hpp>
|
||||
#include <boost/asio/awaitable.hpp>
|
||||
#include <boost/asio/basic_datagram_socket.hpp>
|
||||
#include <boost/asio/basic_deadline_timer.hpp>
|
||||
#include <boost/asio/basic_file.hpp>
|
||||
#include <boost/asio/basic_io_object.hpp>
|
||||
#include <boost/asio/basic_random_access_file.hpp>
|
||||
#include <boost/asio/basic_raw_socket.hpp>
|
||||
#include <boost/asio/basic_readable_pipe.hpp>
|
||||
#include <boost/asio/basic_seq_packet_socket.hpp>
|
||||
#include <boost/asio/basic_serial_port.hpp>
|
||||
#include <boost/asio/basic_signal_set.hpp>
|
||||
#include <boost/asio/basic_socket.hpp>
|
||||
#include <boost/asio/basic_socket_acceptor.hpp>
|
||||
#include <boost/asio/basic_socket_iostream.hpp>
|
||||
#include <boost/asio/basic_socket_streambuf.hpp>
|
||||
#include <boost/asio/basic_stream_file.hpp>
|
||||
#include <boost/asio/basic_stream_socket.hpp>
|
||||
#include <boost/asio/basic_streambuf.hpp>
|
||||
#include <boost/asio/basic_waitable_timer.hpp>
|
||||
#include <boost/asio/basic_writable_pipe.hpp>
|
||||
#include <boost/asio/bind_cancellation_slot.hpp>
|
||||
#include <boost/asio/bind_executor.hpp>
|
||||
#include <boost/asio/buffer.hpp>
|
||||
#include <boost/asio/buffer_registration.hpp>
|
||||
#include <boost/asio/buffered_read_stream_fwd.hpp>
|
||||
#include <boost/asio/buffered_read_stream.hpp>
|
||||
#include <boost/asio/buffered_stream_fwd.hpp>
|
||||
#include <boost/asio/buffered_stream.hpp>
|
||||
#include <boost/asio/buffered_write_stream_fwd.hpp>
|
||||
#include <boost/asio/buffered_write_stream.hpp>
|
||||
#include <boost/asio/buffers_iterator.hpp>
|
||||
#include <boost/asio/cancellation_signal.hpp>
|
||||
#include <boost/asio/cancellation_state.hpp>
|
||||
#include <boost/asio/cancellation_type.hpp>
|
||||
#include <boost/asio/co_spawn.hpp>
|
||||
#include <boost/asio/completion_condition.hpp>
|
||||
#include <boost/asio/compose.hpp>
|
||||
#include <boost/asio/connect.hpp>
|
||||
#include <boost/asio/connect_pipe.hpp>
|
||||
#include <boost/asio/coroutine.hpp>
|
||||
#include <boost/asio/deadline_timer.hpp>
|
||||
#include <boost/asio/defer.hpp>
|
||||
#include <boost/asio/detached.hpp>
|
||||
#include <boost/asio/dispatch.hpp>
|
||||
#include <boost/asio/error.hpp>
|
||||
#include <boost/asio/execution.hpp>
|
||||
#include <boost/asio/execution/allocator.hpp>
|
||||
#include <boost/asio/execution/any_executor.hpp>
|
||||
#include <boost/asio/execution/blocking.hpp>
|
||||
#include <boost/asio/execution/blocking_adaptation.hpp>
|
||||
#include <boost/asio/execution/bulk_execute.hpp>
|
||||
#include <boost/asio/execution/bulk_guarantee.hpp>
|
||||
#include <boost/asio/execution/connect.hpp>
|
||||
#include <boost/asio/execution/context.hpp>
|
||||
#include <boost/asio/execution/context_as.hpp>
|
||||
#include <boost/asio/execution/execute.hpp>
|
||||
#include <boost/asio/execution/executor.hpp>
|
||||
#include <boost/asio/execution/invocable_archetype.hpp>
|
||||
#include <boost/asio/execution/mapping.hpp>
|
||||
#include <boost/asio/execution/occupancy.hpp>
|
||||
#include <boost/asio/execution/operation_state.hpp>
|
||||
#include <boost/asio/execution/outstanding_work.hpp>
|
||||
#include <boost/asio/execution/prefer_only.hpp>
|
||||
#include <boost/asio/execution/receiver.hpp>
|
||||
#include <boost/asio/execution/receiver_invocation_error.hpp>
|
||||
#include <boost/asio/execution/relationship.hpp>
|
||||
#include <boost/asio/execution/schedule.hpp>
|
||||
#include <boost/asio/execution/scheduler.hpp>
|
||||
#include <boost/asio/execution/sender.hpp>
|
||||
#include <boost/asio/execution/set_done.hpp>
|
||||
#include <boost/asio/execution/set_error.hpp>
|
||||
#include <boost/asio/execution/set_value.hpp>
|
||||
#include <boost/asio/execution/start.hpp>
|
||||
#include <boost/asio/execution_context.hpp>
|
||||
#include <boost/asio/executor.hpp>
|
||||
#include <boost/asio/executor_work_guard.hpp>
|
||||
#include <boost/asio/file_base.hpp>
|
||||
#include <boost/asio/generic/basic_endpoint.hpp>
|
||||
#include <boost/asio/generic/datagram_protocol.hpp>
|
||||
#include <boost/asio/generic/raw_protocol.hpp>
|
||||
#include <boost/asio/generic/seq_packet_protocol.hpp>
|
||||
#include <boost/asio/generic/stream_protocol.hpp>
|
||||
#include <boost/asio/handler_alloc_hook.hpp>
|
||||
#include <boost/asio/handler_continuation_hook.hpp>
|
||||
#include <boost/asio/handler_invoke_hook.hpp>
|
||||
#include <boost/asio/high_resolution_timer.hpp>
|
||||
#include <boost/asio/io_context.hpp>
|
||||
#include <boost/asio/io_context_strand.hpp>
|
||||
#include <boost/asio/io_service.hpp>
|
||||
#include <boost/asio/io_service_strand.hpp>
|
||||
#include <boost/asio/ip/address.hpp>
|
||||
#include <boost/asio/ip/address_v4.hpp>
|
||||
#include <boost/asio/ip/address_v4_iterator.hpp>
|
||||
#include <boost/asio/ip/address_v4_range.hpp>
|
||||
#include <boost/asio/ip/address_v6.hpp>
|
||||
#include <boost/asio/ip/address_v6_iterator.hpp>
|
||||
#include <boost/asio/ip/address_v6_range.hpp>
|
||||
#include <boost/asio/ip/network_v4.hpp>
|
||||
#include <boost/asio/ip/network_v6.hpp>
|
||||
#include <boost/asio/ip/bad_address_cast.hpp>
|
||||
#include <boost/asio/ip/basic_endpoint.hpp>
|
||||
#include <boost/asio/ip/basic_resolver.hpp>
|
||||
#include <boost/asio/ip/basic_resolver_entry.hpp>
|
||||
#include <boost/asio/ip/basic_resolver_iterator.hpp>
|
||||
#include <boost/asio/ip/basic_resolver_query.hpp>
|
||||
#include <boost/asio/ip/host_name.hpp>
|
||||
#include <boost/asio/ip/icmp.hpp>
|
||||
#include <boost/asio/ip/multicast.hpp>
|
||||
#include <boost/asio/ip/resolver_base.hpp>
|
||||
#include <boost/asio/ip/resolver_query_base.hpp>
|
||||
#include <boost/asio/ip/tcp.hpp>
|
||||
#include <boost/asio/ip/udp.hpp>
|
||||
#include <boost/asio/ip/unicast.hpp>
|
||||
#include <boost/asio/ip/v6_only.hpp>
|
||||
#include <boost/asio/is_applicable_property.hpp>
|
||||
#include <boost/asio/is_executor.hpp>
|
||||
#include <boost/asio/is_read_buffered.hpp>
|
||||
#include <boost/asio/is_write_buffered.hpp>
|
||||
#include <boost/asio/local/basic_endpoint.hpp>
|
||||
#include <boost/asio/local/connect_pair.hpp>
|
||||
#include <boost/asio/local/datagram_protocol.hpp>
|
||||
#include <boost/asio/local/stream_protocol.hpp>
|
||||
#include <boost/asio/multiple_exceptions.hpp>
|
||||
#include <boost/asio/packaged_task.hpp>
|
||||
#include <boost/asio/placeholders.hpp>
|
||||
#include <boost/asio/posix/basic_descriptor.hpp>
|
||||
#include <boost/asio/posix/basic_stream_descriptor.hpp>
|
||||
#include <boost/asio/posix/descriptor.hpp>
|
||||
#include <boost/asio/posix/descriptor_base.hpp>
|
||||
#include <boost/asio/posix/stream_descriptor.hpp>
|
||||
#include <boost/asio/post.hpp>
|
||||
#include <boost/asio/prefer.hpp>
|
||||
#include <boost/asio/query.hpp>
|
||||
#include <boost/asio/random_access_file.hpp>
|
||||
#include <boost/asio/read.hpp>
|
||||
#include <boost/asio/read_at.hpp>
|
||||
#include <boost/asio/read_until.hpp>
|
||||
#include <boost/asio/readable_pipe.hpp>
|
||||
#include <boost/asio/redirect_error.hpp>
|
||||
#include <boost/asio/registered_buffer.hpp>
|
||||
#include <boost/asio/require.hpp>
|
||||
#include <boost/asio/require_concept.hpp>
|
||||
#include <boost/asio/serial_port.hpp>
|
||||
#include <boost/asio/serial_port_base.hpp>
|
||||
#include <boost/asio/signal_set.hpp>
|
||||
#include <boost/asio/socket_base.hpp>
|
||||
#include <boost/asio/static_thread_pool.hpp>
|
||||
#include <boost/asio/steady_timer.hpp>
|
||||
#include <boost/asio/strand.hpp>
|
||||
#include <boost/asio/stream_file.hpp>
|
||||
#include <boost/asio/streambuf.hpp>
|
||||
#include <boost/asio/system_context.hpp>
|
||||
#include <boost/asio/system_executor.hpp>
|
||||
#include <boost/asio/system_timer.hpp>
|
||||
#include <boost/asio/this_coro.hpp>
|
||||
#include <boost/asio/thread_pool.hpp>
|
||||
#include <boost/asio/time_traits.hpp>
|
||||
#include <boost/asio/use_awaitable.hpp>
|
||||
#include <boost/asio/use_future.hpp>
|
||||
#include <boost/asio/uses_executor.hpp>
|
||||
#include <boost/asio/version.hpp>
|
||||
#include <boost/asio/wait_traits.hpp>
|
||||
#include <boost/asio/windows/basic_object_handle.hpp>
|
||||
#include <boost/asio/windows/basic_overlapped_handle.hpp>
|
||||
#include <boost/asio/windows/basic_random_access_handle.hpp>
|
||||
#include <boost/asio/windows/basic_stream_handle.hpp>
|
||||
#include <boost/asio/windows/object_handle.hpp>
|
||||
#include <boost/asio/windows/overlapped_handle.hpp>
|
||||
#include <boost/asio/windows/overlapped_ptr.hpp>
|
||||
#include <boost/asio/windows/random_access_handle.hpp>
|
||||
#include <boost/asio/windows/stream_handle.hpp>
|
||||
#include <boost/asio/writable_pipe.hpp>
|
||||
#include <boost/asio/write.hpp>
|
||||
#include <boost/asio/write_at.hpp>
|
||||
|
||||
#endif // BOOST_ASIO_HPP
|
||||
@ -1,85 +0,0 @@
|
||||
//
|
||||
// boost/assert.hpp - BOOST_ASSERT(expr)
|
||||
// BOOST_ASSERT_MSG(expr, msg)
|
||||
// BOOST_VERIFY(expr)
|
||||
// BOOST_VERIFY_MSG(expr, msg)
|
||||
// BOOST_ASSERT_IS_VOID
|
||||
//
|
||||
// Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.
|
||||
// Copyright (c) 2007, 2014 Peter Dimov
|
||||
// Copyright (c) Beman Dawes 2011
|
||||
// Copyright (c) 2015 Ion Gaztanaga
|
||||
//
|
||||
// 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
|
||||
//
|
||||
// Note: There are no include guards. This is intentional.
|
||||
//
|
||||
// See http://www.boost.org/libs/assert/assert.html for documentation.
|
||||
//
|
||||
|
||||
//
|
||||
// Stop inspect complaining about use of 'assert':
|
||||
//
|
||||
// boostinspect:naassert_macro
|
||||
//
|
||||
|
||||
//
|
||||
// BOOST_ASSERT, BOOST_ASSERT_MSG, BOOST_ASSERT_IS_VOID
|
||||
//
|
||||
|
||||
#undef BOOST_ASSERT
|
||||
#undef BOOST_ASSERT_MSG
|
||||
#undef BOOST_ASSERT_IS_VOID
|
||||
|
||||
#if defined(BOOST_DISABLE_ASSERTS) || ( defined(BOOST_ENABLE_ASSERT_DEBUG_HANDLER) && defined(NDEBUG) )
|
||||
|
||||
# define BOOST_ASSERT(expr) ((void)0)
|
||||
# define BOOST_ASSERT_MSG(expr, msg) ((void)0)
|
||||
# define BOOST_ASSERT_IS_VOID
|
||||
|
||||
#elif defined(BOOST_ENABLE_ASSERT_HANDLER) || ( defined(BOOST_ENABLE_ASSERT_DEBUG_HANDLER) && !defined(NDEBUG) )
|
||||
|
||||
#include <boost/config.hpp> // for BOOST_LIKELY
|
||||
#include <boost/current_function.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
void assertion_failed(char const * expr, char const * function, char const * file, long line); // user defined
|
||||
void assertion_failed_msg(char const * expr, char const * msg, char const * function, char const * file, long line); // user defined
|
||||
} // namespace boost
|
||||
|
||||
#define BOOST_ASSERT(expr) (BOOST_LIKELY(!!(expr))? ((void)0): ::boost::assertion_failed(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))
|
||||
#define BOOST_ASSERT_MSG(expr, msg) (BOOST_LIKELY(!!(expr))? ((void)0): ::boost::assertion_failed_msg(#expr, msg, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))
|
||||
|
||||
#else
|
||||
|
||||
# include <assert.h> // .h to support old libraries w/o <cassert> - effect is the same
|
||||
|
||||
# define BOOST_ASSERT(expr) assert(expr)
|
||||
# define BOOST_ASSERT_MSG(expr, msg) assert((expr)&&(msg))
|
||||
#if defined(NDEBUG)
|
||||
# define BOOST_ASSERT_IS_VOID
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
//
|
||||
// BOOST_VERIFY, BOOST_VERIFY_MSG
|
||||
//
|
||||
|
||||
#undef BOOST_VERIFY
|
||||
#undef BOOST_VERIFY_MSG
|
||||
|
||||
#if defined(BOOST_DISABLE_ASSERTS) || ( !defined(BOOST_ENABLE_ASSERT_HANDLER) && defined(NDEBUG) )
|
||||
|
||||
# define BOOST_VERIFY(expr) ((void)(expr))
|
||||
# define BOOST_VERIFY_MSG(expr, msg) ((void)(expr))
|
||||
|
||||
#else
|
||||
|
||||
# define BOOST_VERIFY(expr) BOOST_ASSERT(expr)
|
||||
# define BOOST_VERIFY_MSG(expr, msg) BOOST_ASSERT_MSG(expr,msg)
|
||||
|
||||
#endif
|
||||
@ -1,24 +0,0 @@
|
||||
// Boost.Assign library
|
||||
//
|
||||
// Copyright Thorsten Ottosen 2003-2004. Use, modification and
|
||||
// distribution is subject to the Boost Software License, Version
|
||||
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// For more information, see http://www.boost.org/libs/assign/
|
||||
//
|
||||
|
||||
|
||||
#ifndef BOOST_ASSIGN_HPP
|
||||
#define BOOST_ASSIGN_HPP
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/assign/std.hpp>
|
||||
#include <boost/assign/list_of.hpp>
|
||||
#include <boost/assign/list_inserter.hpp>
|
||||
#include <boost/assign/assignment_exception.hpp>
|
||||
|
||||
#endif
|
||||
@ -1,27 +0,0 @@
|
||||
#ifndef BOOST_ATOMIC_HPP
|
||||
#define BOOST_ATOMIC_HPP
|
||||
|
||||
// Copyright (c) 2011 Helge Bahmann
|
||||
// Copyright (c) 2020 Andrey Semashev
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// This header includes all Boost.Atomic public headers
|
||||
|
||||
#include <boost/memory_order.hpp>
|
||||
#include <boost/atomic/capabilities.hpp>
|
||||
#include <boost/atomic/atomic.hpp>
|
||||
#include <boost/atomic/atomic_ref.hpp>
|
||||
#include <boost/atomic/atomic_flag.hpp>
|
||||
#include <boost/atomic/ipc_atomic.hpp>
|
||||
#include <boost/atomic/ipc_atomic_ref.hpp>
|
||||
#include <boost/atomic/ipc_atomic_flag.hpp>
|
||||
#include <boost/atomic/fences.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@ -1,21 +0,0 @@
|
||||
//
|
||||
// Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// Official repository: https://github.com/boostorg/beast
|
||||
//
|
||||
|
||||
#ifndef BOOST_BEAST_HPP
|
||||
#define BOOST_BEAST_HPP
|
||||
|
||||
#include <boost/beast/core/detail/config.hpp> // must come first
|
||||
|
||||
#include <boost/beast/core.hpp>
|
||||
#include <boost/beast/http.hpp>
|
||||
#include <boost/beast/version.hpp>
|
||||
#include <boost/beast/websocket.hpp>
|
||||
#include <boost/beast/zlib.hpp>
|
||||
|
||||
#endif
|
||||
@ -1,19 +0,0 @@
|
||||
// Boost.Bimap
|
||||
//
|
||||
// Copyright (c) 2006-2007 Matias Capeletto
|
||||
//
|
||||
// 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 www.boost.org/libs/bimap for documentation.
|
||||
|
||||
// Convenience header
|
||||
|
||||
#include <boost/bimap/bimap.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
using ::boost::bimaps::bimap;
|
||||
}
|
||||
|
||||
@ -1,60 +0,0 @@
|
||||
#ifndef BOOST_BIND_HPP_INCLUDED
|
||||
#define BOOST_BIND_HPP_INCLUDED
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
// bind.hpp - binds function objects to arguments
|
||||
//
|
||||
// Copyright (c) 2009, 2015 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
|
||||
//
|
||||
// See http://www.boost.org/libs/bind/bind.html for documentation.
|
||||
//
|
||||
// For backward compatibility, this header includes
|
||||
// <boost/bind/bind.hpp> and then imports the placeholders _1, _2,
|
||||
// _3, ... into the global namespace. Definitions in the global
|
||||
// namespace are not a good practice and this use is deprecated.
|
||||
// Please switch to including <boost/bind/bind.hpp> directly,
|
||||
// adding the using directive locally where appropriate.
|
||||
// Alternatively, the existing behavior may be preserved by defining
|
||||
// the macro BOOST_BIND_GLOBAL_PLACEHOLDERS.
|
||||
|
||||
#include <boost/bind/bind.hpp>
|
||||
#include <boost/config/pragma_message.hpp>
|
||||
|
||||
#ifndef BOOST_BIND_NO_PLACEHOLDERS
|
||||
|
||||
#if !defined(BOOST_BIND_GLOBAL_PLACEHOLDERS)
|
||||
|
||||
BOOST_PRAGMA_MESSAGE(
|
||||
"The practice of declaring the Bind placeholders (_1, _2, ...) "
|
||||
"in the global namespace is deprecated. Please use "
|
||||
"<boost/bind/bind.hpp> + using namespace boost::placeholders, "
|
||||
"or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior."
|
||||
)
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_CLANG)
|
||||
# pragma clang diagnostic push
|
||||
# if __has_warning("-Wheader-hygiene")
|
||||
# pragma clang diagnostic ignored "-Wheader-hygiene"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
using namespace boost::placeholders;
|
||||
|
||||
#if defined(BOOST_CLANG)
|
||||
# pragma clang diagnostic pop
|
||||
#endif
|
||||
|
||||
#endif // #ifndef BOOST_BIND_NO_PLACEHOLDERS
|
||||
|
||||
#endif // #ifndef BOOST_BIND_HPP_INCLUDED
|
||||
@ -1,106 +0,0 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// boost blank.hpp header file
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright (c) 2003
|
||||
// Eric Friedman
|
||||
//
|
||||
// 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_BLANK_HPP
|
||||
#define BOOST_BLANK_HPP
|
||||
|
||||
#include "boost/blank_fwd.hpp"
|
||||
|
||||
#if !defined(BOOST_NO_IOSTREAM)
|
||||
#include <iosfwd> // for std::basic_ostream forward declare
|
||||
#include "boost/detail/templated_streams.hpp"
|
||||
#endif // BOOST_NO_IOSTREAM
|
||||
|
||||
#include "boost/type_traits/integral_constant.hpp"
|
||||
#include "boost/type_traits/is_empty.hpp"
|
||||
#include "boost/type_traits/is_pod.hpp"
|
||||
#include "boost/type_traits/is_stateless.hpp"
|
||||
|
||||
namespace boost {
|
||||
|
||||
struct blank
|
||||
{
|
||||
};
|
||||
|
||||
// type traits specializations
|
||||
//
|
||||
|
||||
template <>
|
||||
struct is_pod< blank >
|
||||
: boost::true_type
|
||||
{
|
||||
};
|
||||
|
||||
template <>
|
||||
struct is_empty< blank >
|
||||
: boost::true_type
|
||||
{
|
||||
};
|
||||
|
||||
template <>
|
||||
struct is_stateless< blank >
|
||||
: boost::true_type
|
||||
{
|
||||
};
|
||||
|
||||
// relational operators
|
||||
//
|
||||
|
||||
inline bool operator==(const blank&, const blank&)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
inline bool operator<=(const blank&, const blank&)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
inline bool operator>=(const blank&, const blank&)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
inline bool operator!=(const blank&, const blank&)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
inline bool operator<(const blank&, const blank&)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
inline bool operator>(const blank&, const blank&)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// streaming support
|
||||
//
|
||||
#if !defined(BOOST_NO_IOSTREAM)
|
||||
|
||||
BOOST_TEMPLATED_STREAM_TEMPLATE(E,T)
|
||||
inline BOOST_TEMPLATED_STREAM(ostream, E,T)& operator<<(
|
||||
BOOST_TEMPLATED_STREAM(ostream, E,T)& out
|
||||
, const blank&
|
||||
)
|
||||
{
|
||||
// (output nothing)
|
||||
return out;
|
||||
}
|
||||
|
||||
#endif // BOOST_NO_IOSTREAM
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_BLANK_HPP
|
||||
@ -1,22 +0,0 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// boost blank_fwd.hpp header file
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// Copyright (c) 2003
|
||||
// Eric Friedman
|
||||
//
|
||||
// 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_BLANK_FWD_HPP
|
||||
#define BOOST_BLANK_FWD_HPP
|
||||
|
||||
namespace boost {
|
||||
|
||||
struct blank;
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_BLANK_FWD_HPP
|
||||
@ -1,20 +0,0 @@
|
||||
// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/utility for most recent version including documentation.
|
||||
|
||||
// See boost/detail/call_traits.hpp
|
||||
// for full copyright notices.
|
||||
|
||||
#ifndef BOOST_CALL_TRAITS_HPP
|
||||
#define BOOST_CALL_TRAITS_HPP
|
||||
|
||||
#ifndef BOOST_CONFIG_HPP
|
||||
#include <boost/config.hpp>
|
||||
#endif
|
||||
|
||||
#include <boost/detail/call_traits.hpp>
|
||||
|
||||
#endif // BOOST_CALL_TRAITS_HPP
|
||||
@ -1,47 +0,0 @@
|
||||
/*
|
||||
|
||||
@Copyright Barrett Adair 2015-2017
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
*/
|
||||
|
||||
#ifndef BOOST_CLBL_TRTS_BOOST_CLBL_TRTS_HPP
|
||||
#define BOOST_CLBL_TRTS_BOOST_CLBL_TRTS_HPP
|
||||
|
||||
#include <boost/callable_traits/detail/core.hpp>
|
||||
#include <boost/callable_traits/add_member_const.hpp>
|
||||
#include <boost/callable_traits/add_member_cv.hpp>
|
||||
#include <boost/callable_traits/add_member_lvalue_reference.hpp>
|
||||
#include <boost/callable_traits/add_member_rvalue_reference.hpp>
|
||||
#include <boost/callable_traits/add_member_volatile.hpp>
|
||||
#include <boost/callable_traits/add_noexcept.hpp>
|
||||
#include <boost/callable_traits/add_transaction_safe.hpp>
|
||||
#include <boost/callable_traits/add_varargs.hpp>
|
||||
#include <boost/callable_traits/apply_member_pointer.hpp>
|
||||
#include <boost/callable_traits/apply_return.hpp>
|
||||
#include <boost/callable_traits/args.hpp>
|
||||
#include <boost/callable_traits/class_of.hpp>
|
||||
#include <boost/callable_traits/function_type.hpp>
|
||||
#include <boost/callable_traits/has_member_qualifiers.hpp>
|
||||
#include <boost/callable_traits/has_varargs.hpp>
|
||||
#include <boost/callable_traits/has_void_return.hpp>
|
||||
#include <boost/callable_traits/is_const_member.hpp>
|
||||
#include <boost/callable_traits/is_invocable.hpp>
|
||||
#include <boost/callable_traits/is_lvalue_reference_member.hpp>
|
||||
#include <boost/callable_traits/is_reference_member.hpp>
|
||||
#include <boost/callable_traits/is_rvalue_reference_member.hpp>
|
||||
#include <boost/callable_traits/is_noexcept.hpp>
|
||||
#include <boost/callable_traits/is_transaction_safe.hpp>
|
||||
#include <boost/callable_traits/is_volatile_member.hpp>
|
||||
#include <boost/callable_traits/qualified_class_of.hpp>
|
||||
#include <boost/callable_traits/remove_member_const.hpp>
|
||||
#include <boost/callable_traits/remove_member_cv.hpp>
|
||||
#include <boost/callable_traits/remove_member_reference.hpp>
|
||||
#include <boost/callable_traits/remove_member_volatile.hpp>
|
||||
#include <boost/callable_traits/remove_noexcept.hpp>
|
||||
#include <boost/callable_traits/remove_transaction_safe.hpp>
|
||||
#include <boost/callable_traits/remove_varargs.hpp>
|
||||
#include <boost/callable_traits/return_type.hpp>
|
||||
|
||||
#endif
|
||||
@ -1,20 +0,0 @@
|
||||
// boost cast.hpp header file
|
||||
//
|
||||
// (C) Copyright Antony Polukhin 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)
|
||||
//
|
||||
// See http://www.boost.org/libs/conversion for Documentation.
|
||||
|
||||
// This is a DEPRECATED header file!
|
||||
// Use <boost/polymorphic_cast.hpp> or <boost/numeric/conversion/cast.hpp> instead
|
||||
|
||||
#ifndef BOOST_CAST_HPP
|
||||
#define BOOST_CAST_HPP
|
||||
|
||||
# include <boost/polymorphic_cast.hpp>
|
||||
# include <boost/numeric/conversion/cast.hpp>
|
||||
|
||||
#endif // BOOST_CAST_HPP
|
||||
@ -1,15 +0,0 @@
|
||||
// Boost cerrno.hpp header -------------------------------------------------//
|
||||
|
||||
// Copyright Beman Dawes 2005.
|
||||
// Use, modification, and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See library home page at http://www.boost.org/libs/system
|
||||
|
||||
#ifndef BOOST_CERRNO_HPP_INCLUDED
|
||||
#define BOOST_CERRNO_HPP_INCLUDED
|
||||
|
||||
#include <boost/system/detail/cerrno.hpp>
|
||||
|
||||
#endif // #ifndef BOOST_CERRNO_HPP_INCLUDED
|
||||
@ -1,17 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2014 Glen Fernandes
|
||||
*
|
||||
* Distributed under the Boost Software License, Version 1.0. (See
|
||||
* accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
|
||||
#ifndef BOOST_CHECKED_DELETE_HPP
|
||||
#define BOOST_CHECKED_DELETE_HPP
|
||||
|
||||
// The header file at this path is deprecated;
|
||||
// use boost/core/checked_delete.hpp instead.
|
||||
|
||||
#include <boost/core/checked_delete.hpp>
|
||||
|
||||
#endif
|
||||
@ -1,20 +0,0 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Vicente J. Botet Escriba 2010.
|
||||
// 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/stm for documentation.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef BOOST_CHRONO_HPP
|
||||
#define BOOST_CHRONO_HPP
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
#include <boost/chrono/include.hpp>
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#endif // BOOST_CHRONO_HPP
|
||||
@ -1,65 +0,0 @@
|
||||
// Circular buffer library header file.
|
||||
|
||||
// Copyright (c) 2003-2008 Jan Gaspar
|
||||
|
||||
// Use, modification, and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See www.boost.org/libs/circular_buffer for documentation.
|
||||
|
||||
/*! @file
|
||||
Includes <boost/circular_buffer/base.hpp>
|
||||
*/
|
||||
|
||||
#if !defined(BOOST_CIRCULAR_BUFFER_HPP)
|
||||
#define BOOST_CIRCULAR_BUFFER_HPP
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/circular_buffer_fwd.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
|
||||
/*! Debug support control. */
|
||||
#if !defined(BOOST_CB_ENABLE_DEBUG)
|
||||
#define BOOST_CB_ENABLE_DEBUG 0
|
||||
#endif
|
||||
|
||||
/*! INTERNAL ONLY */
|
||||
#if BOOST_CB_ENABLE_DEBUG
|
||||
#include <boost/assert.hpp>
|
||||
#define BOOST_CB_ASSERT(Expr) BOOST_ASSERT(Expr)
|
||||
#else
|
||||
#define BOOST_CB_ASSERT(Expr) ((void)0)
|
||||
#endif
|
||||
|
||||
/*! INTERNAL ONLY */
|
||||
#if BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x0550) || BOOST_WORKAROUND(__MWERKS__, <= 0x2407)
|
||||
#define BOOST_CB_IS_CONVERTIBLE(Iterator, Type) ((void)0)
|
||||
#else
|
||||
#include <iterator>
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
#define BOOST_CB_IS_CONVERTIBLE(Iterator, Type) \
|
||||
BOOST_STATIC_ASSERT((is_convertible<typename std::iterator_traits<Iterator>::value_type, Type>::value))
|
||||
#endif
|
||||
|
||||
/*! INTERNAL ONLY */
|
||||
#if defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)
|
||||
#define BOOST_CB_ASSERT_TEMPLATED_ITERATOR_CONSTRUCTORS BOOST_STATIC_ASSERT(false);
|
||||
#else
|
||||
#define BOOST_CB_ASSERT_TEMPLATED_ITERATOR_CONSTRUCTORS ((void)0);
|
||||
#endif
|
||||
|
||||
#include <boost/circular_buffer/debug.hpp>
|
||||
#include <boost/circular_buffer/details.hpp>
|
||||
#include <boost/circular_buffer/base.hpp>
|
||||
#include <boost/circular_buffer/space_optimized.hpp>
|
||||
|
||||
#undef BOOST_CB_ASSERT_TEMPLATED_ITERATOR_CONSTRUCTORS
|
||||
#undef BOOST_CB_IS_CONVERTIBLE
|
||||
#undef BOOST_CB_ASSERT
|
||||
|
||||
#endif // #if !defined(BOOST_CIRCULAR_BUFFER_HPP)
|
||||
@ -1,43 +0,0 @@
|
||||
// Forward declaration of the circular buffer and its adaptor.
|
||||
|
||||
// Copyright (c) 2003-2008 Jan Gaspar
|
||||
|
||||
// Use, modification, and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See www.boost.org/libs/circular_buffer for documentation.
|
||||
|
||||
#if !defined(BOOST_CIRCULAR_BUFFER_FWD_HPP)
|
||||
#define BOOST_CIRCULAR_BUFFER_FWD_HPP
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#if !defined(BOOST_NO_STD_ALLOCATOR)
|
||||
#include <memory>
|
||||
#else
|
||||
#include <vector>
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
|
||||
#if !defined(BOOST_NO_STD_ALLOCATOR)
|
||||
#define BOOST_CB_DEFAULT_ALLOCATOR(T) std::allocator<T>
|
||||
#else
|
||||
#define BOOST_CB_DEFAULT_ALLOCATOR(T) BOOST_DEDUCED_TYPENAME std::vector<T>::allocator_type
|
||||
#endif
|
||||
|
||||
template <class T, class Alloc = BOOST_CB_DEFAULT_ALLOCATOR(T)>
|
||||
class circular_buffer;
|
||||
|
||||
template <class T, class Alloc = BOOST_CB_DEFAULT_ALLOCATOR(T)>
|
||||
class circular_buffer_space_optimized;
|
||||
|
||||
#undef BOOST_CB_DEFAULT_ALLOCATOR
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // #if !defined(BOOST_CIRCULAR_BUFFER_FWD_HPP)
|
||||
@ -1,20 +0,0 @@
|
||||
// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/utility for most recent version including documentation.
|
||||
|
||||
// See boost/detail/compressed_pair.hpp
|
||||
// for full copyright notices.
|
||||
|
||||
#ifndef BOOST_COMPRESSED_PAIR_HPP
|
||||
#define BOOST_COMPRESSED_PAIR_HPP
|
||||
|
||||
#ifndef BOOST_CONFIG_HPP
|
||||
#include <boost/config.hpp>
|
||||
#endif
|
||||
|
||||
#include <boost/detail/compressed_pair.hpp>
|
||||
|
||||
#endif // BOOST_COMPRESSED_PAIR_HPP
|
||||
@ -1,44 +0,0 @@
|
||||
//---------------------------------------------------------------------------//
|
||||
// Copyright (c) 2013 Kyle Lutz <kyle.r.lutz@gmail.com>
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
//
|
||||
// See http://boostorg.github.com/compute for more information.
|
||||
//---------------------------------------------------------------------------//
|
||||
|
||||
#ifndef BOOST_COMPUTE_HPP
|
||||
#define BOOST_COMPUTE_HPP
|
||||
|
||||
#include <boost/compute/algorithm.hpp>
|
||||
#include <boost/compute/allocator.hpp>
|
||||
#include <boost/compute/async.hpp>
|
||||
#include <boost/compute/buffer.hpp>
|
||||
#include <boost/compute/cl.hpp>
|
||||
#include <boost/compute/command_queue.hpp>
|
||||
#include <boost/compute/config.hpp>
|
||||
#include <boost/compute/container.hpp>
|
||||
#include <boost/compute/context.hpp>
|
||||
#include <boost/compute/device.hpp>
|
||||
#include <boost/compute/functional.hpp>
|
||||
#include <boost/compute/image.hpp>
|
||||
#include <boost/compute/iterator.hpp>
|
||||
#include <boost/compute/kernel.hpp>
|
||||
#include <boost/compute/lambda.hpp>
|
||||
#include <boost/compute/pipe.hpp>
|
||||
#include <boost/compute/platform.hpp>
|
||||
#include <boost/compute/program.hpp>
|
||||
#include <boost/compute/random.hpp>
|
||||
#include <boost/compute/svm.hpp>
|
||||
#include <boost/compute/system.hpp>
|
||||
#include <boost/compute/types.hpp>
|
||||
#include <boost/compute/user_event.hpp>
|
||||
#include <boost/compute/utility.hpp>
|
||||
#include <boost/compute/version.hpp>
|
||||
|
||||
#ifdef BOOST_COMPUTE_HAVE_HDR_CL_EXT
|
||||
#include <boost/compute/cl_ext.hpp>
|
||||
#endif
|
||||
|
||||
#endif // BOOST_COMPUTE_HPP
|
||||
@ -1,670 +0,0 @@
|
||||
//
|
||||
// (C) Copyright Jeremy Siek 2000.
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// Revision History:
|
||||
//
|
||||
// 17 July 2001: Added const to some member functions. (Jeremy Siek)
|
||||
// 05 May 2001: Removed static dummy_cons object. (Jeremy Siek)
|
||||
|
||||
// See http://www.boost.org/libs/concept_check for documentation.
|
||||
|
||||
#ifndef BOOST_CONCEPT_ARCHETYPES_HPP
|
||||
#define BOOST_CONCEPT_ARCHETYPES_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
#include <functional>
|
||||
#include <iterator> // iterator tags
|
||||
#include <cstddef> // std::ptrdiff_t
|
||||
|
||||
namespace boost {
|
||||
|
||||
//===========================================================================
|
||||
// Basic Archetype Classes
|
||||
|
||||
namespace detail {
|
||||
class dummy_constructor { };
|
||||
}
|
||||
|
||||
// A type that models no concept. The template parameter
|
||||
// is only there so that null_archetype types can be created
|
||||
// that have different type.
|
||||
template <class T = int>
|
||||
class null_archetype {
|
||||
private:
|
||||
null_archetype() { }
|
||||
null_archetype(const null_archetype&) { }
|
||||
null_archetype& operator=(const null_archetype&) { return *this; }
|
||||
public:
|
||||
null_archetype(detail::dummy_constructor) { }
|
||||
#ifndef __MWERKS__
|
||||
template <class TT>
|
||||
friend void dummy_friend(); // just to avoid warnings
|
||||
#endif
|
||||
};
|
||||
|
||||
// This is a helper class that provides a way to get a reference to
|
||||
// an object. The get() function will never be called at run-time
|
||||
// (nothing in this file will) so this seemingly very bad function
|
||||
// is really quite innocent. The name of this class needs to be
|
||||
// changed.
|
||||
template <class T>
|
||||
class static_object
|
||||
{
|
||||
public:
|
||||
static T& get()
|
||||
{
|
||||
#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
|
||||
return *reinterpret_cast<T*>(0);
|
||||
#else
|
||||
static char d[sizeof(T)];
|
||||
return *reinterpret_cast<T*>(d);
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
template <class Base = null_archetype<> >
|
||||
class default_constructible_archetype : public Base {
|
||||
public:
|
||||
default_constructible_archetype()
|
||||
: Base(static_object<detail::dummy_constructor>::get()) { }
|
||||
default_constructible_archetype(detail::dummy_constructor x) : Base(x) { }
|
||||
};
|
||||
|
||||
template <class Base = null_archetype<> >
|
||||
class assignable_archetype : public Base {
|
||||
assignable_archetype() { }
|
||||
assignable_archetype(const assignable_archetype&) { }
|
||||
public:
|
||||
assignable_archetype& operator=(const assignable_archetype&) {
|
||||
return *this;
|
||||
}
|
||||
assignable_archetype(detail::dummy_constructor x) : Base(x) { }
|
||||
};
|
||||
|
||||
template <class Base = null_archetype<> >
|
||||
class copy_constructible_archetype : public Base {
|
||||
public:
|
||||
copy_constructible_archetype()
|
||||
: Base(static_object<detail::dummy_constructor>::get()) { }
|
||||
copy_constructible_archetype(const copy_constructible_archetype&)
|
||||
: Base(static_object<detail::dummy_constructor>::get()) { }
|
||||
copy_constructible_archetype(detail::dummy_constructor x) : Base(x) { }
|
||||
};
|
||||
|
||||
template <class Base = null_archetype<> >
|
||||
class sgi_assignable_archetype : public Base {
|
||||
public:
|
||||
sgi_assignable_archetype(const sgi_assignable_archetype&)
|
||||
: Base(static_object<detail::dummy_constructor>::get()) { }
|
||||
sgi_assignable_archetype& operator=(const sgi_assignable_archetype&) {
|
||||
return *this;
|
||||
}
|
||||
sgi_assignable_archetype(const detail::dummy_constructor& x) : Base(x) { }
|
||||
};
|
||||
|
||||
struct default_archetype_base {
|
||||
default_archetype_base(detail::dummy_constructor) { }
|
||||
};
|
||||
|
||||
// Careful, don't use same type for T and Base. That results in the
|
||||
// conversion operator being invalid. Since T is often
|
||||
// null_archetype, can't use null_archetype for Base.
|
||||
template <class T, class Base = default_archetype_base>
|
||||
class convertible_to_archetype : public Base {
|
||||
private:
|
||||
convertible_to_archetype() { }
|
||||
convertible_to_archetype(const convertible_to_archetype& ) { }
|
||||
convertible_to_archetype& operator=(const convertible_to_archetype&)
|
||||
{ return *this; }
|
||||
public:
|
||||
convertible_to_archetype(detail::dummy_constructor x) : Base(x) { }
|
||||
operator const T&() const { return static_object<T>::get(); }
|
||||
};
|
||||
|
||||
template <class T, class Base = default_archetype_base>
|
||||
class convertible_from_archetype : public Base {
|
||||
private:
|
||||
convertible_from_archetype() { }
|
||||
convertible_from_archetype(const convertible_from_archetype& ) { }
|
||||
convertible_from_archetype& operator=(const convertible_from_archetype&)
|
||||
{ return *this; }
|
||||
public:
|
||||
convertible_from_archetype(detail::dummy_constructor x) : Base(x) { }
|
||||
convertible_from_archetype(const T&) { }
|
||||
convertible_from_archetype& operator=(const T&)
|
||||
{ return *this; }
|
||||
};
|
||||
|
||||
class boolean_archetype {
|
||||
public:
|
||||
boolean_archetype(const boolean_archetype&) { }
|
||||
operator bool() const { return true; }
|
||||
boolean_archetype(detail::dummy_constructor) { }
|
||||
private:
|
||||
boolean_archetype() { }
|
||||
boolean_archetype& operator=(const boolean_archetype&) { return *this; }
|
||||
};
|
||||
|
||||
template <class Base = null_archetype<> >
|
||||
class equality_comparable_archetype : public Base {
|
||||
public:
|
||||
equality_comparable_archetype(detail::dummy_constructor x) : Base(x) { }
|
||||
};
|
||||
template <class Base>
|
||||
boolean_archetype
|
||||
operator==(const equality_comparable_archetype<Base>&,
|
||||
const equality_comparable_archetype<Base>&)
|
||||
{
|
||||
return boolean_archetype(static_object<detail::dummy_constructor>::get());
|
||||
}
|
||||
template <class Base>
|
||||
boolean_archetype
|
||||
operator!=(const equality_comparable_archetype<Base>&,
|
||||
const equality_comparable_archetype<Base>&)
|
||||
{
|
||||
return boolean_archetype(static_object<detail::dummy_constructor>::get());
|
||||
}
|
||||
|
||||
|
||||
template <class Base = null_archetype<> >
|
||||
class equality_comparable2_first_archetype : public Base {
|
||||
public:
|
||||
equality_comparable2_first_archetype(detail::dummy_constructor x)
|
||||
: Base(x) { }
|
||||
};
|
||||
template <class Base = null_archetype<> >
|
||||
class equality_comparable2_second_archetype : public Base {
|
||||
public:
|
||||
equality_comparable2_second_archetype(detail::dummy_constructor x)
|
||||
: Base(x) { }
|
||||
};
|
||||
template <class Base1, class Base2>
|
||||
boolean_archetype
|
||||
operator==(const equality_comparable2_first_archetype<Base1>&,
|
||||
const equality_comparable2_second_archetype<Base2>&)
|
||||
{
|
||||
return boolean_archetype(static_object<detail::dummy_constructor>::get());
|
||||
}
|
||||
template <class Base1, class Base2>
|
||||
boolean_archetype
|
||||
operator!=(const equality_comparable2_first_archetype<Base1>&,
|
||||
const equality_comparable2_second_archetype<Base2>&)
|
||||
{
|
||||
return boolean_archetype(static_object<detail::dummy_constructor>::get());
|
||||
}
|
||||
|
||||
|
||||
template <class Base = null_archetype<> >
|
||||
class less_than_comparable_archetype : public Base {
|
||||
public:
|
||||
less_than_comparable_archetype(detail::dummy_constructor x) : Base(x) { }
|
||||
};
|
||||
template <class Base>
|
||||
boolean_archetype
|
||||
operator<(const less_than_comparable_archetype<Base>&,
|
||||
const less_than_comparable_archetype<Base>&)
|
||||
{
|
||||
return boolean_archetype(static_object<detail::dummy_constructor>::get());
|
||||
}
|
||||
|
||||
|
||||
|
||||
template <class Base = null_archetype<> >
|
||||
class comparable_archetype : public Base {
|
||||
public:
|
||||
comparable_archetype(detail::dummy_constructor x) : Base(x) { }
|
||||
};
|
||||
template <class Base>
|
||||
boolean_archetype
|
||||
operator<(const comparable_archetype<Base>&,
|
||||
const comparable_archetype<Base>&)
|
||||
{
|
||||
return boolean_archetype(static_object<detail::dummy_constructor>::get());
|
||||
}
|
||||
template <class Base>
|
||||
boolean_archetype
|
||||
operator<=(const comparable_archetype<Base>&,
|
||||
const comparable_archetype<Base>&)
|
||||
{
|
||||
return boolean_archetype(static_object<detail::dummy_constructor>::get());
|
||||
}
|
||||
template <class Base>
|
||||
boolean_archetype
|
||||
operator>(const comparable_archetype<Base>&,
|
||||
const comparable_archetype<Base>&)
|
||||
{
|
||||
return boolean_archetype(static_object<detail::dummy_constructor>::get());
|
||||
}
|
||||
template <class Base>
|
||||
boolean_archetype
|
||||
operator>=(const comparable_archetype<Base>&,
|
||||
const comparable_archetype<Base>&)
|
||||
{
|
||||
return boolean_archetype(static_object<detail::dummy_constructor>::get());
|
||||
}
|
||||
|
||||
|
||||
// The purpose of the optags is so that one can specify
|
||||
// exactly which types the operator< is defined between.
|
||||
// This is useful for allowing the operations:
|
||||
//
|
||||
// A a; B b;
|
||||
// a < b
|
||||
// b < a
|
||||
//
|
||||
// without also allowing the combinations:
|
||||
//
|
||||
// a < a
|
||||
// b < b
|
||||
//
|
||||
struct optag1 { };
|
||||
struct optag2 { };
|
||||
struct optag3 { };
|
||||
|
||||
#define BOOST_DEFINE_BINARY_PREDICATE_ARCHETYPE(OP, NAME) \
|
||||
template <class Base = null_archetype<>, class Tag = optag1 > \
|
||||
class NAME##_first_archetype : public Base { \
|
||||
public: \
|
||||
NAME##_first_archetype(detail::dummy_constructor x) : Base(x) { } \
|
||||
}; \
|
||||
\
|
||||
template <class Base = null_archetype<>, class Tag = optag1 > \
|
||||
class NAME##_second_archetype : public Base { \
|
||||
public: \
|
||||
NAME##_second_archetype(detail::dummy_constructor x) : Base(x) { } \
|
||||
}; \
|
||||
\
|
||||
template <class BaseFirst, class BaseSecond, class Tag> \
|
||||
boolean_archetype \
|
||||
operator OP (const NAME##_first_archetype<BaseFirst, Tag>&, \
|
||||
const NAME##_second_archetype<BaseSecond, Tag>&) \
|
||||
{ \
|
||||
return boolean_archetype(static_object<detail::dummy_constructor>::get()); \
|
||||
}
|
||||
|
||||
BOOST_DEFINE_BINARY_PREDICATE_ARCHETYPE(==, equal_op)
|
||||
BOOST_DEFINE_BINARY_PREDICATE_ARCHETYPE(!=, not_equal_op)
|
||||
BOOST_DEFINE_BINARY_PREDICATE_ARCHETYPE(<, less_than_op)
|
||||
BOOST_DEFINE_BINARY_PREDICATE_ARCHETYPE(<=, less_equal_op)
|
||||
BOOST_DEFINE_BINARY_PREDICATE_ARCHETYPE(>, greater_than_op)
|
||||
BOOST_DEFINE_BINARY_PREDICATE_ARCHETYPE(>=, greater_equal_op)
|
||||
|
||||
#define BOOST_DEFINE_OPERATOR_ARCHETYPE(OP, NAME) \
|
||||
template <class Base = null_archetype<> > \
|
||||
class NAME##_archetype : public Base { \
|
||||
public: \
|
||||
NAME##_archetype(detail::dummy_constructor x) : Base(x) { } \
|
||||
NAME##_archetype(const NAME##_archetype&) \
|
||||
: Base(static_object<detail::dummy_constructor>::get()) { } \
|
||||
NAME##_archetype& operator=(const NAME##_archetype&) { return *this; } \
|
||||
}; \
|
||||
template <class Base> \
|
||||
NAME##_archetype<Base> \
|
||||
operator OP (const NAME##_archetype<Base>&,\
|
||||
const NAME##_archetype<Base>&) \
|
||||
{ \
|
||||
return \
|
||||
NAME##_archetype<Base>(static_object<detail::dummy_constructor>::get()); \
|
||||
}
|
||||
|
||||
BOOST_DEFINE_OPERATOR_ARCHETYPE(+, addable)
|
||||
BOOST_DEFINE_OPERATOR_ARCHETYPE(-, subtractable)
|
||||
BOOST_DEFINE_OPERATOR_ARCHETYPE(*, multipliable)
|
||||
BOOST_DEFINE_OPERATOR_ARCHETYPE(/, dividable)
|
||||
BOOST_DEFINE_OPERATOR_ARCHETYPE(%, modable)
|
||||
|
||||
// As is, these are useless because of the return type.
|
||||
// Need to invent a better way...
|
||||
#define BOOST_DEFINE_BINARY_OPERATOR_ARCHETYPE(OP, NAME) \
|
||||
template <class Return, class Base = null_archetype<> > \
|
||||
class NAME##_first_archetype : public Base { \
|
||||
public: \
|
||||
NAME##_first_archetype(detail::dummy_constructor x) : Base(x) { } \
|
||||
}; \
|
||||
\
|
||||
template <class Return, class Base = null_archetype<> > \
|
||||
class NAME##_second_archetype : public Base { \
|
||||
public: \
|
||||
NAME##_second_archetype(detail::dummy_constructor x) : Base(x) { } \
|
||||
}; \
|
||||
\
|
||||
template <class Return, class BaseFirst, class BaseSecond> \
|
||||
Return \
|
||||
operator OP (const NAME##_first_archetype<Return, BaseFirst>&, \
|
||||
const NAME##_second_archetype<Return, BaseSecond>&) \
|
||||
{ \
|
||||
return Return(static_object<detail::dummy_constructor>::get()); \
|
||||
}
|
||||
|
||||
BOOST_DEFINE_BINARY_OPERATOR_ARCHETYPE(+, plus_op)
|
||||
BOOST_DEFINE_BINARY_OPERATOR_ARCHETYPE(*, time_op)
|
||||
BOOST_DEFINE_BINARY_OPERATOR_ARCHETYPE(/, divide_op)
|
||||
BOOST_DEFINE_BINARY_OPERATOR_ARCHETYPE(-, subtract_op)
|
||||
BOOST_DEFINE_BINARY_OPERATOR_ARCHETYPE(%, mod_op)
|
||||
|
||||
//===========================================================================
|
||||
// Function Object Archetype Classes
|
||||
|
||||
template <class Return>
|
||||
class generator_archetype {
|
||||
public:
|
||||
const Return& operator()() {
|
||||
return static_object<Return>::get();
|
||||
}
|
||||
};
|
||||
|
||||
class void_generator_archetype {
|
||||
public:
|
||||
void operator()() { }
|
||||
};
|
||||
|
||||
template <class Arg, class Return>
|
||||
class unary_function_archetype {
|
||||
private:
|
||||
unary_function_archetype() { }
|
||||
public:
|
||||
unary_function_archetype(detail::dummy_constructor) { }
|
||||
const Return& operator()(const Arg&) const {
|
||||
return static_object<Return>::get();
|
||||
}
|
||||
};
|
||||
|
||||
template <class Arg1, class Arg2, class Return>
|
||||
class binary_function_archetype {
|
||||
private:
|
||||
binary_function_archetype() { }
|
||||
public:
|
||||
binary_function_archetype(detail::dummy_constructor) { }
|
||||
const Return& operator()(const Arg1&, const Arg2&) const {
|
||||
return static_object<Return>::get();
|
||||
}
|
||||
};
|
||||
|
||||
template <class Arg>
|
||||
class unary_predicate_archetype {
|
||||
typedef boolean_archetype Return;
|
||||
unary_predicate_archetype() { }
|
||||
public:
|
||||
unary_predicate_archetype(detail::dummy_constructor) { }
|
||||
const Return& operator()(const Arg&) const {
|
||||
return static_object<Return>::get();
|
||||
}
|
||||
};
|
||||
|
||||
template <class Arg1, class Arg2, class Base = null_archetype<> >
|
||||
class binary_predicate_archetype {
|
||||
typedef boolean_archetype Return;
|
||||
binary_predicate_archetype() { }
|
||||
public:
|
||||
binary_predicate_archetype(detail::dummy_constructor) { }
|
||||
const Return& operator()(const Arg1&, const Arg2&) const {
|
||||
return static_object<Return>::get();
|
||||
}
|
||||
};
|
||||
|
||||
//===========================================================================
|
||||
// Iterator Archetype Classes
|
||||
|
||||
template <class T, int I = 0>
|
||||
class input_iterator_archetype
|
||||
{
|
||||
private:
|
||||
typedef input_iterator_archetype self;
|
||||
public:
|
||||
typedef std::input_iterator_tag iterator_category;
|
||||
typedef T value_type;
|
||||
struct reference {
|
||||
operator const value_type&() const { return static_object<T>::get(); }
|
||||
};
|
||||
typedef const T* pointer;
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
self& operator=(const self&) { return *this; }
|
||||
bool operator==(const self&) const { return true; }
|
||||
bool operator!=(const self&) const { return true; }
|
||||
reference operator*() const { return reference(); }
|
||||
self& operator++() { return *this; }
|
||||
self operator++(int) { return *this; }
|
||||
};
|
||||
|
||||
template <class T>
|
||||
class input_iterator_archetype_no_proxy
|
||||
{
|
||||
private:
|
||||
typedef input_iterator_archetype_no_proxy self;
|
||||
public:
|
||||
typedef std::input_iterator_tag iterator_category;
|
||||
typedef T value_type;
|
||||
typedef const T& reference;
|
||||
typedef const T* pointer;
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
self& operator=(const self&) { return *this; }
|
||||
bool operator==(const self&) const { return true; }
|
||||
bool operator!=(const self&) const { return true; }
|
||||
reference operator*() const { return static_object<T>::get(); }
|
||||
self& operator++() { return *this; }
|
||||
self operator++(int) { return *this; }
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct output_proxy {
|
||||
output_proxy& operator=(const T&) { return *this; }
|
||||
};
|
||||
|
||||
template <class T>
|
||||
class output_iterator_archetype
|
||||
{
|
||||
public:
|
||||
typedef output_iterator_archetype self;
|
||||
public:
|
||||
typedef std::output_iterator_tag iterator_category;
|
||||
typedef output_proxy<T> value_type;
|
||||
typedef output_proxy<T> reference;
|
||||
typedef void pointer;
|
||||
typedef void difference_type;
|
||||
output_iterator_archetype(detail::dummy_constructor) { }
|
||||
output_iterator_archetype(const self&) { }
|
||||
self& operator=(const self&) { return *this; }
|
||||
bool operator==(const self&) const { return true; }
|
||||
bool operator!=(const self&) const { return true; }
|
||||
reference operator*() const { return output_proxy<T>(); }
|
||||
self& operator++() { return *this; }
|
||||
self operator++(int) { return *this; }
|
||||
private:
|
||||
output_iterator_archetype() { }
|
||||
};
|
||||
|
||||
template <class T>
|
||||
class input_output_iterator_archetype
|
||||
{
|
||||
private:
|
||||
typedef input_output_iterator_archetype self;
|
||||
struct in_out_tag : public std::input_iterator_tag, public std::output_iterator_tag { };
|
||||
public:
|
||||
typedef in_out_tag iterator_category;
|
||||
typedef T value_type;
|
||||
struct reference {
|
||||
reference& operator=(const T&) { return *this; }
|
||||
operator value_type() { return static_object<T>::get(); }
|
||||
};
|
||||
typedef const T* pointer;
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
input_output_iterator_archetype() { }
|
||||
self& operator=(const self&) { return *this; }
|
||||
bool operator==(const self&) const { return true; }
|
||||
bool operator!=(const self&) const { return true; }
|
||||
reference operator*() const { return reference(); }
|
||||
self& operator++() { return *this; }
|
||||
self operator++(int) { return *this; }
|
||||
};
|
||||
|
||||
template <class T>
|
||||
class forward_iterator_archetype
|
||||
{
|
||||
public:
|
||||
typedef forward_iterator_archetype self;
|
||||
public:
|
||||
typedef std::forward_iterator_tag iterator_category;
|
||||
typedef T value_type;
|
||||
typedef const T& reference;
|
||||
typedef T const* pointer;
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
forward_iterator_archetype() { }
|
||||
self& operator=(const self&) { return *this; }
|
||||
bool operator==(const self&) const { return true; }
|
||||
bool operator!=(const self&) const { return true; }
|
||||
reference operator*() const { return static_object<T>::get(); }
|
||||
self& operator++() { return *this; }
|
||||
self operator++(int) { return *this; }
|
||||
};
|
||||
|
||||
template <class T>
|
||||
class mutable_forward_iterator_archetype
|
||||
{
|
||||
public:
|
||||
typedef mutable_forward_iterator_archetype self;
|
||||
public:
|
||||
typedef std::forward_iterator_tag iterator_category;
|
||||
typedef T value_type;
|
||||
typedef T& reference;
|
||||
typedef T* pointer;
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
mutable_forward_iterator_archetype() { }
|
||||
self& operator=(const self&) { return *this; }
|
||||
bool operator==(const self&) const { return true; }
|
||||
bool operator!=(const self&) const { return true; }
|
||||
reference operator*() const { return static_object<T>::get(); }
|
||||
self& operator++() { return *this; }
|
||||
self operator++(int) { return *this; }
|
||||
};
|
||||
|
||||
template <class T>
|
||||
class bidirectional_iterator_archetype
|
||||
{
|
||||
public:
|
||||
typedef bidirectional_iterator_archetype self;
|
||||
public:
|
||||
typedef std::bidirectional_iterator_tag iterator_category;
|
||||
typedef T value_type;
|
||||
typedef const T& reference;
|
||||
typedef T* pointer;
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
bidirectional_iterator_archetype() { }
|
||||
self& operator=(const self&) { return *this; }
|
||||
bool operator==(const self&) const { return true; }
|
||||
bool operator!=(const self&) const { return true; }
|
||||
reference operator*() const { return static_object<T>::get(); }
|
||||
self& operator++() { return *this; }
|
||||
self operator++(int) { return *this; }
|
||||
self& operator--() { return *this; }
|
||||
self operator--(int) { return *this; }
|
||||
};
|
||||
|
||||
template <class T>
|
||||
class mutable_bidirectional_iterator_archetype
|
||||
{
|
||||
public:
|
||||
typedef mutable_bidirectional_iterator_archetype self;
|
||||
public:
|
||||
typedef std::bidirectional_iterator_tag iterator_category;
|
||||
typedef T value_type;
|
||||
typedef T& reference;
|
||||
typedef T* pointer;
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
mutable_bidirectional_iterator_archetype() { }
|
||||
self& operator=(const self&) { return *this; }
|
||||
bool operator==(const self&) const { return true; }
|
||||
bool operator!=(const self&) const { return true; }
|
||||
reference operator*() const { return static_object<T>::get(); }
|
||||
self& operator++() { return *this; }
|
||||
self operator++(int) { return *this; }
|
||||
self& operator--() { return *this; }
|
||||
self operator--(int) { return *this; }
|
||||
};
|
||||
|
||||
template <class T>
|
||||
class random_access_iterator_archetype
|
||||
{
|
||||
public:
|
||||
typedef random_access_iterator_archetype self;
|
||||
public:
|
||||
typedef std::random_access_iterator_tag iterator_category;
|
||||
typedef T value_type;
|
||||
typedef const T& reference;
|
||||
typedef T* pointer;
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
random_access_iterator_archetype() { }
|
||||
self& operator=(const self&) { return *this; }
|
||||
bool operator==(const self&) const { return true; }
|
||||
bool operator!=(const self&) const { return true; }
|
||||
reference operator*() const { return static_object<T>::get(); }
|
||||
self& operator++() { return *this; }
|
||||
self operator++(int) { return *this; }
|
||||
self& operator--() { return *this; }
|
||||
self operator--(int) { return *this; }
|
||||
reference operator[](difference_type) const
|
||||
{ return static_object<T>::get(); }
|
||||
self& operator+=(difference_type) { return *this; }
|
||||
self& operator-=(difference_type) { return *this; }
|
||||
difference_type operator-(const self&) const
|
||||
{ return difference_type(); }
|
||||
self operator+(difference_type) const { return *this; }
|
||||
self operator-(difference_type) const { return *this; }
|
||||
bool operator<(const self&) const { return true; }
|
||||
bool operator<=(const self&) const { return true; }
|
||||
bool operator>(const self&) const { return true; }
|
||||
bool operator>=(const self&) const { return true; }
|
||||
};
|
||||
template <class T>
|
||||
random_access_iterator_archetype<T>
|
||||
operator+(typename random_access_iterator_archetype<T>::difference_type,
|
||||
const random_access_iterator_archetype<T>& x)
|
||||
{ return x; }
|
||||
|
||||
|
||||
template <class T>
|
||||
class mutable_random_access_iterator_archetype
|
||||
{
|
||||
public:
|
||||
typedef mutable_random_access_iterator_archetype self;
|
||||
public:
|
||||
typedef std::random_access_iterator_tag iterator_category;
|
||||
typedef T value_type;
|
||||
typedef T& reference;
|
||||
typedef T* pointer;
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
mutable_random_access_iterator_archetype() { }
|
||||
self& operator=(const self&) { return *this; }
|
||||
bool operator==(const self&) const { return true; }
|
||||
bool operator!=(const self&) const { return true; }
|
||||
reference operator*() const { return static_object<T>::get(); }
|
||||
self& operator++() { return *this; }
|
||||
self operator++(int) { return *this; }
|
||||
self& operator--() { return *this; }
|
||||
self operator--(int) { return *this; }
|
||||
reference operator[](difference_type) const
|
||||
{ return static_object<T>::get(); }
|
||||
self& operator+=(difference_type) { return *this; }
|
||||
self& operator-=(difference_type) { return *this; }
|
||||
difference_type operator-(const self&) const
|
||||
{ return difference_type(); }
|
||||
self operator+(difference_type) const { return *this; }
|
||||
self operator-(difference_type) const { return *this; }
|
||||
bool operator<(const self&) const { return true; }
|
||||
bool operator<=(const self&) const { return true; }
|
||||
bool operator>(const self&) const { return true; }
|
||||
bool operator>=(const self&) const { return true; }
|
||||
};
|
||||
template <class T>
|
||||
mutable_random_access_iterator_archetype<T>
|
||||
operator+
|
||||
(typename mutable_random_access_iterator_archetype<T>::difference_type,
|
||||
const mutable_random_access_iterator_archetype<T>& x)
|
||||
{ return x; }
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_CONCEPT_ARCHETYPES_H
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,67 +0,0 @@
|
||||
// Boost config.hpp configuration header file ------------------------------//
|
||||
|
||||
// (C) Copyright John Maddock 2002.
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See http://www.boost.org/libs/config for most recent version.
|
||||
|
||||
// Boost config.hpp policy and rationale documentation has been moved to
|
||||
// http://www.boost.org/libs/config
|
||||
//
|
||||
// CAUTION: This file is intended to be completely stable -
|
||||
// DO NOT MODIFY THIS FILE!
|
||||
//
|
||||
|
||||
#ifndef BOOST_CONFIG_HPP
|
||||
#define BOOST_CONFIG_HPP
|
||||
|
||||
// if we don't have a user config, then use the default location:
|
||||
#if !defined(BOOST_USER_CONFIG) && !defined(BOOST_NO_USER_CONFIG)
|
||||
# define BOOST_USER_CONFIG <boost/config/user.hpp>
|
||||
#if 0
|
||||
// For dependency trackers:
|
||||
# include <boost/config/user.hpp>
|
||||
#endif
|
||||
#endif
|
||||
// include it first:
|
||||
#ifdef BOOST_USER_CONFIG
|
||||
# include BOOST_USER_CONFIG
|
||||
#endif
|
||||
|
||||
// if we don't have a compiler config set, try and find one:
|
||||
#if !defined(BOOST_COMPILER_CONFIG) && !defined(BOOST_NO_COMPILER_CONFIG) && !defined(BOOST_NO_CONFIG)
|
||||
# include <boost/config/detail/select_compiler_config.hpp>
|
||||
#endif
|
||||
// if we have a compiler config, include it now:
|
||||
#ifdef BOOST_COMPILER_CONFIG
|
||||
# include BOOST_COMPILER_CONFIG
|
||||
#endif
|
||||
|
||||
// if we don't have a std library config set, try and find one:
|
||||
#if !defined(BOOST_STDLIB_CONFIG) && !defined(BOOST_NO_STDLIB_CONFIG) && !defined(BOOST_NO_CONFIG) && defined(__cplusplus)
|
||||
# include <boost/config/detail/select_stdlib_config.hpp>
|
||||
#endif
|
||||
// if we have a std library config, include it now:
|
||||
#ifdef BOOST_STDLIB_CONFIG
|
||||
# include BOOST_STDLIB_CONFIG
|
||||
#endif
|
||||
|
||||
// if we don't have a platform config set, try and find one:
|
||||
#if !defined(BOOST_PLATFORM_CONFIG) && !defined(BOOST_NO_PLATFORM_CONFIG) && !defined(BOOST_NO_CONFIG)
|
||||
# include <boost/config/detail/select_platform_config.hpp>
|
||||
#endif
|
||||
// if we have a platform config, include it now:
|
||||
#ifdef BOOST_PLATFORM_CONFIG
|
||||
# include BOOST_PLATFORM_CONFIG
|
||||
#endif
|
||||
|
||||
// get config suffix code:
|
||||
#include <boost/config/detail/suffix.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#endif // BOOST_CONFIG_HPP
|
||||
@ -1,44 +0,0 @@
|
||||
|
||||
#ifndef BOOST_CONTRACT_HPP_
|
||||
#define BOOST_CONTRACT_HPP_
|
||||
|
||||
// Copyright (C) 2008-2018 Lorenzo Caminiti
|
||||
// Distributed under the Boost Software License, Version 1.0 (see accompanying
|
||||
// file LICENSE_1_0.txt or a copy at http://www.boost.org/LICENSE_1_0.txt).
|
||||
// See: http://www.boost.org/doc/libs/release/libs/contract/doc/html/index.html
|
||||
|
||||
/** @file
|
||||
Include all header files required by this library at once (for convenience).
|
||||
|
||||
All header files <c>boost/contract/\*.hpp</c> are independent from one another
|
||||
and can be included one-by-one to reduce the amount of code to compile from this
|
||||
library in user code (but this was measured to not make an appreciable
|
||||
difference in compile-time so <c>boost/contract.hpp</c> can be included directly
|
||||
in most cases).
|
||||
Instead the headers <c>boost/contract/core/\*.hpp</c> are not independent from
|
||||
other library headers and they are automatically included by the
|
||||
<c>boost/contract/\*.hpp</c> headers (so the <c>boost/contract/core/\*.hpp</c>
|
||||
headers are usually not directly included by programmers).
|
||||
|
||||
All files under the <c>boost/contract/detail/</c> directory, names within the
|
||||
@c boost::contract::detail namespace, names prefixed by
|
||||
@c boost_contract_detail... and @c BOOST_CONTRACT_DETAIL... (in any namesapce,
|
||||
including user's code) are reserved for internal use of this library and should
|
||||
never be used directly by programmers.
|
||||
|
||||
@see @RefSect{getting_started, Getting Started}
|
||||
*/
|
||||
|
||||
#include <boost/contract/assert.hpp>
|
||||
#include <boost/contract/base_types.hpp>
|
||||
#include <boost/contract/call_if.hpp>
|
||||
#include <boost/contract/constructor.hpp>
|
||||
#include <boost/contract/destructor.hpp>
|
||||
#include <boost/contract/function.hpp>
|
||||
#include <boost/contract/check.hpp>
|
||||
#include <boost/contract/old.hpp>
|
||||
#include <boost/contract/override.hpp>
|
||||
#include <boost/contract/public_function.hpp>
|
||||
|
||||
#endif // #include guard
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,209 +0,0 @@
|
||||
/// @file
|
||||
// Boost.Convert
|
||||
// Copyright (c) 2009-2020 Vladimir Batov.
|
||||
//
|
||||
// Many thanks to Julian Gonggrijp, Rob Stewart, Andrzej Krzemienski, Matus Chochlik, Jeroen Habraken,
|
||||
// Hartmut Kaiser, Joel De Guzman, Thijs (M.A.) van den Berg, Roland Bock, Gavin Lambert, Paul Bristow,
|
||||
// Alex Hagen-Zanker, Christopher Kormanyos for taking part in the Boost.Convert review.
|
||||
//
|
||||
// Special thanks to:
|
||||
//
|
||||
// 1. Alex Hagen-Zanker, Roland Bock, Rob Stewart for their considerable contributions to the design
|
||||
// and implementation of the library;
|
||||
// 2. Andrzej Krzemienski for helping to partition responsibilities and to ultimately pave
|
||||
// the way for the boost::optional and future std::tr2::optional deployment;
|
||||
// 3. Edward Diener the Boost Review Manager for helping with the converters' design, his continuous
|
||||
// involvement, technical and administrative help, guidance and advice;
|
||||
// 4. Joel De Guzman, Rob Stewart and Alex Hagen-Zanker for making sure the performance tests work
|
||||
// as they should;
|
||||
// 5. Paul Bristow for helping great deal with the documentation;
|
||||
// 6. Kevlin Henney and Dave Abrahams for their lexical_cast-related insights and explanations.
|
||||
//
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. See http://www.boost.org/LICENSE_1_0.txt.
|
||||
|
||||
#ifndef BOOST_CONVERT_HPP
|
||||
#define BOOST_CONVERT_HPP
|
||||
|
||||
#include <boost/convert/detail/is_fun.hpp>
|
||||
#include <boost/core/ref.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace detail { enum throw_on_failure {}; }
|
||||
|
||||
/// @details boost::throw_on_failure is the 'tag' object
|
||||
/// to request the exception-throwing behavior.
|
||||
detail::throw_on_failure const throw_on_failure = detail::throw_on_failure(0);
|
||||
|
||||
namespace cnv
|
||||
{
|
||||
template<typename, typename, typename> struct reference;
|
||||
struct by_default;
|
||||
}
|
||||
|
||||
/// @brief Boost.Convert main deployment interface
|
||||
/// @param[in] value_in Value of the TypeIn type to be converted to the TypeOut type
|
||||
/// @param[in] converter Converter to be used for conversion
|
||||
/// @return boost::optional<TypeOut> result of conversion together with the indication of
|
||||
/// success or failure of the conversion request.
|
||||
/// @details For example,
|
||||
/// @code
|
||||
/// boost::cnv::cstream cnv;
|
||||
///
|
||||
/// boost::optional<int> i = boost::convert<int>("12", cnv);
|
||||
/// boost::optional<string> s = boost::convert<string>(123.456, cnv);
|
||||
/// @endcode
|
||||
|
||||
template<typename TypeOut, typename TypeIn, typename Converter>
|
||||
boost::optional<TypeOut>
|
||||
convert(TypeIn const& value_in, Converter const& converter)
|
||||
{
|
||||
optional<TypeOut> result;
|
||||
boost::unwrap_ref(converter)(value_in, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
namespace cnv { namespace detail
|
||||
{
|
||||
template<typename TypeOut, typename TypeIn, typename Converter =boost::cnv::by_default>
|
||||
struct delayed_resolution
|
||||
{
|
||||
static optional<TypeOut> convert(TypeIn const& value_in)
|
||||
{
|
||||
return boost::convert<TypeOut>(value_in, Converter());
|
||||
}
|
||||
};
|
||||
}}
|
||||
/// @brief Boost.Convert deployment interface with the default converter
|
||||
/// @details For example,
|
||||
/// @code
|
||||
/// struct boost::cnv::by_default : boost::cnv::cstream {};
|
||||
///
|
||||
/// // boost::cnv::cstream (through boost::cnv::by_default) is deployed
|
||||
/// // as the default converter when no converter is provided explicitly.
|
||||
/// boost::optional<int> i = boost::convert<int>("12");
|
||||
/// boost::optional<string> s = boost::convert<string>(123.456);
|
||||
/// @endcode
|
||||
|
||||
template<typename TypeOut, typename TypeIn>
|
||||
boost::optional<TypeOut>
|
||||
convert(TypeIn const& value_in)
|
||||
{
|
||||
return cnv::detail::delayed_resolution<TypeOut, TypeIn>::convert(value_in);
|
||||
}
|
||||
}
|
||||
|
||||
namespace boost
|
||||
{
|
||||
/// @brief Boost.Convert non-optional deployment interface
|
||||
|
||||
template<typename TypeOut, typename TypeIn, typename Converter>
|
||||
TypeOut
|
||||
convert(TypeIn const& value_in, Converter const& converter, boost::detail::throw_on_failure)
|
||||
{
|
||||
return convert<TypeOut>(value_in, converter).value();
|
||||
}
|
||||
|
||||
template<typename TypeOut, typename TypeIn, typename Converter, typename Fallback>
|
||||
typename std::enable_if<is_convertible<Fallback, TypeOut>::value, TypeOut>::type
|
||||
convert(TypeIn const& value_in, Converter const& converter, Fallback const& fallback)
|
||||
{
|
||||
return convert<TypeOut>(value_in, converter).value_or(fallback);
|
||||
}
|
||||
|
||||
template<typename TypeOut, typename TypeIn, typename Converter, typename Fallback>
|
||||
typename std::enable_if<cnv::is_fun<Fallback, TypeOut>::value, TypeOut>::type
|
||||
convert(TypeIn const& value_in, Converter const& converter, Fallback fallback)
|
||||
{
|
||||
return convert<TypeOut>(value_in, converter).value_or_eval(fallback);
|
||||
}
|
||||
}
|
||||
|
||||
namespace boost { namespace cnv
|
||||
{
|
||||
template<typename Converter, typename TypeOut, typename TypeIn>
|
||||
struct reference
|
||||
{
|
||||
using this_type = reference;
|
||||
|
||||
reference (Converter const& cnv) : converter_(cnv) {}
|
||||
reference (Converter&& cnv) : converter_(std::move(cnv)) {}
|
||||
|
||||
this_type&
|
||||
value_or(TypeOut const& fallback)
|
||||
{
|
||||
return (fallback_ = fallback, *this);
|
||||
}
|
||||
|
||||
TypeOut
|
||||
operator()(TypeIn const& value_in) const
|
||||
{
|
||||
optional<TypeOut> result = convert<TypeOut>(value_in, converter_);
|
||||
return result ? result.get() : fallback_.value();
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
Converter converter_;
|
||||
optional<TypeOut> fallback_;
|
||||
};
|
||||
template<typename Converter, typename TypeOut>
|
||||
struct reference<Converter, TypeOut, void>
|
||||
{
|
||||
using this_type = reference;
|
||||
|
||||
reference (Converter const& cnv) : converter_(cnv) {}
|
||||
reference (Converter&& cnv) : converter_(std::move(cnv)) {}
|
||||
|
||||
this_type&
|
||||
value_or(TypeOut const& fallback)
|
||||
{
|
||||
return (fallback_ = fallback, *this);
|
||||
}
|
||||
|
||||
template<typename TypeIn>
|
||||
TypeOut
|
||||
operator()(TypeIn const& value_in) const
|
||||
{
|
||||
optional<TypeOut> result = convert<TypeOut>(value_in, converter_);
|
||||
return result ? result.get() : fallback_.value();
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
Converter converter_;
|
||||
optional<TypeOut> fallback_;
|
||||
};
|
||||
|
||||
/// @brief Boost.Convert deployment interface with algorithms
|
||||
/// @details For example,
|
||||
/// @code
|
||||
/// std::array<char const*, 3> strs = {{ " 5", "0XF", "not an int" }};
|
||||
/// std::vector<int> ints;
|
||||
/// boost::cnv::cstream cnv;
|
||||
///
|
||||
/// cnv(std::hex)(std::skipws);
|
||||
///
|
||||
/// std::transform(
|
||||
/// strs.begin(),
|
||||
/// strs.end(),
|
||||
/// std::back_inserter(ints),
|
||||
/// boost::cnv::apply<int>(std::cref(cnv)).value_or(-1));
|
||||
/// @endcode
|
||||
|
||||
template<typename TypeOut, typename TypeIn, typename Converter>
|
||||
reference<Converter, TypeOut, TypeIn>
|
||||
apply(Converter const& cnv)
|
||||
{
|
||||
return cnv::reference<Converter, TypeOut, TypeIn>(cnv);
|
||||
}
|
||||
template<typename TypeOut, typename Converter>
|
||||
reference<Converter, TypeOut, void>
|
||||
apply(Converter const& cnv)
|
||||
{
|
||||
return cnv::reference<Converter, TypeOut, void>(cnv);
|
||||
}
|
||||
}}
|
||||
|
||||
#endif // BOOST_CONVERT_HPP
|
||||
@ -1,274 +0,0 @@
|
||||
/*
|
||||
Copyright (C) 2002 Brad King (brad.king@kitware.com)
|
||||
Douglas Gregor (gregod@cs.rpi.edu)
|
||||
|
||||
Copyright (C) 2002, 2008, 2013 Peter Dimov
|
||||
|
||||
Copyright (C) 2017 Glen Joseph Fernandes (glenjofe@gmail.com)
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
|
||||
#ifndef BOOST_CORE_ADDRESSOF_HPP
|
||||
#define BOOST_CORE_ADDRESSOF_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#if defined(BOOST_MSVC_FULL_VER) && BOOST_MSVC_FULL_VER >= 190024215
|
||||
#define BOOST_CORE_HAS_BUILTIN_ADDRESSOF
|
||||
#elif defined(BOOST_GCC) && BOOST_GCC >= 70000
|
||||
#define BOOST_CORE_HAS_BUILTIN_ADDRESSOF
|
||||
#elif defined(__has_builtin)
|
||||
#if __has_builtin(__builtin_addressof)
|
||||
#define BOOST_CORE_HAS_BUILTIN_ADDRESSOF
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_CORE_HAS_BUILTIN_ADDRESSOF)
|
||||
#if defined(BOOST_NO_CXX11_CONSTEXPR)
|
||||
#define BOOST_CORE_NO_CONSTEXPR_ADDRESSOF
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
|
||||
template<class T>
|
||||
BOOST_CONSTEXPR inline T*
|
||||
addressof(T& o) BOOST_NOEXCEPT
|
||||
{
|
||||
return __builtin_addressof(o);
|
||||
}
|
||||
|
||||
} /* boost */
|
||||
#else
|
||||
#include <boost/config/workaround.hpp>
|
||||
#include <cstddef>
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
|
||||
template<class T>
|
||||
class addrof_ref {
|
||||
public:
|
||||
BOOST_FORCEINLINE addrof_ref(T& o) BOOST_NOEXCEPT
|
||||
: o_(o) { }
|
||||
BOOST_FORCEINLINE operator T&() const BOOST_NOEXCEPT {
|
||||
return o_;
|
||||
}
|
||||
private:
|
||||
addrof_ref& operator=(const addrof_ref&);
|
||||
T& o_;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct addrof {
|
||||
static BOOST_FORCEINLINE T* get(T& o, long) BOOST_NOEXCEPT {
|
||||
return reinterpret_cast<T*>(&
|
||||
const_cast<char&>(reinterpret_cast<const volatile char&>(o)));
|
||||
}
|
||||
static BOOST_FORCEINLINE T* get(T* p, int) BOOST_NOEXCEPT {
|
||||
return p;
|
||||
}
|
||||
};
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_NULLPTR)
|
||||
#if !defined(BOOST_NO_CXX11_DECLTYPE) && \
|
||||
(defined(__INTEL_COMPILER) || \
|
||||
(defined(__clang__) && !defined(_LIBCPP_VERSION)))
|
||||
typedef decltype(nullptr) addrof_null_t;
|
||||
#else
|
||||
typedef std::nullptr_t addrof_null_t;
|
||||
#endif
|
||||
|
||||
template<>
|
||||
struct addrof<addrof_null_t> {
|
||||
typedef addrof_null_t type;
|
||||
static BOOST_FORCEINLINE type* get(type& o, int) BOOST_NOEXCEPT {
|
||||
return &o;
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct addrof<const addrof_null_t> {
|
||||
typedef const addrof_null_t type;
|
||||
static BOOST_FORCEINLINE type* get(type& o, int) BOOST_NOEXCEPT {
|
||||
return &o;
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct addrof<volatile addrof_null_t> {
|
||||
typedef volatile addrof_null_t type;
|
||||
static BOOST_FORCEINLINE type* get(type& o, int) BOOST_NOEXCEPT {
|
||||
return &o;
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct addrof<const volatile addrof_null_t> {
|
||||
typedef const volatile addrof_null_t type;
|
||||
static BOOST_FORCEINLINE type* get(type& o, int) BOOST_NOEXCEPT {
|
||||
return &o;
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
} /* detail */
|
||||
|
||||
#if defined(BOOST_NO_CXX11_SFINAE_EXPR) || \
|
||||
defined(BOOST_NO_CXX11_CONSTEXPR) || \
|
||||
defined(BOOST_NO_CXX11_DECLTYPE)
|
||||
#define BOOST_CORE_NO_CONSTEXPR_ADDRESSOF
|
||||
|
||||
template<class T>
|
||||
BOOST_FORCEINLINE T*
|
||||
addressof(T& o) BOOST_NOEXCEPT
|
||||
{
|
||||
#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x610)) || \
|
||||
BOOST_WORKAROUND(__SUNPRO_CC, <= 0x5120)
|
||||
return boost::detail::addrof<T>::get(o, 0);
|
||||
#else
|
||||
return boost::detail::addrof<T>::get(boost::detail::addrof_ref<T>(o), 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590))
|
||||
namespace detail {
|
||||
|
||||
template<class T>
|
||||
struct addrof_result {
|
||||
typedef T* type;
|
||||
};
|
||||
|
||||
} /* detail */
|
||||
|
||||
template<class T, std::size_t N>
|
||||
BOOST_FORCEINLINE typename boost::detail::addrof_result<T[N]>::type
|
||||
addressof(T (&o)[N]) BOOST_NOEXCEPT
|
||||
{
|
||||
return &o;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
|
||||
template<class T, std::size_t N>
|
||||
BOOST_FORCEINLINE
|
||||
T (*addressof(T (&o)[N]) BOOST_NOEXCEPT)[N]
|
||||
{
|
||||
return reinterpret_cast<T(*)[N]>(&o);
|
||||
}
|
||||
|
||||
template<class T, std::size_t N>
|
||||
BOOST_FORCEINLINE
|
||||
const T (*addressof(const T (&o)[N]) BOOST_NOEXCEPT)[N]
|
||||
{
|
||||
return reinterpret_cast<const T(*)[N]>(&o);
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
namespace detail {
|
||||
|
||||
template<class T>
|
||||
T addrof_declval() BOOST_NOEXCEPT;
|
||||
|
||||
template<class>
|
||||
struct addrof_void {
|
||||
typedef void type;
|
||||
};
|
||||
|
||||
template<class T, class E = void>
|
||||
struct addrof_member_operator {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct addrof_member_operator<T, typename
|
||||
addrof_void<decltype(addrof_declval<T&>().operator&())>::type> {
|
||||
static constexpr bool value = true;
|
||||
};
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_INTEL, < 1600)
|
||||
struct addrof_addressable { };
|
||||
|
||||
addrof_addressable*
|
||||
operator&(addrof_addressable&) BOOST_NOEXCEPT;
|
||||
#endif
|
||||
|
||||
template<class T, class E = void>
|
||||
struct addrof_non_member_operator {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct addrof_non_member_operator<T, typename
|
||||
addrof_void<decltype(operator&(addrof_declval<T&>()))>::type> {
|
||||
static constexpr bool value = true;
|
||||
};
|
||||
|
||||
template<class T, class E = void>
|
||||
struct addrof_expression {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct addrof_expression<T,
|
||||
typename addrof_void<decltype(&addrof_declval<T&>())>::type> {
|
||||
static constexpr bool value = true;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct addrof_is_constexpr {
|
||||
static constexpr bool value = addrof_expression<T>::value &&
|
||||
!addrof_member_operator<T>::value &&
|
||||
!addrof_non_member_operator<T>::value;
|
||||
};
|
||||
|
||||
template<bool E, class T>
|
||||
struct addrof_if { };
|
||||
|
||||
template<class T>
|
||||
struct addrof_if<true, T> {
|
||||
typedef T* type;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
BOOST_FORCEINLINE
|
||||
typename addrof_if<!addrof_is_constexpr<T>::value, T>::type
|
||||
addressof(T& o) BOOST_NOEXCEPT
|
||||
{
|
||||
return addrof<T>::get(addrof_ref<T>(o), 0);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
constexpr BOOST_FORCEINLINE
|
||||
typename addrof_if<addrof_is_constexpr<T>::value, T>::type
|
||||
addressof(T& o) BOOST_NOEXCEPT
|
||||
{
|
||||
return &o;
|
||||
}
|
||||
|
||||
} /* detail */
|
||||
|
||||
template<class T>
|
||||
constexpr BOOST_FORCEINLINE T*
|
||||
addressof(T& o) BOOST_NOEXCEPT
|
||||
{
|
||||
return boost::detail::addressof(o);
|
||||
}
|
||||
#endif
|
||||
|
||||
} /* boost */
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && \
|
||||
!defined(BOOST_NO_CXX11_DELETED_FUNCTIONS)
|
||||
namespace boost {
|
||||
|
||||
template<class T>
|
||||
const T* addressof(const T&&) = delete;
|
||||
|
||||
} /* boost */
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@ -1,169 +0,0 @@
|
||||
/*
|
||||
Copyright 2019 Glen Joseph Fernandes
|
||||
(glenjofe@gmail.com)
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
#ifndef BOOST_CORE_ALLOC_CONSTRUCT_HPP
|
||||
#define BOOST_CORE_ALLOC_CONSTRUCT_HPP
|
||||
|
||||
#include <boost/core/noinit_adaptor.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
template<class A, class T>
|
||||
inline void
|
||||
alloc_destroy(A& a, T* p)
|
||||
{
|
||||
boost::allocator_destroy(a, p);
|
||||
}
|
||||
|
||||
template<class A, class T>
|
||||
inline void
|
||||
alloc_destroy_n(A& a, T* p, std::size_t n)
|
||||
{
|
||||
while (n > 0) {
|
||||
boost::allocator_destroy(a, p + --n);
|
||||
}
|
||||
}
|
||||
|
||||
template<class A, class T>
|
||||
inline void
|
||||
alloc_destroy(noinit_adaptor<A>&, T* p)
|
||||
{
|
||||
p->~T();
|
||||
}
|
||||
|
||||
template<class A, class T>
|
||||
inline void
|
||||
alloc_destroy_n(noinit_adaptor<A>&, T* p, std::size_t n)
|
||||
{
|
||||
while (n > 0) {
|
||||
p[--n].~T();
|
||||
}
|
||||
}
|
||||
|
||||
namespace detail {
|
||||
|
||||
template<class A, class T>
|
||||
class alloc_destroyer {
|
||||
public:
|
||||
alloc_destroyer(A& a, T* p) BOOST_NOEXCEPT
|
||||
: a_(a),
|
||||
p_(p),
|
||||
n_(0) { }
|
||||
|
||||
~alloc_destroyer() {
|
||||
boost::alloc_destroy_n(a_, p_, n_);
|
||||
}
|
||||
|
||||
std::size_t& size() BOOST_NOEXCEPT {
|
||||
return n_;
|
||||
}
|
||||
|
||||
private:
|
||||
alloc_destroyer(const alloc_destroyer&);
|
||||
alloc_destroyer& operator=(const alloc_destroyer&);
|
||||
|
||||
A& a_;
|
||||
T* p_;
|
||||
std::size_t n_;
|
||||
};
|
||||
|
||||
} /* detail */
|
||||
|
||||
template<class A, class T>
|
||||
inline void
|
||||
alloc_construct(A& a, T* p)
|
||||
{
|
||||
boost::allocator_construct(a, p);
|
||||
}
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||
template<class A, class T, class U, class... V>
|
||||
inline void
|
||||
alloc_construct(A& a, T* p, U&& u, V&&... v)
|
||||
{
|
||||
boost::allocator_construct(a, p, std::forward<U>(u),
|
||||
std::forward<V>(v)...);
|
||||
}
|
||||
#else
|
||||
template<class A, class T, class U>
|
||||
inline void
|
||||
alloc_construct(A& a, T* p, U&& u)
|
||||
{
|
||||
boost::allocator_construct(a, p, std::forward<U>(u));
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
template<class A, class T, class U>
|
||||
inline void
|
||||
alloc_construct(A& a, T* p, const U& u)
|
||||
{
|
||||
boost::allocator_construct(a, p, u);
|
||||
}
|
||||
|
||||
template<class A, class T, class U>
|
||||
inline void
|
||||
alloc_construct(A& a, T* p, U& u)
|
||||
{
|
||||
boost::allocator_construct(a, p, u);
|
||||
}
|
||||
#endif
|
||||
|
||||
template<class A, class T>
|
||||
inline void
|
||||
alloc_construct_n(A& a, T* p, std::size_t n)
|
||||
{
|
||||
detail::alloc_destroyer<A, T> hold(a, p);
|
||||
for (std::size_t& i = hold.size(); i < n; ++i) {
|
||||
boost::allocator_construct(a, p + i);
|
||||
}
|
||||
hold.size() = 0;
|
||||
}
|
||||
|
||||
template<class A, class T>
|
||||
inline void
|
||||
alloc_construct_n(A& a, T* p, std::size_t n, const T* l, std::size_t m)
|
||||
{
|
||||
detail::alloc_destroyer<A, T> hold(a, p);
|
||||
for (std::size_t& i = hold.size(); i < n; ++i) {
|
||||
boost::allocator_construct(a, p + i, l[i % m]);
|
||||
}
|
||||
hold.size() = 0;
|
||||
}
|
||||
|
||||
template<class A, class T, class I>
|
||||
inline void
|
||||
alloc_construct_n(A& a, T* p, std::size_t n, I b)
|
||||
{
|
||||
detail::alloc_destroyer<A, T> hold(a, p);
|
||||
for (std::size_t& i = hold.size(); i < n; void(++i), void(++b)) {
|
||||
boost::allocator_construct(a, p + i, *b);
|
||||
}
|
||||
hold.size() = 0;
|
||||
}
|
||||
|
||||
template<class A, class T>
|
||||
inline void
|
||||
alloc_construct(noinit_adaptor<A>&, T* p)
|
||||
{
|
||||
::new(static_cast<void*>(p)) T;
|
||||
}
|
||||
|
||||
template<class A, class T>
|
||||
inline void
|
||||
alloc_construct_n(noinit_adaptor<A>& a, T* p, std::size_t n)
|
||||
{
|
||||
detail::alloc_destroyer<noinit_adaptor<A>, T> hold(a, p);
|
||||
for (std::size_t& i = hold.size(); i < n; ++i) {
|
||||
::new(static_cast<void*>(p + i)) T;
|
||||
}
|
||||
hold.size() = 0;
|
||||
}
|
||||
|
||||
} /* boost */
|
||||
|
||||
#endif
|
||||
@ -1,601 +0,0 @@
|
||||
/*
|
||||
Copyright 2020-2021 Glen Joseph Fernandes
|
||||
(glenjofe@gmail.com)
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
#ifndef BOOST_CORE_ALLOCATOR_ACCESS_HPP
|
||||
#define BOOST_CORE_ALLOCATOR_ACCESS_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#if !defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
#include <boost/core/pointer_traits.hpp>
|
||||
#include <limits>
|
||||
#include <type_traits>
|
||||
#endif
|
||||
#include <new>
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
#include <utility>
|
||||
#endif
|
||||
|
||||
#if defined(_LIBCPP_SUPPRESS_DEPRECATED_PUSH)
|
||||
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
|
||||
#endif
|
||||
#if defined(_STL_DISABLE_DEPRECATED_WARNING)
|
||||
_STL_DISABLE_DEPRECATED_WARNING
|
||||
#endif
|
||||
#if defined(_MSC_VER)
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4996)
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
|
||||
template<class A>
|
||||
struct allocator_value_type {
|
||||
typedef typename A::value_type type;
|
||||
};
|
||||
|
||||
#if defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
template<class A>
|
||||
struct allocator_pointer {
|
||||
typedef typename A::pointer type;
|
||||
};
|
||||
#else
|
||||
template<class A, class = void>
|
||||
struct allocator_pointer {
|
||||
typedef typename A::value_type* type;
|
||||
};
|
||||
|
||||
namespace detail {
|
||||
|
||||
template<class>
|
||||
struct alloc_void {
|
||||
typedef void type;
|
||||
};
|
||||
|
||||
} /* detail */
|
||||
|
||||
template<class A>
|
||||
struct allocator_pointer<A,
|
||||
typename detail::alloc_void<typename A::pointer>::type> {
|
||||
typedef typename A::pointer type;
|
||||
};
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
template<class A>
|
||||
struct allocator_const_pointer {
|
||||
typedef typename A::const_pointer type;
|
||||
};
|
||||
#else
|
||||
template<class A, class = void>
|
||||
struct allocator_const_pointer {
|
||||
typedef typename pointer_traits<typename
|
||||
allocator_pointer<A>::type>::template
|
||||
rebind_to<const typename A::value_type>::type type;
|
||||
};
|
||||
|
||||
template<class A>
|
||||
struct allocator_const_pointer<A,
|
||||
typename detail::alloc_void<typename A::const_pointer>::type> {
|
||||
typedef typename A::const_pointer type;
|
||||
};
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
template<class A>
|
||||
struct allocator_void_pointer {
|
||||
typedef typename A::template rebind<void>::other::pointer type;
|
||||
};
|
||||
#else
|
||||
template<class A, class = void>
|
||||
struct allocator_void_pointer {
|
||||
typedef typename pointer_traits<typename
|
||||
allocator_pointer<A>::type>::template
|
||||
rebind_to<void>::type type;
|
||||
};
|
||||
|
||||
template<class A>
|
||||
struct allocator_void_pointer<A,
|
||||
typename detail::alloc_void<typename A::void_pointer>::type> {
|
||||
typedef typename A::void_pointer type;
|
||||
};
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
template<class A>
|
||||
struct allocator_const_void_pointer {
|
||||
typedef typename A::template rebind<void>::other::const_pointer type;
|
||||
};
|
||||
#else
|
||||
template<class A, class = void>
|
||||
struct allocator_const_void_pointer {
|
||||
typedef typename pointer_traits<typename
|
||||
allocator_pointer<A>::type>::template
|
||||
rebind_to<const void>::type type;
|
||||
};
|
||||
|
||||
template<class A>
|
||||
struct allocator_const_void_pointer<A,
|
||||
typename detail::alloc_void<typename A::const_void_pointer>::type> {
|
||||
typedef typename A::const_void_pointer type;
|
||||
};
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
template<class A>
|
||||
struct allocator_difference_type {
|
||||
typedef typename A::difference_type type;
|
||||
};
|
||||
#else
|
||||
template<class A, class = void>
|
||||
struct allocator_difference_type {
|
||||
typedef typename pointer_traits<typename
|
||||
allocator_pointer<A>::type>::difference_type type;
|
||||
};
|
||||
|
||||
template<class A>
|
||||
struct allocator_difference_type<A,
|
||||
typename detail::alloc_void<typename A::difference_type>::type> {
|
||||
typedef typename A::difference_type type;
|
||||
};
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
template<class A>
|
||||
struct allocator_size_type {
|
||||
typedef typename A::size_type type;
|
||||
};
|
||||
#else
|
||||
template<class A, class = void>
|
||||
struct allocator_size_type {
|
||||
typedef typename std::make_unsigned<typename
|
||||
allocator_difference_type<A>::type>::type type;
|
||||
};
|
||||
|
||||
template<class A>
|
||||
struct allocator_size_type<A,
|
||||
typename detail::alloc_void<typename A::size_type>::type> {
|
||||
typedef typename A::size_type type;
|
||||
};
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
namespace detail {
|
||||
|
||||
struct alloc_false {
|
||||
BOOST_STATIC_CONSTEXPR bool value = false;
|
||||
};
|
||||
|
||||
} /* detail */
|
||||
|
||||
template<class A>
|
||||
struct allocator_propagate_on_container_copy_assignment {
|
||||
typedef detail::alloc_false type;
|
||||
};
|
||||
#else
|
||||
template<class A, class = void>
|
||||
struct allocator_propagate_on_container_copy_assignment {
|
||||
typedef std::false_type type;
|
||||
};
|
||||
|
||||
template<class A>
|
||||
struct allocator_propagate_on_container_copy_assignment<A,
|
||||
typename detail::alloc_void<typename
|
||||
A::propagate_on_container_copy_assignment>::type> {
|
||||
typedef typename A::propagate_on_container_copy_assignment type;
|
||||
};
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
template<class A>
|
||||
struct allocator_propagate_on_container_move_assignment {
|
||||
typedef detail::alloc_false type;
|
||||
};
|
||||
#else
|
||||
template<class A, class = void>
|
||||
struct allocator_propagate_on_container_move_assignment {
|
||||
typedef std::false_type type;
|
||||
};
|
||||
|
||||
template<class A>
|
||||
struct allocator_propagate_on_container_move_assignment<A,
|
||||
typename detail::alloc_void<typename
|
||||
A::propagate_on_container_move_assignment>::type> {
|
||||
typedef typename A::propagate_on_container_move_assignment type;
|
||||
};
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
template<class A>
|
||||
struct allocator_propagate_on_container_swap {
|
||||
typedef detail::alloc_false type;
|
||||
};
|
||||
#else
|
||||
template<class A, class = void>
|
||||
struct allocator_propagate_on_container_swap {
|
||||
typedef std::false_type type;
|
||||
};
|
||||
|
||||
template<class A>
|
||||
struct allocator_propagate_on_container_swap<A,
|
||||
typename detail::alloc_void<typename
|
||||
A::propagate_on_container_swap>::type> {
|
||||
typedef typename A::propagate_on_container_swap type;
|
||||
};
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
template<class A>
|
||||
struct allocator_is_always_equal {
|
||||
typedef detail::alloc_false type;
|
||||
};
|
||||
#else
|
||||
template<class A, class = void>
|
||||
struct allocator_is_always_equal {
|
||||
typedef typename std::is_empty<A>::type type;
|
||||
};
|
||||
|
||||
template<class A>
|
||||
struct allocator_is_always_equal<A,
|
||||
typename detail::alloc_void<typename A::is_always_equal>::type> {
|
||||
typedef typename A::is_always_equal type;
|
||||
};
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
template<class A, class T>
|
||||
struct allocator_rebind {
|
||||
typedef typename A::template rebind<T>::other type;
|
||||
};
|
||||
#else
|
||||
namespace detail {
|
||||
|
||||
template<class, class>
|
||||
struct alloc_to { };
|
||||
|
||||
template<template<class, class...> class A, class T, class U, class... V>
|
||||
struct alloc_to<A<U, V...>, T> {
|
||||
typedef A<T, V...> type;
|
||||
};
|
||||
|
||||
} /* detail */
|
||||
|
||||
template<class A, class T, class = void>
|
||||
struct allocator_rebind {
|
||||
typedef typename detail::alloc_to<A, T>::type type;
|
||||
};
|
||||
|
||||
template<class A, class T>
|
||||
struct allocator_rebind<A, T,
|
||||
typename detail::alloc_void<typename A::template rebind<T>::other>::type> {
|
||||
typedef typename A::template rebind<T>::other type;
|
||||
};
|
||||
#endif
|
||||
|
||||
template<class A>
|
||||
inline typename allocator_pointer<A>::type
|
||||
allocator_allocate(A& a, typename allocator_size_type<A>::type n)
|
||||
{
|
||||
return a.allocate(n);
|
||||
}
|
||||
|
||||
template<class A>
|
||||
inline void
|
||||
allocator_deallocate(A& a, typename allocator_pointer<A>::type p,
|
||||
typename allocator_size_type<A>::type n)
|
||||
{
|
||||
a.deallocate(p, n);
|
||||
}
|
||||
|
||||
#if defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
template<class A>
|
||||
inline typename allocator_pointer<A>::type
|
||||
allocator_allocate(A& a, typename allocator_size_type<A>::type n,
|
||||
typename allocator_const_void_pointer<A>::type h)
|
||||
{
|
||||
return a.allocate(n, h);
|
||||
}
|
||||
#else
|
||||
namespace detail {
|
||||
|
||||
struct alloc_none { };
|
||||
|
||||
template<class A>
|
||||
class alloc_has_allocate {
|
||||
template<class O>
|
||||
static auto check(int) -> decltype(std::declval<O&>().allocate(
|
||||
std::declval<typename allocator_size_type<A>::type>(),
|
||||
std::declval<typename allocator_const_void_pointer<A>::type>()));
|
||||
|
||||
template<class>
|
||||
static alloc_none check(long);
|
||||
|
||||
public:
|
||||
BOOST_STATIC_CONSTEXPR bool value =
|
||||
!std::is_same<decltype(check<A>(0)), alloc_none>::value;
|
||||
};
|
||||
|
||||
} /* detail */
|
||||
|
||||
template<class A>
|
||||
inline typename std::enable_if<detail::alloc_has_allocate<A>::value,
|
||||
typename allocator_pointer<A>::type>::type
|
||||
allocator_allocate(A& a, typename allocator_size_type<A>::type n,
|
||||
typename allocator_const_void_pointer<A>::type h)
|
||||
{
|
||||
return a.allocate(n, h);
|
||||
}
|
||||
|
||||
template<class A>
|
||||
inline typename std::enable_if<!detail::alloc_has_allocate<A>::value,
|
||||
typename allocator_pointer<A>::type>::type
|
||||
allocator_allocate(A& a, typename allocator_size_type<A>::type n,
|
||||
typename allocator_const_void_pointer<A>::type)
|
||||
{
|
||||
return a.allocate(n);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
template<class A, class T>
|
||||
inline void
|
||||
allocator_construct(A&, T* p)
|
||||
{
|
||||
::new((void*)p) T();
|
||||
}
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||
template<class A, class T, class V, class... Args>
|
||||
inline void
|
||||
allocator_construct(A&, T* p, V&& v, Args&&... args)
|
||||
{
|
||||
::new((void*)p) T(std::forward<V>(v), std::forward<Args>(args)...);
|
||||
}
|
||||
#else
|
||||
template<class A, class T, class V>
|
||||
inline void
|
||||
allocator_construct(A&, T* p, V&& v)
|
||||
{
|
||||
::new((void*)p) T(std::forward<V>(v));
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
template<class A, class T, class V>
|
||||
inline void
|
||||
allocator_construct(A&, T* p, const V& v)
|
||||
{
|
||||
::new((void*)p) T(v);
|
||||
}
|
||||
|
||||
template<class A, class T, class V>
|
||||
inline void
|
||||
allocator_construct(A&, T* p, V& v)
|
||||
{
|
||||
::new((void*)p) T(v);
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
namespace detail {
|
||||
|
||||
template<class A, class T, class... Args>
|
||||
class alloc_has_construct {
|
||||
template<class O>
|
||||
static auto check(int)
|
||||
-> decltype(std::declval<O&>().construct(std::declval<T*>(),
|
||||
std::declval<Args&&>()...));
|
||||
|
||||
template<class>
|
||||
static alloc_none check(long);
|
||||
|
||||
public:
|
||||
BOOST_STATIC_CONSTEXPR bool value =
|
||||
!std::is_same<decltype(check<A>(0)), alloc_none>::value;
|
||||
};
|
||||
|
||||
} /* detail */
|
||||
|
||||
template<class A, class T, class... Args>
|
||||
inline typename std::enable_if<detail::alloc_has_construct<A, T,
|
||||
Args...>::value>::type
|
||||
allocator_construct(A& a, T* p, Args&&... args)
|
||||
{
|
||||
a.construct(p, std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
template<class A, class T, class... Args>
|
||||
inline typename std::enable_if<!detail::alloc_has_construct<A, T,
|
||||
Args...>::value>::type
|
||||
allocator_construct(A&, T* p, Args&&... args)
|
||||
{
|
||||
::new((void*)p) T(std::forward<Args>(args)...);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
template<class A, class T>
|
||||
inline void
|
||||
allocator_destroy(A&, T* p)
|
||||
{
|
||||
p->~T();
|
||||
(void)p;
|
||||
}
|
||||
#else
|
||||
namespace detail {
|
||||
|
||||
template<class A, class T>
|
||||
class alloc_has_destroy {
|
||||
template<class O>
|
||||
static auto check(int)
|
||||
-> decltype(std::declval<O&>().destroy(std::declval<T*>()));
|
||||
|
||||
template<class>
|
||||
static alloc_none check(long);
|
||||
|
||||
public:
|
||||
BOOST_STATIC_CONSTEXPR bool value =
|
||||
!std::is_same<decltype(check<A>(0)), alloc_none>::value;
|
||||
};
|
||||
|
||||
} /* detail */
|
||||
|
||||
template<class A, class T>
|
||||
inline typename std::enable_if<detail::alloc_has_destroy<A, T>::value>::type
|
||||
allocator_destroy(A& a, T* p)
|
||||
{
|
||||
a.destroy(p);
|
||||
}
|
||||
|
||||
template<class A, class T>
|
||||
inline typename std::enable_if<!detail::alloc_has_destroy<A, T>::value>::type
|
||||
allocator_destroy(A&, T* p)
|
||||
{
|
||||
p->~T();
|
||||
(void)p;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
template<class A>
|
||||
inline typename allocator_size_type<A>::type
|
||||
allocator_max_size(const A& a)
|
||||
{
|
||||
return a.max_size();
|
||||
}
|
||||
#else
|
||||
namespace detail {
|
||||
|
||||
template<class A>
|
||||
class alloc_has_max_size {
|
||||
template<class O>
|
||||
static auto check(int) -> decltype(std::declval<O&>().max_size());
|
||||
|
||||
template<class>
|
||||
static alloc_none check(long);
|
||||
|
||||
public:
|
||||
BOOST_STATIC_CONSTEXPR bool value =
|
||||
!std::is_same<decltype(check<A>(0)), alloc_none>::value;
|
||||
};
|
||||
|
||||
} /* detail */
|
||||
|
||||
template<class A>
|
||||
inline typename std::enable_if<detail::alloc_has_max_size<A>::value,
|
||||
typename allocator_size_type<A>::type>::type
|
||||
allocator_max_size(const A& a)
|
||||
{
|
||||
return a.max_size();
|
||||
}
|
||||
|
||||
template<class A>
|
||||
inline typename std::enable_if<!detail::alloc_has_max_size<A>::value,
|
||||
typename allocator_size_type<A>::type>::type
|
||||
allocator_max_size(const A&)
|
||||
{
|
||||
return (std::numeric_limits<typename
|
||||
allocator_size_type<A>::type>::max)() / sizeof(typename A::value_type);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
template<class A>
|
||||
inline A
|
||||
allocator_select_on_container_copy_construction(const A& a)
|
||||
{
|
||||
return a;
|
||||
}
|
||||
#else
|
||||
namespace detail {
|
||||
|
||||
template<class A>
|
||||
class alloc_has_soccc {
|
||||
template<class O>
|
||||
static auto check(int)
|
||||
-> decltype(std::declval<O&>().select_on_container_copy_construction());
|
||||
|
||||
template<class>
|
||||
static alloc_none check(long);
|
||||
|
||||
public:
|
||||
BOOST_STATIC_CONSTEXPR bool value =
|
||||
!std::is_same<decltype(check<A>(0)), alloc_none>::value;
|
||||
};
|
||||
|
||||
} /* detail */
|
||||
|
||||
template<class A>
|
||||
inline typename std::enable_if<detail::alloc_has_soccc<A>::value, A>::type
|
||||
allocator_select_on_container_copy_construction(const A& a)
|
||||
{
|
||||
return a.select_on_container_copy_construction();
|
||||
}
|
||||
|
||||
template<class A>
|
||||
inline typename std::enable_if<!detail::alloc_has_soccc<A>::value, A>::type
|
||||
allocator_select_on_container_copy_construction(const A& a)
|
||||
{
|
||||
return a;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
|
||||
template<class A>
|
||||
using allocator_value_type_t = typename allocator_value_type<A>::type;
|
||||
|
||||
template<class A>
|
||||
using allocator_pointer_t = typename allocator_pointer<A>::type;
|
||||
|
||||
template<class A>
|
||||
using allocator_const_pointer_t = typename allocator_const_pointer<A>::type;
|
||||
|
||||
template<class A>
|
||||
using allocator_void_pointer_t = typename allocator_void_pointer<A>::type;
|
||||
|
||||
template<class A>
|
||||
using allocator_const_void_pointer_t =
|
||||
typename allocator_const_void_pointer<A>::type;
|
||||
|
||||
template<class A>
|
||||
using allocator_difference_type_t =
|
||||
typename allocator_difference_type<A>::type;
|
||||
|
||||
template<class A>
|
||||
using allocator_size_type_t = typename allocator_size_type<A>::type;
|
||||
|
||||
template<class A>
|
||||
using allocator_propagate_on_container_copy_assignment_t =
|
||||
typename allocator_propagate_on_container_copy_assignment<A>::type;
|
||||
|
||||
template<class A>
|
||||
using allocator_propagate_on_container_move_assignment_t =
|
||||
typename allocator_propagate_on_container_move_assignment<A>::type;
|
||||
|
||||
template<class A>
|
||||
using allocator_propagate_on_container_swap_t =
|
||||
typename allocator_propagate_on_container_swap<A>::type;
|
||||
|
||||
template<class A>
|
||||
using allocator_is_always_equal_t =
|
||||
typename allocator_is_always_equal<A>::type;
|
||||
|
||||
template<class A, class T>
|
||||
using allocator_rebind_t = typename allocator_rebind<A, T>::type;
|
||||
#endif
|
||||
|
||||
} /* boost */
|
||||
|
||||
#if defined(_LIBCPP_SUPPRESS_DEPRECATED_POP)
|
||||
_LIBCPP_SUPPRESS_DEPRECATED_POP
|
||||
#endif
|
||||
#if defined(_STL_RESTORE_DEPRECATED_WARNING)
|
||||
_STL_RESTORE_DEPRECATED_WARNING
|
||||
#endif
|
||||
#if defined(_MSC_VER)
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@ -1,592 +0,0 @@
|
||||
#ifndef BOOST_CORE_BIT_HPP_INCLUDED
|
||||
#define BOOST_CORE_BIT_HPP_INCLUDED
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
// boost/core/bit.hpp
|
||||
//
|
||||
// A portable version of the C++20 standard header <bit>
|
||||
//
|
||||
// Copyright 2020 Peter Dimov
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/cstdint.hpp>
|
||||
#include <limits>
|
||||
#include <cstring>
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
|
||||
# include <intrin.h>
|
||||
# pragma intrinsic(_BitScanForward)
|
||||
# pragma intrinsic(_BitScanReverse)
|
||||
|
||||
# if defined(_M_X64)
|
||||
# pragma intrinsic(_BitScanForward64)
|
||||
# pragma intrinsic(_BitScanReverse64)
|
||||
# endif
|
||||
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable: 4127) // conditional expression is constant
|
||||
# pragma warning(disable: 4244) // conversion from int to T
|
||||
|
||||
#endif // defined(_MSC_VER)
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace core
|
||||
{
|
||||
|
||||
// bit_cast
|
||||
|
||||
template<class To, class From>
|
||||
To bit_cast( From const & from ) BOOST_NOEXCEPT
|
||||
{
|
||||
BOOST_STATIC_ASSERT( sizeof(To) == sizeof(From) );
|
||||
|
||||
To to;
|
||||
std::memcpy( &to, &from, sizeof(To) );
|
||||
return to;
|
||||
}
|
||||
|
||||
// countl
|
||||
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
BOOST_CONSTEXPR inline int countl_impl( unsigned char x ) BOOST_NOEXCEPT
|
||||
{
|
||||
return x? __builtin_clz( x ) - ( std::numeric_limits<unsigned int>::digits - std::numeric_limits<unsigned char>::digits ): std::numeric_limits<unsigned char>::digits;
|
||||
}
|
||||
|
||||
BOOST_CONSTEXPR inline int countl_impl( unsigned short x ) BOOST_NOEXCEPT
|
||||
{
|
||||
return x? __builtin_clz( x ) - ( std::numeric_limits<unsigned int>::digits - std::numeric_limits<unsigned short>::digits ): std::numeric_limits<unsigned short>::digits;
|
||||
}
|
||||
|
||||
BOOST_CONSTEXPR inline int countl_impl( unsigned int x ) BOOST_NOEXCEPT
|
||||
{
|
||||
return x? __builtin_clz( x ): std::numeric_limits<unsigned int>::digits;
|
||||
}
|
||||
|
||||
BOOST_CONSTEXPR inline int countl_impl( unsigned long x ) BOOST_NOEXCEPT
|
||||
{
|
||||
return x? __builtin_clzl( x ): std::numeric_limits<unsigned long>::digits;
|
||||
}
|
||||
|
||||
BOOST_CONSTEXPR inline int countl_impl( unsigned long long x ) BOOST_NOEXCEPT
|
||||
{
|
||||
return x? __builtin_clzll( x ): std::numeric_limits<unsigned long long>::digits;
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
|
||||
template<class T>
|
||||
BOOST_CONSTEXPR int countl_zero( T x ) BOOST_NOEXCEPT
|
||||
{
|
||||
return boost::core::detail::countl_impl( x );
|
||||
}
|
||||
|
||||
#else // defined(__GNUC__) || defined(__clang__)
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
inline int countl_impl( boost::uint32_t x ) BOOST_NOEXCEPT
|
||||
{
|
||||
#if defined(_MSC_VER)
|
||||
|
||||
unsigned long r;
|
||||
|
||||
if( _BitScanReverse( &r, x ) )
|
||||
{
|
||||
return 31 - static_cast<int>( r );
|
||||
}
|
||||
else
|
||||
{
|
||||
return 32;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static unsigned char const mod37[ 37 ] = { 32, 31, 6, 30, 9, 5, 0, 29, 16, 8, 2, 4, 21, 0, 19, 28, 25, 15, 0, 7, 10, 1, 17, 3, 22, 20, 26, 0, 11, 18, 23, 27, 12, 24, 13, 14, 0 };
|
||||
|
||||
x |= x >> 1;
|
||||
x |= x >> 2;
|
||||
x |= x >> 4;
|
||||
x |= x >> 8;
|
||||
x |= x >> 16;
|
||||
|
||||
return mod37[ x % 37 ];
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
inline int countl_impl( boost::uint64_t x ) BOOST_NOEXCEPT
|
||||
{
|
||||
#if defined(_MSC_VER) && defined(_M_X64)
|
||||
|
||||
unsigned long r;
|
||||
|
||||
if( _BitScanReverse64( &r, x ) )
|
||||
{
|
||||
return 63 - static_cast<int>( r );
|
||||
}
|
||||
else
|
||||
{
|
||||
return 64;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
return static_cast<boost::uint32_t>( x >> 32 ) != 0?
|
||||
boost::core::detail::countl_impl( static_cast<boost::uint32_t>( x >> 32 ) ):
|
||||
boost::core::detail::countl_impl( static_cast<boost::uint32_t>( x ) ) + 32;
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
inline int countl_impl( boost::uint8_t x ) BOOST_NOEXCEPT
|
||||
{
|
||||
return boost::core::detail::countl_impl( static_cast<boost::uint32_t>( x ) ) - 24;
|
||||
}
|
||||
|
||||
inline int countl_impl( boost::uint16_t x ) BOOST_NOEXCEPT
|
||||
{
|
||||
return boost::core::detail::countl_impl( static_cast<boost::uint32_t>( x ) ) - 16;
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
|
||||
template<class T>
|
||||
int countl_zero( T x ) BOOST_NOEXCEPT
|
||||
{
|
||||
BOOST_STATIC_ASSERT( sizeof(T) == sizeof(boost::uint8_t) || sizeof(T) == sizeof(boost::uint16_t) || sizeof(T) == sizeof(boost::uint32_t) || sizeof(T) == sizeof(boost::uint64_t) );
|
||||
|
||||
if( sizeof(T) == sizeof(boost::uint8_t) )
|
||||
{
|
||||
return boost::core::detail::countl_impl( static_cast<boost::uint8_t>( x ) );
|
||||
}
|
||||
else if( sizeof(T) == sizeof(boost::uint16_t) )
|
||||
{
|
||||
return boost::core::detail::countl_impl( static_cast<boost::uint16_t>( x ) );
|
||||
}
|
||||
else if( sizeof(T) == sizeof(boost::uint32_t) )
|
||||
{
|
||||
return boost::core::detail::countl_impl( static_cast<boost::uint32_t>( x ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
return boost::core::detail::countl_impl( static_cast<boost::uint64_t>( x ) );
|
||||
}
|
||||
}
|
||||
|
||||
#endif // defined(__GNUC__) || defined(__clang__)
|
||||
|
||||
template<class T>
|
||||
BOOST_CONSTEXPR int countl_one( T x ) BOOST_NOEXCEPT
|
||||
{
|
||||
return boost::core::countl_zero( static_cast<T>( ~x ) );
|
||||
}
|
||||
|
||||
// countr
|
||||
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
BOOST_CONSTEXPR inline int countr_impl( unsigned char x ) BOOST_NOEXCEPT
|
||||
{
|
||||
return x? __builtin_ctz( x ): std::numeric_limits<unsigned char>::digits;
|
||||
}
|
||||
|
||||
BOOST_CONSTEXPR inline int countr_impl( unsigned short x ) BOOST_NOEXCEPT
|
||||
{
|
||||
return x? __builtin_ctz( x ): std::numeric_limits<unsigned short>::digits;
|
||||
}
|
||||
|
||||
BOOST_CONSTEXPR inline int countr_impl( unsigned int x ) BOOST_NOEXCEPT
|
||||
{
|
||||
return x? __builtin_ctz( x ): std::numeric_limits<unsigned int>::digits;
|
||||
}
|
||||
|
||||
BOOST_CONSTEXPR inline int countr_impl( unsigned long x ) BOOST_NOEXCEPT
|
||||
{
|
||||
return x? __builtin_ctzl( x ): std::numeric_limits<unsigned long>::digits;
|
||||
}
|
||||
|
||||
BOOST_CONSTEXPR inline int countr_impl( unsigned long long x ) BOOST_NOEXCEPT
|
||||
{
|
||||
return x? __builtin_ctzll( x ): std::numeric_limits<unsigned long long>::digits;
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
|
||||
template<class T>
|
||||
BOOST_CONSTEXPR int countr_zero( T x ) BOOST_NOEXCEPT
|
||||
{
|
||||
return boost::core::detail::countr_impl( x );
|
||||
}
|
||||
|
||||
#else // defined(__GNUC__) || defined(__clang__)
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
inline int countr_impl( boost::uint32_t x ) BOOST_NOEXCEPT
|
||||
{
|
||||
#if defined(_MSC_VER)
|
||||
|
||||
unsigned long r;
|
||||
|
||||
if( _BitScanForward( &r, x ) )
|
||||
{
|
||||
return static_cast<int>( r );
|
||||
}
|
||||
else
|
||||
{
|
||||
return 32;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static unsigned char const mod37[ 37 ] = { 32, 0, 1, 26, 2, 23, 27, 0, 3, 16, 24, 30, 28, 11, 0, 13, 4, 7, 17, 0, 25, 22, 31, 15, 29, 10, 12, 6, 0, 21, 14, 9, 5, 20, 8, 19, 18 };
|
||||
return mod37[ ( -(boost::int32_t)x & x ) % 37 ];
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
inline int countr_impl( boost::uint64_t x ) BOOST_NOEXCEPT
|
||||
{
|
||||
#if defined(_MSC_VER) && defined(_M_X64)
|
||||
|
||||
unsigned long r;
|
||||
|
||||
if( _BitScanForward64( &r, x ) )
|
||||
{
|
||||
return static_cast<int>( r );
|
||||
}
|
||||
else
|
||||
{
|
||||
return 64;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
return static_cast<boost::uint32_t>( x ) != 0?
|
||||
boost::core::detail::countr_impl( static_cast<boost::uint32_t>( x ) ):
|
||||
boost::core::detail::countr_impl( static_cast<boost::uint32_t>( x >> 32 ) ) + 32;
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
inline int countr_impl( boost::uint8_t x ) BOOST_NOEXCEPT
|
||||
{
|
||||
return boost::core::detail::countr_impl( static_cast<boost::uint32_t>( x ) | 0x100 );
|
||||
}
|
||||
|
||||
inline int countr_impl( boost::uint16_t x ) BOOST_NOEXCEPT
|
||||
{
|
||||
return boost::core::detail::countr_impl( static_cast<boost::uint32_t>( x ) | 0x10000 );
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
|
||||
template<class T>
|
||||
int countr_zero( T x ) BOOST_NOEXCEPT
|
||||
{
|
||||
BOOST_STATIC_ASSERT( sizeof(T) == sizeof(boost::uint8_t) || sizeof(T) == sizeof(boost::uint16_t) || sizeof(T) == sizeof(boost::uint32_t) || sizeof(T) == sizeof(boost::uint64_t) );
|
||||
|
||||
if( sizeof(T) == sizeof(boost::uint8_t) )
|
||||
{
|
||||
return boost::core::detail::countr_impl( static_cast<boost::uint8_t>( x ) );
|
||||
}
|
||||
else if( sizeof(T) == sizeof(boost::uint16_t) )
|
||||
{
|
||||
return boost::core::detail::countr_impl( static_cast<boost::uint16_t>( x ) );
|
||||
}
|
||||
else if( sizeof(T) == sizeof(boost::uint32_t) )
|
||||
{
|
||||
return boost::core::detail::countr_impl( static_cast<boost::uint32_t>( x ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
return boost::core::detail::countr_impl( static_cast<boost::uint64_t>( x ) );
|
||||
}
|
||||
}
|
||||
|
||||
#endif // defined(__GNUC__) || defined(__clang__)
|
||||
|
||||
template<class T>
|
||||
BOOST_CONSTEXPR int countr_one( T x ) BOOST_NOEXCEPT
|
||||
{
|
||||
return boost::core::countr_zero( static_cast<T>( ~x ) );
|
||||
}
|
||||
|
||||
// popcount
|
||||
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
|
||||
#if defined(__clang__) && __clang_major__ * 100 + __clang_minor__ < 304
|
||||
# define BOOST_CORE_POPCOUNT_CONSTEXPR
|
||||
#else
|
||||
# define BOOST_CORE_POPCOUNT_CONSTEXPR BOOST_CONSTEXPR
|
||||
#endif
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
BOOST_CORE_POPCOUNT_CONSTEXPR inline int popcount_impl( unsigned char x ) BOOST_NOEXCEPT
|
||||
{
|
||||
return __builtin_popcount( x );
|
||||
}
|
||||
|
||||
BOOST_CORE_POPCOUNT_CONSTEXPR inline int popcount_impl( unsigned short x ) BOOST_NOEXCEPT
|
||||
{
|
||||
return __builtin_popcount( x );
|
||||
}
|
||||
|
||||
BOOST_CORE_POPCOUNT_CONSTEXPR inline int popcount_impl( unsigned int x ) BOOST_NOEXCEPT
|
||||
{
|
||||
return __builtin_popcount( x );
|
||||
}
|
||||
|
||||
BOOST_CORE_POPCOUNT_CONSTEXPR inline int popcount_impl( unsigned long x ) BOOST_NOEXCEPT
|
||||
{
|
||||
return __builtin_popcountl( x );
|
||||
}
|
||||
|
||||
BOOST_CORE_POPCOUNT_CONSTEXPR inline int popcount_impl( unsigned long long x ) BOOST_NOEXCEPT
|
||||
{
|
||||
return __builtin_popcountll( x );
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
|
||||
#undef BOOST_CORE_POPCOUNT_CONSTEXPR
|
||||
|
||||
template<class T>
|
||||
BOOST_CONSTEXPR int popcount( T x ) BOOST_NOEXCEPT
|
||||
{
|
||||
return boost::core::detail::popcount_impl( x );
|
||||
}
|
||||
|
||||
#else // defined(__GNUC__) || defined(__clang__)
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
BOOST_CXX14_CONSTEXPR inline int popcount_impl( boost::uint32_t x ) BOOST_NOEXCEPT
|
||||
{
|
||||
x = x - ( ( x >> 1 ) & 0x55555555 );
|
||||
x = ( x & 0x33333333 ) + ( ( x >> 2 ) & 0x33333333 );
|
||||
x = ( x + ( x >> 4 ) ) & 0x0F0F0F0F;
|
||||
|
||||
return static_cast<unsigned>( ( x * 0x01010101 ) >> 24 );
|
||||
}
|
||||
|
||||
BOOST_CXX14_CONSTEXPR inline int popcount_impl( boost::uint64_t x ) BOOST_NOEXCEPT
|
||||
{
|
||||
x = x - ( ( x >> 1 ) & 0x5555555555555555 );
|
||||
x = ( x & 0x3333333333333333 ) + ( ( x >> 2 ) & 0x3333333333333333 );
|
||||
x = ( x + ( x >> 4 ) ) & 0x0F0F0F0F0F0F0F0F;
|
||||
|
||||
return static_cast<unsigned>( ( x * 0x0101010101010101 ) >> 56 );
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
|
||||
template<class T>
|
||||
BOOST_CXX14_CONSTEXPR int popcount( T x ) BOOST_NOEXCEPT
|
||||
{
|
||||
BOOST_STATIC_ASSERT( sizeof(T) <= sizeof(boost::uint64_t) );
|
||||
|
||||
if( sizeof(T) <= sizeof(boost::uint32_t) )
|
||||
{
|
||||
return boost::core::detail::popcount_impl( static_cast<boost::uint32_t>( x ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
return boost::core::detail::popcount_impl( static_cast<boost::uint64_t>( x ) );
|
||||
}
|
||||
}
|
||||
|
||||
#endif // defined(__GNUC__) || defined(__clang__)
|
||||
|
||||
// rotating
|
||||
|
||||
template<class T>
|
||||
BOOST_CXX14_CONSTEXPR T rotl( T x, int s ) BOOST_NOEXCEPT
|
||||
{
|
||||
unsigned const mask = std::numeric_limits<T>::digits - 1;
|
||||
return x << (s & mask) | x >> ((-s) & mask);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
BOOST_CXX14_CONSTEXPR T rotr( T x, int s ) BOOST_NOEXCEPT
|
||||
{
|
||||
unsigned const mask = std::numeric_limits<T>::digits - 1;
|
||||
return x >> (s & mask) | x << ((-s) & mask);
|
||||
}
|
||||
|
||||
// integral powers of 2
|
||||
|
||||
template<class T>
|
||||
BOOST_CONSTEXPR bool has_single_bit( T x ) BOOST_NOEXCEPT
|
||||
{
|
||||
return x != 0 && ( x & ( x - 1 ) ) == 0;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
BOOST_CONSTEXPR T bit_width( T x ) BOOST_NOEXCEPT
|
||||
{
|
||||
return std::numeric_limits<T>::digits - boost::core::countl_zero( x );
|
||||
}
|
||||
|
||||
template<class T>
|
||||
BOOST_CONSTEXPR T bit_floor( T x ) BOOST_NOEXCEPT
|
||||
{
|
||||
return x == 0? 0: T(1) << ( boost::core::bit_width( x ) - 1 );
|
||||
}
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
BOOST_CXX14_CONSTEXPR inline boost::uint32_t bit_ceil_impl( boost::uint32_t x ) BOOST_NOEXCEPT
|
||||
{
|
||||
if( x == 0 )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
--x;
|
||||
|
||||
x |= x >> 1;
|
||||
x |= x >> 2;
|
||||
x |= x >> 4;
|
||||
x |= x >> 8;
|
||||
x |= x >> 16;
|
||||
|
||||
++x;
|
||||
|
||||
return x;
|
||||
}
|
||||
|
||||
BOOST_CXX14_CONSTEXPR inline boost::uint64_t bit_ceil_impl( boost::uint64_t x ) BOOST_NOEXCEPT
|
||||
{
|
||||
if( x == 0 )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
--x;
|
||||
|
||||
x |= x >> 1;
|
||||
x |= x >> 2;
|
||||
x |= x >> 4;
|
||||
x |= x >> 8;
|
||||
x |= x >> 16;
|
||||
x |= x >> 32;
|
||||
|
||||
++x;
|
||||
|
||||
return x;
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
|
||||
template<class T>
|
||||
BOOST_CXX14_CONSTEXPR T bit_ceil( T x ) BOOST_NOEXCEPT
|
||||
{
|
||||
BOOST_STATIC_ASSERT( sizeof(T) <= sizeof(boost::uint64_t) );
|
||||
|
||||
if( sizeof(T) <= sizeof(boost::uint32_t) )
|
||||
{
|
||||
return static_cast<T>( boost::core::detail::bit_ceil_impl( static_cast<boost::uint32_t>( x ) ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
return static_cast<T>( boost::core::detail::bit_ceil_impl( static_cast<boost::uint64_t>( x ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
// endian
|
||||
|
||||
#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
||||
|
||||
# define BOOST_CORE_BIT_NATIVE_INITIALIZER =little
|
||||
|
||||
#elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
|
||||
|
||||
# define BOOST_CORE_BIT_NATIVE_INITIALIZER =big
|
||||
|
||||
#elif defined(__BYTE_ORDER__) && defined(__ORDER_PDP_ENDIAN__) && __BYTE_ORDER__ == __ORDER_PDP_ENDIAN__
|
||||
|
||||
# define BOOST_CORE_BIT_NATIVE_INITIALIZER
|
||||
|
||||
#elif defined(__LITTLE_ENDIAN__)
|
||||
|
||||
# define BOOST_CORE_BIT_NATIVE_INITIALIZER =little
|
||||
|
||||
#elif defined(__BIG_ENDIAN__)
|
||||
|
||||
# define BOOST_CORE_BIT_NATIVE_INITIALIZER =big
|
||||
|
||||
#elif defined(_MSC_VER) || defined(__i386__) || defined(__x86_64__)
|
||||
|
||||
# define BOOST_CORE_BIT_NATIVE_INITIALIZER =little
|
||||
|
||||
#else
|
||||
|
||||
# define BOOST_CORE_BIT_NATIVE_INITIALIZER
|
||||
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_SCOPED_ENUMS)
|
||||
|
||||
enum class endian
|
||||
{
|
||||
big,
|
||||
little,
|
||||
native BOOST_CORE_BIT_NATIVE_INITIALIZER
|
||||
};
|
||||
|
||||
typedef endian endian_type;
|
||||
|
||||
#else
|
||||
|
||||
namespace endian
|
||||
{
|
||||
|
||||
enum type
|
||||
{
|
||||
big,
|
||||
little,
|
||||
native BOOST_CORE_BIT_NATIVE_INITIALIZER
|
||||
};
|
||||
|
||||
} // namespace endian
|
||||
|
||||
typedef endian::type endian_type;
|
||||
|
||||
#endif
|
||||
|
||||
#undef BOOST_CORE_BIT_NATIVE_INITIALIZER
|
||||
|
||||
} // namespace core
|
||||
} // namespace boost
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#endif // #ifndef BOOST_CORE_BIT_HPP_INCLUDED
|
||||
@ -1,71 +0,0 @@
|
||||
#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
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
//
|
||||
// boost/checked_delete.hpp
|
||||
//
|
||||
// Copyright (c) 2002, 2003 Peter Dimov
|
||||
// Copyright (c) 2003 Daniel Frey
|
||||
// Copyright (c) 2003 Howard Hinnant
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// See http://www.boost.org/libs/core/doc/html/core/checked_delete.html for documentation.
|
||||
//
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
// verify that types are complete for increased safety
|
||||
|
||||
template<class T> inline void checked_delete(T * x) BOOST_NOEXCEPT
|
||||
{
|
||||
// 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) BOOST_NOEXCEPT
|
||||
{
|
||||
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_NOEXCEPT
|
||||
{
|
||||
// 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_NOEXCEPT
|
||||
{
|
||||
boost::checked_array_delete(x);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_CORE_CHECKED_DELETE_HPP
|
||||
@ -1,298 +0,0 @@
|
||||
#ifndef BOOST_CORE_CMATH_HPP_INCLUDED
|
||||
#define BOOST_CORE_CMATH_HPP_INCLUDED
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
// boost/core/cmath.hpp
|
||||
//
|
||||
// Floating point classification and sign manipulation functions
|
||||
// Extracted from https://github.com/boostorg/lexical_cast/pull/37
|
||||
//
|
||||
// Copyright 2020, 2021 Peter Dimov
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#if defined(BOOST_CORE_USE_GENERIC_CMATH) || (!defined(_MSC_VER) && !defined(FP_SUBNORMAL))
|
||||
|
||||
#include <boost/cstdint.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <limits>
|
||||
#include <cstring>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace core
|
||||
{
|
||||
|
||||
// fpclassify return values
|
||||
|
||||
int const fp_zero = 0;
|
||||
int const fp_subnormal = 1;
|
||||
int const fp_normal = 2;
|
||||
int const fp_infinite = 3;
|
||||
int const fp_nan = 4;
|
||||
|
||||
// Classification functions
|
||||
|
||||
template<class T> bool isfinite( T x )
|
||||
{
|
||||
return x <= (std::numeric_limits<T>::max)() && x >= -(std::numeric_limits<T>::max)();
|
||||
}
|
||||
|
||||
template<class T> bool isinf( T x )
|
||||
{
|
||||
return x > (std::numeric_limits<T>::max)() || x < -(std::numeric_limits<T>::max)();
|
||||
}
|
||||
|
||||
template<class T> bool isnan( T x )
|
||||
{
|
||||
return !isfinite( x ) && !isinf( x );
|
||||
}
|
||||
|
||||
template<class T> bool isnormal( T x )
|
||||
{
|
||||
return isfinite( x ) && ( x >= (std::numeric_limits<T>::min)() || x <= -(std::numeric_limits<T>::min)() );
|
||||
}
|
||||
|
||||
template<class T> int fpclassify( T x )
|
||||
{
|
||||
if( x == 0 ) return fp_zero;
|
||||
|
||||
if( x < 0 ) x = -x;
|
||||
|
||||
if( x > (std::numeric_limits<T>::max)() ) return fp_infinite;
|
||||
|
||||
if( x >= (std::numeric_limits<T>::min)() ) return fp_normal;
|
||||
|
||||
if( x < (std::numeric_limits<T>::min)() ) return fp_subnormal;
|
||||
|
||||
return fp_nan;
|
||||
}
|
||||
|
||||
// Sign manipulation functions
|
||||
|
||||
inline bool signbit( float x )
|
||||
{
|
||||
boost::int32_t y;
|
||||
|
||||
BOOST_STATIC_ASSERT( sizeof( x ) == sizeof( y ) );
|
||||
|
||||
std::memcpy( &y, &x, sizeof( y ) );
|
||||
|
||||
return y < 0;
|
||||
}
|
||||
|
||||
inline bool signbit( double x )
|
||||
{
|
||||
boost::int64_t y;
|
||||
|
||||
BOOST_STATIC_ASSERT( sizeof( x ) == sizeof( y ) );
|
||||
|
||||
std::memcpy( &y, &x, sizeof( y ) );
|
||||
|
||||
return y < 0;
|
||||
}
|
||||
|
||||
inline bool signbit( long double x )
|
||||
{
|
||||
return signbit( static_cast<double>( x ) );
|
||||
}
|
||||
|
||||
template<class T> T copysign( T x, T y )
|
||||
{
|
||||
return signbit( x ) == signbit( y )? x: -x;
|
||||
}
|
||||
|
||||
} // namespace core
|
||||
} // namespace boost
|
||||
|
||||
#else // defined(BOOST_CORE_USE_GENERIC_CMATH)
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER < 1800
|
||||
# include <float.h>
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace core
|
||||
{
|
||||
#if defined(_MSC_VER) && _MSC_VER < 1800
|
||||
|
||||
template<class T> T copysign( T x, T y )
|
||||
{
|
||||
return static_cast<T>( _copysign( static_cast<double>( x ), static_cast<double>( y ) ) );
|
||||
}
|
||||
|
||||
template<class T> bool isnan( T x )
|
||||
{
|
||||
return _isnan( static_cast<double>( x ) ) != 0;
|
||||
}
|
||||
|
||||
template<class T> bool isfinite( T x )
|
||||
{
|
||||
return _finite( static_cast<double>( x ) ) != 0;
|
||||
}
|
||||
|
||||
template<class T> bool isinf( T x )
|
||||
{
|
||||
return ( _fpclass( static_cast<double>( x ) ) & ( _FPCLASS_PINF | _FPCLASS_NINF ) ) != 0;
|
||||
}
|
||||
|
||||
inline bool isnormal( float x )
|
||||
{
|
||||
// no _fpclassf in 32 bit mode
|
||||
unsigned y = reinterpret_cast< unsigned const& >( x );
|
||||
unsigned exp = ( y >> 23 ) & 0xFF;
|
||||
return exp != 0 && exp != 0xFF;
|
||||
}
|
||||
|
||||
inline bool isnormal( double x )
|
||||
{
|
||||
return ( _fpclass( x ) & ( _FPCLASS_PN | _FPCLASS_NN ) ) != 0;
|
||||
}
|
||||
|
||||
inline bool isnormal( long double x )
|
||||
{
|
||||
return boost::core::isnormal( static_cast<double>( x ) );
|
||||
}
|
||||
|
||||
template<class T> bool signbit( T x )
|
||||
{
|
||||
return _copysign( 1.0, static_cast<double>( x ) ) < 0.0;
|
||||
}
|
||||
|
||||
int const fp_zero = 0;
|
||||
int const fp_subnormal = 1;
|
||||
int const fp_normal = 2;
|
||||
int const fp_infinite = 3;
|
||||
int const fp_nan = 4;
|
||||
|
||||
inline int fpclassify( float x )
|
||||
{
|
||||
switch( _fpclass( x ) )
|
||||
{
|
||||
case _FPCLASS_SNAN:
|
||||
case _FPCLASS_QNAN:
|
||||
|
||||
return fp_nan;
|
||||
|
||||
case _FPCLASS_NINF:
|
||||
case _FPCLASS_PINF:
|
||||
|
||||
return fp_infinite;
|
||||
|
||||
case _FPCLASS_NZ:
|
||||
case _FPCLASS_PZ:
|
||||
|
||||
return fp_zero;
|
||||
|
||||
default:
|
||||
|
||||
return boost::core::isnormal( x )? fp_normal: fp_subnormal;
|
||||
}
|
||||
}
|
||||
|
||||
inline int fpclassify( double x )
|
||||
{
|
||||
switch( _fpclass( x ) )
|
||||
{
|
||||
case _FPCLASS_SNAN:
|
||||
case _FPCLASS_QNAN:
|
||||
|
||||
return fp_nan;
|
||||
|
||||
case _FPCLASS_NINF:
|
||||
case _FPCLASS_PINF:
|
||||
|
||||
return fp_infinite;
|
||||
|
||||
case _FPCLASS_NZ:
|
||||
case _FPCLASS_PZ:
|
||||
|
||||
return fp_zero;
|
||||
|
||||
case _FPCLASS_ND:
|
||||
case _FPCLASS_PD:
|
||||
|
||||
return fp_subnormal;
|
||||
|
||||
default:
|
||||
|
||||
return fp_normal;
|
||||
}
|
||||
}
|
||||
|
||||
inline int fpclassify( long double x )
|
||||
{
|
||||
return boost::core::fpclassify( static_cast<double>( x ) );
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
using std::isfinite;
|
||||
using std::isnan;
|
||||
using std::isinf;
|
||||
using std::isnormal;
|
||||
using std::fpclassify;
|
||||
|
||||
int const fp_zero = FP_ZERO;
|
||||
int const fp_subnormal = FP_SUBNORMAL;
|
||||
int const fp_normal = FP_NORMAL;
|
||||
int const fp_infinite = FP_INFINITE;
|
||||
int const fp_nan = FP_NAN;
|
||||
|
||||
using std::signbit;
|
||||
|
||||
// std::copysign doesn't exist in libstdc++ under -std=c++03
|
||||
|
||||
#if !defined(__GNUC__)
|
||||
|
||||
template<class T> T copysign( T x, T y )
|
||||
{
|
||||
return std::copysign( x, y );
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
// ::copysignl is unreliable, use the built-ins
|
||||
|
||||
inline float copysign_impl( float x, float y )
|
||||
{
|
||||
return __builtin_copysignf( x, y );
|
||||
}
|
||||
|
||||
inline double copysign_impl( double x, double y )
|
||||
{
|
||||
return __builtin_copysign( x, y );
|
||||
}
|
||||
|
||||
inline long double copysign_impl( long double x, long double y )
|
||||
{
|
||||
return __builtin_copysignl( x, y );
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
|
||||
template<class T> T copysign( T x, T y )
|
||||
{
|
||||
return boost::core::detail::copysign_impl( x, y );
|
||||
}
|
||||
|
||||
#endif // !defined(__GNUC__)
|
||||
#endif // #if defined(_MSC_VER) && _MSC_VER < 1800
|
||||
|
||||
} // namespace core
|
||||
} // namespace boost
|
||||
|
||||
#endif // defined(BOOST_CORE_USE_GENERIC_CMATH)
|
||||
|
||||
#endif // #ifndef BOOST_CORE_CMATH_HPP_INCLUDED
|
||||
@ -1,148 +0,0 @@
|
||||
/*
|
||||
Copyright 2019 Glen Joseph Fernandes
|
||||
(glenjofe@gmail.com)
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
#ifndef BOOST_CORE_DEFAULT_ALLOCATOR_HPP
|
||||
#define BOOST_CORE_DEFAULT_ALLOCATOR_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <new>
|
||||
|
||||
namespace boost {
|
||||
|
||||
#if defined(BOOST_NO_EXCEPTIONS)
|
||||
BOOST_NORETURN void throw_exception(const std::exception&);
|
||||
#endif
|
||||
|
||||
namespace default_ {
|
||||
|
||||
struct true_type {
|
||||
typedef bool value_type;
|
||||
typedef true_type type;
|
||||
|
||||
BOOST_STATIC_CONSTANT(bool, value = true);
|
||||
|
||||
BOOST_CONSTEXPR operator bool() const BOOST_NOEXCEPT {
|
||||
return true;
|
||||
}
|
||||
|
||||
BOOST_CONSTEXPR bool operator()() const BOOST_NOEXCEPT {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct add_reference {
|
||||
typedef T& type;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct add_reference<void> {
|
||||
typedef void type;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct add_reference<const void> {
|
||||
typedef const void type;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct default_allocator {
|
||||
typedef T value_type;
|
||||
typedef T* pointer;
|
||||
typedef const T* const_pointer;
|
||||
typedef typename add_reference<T>::type reference;
|
||||
typedef typename add_reference<const T>::type const_reference;
|
||||
typedef std::size_t size_type;
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
typedef true_type propagate_on_container_move_assignment;
|
||||
typedef true_type is_always_equal;
|
||||
|
||||
template<class U>
|
||||
struct rebind {
|
||||
typedef default_allocator<U> other;
|
||||
};
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS)
|
||||
default_allocator() = default;
|
||||
#else
|
||||
BOOST_CONSTEXPR default_allocator() BOOST_NOEXCEPT { }
|
||||
#endif
|
||||
|
||||
template<class U>
|
||||
BOOST_CONSTEXPR default_allocator(const default_allocator<U>&)
|
||||
BOOST_NOEXCEPT { }
|
||||
|
||||
BOOST_CONSTEXPR std::size_t max_size() const BOOST_NOEXCEPT {
|
||||
return static_cast<std::size_t>(-1) / (2 < sizeof(T) ? sizeof(T) : 2);
|
||||
}
|
||||
|
||||
#if !defined(BOOST_NO_EXCEPTIONS)
|
||||
T* allocate(std::size_t n) {
|
||||
if (n > max_size()) {
|
||||
throw std::bad_alloc();
|
||||
}
|
||||
return static_cast<T*>(::operator new(sizeof(T) * n));
|
||||
}
|
||||
|
||||
void deallocate(T* p, std::size_t) {
|
||||
::operator delete(p);
|
||||
}
|
||||
#else
|
||||
T* allocate(std::size_t n) {
|
||||
if (n > max_size()) {
|
||||
boost::throw_exception(std::bad_alloc());
|
||||
}
|
||||
void* p = ::operator new(sizeof(T) * n, std::nothrow);
|
||||
if (!p) {
|
||||
boost::throw_exception(std::bad_alloc());
|
||||
}
|
||||
return static_cast<T*>(p);
|
||||
}
|
||||
|
||||
void deallocate(T* p, std::size_t) {
|
||||
::operator delete(p, std::nothrow);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (defined(BOOST_LIBSTDCXX_VERSION) && BOOST_LIBSTDCXX_VERSION < 60000) || \
|
||||
defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
template<class U, class V>
|
||||
void construct(U* p, const V& v) {
|
||||
::new(p) U(v);
|
||||
}
|
||||
|
||||
template<class U>
|
||||
void destroy(U* p) {
|
||||
p->~U();
|
||||
(void)p;
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
template<class T, class U>
|
||||
BOOST_CONSTEXPR inline bool
|
||||
operator==(const default_allocator<T>&,
|
||||
const default_allocator<U>&) BOOST_NOEXCEPT
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
template<class T, class U>
|
||||
BOOST_CONSTEXPR inline bool
|
||||
operator!=(const default_allocator<T>&,
|
||||
const default_allocator<U>&) BOOST_NOEXCEPT
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
} /* default_ */
|
||||
|
||||
using default_::default_allocator;
|
||||
|
||||
} /* boost */
|
||||
|
||||
#endif
|
||||
@ -1,126 +0,0 @@
|
||||
#ifndef BOOST_CORE_DEMANGLE_HPP_INCLUDED
|
||||
#define BOOST_CORE_DEMANGLE_HPP_INCLUDED
|
||||
|
||||
// core::demangle
|
||||
//
|
||||
// Copyright 2014 Peter Dimov
|
||||
// Copyright 2014 Andrey Semashev
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <string>
|
||||
|
||||
#if defined(BOOST_HAS_PRAGMA_ONCE)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
// __has_include is currently supported by GCC and Clang. However GCC 4.9 may have issues and
|
||||
// returns 1 for 'defined( __has_include )', while '__has_include' is actually not supported:
|
||||
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63662
|
||||
#if defined( __has_include ) && (!defined( BOOST_GCC ) || (__GNUC__ + 0) >= 5)
|
||||
# if __has_include(<cxxabi.h>)
|
||||
# define BOOST_CORE_HAS_CXXABI_H
|
||||
# endif
|
||||
#elif defined( __GLIBCXX__ ) || defined( __GLIBCPP__ )
|
||||
# define BOOST_CORE_HAS_CXXABI_H
|
||||
#endif
|
||||
|
||||
#if defined( BOOST_CORE_HAS_CXXABI_H )
|
||||
# include <cxxabi.h>
|
||||
// For some archtectures (mips, mips64, x86, x86_64) cxxabi.h in Android NDK is implemented by gabi++ library
|
||||
// (https://android.googlesource.com/platform/ndk/+/master/sources/cxx-stl/gabi++/), which does not implement
|
||||
// abi::__cxa_demangle(). We detect this implementation by checking the include guard here.
|
||||
# if defined( __GABIXX_CXXABI_H__ )
|
||||
# undef BOOST_CORE_HAS_CXXABI_H
|
||||
# else
|
||||
# include <cstdlib>
|
||||
# include <cstddef>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
namespace core
|
||||
{
|
||||
|
||||
inline char const * demangle_alloc( char const * name ) BOOST_NOEXCEPT;
|
||||
inline void demangle_free( char const * name ) BOOST_NOEXCEPT;
|
||||
|
||||
class scoped_demangled_name
|
||||
{
|
||||
private:
|
||||
char const * m_p;
|
||||
|
||||
public:
|
||||
explicit scoped_demangled_name( char const * name ) BOOST_NOEXCEPT :
|
||||
m_p( demangle_alloc( name ) )
|
||||
{
|
||||
}
|
||||
|
||||
~scoped_demangled_name() BOOST_NOEXCEPT
|
||||
{
|
||||
demangle_free( m_p );
|
||||
}
|
||||
|
||||
char const * get() const BOOST_NOEXCEPT
|
||||
{
|
||||
return m_p;
|
||||
}
|
||||
|
||||
BOOST_DELETED_FUNCTION(scoped_demangled_name( scoped_demangled_name const& ))
|
||||
BOOST_DELETED_FUNCTION(scoped_demangled_name& operator= ( scoped_demangled_name const& ))
|
||||
};
|
||||
|
||||
|
||||
#if defined( BOOST_CORE_HAS_CXXABI_H )
|
||||
|
||||
inline char const * demangle_alloc( char const * name ) BOOST_NOEXCEPT
|
||||
{
|
||||
int status = 0;
|
||||
std::size_t size = 0;
|
||||
return abi::__cxa_demangle( name, NULL, &size, &status );
|
||||
}
|
||||
|
||||
inline void demangle_free( char const * name ) BOOST_NOEXCEPT
|
||||
{
|
||||
std::free( const_cast< char* >( name ) );
|
||||
}
|
||||
|
||||
inline std::string demangle( char const * name )
|
||||
{
|
||||
scoped_demangled_name demangled_name( name );
|
||||
char const * p = demangled_name.get();
|
||||
if( !p )
|
||||
p = name;
|
||||
return p;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
inline char const * demangle_alloc( char const * name ) BOOST_NOEXCEPT
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
inline void demangle_free( char const * ) BOOST_NOEXCEPT
|
||||
{
|
||||
}
|
||||
|
||||
inline std::string demangle( char const * name )
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace core
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#undef BOOST_CORE_HAS_CXXABI_H
|
||||
|
||||
#endif // #ifndef BOOST_CORE_DEMANGLE_HPP_INCLUDED
|
||||
@ -1,54 +0,0 @@
|
||||
#ifndef BOOST_CORE_DETAIL_SPLITMIX64_HPP_INCLUDED
|
||||
#define BOOST_CORE_DETAIL_SPLITMIX64_HPP_INCLUDED
|
||||
|
||||
// Copyright 2020 Peter Dimov
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
//
|
||||
// An implementation of splitmix64 for testing purposes,
|
||||
// derived from Sebastiano Vigna's public domain implementation
|
||||
// http://xorshift.di.unimi.it/splitmix64.c
|
||||
|
||||
#include <boost/cstdint.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
|
||||
class splitmix64
|
||||
{
|
||||
private:
|
||||
|
||||
boost::uint64_t x_;
|
||||
|
||||
public:
|
||||
|
||||
splitmix64(): x_( 0 )
|
||||
{
|
||||
}
|
||||
|
||||
explicit splitmix64( boost::uint64_t seed ): x_( seed )
|
||||
{
|
||||
}
|
||||
|
||||
boost::uint64_t operator()()
|
||||
{
|
||||
x_ += 0x9e3779b97f4a7c15;
|
||||
|
||||
boost::uint64_t z = x_;
|
||||
|
||||
z ^= z >> 30;
|
||||
z *= 0xbf58476d1ce4e5b9;
|
||||
z ^= z >> 27;
|
||||
z *= 0x94d049bb133111eb;
|
||||
z ^= z >> 31;
|
||||
|
||||
return z;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_CORE_DETAIL_SPLITMIX64_HPP_INCLUDED
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,155 +0,0 @@
|
||||
/*
|
||||
Copyright 2018 Glen Joseph Fernandes
|
||||
(glenjofe@gmail.com)
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
#ifndef BOOST_CORE_EMPTY_VALUE_HPP
|
||||
#define BOOST_CORE_EMPTY_VALUE_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
#include <utility>
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_GCC_VERSION) && (BOOST_GCC_VERSION >= 40700)
|
||||
#define BOOST_DETAIL_EMPTY_VALUE_BASE
|
||||
#elif defined(BOOST_INTEL) && defined(_MSC_VER) && (_MSC_VER >= 1800)
|
||||
#define BOOST_DETAIL_EMPTY_VALUE_BASE
|
||||
#elif defined(BOOST_MSVC) && (BOOST_MSVC >= 1800)
|
||||
#define BOOST_DETAIL_EMPTY_VALUE_BASE
|
||||
#elif defined(BOOST_CLANG) && !defined(__CUDACC__)
|
||||
#if __has_feature(is_empty) && __has_feature(is_final)
|
||||
#define BOOST_DETAIL_EMPTY_VALUE_BASE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4510)
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
|
||||
template<class T>
|
||||
struct use_empty_value_base {
|
||||
enum {
|
||||
#if defined(BOOST_DETAIL_EMPTY_VALUE_BASE)
|
||||
value = __is_empty(T) && !__is_final(T)
|
||||
#else
|
||||
value = false
|
||||
#endif
|
||||
};
|
||||
};
|
||||
|
||||
struct empty_init_t { };
|
||||
|
||||
namespace empty_ {
|
||||
|
||||
template<class T, unsigned N = 0,
|
||||
bool E = boost::use_empty_value_base<T>::value>
|
||||
class empty_value {
|
||||
public:
|
||||
typedef T type;
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS)
|
||||
empty_value() = default;
|
||||
#else
|
||||
empty_value() { }
|
||||
#endif
|
||||
|
||||
empty_value(boost::empty_init_t)
|
||||
: value_() { }
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||
template<class U, class... Args>
|
||||
empty_value(boost::empty_init_t, U&& value, Args&&... args)
|
||||
: value_(std::forward<U>(value), std::forward<Args>(args)...) { }
|
||||
#else
|
||||
template<class U>
|
||||
empty_value(boost::empty_init_t, U&& value)
|
||||
: value_(std::forward<U>(value)) { }
|
||||
#endif
|
||||
#else
|
||||
template<class U>
|
||||
empty_value(boost::empty_init_t, const U& value)
|
||||
: value_(value) { }
|
||||
|
||||
template<class U>
|
||||
empty_value(boost::empty_init_t, U& value)
|
||||
: value_(value) { }
|
||||
#endif
|
||||
|
||||
const T& get() const BOOST_NOEXCEPT {
|
||||
return value_;
|
||||
}
|
||||
|
||||
T& get() BOOST_NOEXCEPT {
|
||||
return value_;
|
||||
}
|
||||
|
||||
private:
|
||||
T value_;
|
||||
};
|
||||
|
||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
template<class T, unsigned N>
|
||||
class empty_value<T, N, true>
|
||||
: T {
|
||||
public:
|
||||
typedef T type;
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS)
|
||||
empty_value() = default;
|
||||
#else
|
||||
empty_value() { }
|
||||
#endif
|
||||
|
||||
empty_value(boost::empty_init_t)
|
||||
: T() { }
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||
template<class U, class... Args>
|
||||
empty_value(boost::empty_init_t, U&& value, Args&&... args)
|
||||
: T(std::forward<U>(value), std::forward<Args>(args)...) { }
|
||||
#else
|
||||
template<class U>
|
||||
empty_value(boost::empty_init_t, U&& value)
|
||||
: T(std::forward<U>(value)) { }
|
||||
#endif
|
||||
#else
|
||||
template<class U>
|
||||
empty_value(boost::empty_init_t, const U& value)
|
||||
: T(value) { }
|
||||
|
||||
template<class U>
|
||||
empty_value(boost::empty_init_t, U& value)
|
||||
: T(value) { }
|
||||
#endif
|
||||
|
||||
const T& get() const BOOST_NOEXCEPT {
|
||||
return *this;
|
||||
}
|
||||
|
||||
T& get() BOOST_NOEXCEPT {
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
} /* empty_ */
|
||||
|
||||
using empty_::empty_value;
|
||||
|
||||
BOOST_INLINE_CONSTEXPR empty_init_t empty_init = empty_init_t();
|
||||
|
||||
} /* boost */
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@ -1,128 +0,0 @@
|
||||
// Boost enable_if library
|
||||
|
||||
// Copyright 2003 (c) The Trustees of Indiana University.
|
||||
|
||||
// Use, modification, and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// Authors: Jaakko Jarvi (jajarvi at osl.iu.edu)
|
||||
// Jeremiah Willcock (jewillco at osl.iu.edu)
|
||||
// Andrew Lumsdaine (lums at osl.iu.edu)
|
||||
|
||||
|
||||
#ifndef BOOST_CORE_ENABLE_IF_HPP
|
||||
#define BOOST_CORE_ENABLE_IF_HPP
|
||||
|
||||
#include "boost/config.hpp"
|
||||
|
||||
// Even the definition of enable_if causes problems on some compilers,
|
||||
// so it's macroed out for all compilers that do not support SFINAE
|
||||
|
||||
#ifndef BOOST_NO_SFINAE
|
||||
|
||||
namespace boost
|
||||
{
|
||||
template<typename T, typename R=void>
|
||||
struct enable_if_has_type
|
||||
{
|
||||
typedef R type;
|
||||
};
|
||||
|
||||
template <bool B, class T = void>
|
||||
struct enable_if_c {
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct enable_if_c<false, T> {};
|
||||
|
||||
template <class Cond, class T = void>
|
||||
struct enable_if : public enable_if_c<Cond::value, T> {};
|
||||
|
||||
template <bool B, class T>
|
||||
struct lazy_enable_if_c {
|
||||
typedef typename T::type type;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct lazy_enable_if_c<false, T> {};
|
||||
|
||||
template <class Cond, class T>
|
||||
struct lazy_enable_if : public lazy_enable_if_c<Cond::value, T> {};
|
||||
|
||||
|
||||
template <bool B, class T = void>
|
||||
struct disable_if_c {
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct disable_if_c<true, T> {};
|
||||
|
||||
template <class Cond, class T = void>
|
||||
struct disable_if : public disable_if_c<Cond::value, T> {};
|
||||
|
||||
template <bool B, class T>
|
||||
struct lazy_disable_if_c {
|
||||
typedef typename T::type type;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct lazy_disable_if_c<true, T> {};
|
||||
|
||||
template <class Cond, class T>
|
||||
struct lazy_disable_if : public lazy_disable_if_c<Cond::value, T> {};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#else
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace detail { typedef void enable_if_default_T; }
|
||||
|
||||
template <typename T>
|
||||
struct enable_if_does_not_work_on_this_compiler;
|
||||
|
||||
template<typename T, typename R=void>
|
||||
struct enable_if_has_type : enable_if_does_not_work_on_this_compiler<T>
|
||||
{ };
|
||||
|
||||
template <bool B, class T = detail::enable_if_default_T>
|
||||
struct enable_if_c : enable_if_does_not_work_on_this_compiler<T>
|
||||
{ };
|
||||
|
||||
template <bool B, class T = detail::enable_if_default_T>
|
||||
struct disable_if_c : enable_if_does_not_work_on_this_compiler<T>
|
||||
{ };
|
||||
|
||||
template <bool B, class T = detail::enable_if_default_T>
|
||||
struct lazy_enable_if_c : enable_if_does_not_work_on_this_compiler<T>
|
||||
{ };
|
||||
|
||||
template <bool B, class T = detail::enable_if_default_T>
|
||||
struct lazy_disable_if_c : enable_if_does_not_work_on_this_compiler<T>
|
||||
{ };
|
||||
|
||||
template <class Cond, class T = detail::enable_if_default_T>
|
||||
struct enable_if : enable_if_does_not_work_on_this_compiler<T>
|
||||
{ };
|
||||
|
||||
template <class Cond, class T = detail::enable_if_default_T>
|
||||
struct disable_if : enable_if_does_not_work_on_this_compiler<T>
|
||||
{ };
|
||||
|
||||
template <class Cond, class T = detail::enable_if_default_T>
|
||||
struct lazy_enable_if : enable_if_does_not_work_on_this_compiler<T>
|
||||
{ };
|
||||
|
||||
template <class Cond, class T = detail::enable_if_default_T>
|
||||
struct lazy_disable_if : enable_if_does_not_work_on_this_compiler<T>
|
||||
{ };
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_NO_SFINAE
|
||||
|
||||
#endif
|
||||
@ -1,49 +0,0 @@
|
||||
/*
|
||||
Copyright 2018 Glen Joseph Fernandes
|
||||
(glenjofe@gmail.com)
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
#ifndef BOOST_CORE_EXCHANGE_HPP
|
||||
#define BOOST_CORE_EXCHANGE_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
#include <boost/config/workaround.hpp>
|
||||
#include <utility>
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
|
||||
#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
template<class T, class U>
|
||||
inline T exchange(T& t, const U& u)
|
||||
{
|
||||
T v = t;
|
||||
t = u;
|
||||
return v;
|
||||
}
|
||||
#else
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, < 1800)
|
||||
template<class T, class U>
|
||||
inline T exchange(T& t, U&& u)
|
||||
{
|
||||
T v = std::move(t);
|
||||
t = std::forward<U>(u);
|
||||
return v;
|
||||
}
|
||||
#else
|
||||
template<class T, class U = T>
|
||||
BOOST_CXX14_CONSTEXPR inline T exchange(T& t, U&& u)
|
||||
{
|
||||
T v = std::move(t);
|
||||
t = std::forward<U>(u);
|
||||
return v;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
} /* boost */
|
||||
|
||||
#endif
|
||||
@ -1,163 +0,0 @@
|
||||
/*
|
||||
* 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>
|
||||
#include <boost/config/workaround.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! ();\
|
||||
}
|
||||
|
||||
#if !BOOST_WORKAROUND(BOOST_GCC, < 40700)
|
||||
|
||||
/*!
|
||||
* \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
|
||||
|
||||
#define BOOST_CONSTEXPR_EXPLICIT_OPERATOR_BOOL() BOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT()
|
||||
|
||||
#endif
|
||||
|
||||
#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
|
||||
@ -1,45 +0,0 @@
|
||||
/*
|
||||
Copyright 2019 Glen Joseph Fernandes
|
||||
(glenjofe@gmail.com)
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
#ifndef BOOST_CORE_FIRST_SCALAR_HPP
|
||||
#define BOOST_CORE_FIRST_SCALAR_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <cstddef>
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
|
||||
template<class T>
|
||||
struct make_scalar {
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
template<class T, std::size_t N>
|
||||
struct make_scalar<T[N]> {
|
||||
typedef typename make_scalar<T>::type type;
|
||||
};
|
||||
|
||||
} /* detail */
|
||||
|
||||
template<class T>
|
||||
BOOST_CONSTEXPR inline T*
|
||||
first_scalar(T* p) BOOST_NOEXCEPT
|
||||
{
|
||||
return p;
|
||||
}
|
||||
|
||||
template<class T, std::size_t N>
|
||||
BOOST_CONSTEXPR inline typename detail::make_scalar<T>::type*
|
||||
first_scalar(T (*p)[N]) BOOST_NOEXCEPT
|
||||
{
|
||||
return boost::first_scalar(&(*p)[0]);
|
||||
}
|
||||
|
||||
} /* boost */
|
||||
|
||||
#endif
|
||||
@ -1,100 +0,0 @@
|
||||
// Copyright (c) 2014 Adam Wulkiewicz, Lodz, Poland.
|
||||
//
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_CORE_IGNORE_UNUSED_HPP
|
||||
#define BOOST_CORE_IGNORE_UNUSED_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
|
||||
template <typename... Ts>
|
||||
BOOST_FORCEINLINE BOOST_CXX14_CONSTEXPR void ignore_unused(Ts&& ...)
|
||||
{}
|
||||
|
||||
#else
|
||||
|
||||
template <typename... Ts>
|
||||
BOOST_FORCEINLINE BOOST_CXX14_CONSTEXPR void ignore_unused(Ts const& ...)
|
||||
{}
|
||||
|
||||
#endif
|
||||
|
||||
template <typename... Ts>
|
||||
BOOST_FORCEINLINE BOOST_CXX14_CONSTEXPR void ignore_unused()
|
||||
{}
|
||||
|
||||
#else // !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||
|
||||
template <typename T1>
|
||||
BOOST_FORCEINLINE BOOST_CXX14_CONSTEXPR void ignore_unused(T1&)
|
||||
{}
|
||||
|
||||
template <typename T1>
|
||||
BOOST_FORCEINLINE BOOST_CXX14_CONSTEXPR void ignore_unused(T1 const&)
|
||||
{}
|
||||
|
||||
template <typename T1, typename T2>
|
||||
BOOST_FORCEINLINE BOOST_CXX14_CONSTEXPR void ignore_unused(T1&, T2&)
|
||||
{}
|
||||
|
||||
template <typename T1, typename T2>
|
||||
BOOST_FORCEINLINE BOOST_CXX14_CONSTEXPR void ignore_unused(T1 const&, T2 const&)
|
||||
{}
|
||||
|
||||
template <typename T1, typename T2, typename T3>
|
||||
BOOST_FORCEINLINE BOOST_CXX14_CONSTEXPR void ignore_unused(T1&, T2&, T3&)
|
||||
{}
|
||||
|
||||
template <typename T1, typename T2, typename T3>
|
||||
BOOST_FORCEINLINE BOOST_CXX14_CONSTEXPR void ignore_unused(T1 const&, T2 const&, T3 const&)
|
||||
{}
|
||||
|
||||
template <typename T1, typename T2, typename T3, typename T4>
|
||||
BOOST_FORCEINLINE BOOST_CXX14_CONSTEXPR void ignore_unused(T1&, T2&, T3&, T4&)
|
||||
{}
|
||||
|
||||
template <typename T1, typename T2, typename T3, typename T4>
|
||||
BOOST_FORCEINLINE BOOST_CXX14_CONSTEXPR void ignore_unused(T1 const&, T2 const&, T3 const&, T4 const&)
|
||||
{}
|
||||
|
||||
template <typename T1, typename T2, typename T3, typename T4, typename T5>
|
||||
BOOST_FORCEINLINE BOOST_CXX14_CONSTEXPR void ignore_unused(T1&, T2&, T3&, T4&, T5&)
|
||||
{}
|
||||
|
||||
template <typename T1, typename T2, typename T3, typename T4, typename T5>
|
||||
BOOST_FORCEINLINE BOOST_CXX14_CONSTEXPR void ignore_unused(T1 const&, T2 const&, T3 const&, T4 const&, T5 const&)
|
||||
{}
|
||||
|
||||
template <typename T1>
|
||||
BOOST_FORCEINLINE BOOST_CXX14_CONSTEXPR void ignore_unused()
|
||||
{}
|
||||
|
||||
template <typename T1, typename T2>
|
||||
BOOST_FORCEINLINE BOOST_CXX14_CONSTEXPR void ignore_unused()
|
||||
{}
|
||||
|
||||
template <typename T1, typename T2, typename T3>
|
||||
BOOST_FORCEINLINE BOOST_CXX14_CONSTEXPR void ignore_unused()
|
||||
{}
|
||||
|
||||
template <typename T1, typename T2, typename T3, typename T4>
|
||||
BOOST_FORCEINLINE BOOST_CXX14_CONSTEXPR void ignore_unused()
|
||||
{}
|
||||
|
||||
template <typename T1, typename T2, typename T3, typename T4, typename T5>
|
||||
BOOST_FORCEINLINE BOOST_CXX14_CONSTEXPR void ignore_unused()
|
||||
{}
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_CORE_IGNORE_UNUSED_HPP
|
||||
@ -1,40 +0,0 @@
|
||||
#ifndef BOOST_CORE_IS_SAME_HPP_INCLUDED
|
||||
#define BOOST_CORE_IS_SAME_HPP_INCLUDED
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
// is_same<T1,T2>::value is true when T1 == T2
|
||||
//
|
||||
// Copyright 2014 Peter Dimov
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
namespace core
|
||||
{
|
||||
|
||||
template< class T1, class T2 > struct is_same
|
||||
{
|
||||
BOOST_STATIC_CONSTANT( bool, value = false );
|
||||
};
|
||||
|
||||
template< class T > struct is_same< T, T >
|
||||
{
|
||||
BOOST_STATIC_CONSTANT( bool, value = true );
|
||||
};
|
||||
|
||||
} // namespace core
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_CORE_IS_SAME_HPP_INCLUDED
|
||||
@ -1,591 +0,0 @@
|
||||
#ifndef BOOST_CORE_LIGHTWEIGHT_TEST_HPP
|
||||
#define BOOST_CORE_LIGHTWEIGHT_TEST_HPP
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
//
|
||||
// boost/core/lightweight_test.hpp - lightweight test library
|
||||
//
|
||||
// Copyright (c) 2002, 2009, 2014 Peter Dimov
|
||||
// Copyright (2) Beman Dawes 2010, 2011
|
||||
// Copyright (3) Ion Gaztanaga 2013
|
||||
//
|
||||
// Copyright 2018 Glen Joseph Fernandes
|
||||
// (glenjofe@gmail.com)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
//
|
||||
|
||||
#include <boost/current_function.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <exception>
|
||||
#include <iostream>
|
||||
#include <iterator>
|
||||
#include <string>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <cstddef>
|
||||
#include <cctype>
|
||||
#include <cstdio>
|
||||
|
||||
#if defined(_MSC_VER) && defined(_CPPLIB_VER) && defined(_DEBUG)
|
||||
# include <crtdbg.h>
|
||||
#endif
|
||||
|
||||
// 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
|
||||
{
|
||||
|
||||
class test_result {
|
||||
public:
|
||||
test_result()
|
||||
: report_(false)
|
||||
, errors_(0) {
|
||||
#if defined(_MSC_VER) && (_MSC_VER > 1310)
|
||||
// disable message boxes on assert(), abort()
|
||||
::_set_abort_behavior(0, _WRITE_ABORT_MSG | _CALL_REPORTFAULT);
|
||||
#endif
|
||||
#if defined(_MSC_VER) && defined(_CPPLIB_VER) && defined(_DEBUG)
|
||||
// disable message boxes on iterator debugging violations
|
||||
_CrtSetReportMode( _CRT_ASSERT, _CRTDBG_MODE_FILE );
|
||||
_CrtSetReportFile( _CRT_ASSERT, _CRTDBG_FILE_STDERR );
|
||||
#endif
|
||||
}
|
||||
|
||||
~test_result() {
|
||||
if (!report_) {
|
||||
BOOST_LIGHTWEIGHT_TEST_OSTREAM << "main() should return report_errors()" << std::endl;
|
||||
std::abort();
|
||||
}
|
||||
}
|
||||
|
||||
int& errors() {
|
||||
return errors_;
|
||||
}
|
||||
|
||||
void done() {
|
||||
report_ = true;
|
||||
}
|
||||
|
||||
private:
|
||||
bool report_;
|
||||
int errors_;
|
||||
};
|
||||
|
||||
inline test_result& test_results()
|
||||
{
|
||||
static test_result instance;
|
||||
return instance;
|
||||
}
|
||||
|
||||
inline int& test_errors()
|
||||
{
|
||||
return test_results().errors();
|
||||
}
|
||||
|
||||
inline bool test_impl(char const * expr, char const * file, int line, char const * function, bool v)
|
||||
{
|
||||
if( v )
|
||||
{
|
||||
test_results();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
BOOST_LIGHTWEIGHT_TEST_OSTREAM
|
||||
<< file << "(" << line << "): test '" << expr << "' failed in function '"
|
||||
<< function << "'" << std::endl;
|
||||
++test_results().errors();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
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_results().errors();
|
||||
}
|
||||
|
||||
inline void throw_failed_impl(const char* expr, char const * excep, char const * file, int line, char const * function)
|
||||
{
|
||||
BOOST_LIGHTWEIGHT_TEST_OSTREAM
|
||||
<< file << "(" << line << "): expression '" << expr << "' did not throw exception '" << excep << "' in function '"
|
||||
<< function << "'" << std::endl;
|
||||
++test_results().errors();
|
||||
}
|
||||
|
||||
inline void no_throw_failed_impl(const char* expr, const char* file, int line, const char* function)
|
||||
{
|
||||
BOOST_LIGHTWEIGHT_TEST_OSTREAM
|
||||
<< file << "(" << line << "): expression '" << expr << "' threw an exception in function '"
|
||||
<< function << "'" << std::endl;
|
||||
++test_results().errors();
|
||||
}
|
||||
|
||||
inline void no_throw_failed_impl(const char* expr, const char* what, const char* file, int line, const char* function)
|
||||
{
|
||||
BOOST_LIGHTWEIGHT_TEST_OSTREAM
|
||||
<< file << "(" << line << "): expression '" << expr << "' threw an exception in function '"
|
||||
<< function << "': " << what << std::endl;
|
||||
++test_results().errors();
|
||||
}
|
||||
|
||||
// In the comparisons below, it is possible that T and U are signed and unsigned integer types, which generates warnings in some compilers.
|
||||
// A cleaner fix would require common_type trait or some meta-programming, which would introduce a dependency on Boost.TypeTraits. To avoid
|
||||
// the dependency we just disable the warnings.
|
||||
#if defined(__clang__) && defined(__has_warning)
|
||||
# if __has_warning("-Wsign-compare")
|
||||
# pragma clang diagnostic push
|
||||
# pragma clang diagnostic ignored "-Wsign-compare"
|
||||
# endif
|
||||
#elif defined(_MSC_VER)
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable: 4389)
|
||||
#elif defined(__GNUC__) && !(defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || defined(__ECC)) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 406
|
||||
# pragma GCC diagnostic push
|
||||
# pragma GCC diagnostic ignored "-Wsign-compare"
|
||||
#endif
|
||||
|
||||
// specialize test output for char pointers to avoid printing as cstring
|
||||
template <class T> inline const T& test_output_impl(const T& v) { return v; }
|
||||
inline const void* test_output_impl(const char* v) { return v; }
|
||||
inline const void* test_output_impl(const unsigned char* v) { return v; }
|
||||
inline const void* test_output_impl(const signed char* v) { return v; }
|
||||
inline const void* test_output_impl(char* v) { return v; }
|
||||
inline const void* test_output_impl(unsigned char* v) { return v; }
|
||||
inline const void* test_output_impl(signed char* v) { return v; }
|
||||
template<class T> inline const void* test_output_impl(T volatile* v) { return const_cast<T*>(v); }
|
||||
|
||||
#if !defined( BOOST_NO_CXX11_NULLPTR )
|
||||
inline const void* test_output_impl(std::nullptr_t) { return nullptr; }
|
||||
#endif
|
||||
|
||||
// print chars as numeric
|
||||
|
||||
inline int test_output_impl( signed char const& v ) { return v; }
|
||||
inline unsigned test_output_impl( unsigned char const& v ) { return v; }
|
||||
|
||||
// Whether wchar_t is signed is implementation-defined
|
||||
|
||||
template<bool Signed> struct lwt_long_type {};
|
||||
template<> struct lwt_long_type<true> { typedef long type; };
|
||||
template<> struct lwt_long_type<false> { typedef unsigned long type; };
|
||||
|
||||
inline lwt_long_type<(static_cast<wchar_t>(-1) < static_cast<wchar_t>(0))>::type test_output_impl( wchar_t const& v ) { return v; }
|
||||
|
||||
#if !defined( BOOST_NO_CXX11_CHAR16_T )
|
||||
inline unsigned long test_output_impl( char16_t const& v ) { return v; }
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_NO_CXX11_CHAR32_T )
|
||||
inline unsigned long test_output_impl( char32_t const& v ) { return v; }
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable: 4996)
|
||||
#endif
|
||||
|
||||
inline std::string test_output_impl( char const& v )
|
||||
{
|
||||
if( std::isprint( static_cast<unsigned char>( v ) ) )
|
||||
{
|
||||
return std::string( 1, v );
|
||||
}
|
||||
else
|
||||
{
|
||||
char buffer[ 8 ];
|
||||
std::sprintf( buffer, "\\x%02X", static_cast<unsigned char>( v ) );
|
||||
|
||||
return buffer;
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
// predicates
|
||||
|
||||
struct lw_test_eq
|
||||
{
|
||||
template <typename T, typename U>
|
||||
bool operator()(const T& t, const U& u) const { return t == u; }
|
||||
};
|
||||
|
||||
struct lw_test_ne
|
||||
{
|
||||
template <typename T, typename U>
|
||||
bool operator()(const T& t, const U& u) const { return t != u; }
|
||||
};
|
||||
|
||||
struct lw_test_lt
|
||||
{
|
||||
template <typename T, typename U>
|
||||
bool operator()(const T& t, const U& u) const { return t < u; }
|
||||
};
|
||||
|
||||
struct lw_test_le
|
||||
{
|
||||
template <typename T, typename U>
|
||||
bool operator()(const T& t, const U& u) const { return t <= u; }
|
||||
};
|
||||
|
||||
struct lw_test_gt
|
||||
{
|
||||
template <typename T, typename U>
|
||||
bool operator()(const T& t, const U& u) const { return t > u; }
|
||||
};
|
||||
|
||||
struct lw_test_ge
|
||||
{
|
||||
template <typename T, typename U>
|
||||
bool operator()(const T& t, const U& u) const { return t >= u; }
|
||||
};
|
||||
|
||||
// lwt_predicate_name
|
||||
|
||||
template<class T> char const * lwt_predicate_name( T const& )
|
||||
{
|
||||
return "~=";
|
||||
}
|
||||
|
||||
inline char const * lwt_predicate_name( lw_test_eq const& )
|
||||
{
|
||||
return "==";
|
||||
}
|
||||
|
||||
inline char const * lwt_predicate_name( lw_test_ne const& )
|
||||
{
|
||||
return "!=";
|
||||
}
|
||||
|
||||
inline char const * lwt_predicate_name( lw_test_lt const& )
|
||||
{
|
||||
return "<";
|
||||
}
|
||||
|
||||
inline char const * lwt_predicate_name( lw_test_le const& )
|
||||
{
|
||||
return "<=";
|
||||
}
|
||||
|
||||
inline char const * lwt_predicate_name( lw_test_gt const& )
|
||||
{
|
||||
return ">";
|
||||
}
|
||||
|
||||
inline char const * lwt_predicate_name( lw_test_ge const& )
|
||||
{
|
||||
return ">=";
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
template<class BinaryPredicate, class T, class U>
|
||||
inline bool test_with_impl(BinaryPredicate pred, char const * expr1, char const * expr2,
|
||||
char const * file, int line, char const * function,
|
||||
T const & t, U const & u)
|
||||
{
|
||||
if( pred(t, u) )
|
||||
{
|
||||
test_results();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
BOOST_LIGHTWEIGHT_TEST_OSTREAM
|
||||
<< file << "(" << line << "): test '" << expr1 << " " << lwt_predicate_name(pred) << " " << expr2
|
||||
<< "' ('" << test_output_impl(t) << "' " << lwt_predicate_name(pred) << " '" << test_output_impl(u)
|
||||
<< "') failed in function '" << function << "'" << std::endl;
|
||||
++test_results().errors();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
inline bool test_cstr_eq_impl( char const * expr1, char const * expr2,
|
||||
char const * file, int line, char const * function, char const * const t, char const * const u )
|
||||
{
|
||||
if( std::strcmp(t, u) == 0 )
|
||||
{
|
||||
test_results();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
BOOST_LIGHTWEIGHT_TEST_OSTREAM
|
||||
<< file << "(" << line << "): test '" << expr1 << " == " << expr2 << "' ('" << t
|
||||
<< "' == '" << u << "') failed in function '" << function << "'" << std::endl;
|
||||
++test_results().errors();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
inline bool test_cstr_ne_impl( char const * expr1, char const * expr2,
|
||||
char const * file, int line, char const * function, char const * const t, char const * const u )
|
||||
{
|
||||
if( std::strcmp(t, u) != 0 )
|
||||
{
|
||||
test_results();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
BOOST_LIGHTWEIGHT_TEST_OSTREAM
|
||||
<< file << "(" << line << "): test '" << expr1 << " != " << expr2 << "' ('" << t
|
||||
<< "' != '" << u << "') failed in function '" << function << "'" << std::endl;
|
||||
++test_results().errors();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
template<class FormattedOutputFunction, class InputIterator1, class InputIterator2>
|
||||
bool test_all_eq_impl(FormattedOutputFunction& output,
|
||||
char const * file, int line, char const * function,
|
||||
InputIterator1 first_begin, InputIterator1 first_end,
|
||||
InputIterator2 second_begin, InputIterator2 second_end)
|
||||
{
|
||||
InputIterator1 first_it = first_begin;
|
||||
InputIterator2 second_it = second_begin;
|
||||
typename std::iterator_traits<InputIterator1>::difference_type first_index = 0;
|
||||
typename std::iterator_traits<InputIterator2>::difference_type second_index = 0;
|
||||
std::size_t error_count = 0;
|
||||
const std::size_t max_count = 8;
|
||||
do
|
||||
{
|
||||
while ((first_it != first_end) && (second_it != second_end) && (*first_it == *second_it))
|
||||
{
|
||||
++first_it;
|
||||
++second_it;
|
||||
++first_index;
|
||||
++second_index;
|
||||
}
|
||||
if ((first_it == first_end) || (second_it == second_end))
|
||||
{
|
||||
break; // do-while
|
||||
}
|
||||
if (error_count == 0)
|
||||
{
|
||||
output << file << "(" << line << "): Container contents differ in function '" << function << "':";
|
||||
}
|
||||
else if (error_count >= max_count)
|
||||
{
|
||||
output << " ...";
|
||||
break;
|
||||
}
|
||||
output << " [" << first_index << "] '" << test_output_impl(*first_it) << "' != '" << test_output_impl(*second_it) << "'";
|
||||
++first_it;
|
||||
++second_it;
|
||||
++first_index;
|
||||
++second_index;
|
||||
++error_count;
|
||||
} while (first_it != first_end);
|
||||
|
||||
first_index += std::distance(first_it, first_end);
|
||||
second_index += std::distance(second_it, second_end);
|
||||
if (first_index != second_index)
|
||||
{
|
||||
if (error_count == 0)
|
||||
{
|
||||
output << file << "(" << line << "): Container sizes differ in function '" << function << "': size(" << first_index << ") != size(" << second_index << ")";
|
||||
}
|
||||
else
|
||||
{
|
||||
output << " [*] size(" << first_index << ") != size(" << second_index << ")";
|
||||
}
|
||||
++error_count;
|
||||
}
|
||||
|
||||
if (error_count == 0)
|
||||
{
|
||||
test_results();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
output << std::endl;
|
||||
++test_results().errors();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
template<class FormattedOutputFunction, class InputIterator1, class InputIterator2, typename BinaryPredicate>
|
||||
bool test_all_with_impl(FormattedOutputFunction& output,
|
||||
char const * file, int line, char const * function,
|
||||
InputIterator1 first_begin, InputIterator1 first_end,
|
||||
InputIterator2 second_begin, InputIterator2 second_end,
|
||||
BinaryPredicate predicate)
|
||||
{
|
||||
InputIterator1 first_it = first_begin;
|
||||
InputIterator2 second_it = second_begin;
|
||||
typename std::iterator_traits<InputIterator1>::difference_type first_index = 0;
|
||||
typename std::iterator_traits<InputIterator2>::difference_type second_index = 0;
|
||||
std::size_t error_count = 0;
|
||||
const std::size_t max_count = 8;
|
||||
do
|
||||
{
|
||||
while ((first_it != first_end) && (second_it != second_end) && predicate(*first_it, *second_it))
|
||||
{
|
||||
++first_it;
|
||||
++second_it;
|
||||
++first_index;
|
||||
++second_index;
|
||||
}
|
||||
if ((first_it == first_end) || (second_it == second_end))
|
||||
{
|
||||
break; // do-while
|
||||
}
|
||||
if (error_count == 0)
|
||||
{
|
||||
output << file << "(" << line << "): Container contents differ in function '" << function << "':";
|
||||
}
|
||||
else if (error_count >= max_count)
|
||||
{
|
||||
output << " ...";
|
||||
break;
|
||||
}
|
||||
output << " [" << first_index << "]";
|
||||
++first_it;
|
||||
++second_it;
|
||||
++first_index;
|
||||
++second_index;
|
||||
++error_count;
|
||||
} while (first_it != first_end);
|
||||
|
||||
first_index += std::distance(first_it, first_end);
|
||||
second_index += std::distance(second_it, second_end);
|
||||
if (first_index != second_index)
|
||||
{
|
||||
if (error_count == 0)
|
||||
{
|
||||
output << file << "(" << line << "): Container sizes differ in function '" << function << "': size(" << first_index << ") != size(" << second_index << ")";
|
||||
}
|
||||
else
|
||||
{
|
||||
output << " [*] size(" << first_index << ") != size(" << second_index << ")";
|
||||
}
|
||||
++error_count;
|
||||
}
|
||||
|
||||
if (error_count == 0)
|
||||
{
|
||||
test_results();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
output << std::endl;
|
||||
++test_results().errors();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(__clang__) && defined(__has_warning)
|
||||
# if __has_warning("-Wsign-compare")
|
||||
# pragma clang diagnostic pop
|
||||
# endif
|
||||
#elif defined(_MSC_VER)
|
||||
# pragma warning(pop)
|
||||
#elif defined(__GNUC__) && !(defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || defined(__ECC)) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 406
|
||||
# pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
} // namespace detail
|
||||
|
||||
inline int report_errors()
|
||||
{
|
||||
boost::detail::test_result& result = boost::detail::test_results();
|
||||
result.done();
|
||||
|
||||
int errors = result.errors();
|
||||
|
||||
if( errors == 0 )
|
||||
{
|
||||
BOOST_LIGHTWEIGHT_TEST_OSTREAM
|
||||
<< "No errors detected." << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
BOOST_LIGHTWEIGHT_TEST_OSTREAM
|
||||
<< errors << " error" << (errors == 1? "": "s") << " detected." << std::endl;
|
||||
}
|
||||
|
||||
// `return report_errors();` from main only supports 8 bit exit codes
|
||||
return errors < 256? errors: 255;
|
||||
}
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#define BOOST_TEST(expr) ( ::boost::detail::test_impl(#expr, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, (expr)? true: false) )
|
||||
#define BOOST_TEST_NOT(expr) BOOST_TEST(!(expr))
|
||||
|
||||
#define BOOST_ERROR(msg) ( ::boost::detail::error_impl(msg, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION) )
|
||||
|
||||
#define BOOST_TEST_WITH(expr1,expr2,predicate) ( ::boost::detail::test_with_impl(predicate, #expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2) )
|
||||
|
||||
#define BOOST_TEST_EQ(expr1,expr2) ( ::boost::detail::test_with_impl(::boost::detail::lw_test_eq(), #expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2) )
|
||||
#define BOOST_TEST_NE(expr1,expr2) ( ::boost::detail::test_with_impl(::boost::detail::lw_test_ne(), #expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2) )
|
||||
|
||||
#define BOOST_TEST_LT(expr1,expr2) ( ::boost::detail::test_with_impl(::boost::detail::lw_test_lt(), #expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2) )
|
||||
#define BOOST_TEST_LE(expr1,expr2) ( ::boost::detail::test_with_impl(::boost::detail::lw_test_le(), #expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2) )
|
||||
#define BOOST_TEST_GT(expr1,expr2) ( ::boost::detail::test_with_impl(::boost::detail::lw_test_gt(), #expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2) )
|
||||
#define BOOST_TEST_GE(expr1,expr2) ( ::boost::detail::test_with_impl(::boost::detail::lw_test_ge(), #expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2) )
|
||||
|
||||
#define BOOST_TEST_CSTR_EQ(expr1,expr2) ( ::boost::detail::test_cstr_eq_impl(#expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2) )
|
||||
#define BOOST_TEST_CSTR_NE(expr1,expr2) ( ::boost::detail::test_cstr_ne_impl(#expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2) )
|
||||
|
||||
#define BOOST_TEST_ALL_EQ(begin1, end1, begin2, end2) ( ::boost::detail::test_all_eq_impl(BOOST_LIGHTWEIGHT_TEST_OSTREAM, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, begin1, end1, begin2, end2) )
|
||||
#define BOOST_TEST_ALL_WITH(begin1, end1, begin2, end2, predicate) ( ::boost::detail::test_all_with_impl(BOOST_LIGHTWEIGHT_TEST_OSTREAM, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, begin1, end1, begin2, end2, predicate) )
|
||||
|
||||
#ifndef BOOST_NO_EXCEPTIONS
|
||||
#define BOOST_TEST_THROWS( EXPR, EXCEP ) \
|
||||
try { \
|
||||
EXPR; \
|
||||
::boost::detail::throw_failed_impl \
|
||||
(#EXPR, #EXCEP, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION); \
|
||||
} \
|
||||
catch(EXCEP const&) { \
|
||||
::boost::detail::test_results(); \
|
||||
} \
|
||||
catch(...) { \
|
||||
::boost::detail::throw_failed_impl \
|
||||
(#EXPR, #EXCEP, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION); \
|
||||
} \
|
||||
//
|
||||
#else
|
||||
#define BOOST_TEST_THROWS( EXPR, EXCEP )
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_NO_EXCEPTIONS
|
||||
# define BOOST_TEST_NO_THROW(EXPR) \
|
||||
try { \
|
||||
EXPR; \
|
||||
} catch (const std::exception& e) { \
|
||||
::boost::detail::no_throw_failed_impl \
|
||||
(#EXPR, e.what(), __FILE__, __LINE__, BOOST_CURRENT_FUNCTION); \
|
||||
} catch (...) { \
|
||||
::boost::detail::no_throw_failed_impl \
|
||||
(#EXPR, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION); \
|
||||
}
|
||||
//
|
||||
#else
|
||||
# define BOOST_TEST_NO_THROW(EXPR) { EXPR; }
|
||||
#endif
|
||||
|
||||
#endif // #ifndef BOOST_CORE_LIGHTWEIGHT_TEST_HPP
|
||||
@ -1,91 +0,0 @@
|
||||
#ifndef BOOST_CORE_LIGHTWEIGHT_TEST_TRAIT_HPP
|
||||
#define BOOST_CORE_LIGHTWEIGHT_TEST_TRAIT_HPP
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
// boost/core/lightweight_test_trait.hpp
|
||||
//
|
||||
// BOOST_TEST_TRAIT_TRUE, BOOST_TEST_TRAIT_FALSE, BOOST_TEST_TRAIT_SAME
|
||||
//
|
||||
// Copyright 2014, 2021 Peter Dimov
|
||||
//
|
||||
// Copyright 2019 Glen Joseph Fernandes
|
||||
// (glenjofe@gmail.com)
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/core/type_name.hpp>
|
||||
#include <boost/core/is_same.hpp>
|
||||
#include <boost/config.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
|
||||
template< class T > inline void test_trait_impl( char const * trait, void (*)( T ),
|
||||
bool expected, char const * file, int line, char const * function )
|
||||
{
|
||||
if( T::value == expected )
|
||||
{
|
||||
test_results();
|
||||
}
|
||||
else
|
||||
{
|
||||
BOOST_LIGHTWEIGHT_TEST_OSTREAM
|
||||
<< file << "(" << line << "): predicate '" << trait << "' ["
|
||||
<< boost::core::type_name<T>() << "]"
|
||||
<< " test failed in function '" << function
|
||||
<< "' (should have been " << ( expected? "true": "false" ) << ")"
|
||||
<< std::endl;
|
||||
|
||||
++test_results().errors();
|
||||
}
|
||||
}
|
||||
|
||||
template<class T> inline bool test_trait_same_impl_( T )
|
||||
{
|
||||
return T::value;
|
||||
}
|
||||
|
||||
template<class T1, class T2> inline void test_trait_same_impl( char const * types,
|
||||
boost::core::is_same<T1, T2> same, char const * file, int line, char const * function )
|
||||
{
|
||||
if( test_trait_same_impl_( same ) )
|
||||
{
|
||||
test_results();
|
||||
}
|
||||
else
|
||||
{
|
||||
BOOST_LIGHTWEIGHT_TEST_OSTREAM
|
||||
<< file << "(" << line << "): test 'is_same<" << types << ">'"
|
||||
<< " failed in function '" << function
|
||||
<< "' ('" << boost::core::type_name<T1>()
|
||||
<< "' != '" << boost::core::type_name<T2>() << "')"
|
||||
<< std::endl;
|
||||
|
||||
++test_results().errors();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
} // namespace boost
|
||||
|
||||
#define BOOST_TEST_TRAIT_TRUE(type) ( ::boost::detail::test_trait_impl(#type, (void(*)type)0, true, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION) )
|
||||
#define BOOST_TEST_TRAIT_FALSE(type) ( ::boost::detail::test_trait_impl(#type, (void(*)type)0, false, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION) )
|
||||
|
||||
#if defined(__GNUC__)
|
||||
// ignoring -Wvariadic-macros with #pragma doesn't work under GCC
|
||||
# pragma GCC system_header
|
||||
#endif
|
||||
|
||||
#define BOOST_TEST_TRAIT_SAME(...) ( ::boost::detail::test_trait_same_impl(#__VA_ARGS__, ::boost::core::is_same<__VA_ARGS__>(), __FILE__, __LINE__, BOOST_CURRENT_FUNCTION) )
|
||||
|
||||
#endif // #ifndef BOOST_CORE_LIGHTWEIGHT_TEST_TRAIT_HPP
|
||||
@ -1,56 +0,0 @@
|
||||
#ifndef BOOST_CORE_NO_EXCEPTIONS_SUPPORT_HPP
|
||||
#define BOOST_CORE_NO_EXCEPTIONS_SUPPORT_HPP
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// (C) Copyright 2004 Pavel Vozenilek.
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt
|
||||
// or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
//
|
||||
// This file contains helper macros used when exception support may be
|
||||
// disabled (as indicated by macro BOOST_NO_EXCEPTIONS).
|
||||
//
|
||||
// Before picking up these macros you may consider using RAII techniques
|
||||
// to deal with exceptions - their syntax can be always the same with
|
||||
// or without exception support enabled.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
|
||||
#if !(defined BOOST_NO_EXCEPTIONS)
|
||||
# define BOOST_TRY { try
|
||||
# define BOOST_CATCH(x) catch(x)
|
||||
# define BOOST_RETHROW throw;
|
||||
# define BOOST_CATCH_END }
|
||||
#else
|
||||
# if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
|
||||
# define BOOST_TRY { if ("")
|
||||
# define BOOST_CATCH(x) else if (!"")
|
||||
# elif !defined(BOOST_MSVC) || BOOST_MSVC >= 1900
|
||||
# define BOOST_TRY { if (true)
|
||||
# define BOOST_CATCH(x) else if (false)
|
||||
# else
|
||||
// warning C4127: conditional expression is constant
|
||||
# define BOOST_TRY { \
|
||||
__pragma(warning(push)) \
|
||||
__pragma(warning(disable: 4127)) \
|
||||
if (true) \
|
||||
__pragma(warning(pop))
|
||||
# define BOOST_CATCH(x) else \
|
||||
__pragma(warning(push)) \
|
||||
__pragma(warning(disable: 4127)) \
|
||||
if (false) \
|
||||
__pragma(warning(pop))
|
||||
# endif
|
||||
# define BOOST_RETHROW
|
||||
# define BOOST_CATCH_END }
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
@ -1,88 +0,0 @@
|
||||
/*
|
||||
Copyright 2019 Glen Joseph Fernandes
|
||||
(glenjofe@gmail.com)
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
#ifndef BOOST_CORE_NOINIT_ADAPTOR_HPP
|
||||
#define BOOST_CORE_NOINIT_ADAPTOR_HPP
|
||||
|
||||
#include <boost/core/allocator_access.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
template<class A>
|
||||
struct noinit_adaptor
|
||||
: A {
|
||||
template<class U>
|
||||
struct rebind {
|
||||
typedef noinit_adaptor<typename allocator_rebind<A, U>::type> other;
|
||||
};
|
||||
|
||||
noinit_adaptor()
|
||||
: A() { }
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
template<class U>
|
||||
noinit_adaptor(U&& u) BOOST_NOEXCEPT
|
||||
: A(std::forward<U>(u)) { }
|
||||
#else
|
||||
template<class U>
|
||||
noinit_adaptor(const U& u) BOOST_NOEXCEPT
|
||||
: A(u) { }
|
||||
|
||||
template<class U>
|
||||
noinit_adaptor(U& u) BOOST_NOEXCEPT
|
||||
: A(u) { }
|
||||
#endif
|
||||
|
||||
template<class U>
|
||||
noinit_adaptor(const noinit_adaptor<U>& u) BOOST_NOEXCEPT
|
||||
: A(static_cast<const A&>(u)) { }
|
||||
|
||||
template<class U>
|
||||
void construct(U* p) {
|
||||
::new((void*)p) U;
|
||||
}
|
||||
|
||||
#if defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
template<class U, class V>
|
||||
void construct(U* p, const V& v) {
|
||||
::new((void*)p) U(v);
|
||||
}
|
||||
#endif
|
||||
|
||||
template<class U>
|
||||
void destroy(U* p) {
|
||||
p->~U();
|
||||
(void)p;
|
||||
}
|
||||
};
|
||||
|
||||
template<class T, class U>
|
||||
inline bool
|
||||
operator==(const noinit_adaptor<T>& lhs,
|
||||
const noinit_adaptor<U>& rhs) BOOST_NOEXCEPT
|
||||
{
|
||||
return static_cast<const T&>(lhs) == static_cast<const U&>(rhs);
|
||||
}
|
||||
|
||||
template<class T, class U>
|
||||
inline bool
|
||||
operator!=(const noinit_adaptor<T>& lhs,
|
||||
const noinit_adaptor<U>& rhs) BOOST_NOEXCEPT
|
||||
{
|
||||
return !(lhs == rhs);
|
||||
}
|
||||
|
||||
template<class A>
|
||||
inline noinit_adaptor<A>
|
||||
noinit_adapt(const A& a) BOOST_NOEXCEPT
|
||||
{
|
||||
return noinit_adaptor<A>(a);
|
||||
}
|
||||
|
||||
} /* boost */
|
||||
|
||||
#endif
|
||||
@ -1,63 +0,0 @@
|
||||
// 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
|
||||
{
|
||||
#ifndef BOOST_NONCOPYABLE_BASE_TOKEN_DEFINED
|
||||
#define BOOST_NONCOPYABLE_BASE_TOKEN_DEFINED
|
||||
|
||||
// noncopyable derives from base_token to enable Type Traits to detect
|
||||
// whether a type derives from noncopyable without needing the definition
|
||||
// of noncopyable itself.
|
||||
//
|
||||
// The definition of base_token is macro-guarded so that Type Trais can
|
||||
// define it locally without including this header, to avoid a dependency
|
||||
// on Core.
|
||||
|
||||
struct base_token {};
|
||||
|
||||
#endif // #ifndef BOOST_NONCOPYABLE_BASE_TOKEN_DEFINED
|
||||
|
||||
class noncopyable: base_token
|
||||
{
|
||||
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
|
||||
@ -1,44 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
@ -1,57 +0,0 @@
|
||||
/*
|
||||
Copyright 2019 Glen Joseph Fernandes
|
||||
(glenjofe@gmail.com)
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
#ifndef BOOST_CORE_NVP_HPP
|
||||
#define BOOST_CORE_NVP_HPP
|
||||
|
||||
#include <boost/core/addressof.hpp>
|
||||
#include <boost/config.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace serialization {
|
||||
|
||||
template<class T>
|
||||
class nvp {
|
||||
public:
|
||||
nvp(const char* n, T& v) BOOST_NOEXCEPT
|
||||
: n_(n)
|
||||
, v_(boost::addressof(v)) { }
|
||||
|
||||
const char* name() const BOOST_NOEXCEPT {
|
||||
return n_;
|
||||
}
|
||||
|
||||
T& value() const BOOST_NOEXCEPT {
|
||||
return *v_;
|
||||
}
|
||||
|
||||
const T& const_value() const BOOST_NOEXCEPT {
|
||||
return *v_;
|
||||
}
|
||||
|
||||
private:
|
||||
const char* n_;
|
||||
T* v_;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
inline const nvp<T>
|
||||
make_nvp(const char* n, T& v) BOOST_NOEXCEPT
|
||||
{
|
||||
return nvp<T>(n, v);
|
||||
}
|
||||
|
||||
} /* serialization */
|
||||
|
||||
using serialization::nvp;
|
||||
using serialization::make_nvp;
|
||||
|
||||
} /* boost */
|
||||
|
||||
#define BOOST_NVP(v) boost::make_nvp(BOOST_STRINGIZE(v), v)
|
||||
|
||||
#endif
|
||||
@ -1,234 +0,0 @@
|
||||
/*
|
||||
Copyright 2017-2018 Glen Joseph Fernandes
|
||||
(glenjofe@gmail.com)
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
#ifndef BOOST_CORE_POINTER_TRAITS_HPP
|
||||
#define BOOST_CORE_POINTER_TRAITS_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#if !defined(BOOST_NO_CXX11_POINTER_TRAITS)
|
||||
#include <memory>
|
||||
#else
|
||||
#include <boost/core/addressof.hpp>
|
||||
#include <cstddef>
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_POINTER_TRAITS)
|
||||
template<class T>
|
||||
struct pointer_traits
|
||||
: std::pointer_traits<T> {
|
||||
template<class U>
|
||||
struct rebind_to {
|
||||
typedef typename std::pointer_traits<T>::template rebind<U> type;
|
||||
};
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct pointer_traits<T*>
|
||||
: std::pointer_traits<T*> {
|
||||
template<class U>
|
||||
struct rebind_to {
|
||||
typedef U* type;
|
||||
};
|
||||
};
|
||||
#else
|
||||
namespace detail {
|
||||
|
||||
template<class>
|
||||
struct ptr_void {
|
||||
typedef void type;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct ptr_first;
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||
template<template<class, class...> class T, class U, class... Args>
|
||||
struct ptr_first<T<U, Args...> > {
|
||||
typedef U type;
|
||||
};
|
||||
#else
|
||||
template<template<class> class T, class U>
|
||||
struct ptr_first<T<U> > {
|
||||
typedef U type;
|
||||
};
|
||||
|
||||
template<template<class, class> class T, class U1, class U2>
|
||||
struct ptr_first<T<U1, U2> > {
|
||||
typedef U1 type;
|
||||
};
|
||||
|
||||
template<template<class, class, class> class T, class U1, class U2, class U3>
|
||||
struct ptr_first<T<U1, U2, U3> > {
|
||||
typedef U1 type;
|
||||
};
|
||||
#endif
|
||||
|
||||
template<class T, class = void>
|
||||
struct ptr_element {
|
||||
typedef typename ptr_first<T>::type type;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct ptr_element<T, typename ptr_void<typename T::element_type>::type> {
|
||||
typedef typename T::element_type type;
|
||||
};
|
||||
|
||||
template<class, class = void>
|
||||
struct ptr_difference {
|
||||
typedef std::ptrdiff_t type;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct ptr_difference<T,
|
||||
typename ptr_void<typename T::difference_type>::type> {
|
||||
typedef typename T::difference_type type;
|
||||
};
|
||||
|
||||
template<class T, class V>
|
||||
struct ptr_transform;
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||
template<template<class, class...> class T, class U, class... Args, class V>
|
||||
struct ptr_transform<T<U, Args...>, V> {
|
||||
typedef T<V, Args...> type;
|
||||
};
|
||||
#else
|
||||
template<template<class> class T, class U, class V>
|
||||
struct ptr_transform<T<U>, V> {
|
||||
typedef T<V> type;
|
||||
};
|
||||
|
||||
template<template<class, class> class T, class U1, class U2, class V>
|
||||
struct ptr_transform<T<U1, U2>, V> {
|
||||
typedef T<V, U2> type;
|
||||
};
|
||||
|
||||
template<template<class, class, class> class T,
|
||||
class U1, class U2, class U3, class V>
|
||||
struct ptr_transform<T<U1, U2, U3>, V> {
|
||||
typedef T<V, U2, U3> type;
|
||||
};
|
||||
#endif
|
||||
|
||||
template<class T, class U, class = void>
|
||||
struct ptr_rebind {
|
||||
typedef typename ptr_transform<T, U>::type type;
|
||||
};
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
|
||||
template<class T, class U>
|
||||
struct ptr_rebind<T, U,
|
||||
typename ptr_void<typename T::template rebind<U> >::type> {
|
||||
typedef typename T::template rebind<U> type;
|
||||
};
|
||||
#endif
|
||||
|
||||
template<class T>
|
||||
struct ptr_value {
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct ptr_value<void> {
|
||||
typedef struct { } type;
|
||||
};
|
||||
|
||||
} /* detail */
|
||||
|
||||
template<class T>
|
||||
struct pointer_traits {
|
||||
typedef T pointer;
|
||||
typedef typename detail::ptr_element<T>::type element_type;
|
||||
typedef typename detail::ptr_difference<T>::type difference_type;
|
||||
template<class U>
|
||||
struct rebind_to {
|
||||
typedef typename detail::ptr_rebind<T, U>::type type;
|
||||
};
|
||||
#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
|
||||
template<class U>
|
||||
using rebind = typename detail::ptr_rebind<T, U>::type;
|
||||
#endif
|
||||
static pointer
|
||||
pointer_to(typename detail::ptr_value<element_type>::type& v) {
|
||||
return pointer::pointer_to(v);
|
||||
}
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct pointer_traits<T*> {
|
||||
typedef T* pointer;
|
||||
typedef T element_type;
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
template<class U>
|
||||
struct rebind_to {
|
||||
typedef U* type;
|
||||
};
|
||||
#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
|
||||
template<class U>
|
||||
using rebind = U*;
|
||||
#endif
|
||||
static T*
|
||||
pointer_to(typename detail::ptr_value<T>::type& v) BOOST_NOEXCEPT {
|
||||
return boost::addressof(v);
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
template<class T>
|
||||
BOOST_CONSTEXPR inline T*
|
||||
to_address(T* v) BOOST_NOEXCEPT
|
||||
{
|
||||
return v;
|
||||
}
|
||||
|
||||
#if !defined(BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION)
|
||||
namespace detail {
|
||||
|
||||
template<class T>
|
||||
inline T*
|
||||
ptr_address(T* v, int) BOOST_NOEXCEPT
|
||||
{
|
||||
return v;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline auto
|
||||
ptr_address(const T& v, int) BOOST_NOEXCEPT
|
||||
-> decltype(boost::pointer_traits<T>::to_address(v))
|
||||
{
|
||||
return boost::pointer_traits<T>::to_address(v);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline auto
|
||||
ptr_address(const T& v, long) BOOST_NOEXCEPT
|
||||
{
|
||||
return boost::detail::ptr_address(v.operator->(), 0);
|
||||
}
|
||||
|
||||
} /* detail */
|
||||
|
||||
template<class T>
|
||||
inline auto
|
||||
to_address(const T& v) BOOST_NOEXCEPT
|
||||
{
|
||||
return boost::detail::ptr_address(v, 0);
|
||||
}
|
||||
#else
|
||||
template<class T>
|
||||
inline typename pointer_traits<T>::element_type*
|
||||
to_address(const T& v) BOOST_NOEXCEPT
|
||||
{
|
||||
return boost::to_address(v.operator->());
|
||||
}
|
||||
#endif
|
||||
|
||||
} /* boost */
|
||||
|
||||
#endif
|
||||
@ -1,59 +0,0 @@
|
||||
#ifndef BOOST_CORE_QUICK_EXIT_HPP_INCLUDED
|
||||
#define BOOST_CORE_QUICK_EXIT_HPP_INCLUDED
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
// boost/core/quick_exit.hpp
|
||||
//
|
||||
// Copyright 2018 Peter Dimov
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <stdlib.h>
|
||||
|
||||
#if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)
|
||||
|
||||
extern "C" _CRTIMP __cdecl __MINGW_NOTHROW void _exit (int) __MINGW_ATTRIB_NORETURN;
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(__CYGWIN__) && __cplusplus < 201103L
|
||||
|
||||
extern "C" _Noreturn void quick_exit(int);
|
||||
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
BOOST_NORETURN void quick_exit( int code ) BOOST_NOEXCEPT
|
||||
{
|
||||
#if defined(_MSC_VER) && _MSC_VER < 1900
|
||||
|
||||
::_exit( code );
|
||||
|
||||
#elif defined(__MINGW32__)
|
||||
|
||||
::_exit( code );
|
||||
|
||||
#elif defined(__APPLE__)
|
||||
|
||||
::_Exit( code );
|
||||
|
||||
#else
|
||||
|
||||
::quick_exit( code );
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_CORE_QUICK_EXIT_HPP_INCLUDED
|
||||
@ -1,338 +0,0 @@
|
||||
#ifndef BOOST_CORE_REF_HPP
|
||||
#define BOOST_CORE_REF_HPP
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
#include <boost/core/addressof.hpp>
|
||||
#include <boost/core/enable_if.hpp>
|
||||
|
||||
//
|
||||
// ref.hpp - ref/cref, useful helper functions
|
||||
//
|
||||
// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 2001, 2002 Peter Dimov
|
||||
// Copyright (C) 2002 David Abrahams
|
||||
//
|
||||
// Copyright (C) 2014 Glen Joseph Fernandes
|
||||
// (glenjofe@gmail.com)
|
||||
//
|
||||
// Copyright (C) 2014 Agustin Berge
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// See http://www.boost.org/libs/core/doc/html/core/ref.html for documentation.
|
||||
//
|
||||
|
||||
/**
|
||||
@file
|
||||
*/
|
||||
|
||||
/**
|
||||
Boost namespace.
|
||||
*/
|
||||
namespace boost
|
||||
{
|
||||
|
||||
#if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, == 1600 )
|
||||
|
||||
struct ref_workaround_tag {};
|
||||
|
||||
#endif
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
template< class Y, class T > struct ref_convertible
|
||||
{
|
||||
typedef char (&yes) [1];
|
||||
typedef char (&no) [2];
|
||||
|
||||
static yes f( T* );
|
||||
static no f( ... );
|
||||
|
||||
enum _vt { value = sizeof( (f)( static_cast<Y*>(0) ) ) == sizeof(yes) };
|
||||
};
|
||||
|
||||
struct ref_empty
|
||||
{
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
// reference_wrapper
|
||||
|
||||
/**
|
||||
@brief Contains a reference to an object of type `T`.
|
||||
|
||||
`reference_wrapper` is primarily used to "feed" references to
|
||||
function templates (algorithms) that take their parameter by
|
||||
value. It provides an implicit conversion to `T&`, which
|
||||
usually allows the function templates to work on references
|
||||
unmodified.
|
||||
*/
|
||||
template<class T> class reference_wrapper
|
||||
{
|
||||
public:
|
||||
/**
|
||||
Type `T`.
|
||||
*/
|
||||
typedef T type;
|
||||
|
||||
/**
|
||||
Constructs a `reference_wrapper` object that stores a
|
||||
reference to `t`.
|
||||
|
||||
@remark Does not throw.
|
||||
*/
|
||||
BOOST_FORCEINLINE explicit reference_wrapper(T& t): t_(boost::addressof(t)) {}
|
||||
|
||||
#if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, == 1600 )
|
||||
|
||||
BOOST_FORCEINLINE explicit reference_wrapper( T & t, ref_workaround_tag ): t_( boost::addressof( t ) ) {}
|
||||
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
/**
|
||||
@remark Construction from a temporary object is disabled.
|
||||
*/
|
||||
BOOST_DELETED_FUNCTION(reference_wrapper(T&& t))
|
||||
public:
|
||||
#endif
|
||||
|
||||
template<class Y> friend class reference_wrapper;
|
||||
|
||||
/**
|
||||
Constructs a `reference_wrapper` object that stores the
|
||||
reference stored in the compatible `reference_wrapper` `r`.
|
||||
|
||||
@remark Only enabled when `Y*` is convertible to `T*`.
|
||||
@remark Does not throw.
|
||||
*/
|
||||
template<class Y> reference_wrapper( reference_wrapper<Y> r,
|
||||
typename enable_if_c<boost::detail::ref_convertible<Y, T>::value,
|
||||
boost::detail::ref_empty>::type = boost::detail::ref_empty() ): t_( r.t_ )
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
@return The stored reference.
|
||||
@remark Does not throw.
|
||||
*/
|
||||
BOOST_FORCEINLINE operator T& () const { return *t_; }
|
||||
|
||||
/**
|
||||
@return The stored reference.
|
||||
@remark Does not throw.
|
||||
*/
|
||||
BOOST_FORCEINLINE T& get() const { return *t_; }
|
||||
|
||||
/**
|
||||
@return A pointer to the object referenced by the stored
|
||||
reference.
|
||||
@remark Does not throw.
|
||||
*/
|
||||
BOOST_FORCEINLINE T* get_pointer() const { return t_; }
|
||||
|
||||
private:
|
||||
|
||||
T* t_;
|
||||
};
|
||||
|
||||
// ref
|
||||
|
||||
/**
|
||||
@cond
|
||||
*/
|
||||
#if defined( BOOST_BORLANDC ) && BOOST_WORKAROUND( BOOST_BORLANDC, BOOST_TESTED_AT(0x581) )
|
||||
# define BOOST_REF_CONST
|
||||
#else
|
||||
# define BOOST_REF_CONST const
|
||||
#endif
|
||||
/**
|
||||
@endcond
|
||||
*/
|
||||
|
||||
/**
|
||||
@return `reference_wrapper<T>(t)`
|
||||
@remark Does not throw.
|
||||
*/
|
||||
template<class T> BOOST_FORCEINLINE reference_wrapper<T> BOOST_REF_CONST ref( T & t )
|
||||
{
|
||||
#if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, == 1600 )
|
||||
|
||||
return reference_wrapper<T>( t, ref_workaround_tag() );
|
||||
|
||||
#else
|
||||
|
||||
return reference_wrapper<T>( t );
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
// cref
|
||||
|
||||
/**
|
||||
@return `reference_wrapper<T const>(t)`
|
||||
@remark Does not throw.
|
||||
*/
|
||||
template<class T> BOOST_FORCEINLINE reference_wrapper<T const> BOOST_REF_CONST cref( T const & t )
|
||||
{
|
||||
return reference_wrapper<T const>(t);
|
||||
}
|
||||
|
||||
#undef BOOST_REF_CONST
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
|
||||
/**
|
||||
@cond
|
||||
*/
|
||||
#if defined(BOOST_NO_CXX11_DELETED_FUNCTIONS)
|
||||
# define BOOST_REF_DELETE
|
||||
#else
|
||||
# define BOOST_REF_DELETE = delete
|
||||
#endif
|
||||
/**
|
||||
@endcond
|
||||
*/
|
||||
|
||||
/**
|
||||
@remark Construction from a temporary object is disabled.
|
||||
*/
|
||||
template<class T> void ref(T const&&) BOOST_REF_DELETE;
|
||||
|
||||
/**
|
||||
@remark Construction from a temporary object is disabled.
|
||||
*/
|
||||
template<class T> void cref(T const&&) BOOST_REF_DELETE;
|
||||
|
||||
#undef BOOST_REF_DELETE
|
||||
|
||||
#endif
|
||||
|
||||
// is_reference_wrapper
|
||||
|
||||
/**
|
||||
@brief Determine if a type `T` is an instantiation of
|
||||
`reference_wrapper`.
|
||||
|
||||
The value static constant will be true if the type `T` is a
|
||||
specialization of `reference_wrapper`.
|
||||
*/
|
||||
template<typename T> struct is_reference_wrapper
|
||||
{
|
||||
BOOST_STATIC_CONSTANT( bool, value = false );
|
||||
};
|
||||
|
||||
/**
|
||||
@cond
|
||||
*/
|
||||
template<typename T> struct is_reference_wrapper< reference_wrapper<T> >
|
||||
{
|
||||
BOOST_STATIC_CONSTANT( bool, value = true );
|
||||
};
|
||||
|
||||
#if !defined(BOOST_NO_CV_SPECIALIZATIONS)
|
||||
|
||||
template<typename T> struct is_reference_wrapper< reference_wrapper<T> const >
|
||||
{
|
||||
BOOST_STATIC_CONSTANT( bool, value = true );
|
||||
};
|
||||
|
||||
template<typename T> struct is_reference_wrapper< reference_wrapper<T> volatile >
|
||||
{
|
||||
BOOST_STATIC_CONSTANT( bool, value = true );
|
||||
};
|
||||
|
||||
template<typename T> struct is_reference_wrapper< reference_wrapper<T> const volatile >
|
||||
{
|
||||
BOOST_STATIC_CONSTANT( bool, value = true );
|
||||
};
|
||||
|
||||
#endif // !defined(BOOST_NO_CV_SPECIALIZATIONS)
|
||||
|
||||
/**
|
||||
@endcond
|
||||
*/
|
||||
|
||||
|
||||
// unwrap_reference
|
||||
|
||||
/**
|
||||
@brief Find the type in a `reference_wrapper`.
|
||||
|
||||
The `typedef` type is `T::type` if `T` is a
|
||||
`reference_wrapper`, `T` otherwise.
|
||||
*/
|
||||
template<typename T> struct unwrap_reference
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
/**
|
||||
@cond
|
||||
*/
|
||||
template<typename T> struct unwrap_reference< reference_wrapper<T> >
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
#if !defined(BOOST_NO_CV_SPECIALIZATIONS)
|
||||
|
||||
template<typename T> struct unwrap_reference< reference_wrapper<T> const >
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
template<typename T> struct unwrap_reference< reference_wrapper<T> volatile >
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
template<typename T> struct unwrap_reference< reference_wrapper<T> const volatile >
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
#endif // !defined(BOOST_NO_CV_SPECIALIZATIONS)
|
||||
|
||||
/**
|
||||
@endcond
|
||||
*/
|
||||
|
||||
// unwrap_ref
|
||||
|
||||
/**
|
||||
@return `unwrap_reference<T>::type&(t)`
|
||||
@remark Does not throw.
|
||||
*/
|
||||
template<class T> BOOST_FORCEINLINE typename unwrap_reference<T>::type& unwrap_ref( T & t )
|
||||
{
|
||||
return t;
|
||||
}
|
||||
|
||||
// get_pointer
|
||||
|
||||
/**
|
||||
@cond
|
||||
*/
|
||||
template<class T> BOOST_FORCEINLINE T* get_pointer( reference_wrapper<T> const & r )
|
||||
{
|
||||
return r.get_pointer();
|
||||
}
|
||||
/**
|
||||
@endcond
|
||||
*/
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_CORE_REF_HPP
|
||||
@ -1,194 +0,0 @@
|
||||
// scoped_enum.hpp ---------------------------------------------------------//
|
||||
|
||||
// Copyright Beman Dawes, 2009
|
||||
// Copyright (C) 2011-2012 Vicente J. Botet Escriba
|
||||
// Copyright (C) 2012 Anthony Williams
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#ifndef BOOST_CORE_SCOPED_ENUM_HPP
|
||||
#define BOOST_CORE_SCOPED_ENUM_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
#ifdef BOOST_NO_CXX11_SCOPED_ENUMS
|
||||
|
||||
/**
|
||||
* Meta-function to get the native enum type associated to an enum class or its emulation.
|
||||
*/
|
||||
template <typename EnumType>
|
||||
struct native_type
|
||||
{
|
||||
/**
|
||||
* The member typedef type names the native enum type associated to the scoped enum,
|
||||
* which is it self if the compiler supports scoped enums or EnumType::enum_type if it is an emulated scoped enum.
|
||||
*/
|
||||
typedef typename EnumType::enum_type type;
|
||||
};
|
||||
|
||||
/**
|
||||
* Casts a scoped enum to its underlying type.
|
||||
*
|
||||
* This function is useful when working with scoped enum classes, which doens't implicitly convert to the underlying type.
|
||||
* @param v A scoped enum.
|
||||
* @returns The underlying type.
|
||||
* @throws No-throws.
|
||||
*/
|
||||
template <typename UnderlyingType, typename EnumType>
|
||||
inline
|
||||
BOOST_CONSTEXPR UnderlyingType underlying_cast(EnumType v) BOOST_NOEXCEPT
|
||||
{
|
||||
return v.get_underlying_value_();
|
||||
}
|
||||
|
||||
/**
|
||||
* Casts a scoped enum to its native enum type.
|
||||
*
|
||||
* This function is useful to make programs portable when the scoped enum emulation can not be use where native enums can.
|
||||
*
|
||||
* EnumType the scoped enum type
|
||||
*
|
||||
* @param v A scoped enum.
|
||||
* @returns The native enum value.
|
||||
* @throws No-throws.
|
||||
*/
|
||||
template <typename EnumType>
|
||||
inline
|
||||
BOOST_CONSTEXPR typename EnumType::enum_type native_value(EnumType e) BOOST_NOEXCEPT
|
||||
{
|
||||
return e.get_native_value_();
|
||||
}
|
||||
|
||||
#else // BOOST_NO_CXX11_SCOPED_ENUMS
|
||||
|
||||
template <typename EnumType>
|
||||
struct native_type
|
||||
{
|
||||
typedef EnumType type;
|
||||
};
|
||||
|
||||
template <typename UnderlyingType, typename EnumType>
|
||||
inline
|
||||
BOOST_CONSTEXPR UnderlyingType underlying_cast(EnumType v) BOOST_NOEXCEPT
|
||||
{
|
||||
return static_cast<UnderlyingType>(v);
|
||||
}
|
||||
|
||||
template <typename EnumType>
|
||||
inline
|
||||
BOOST_CONSTEXPR EnumType native_value(EnumType e) BOOST_NOEXCEPT
|
||||
{
|
||||
return e;
|
||||
}
|
||||
|
||||
#endif // BOOST_NO_CXX11_SCOPED_ENUMS
|
||||
}
|
||||
|
||||
|
||||
#ifdef BOOST_NO_CXX11_SCOPED_ENUMS
|
||||
|
||||
#ifndef BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
|
||||
|
||||
#define BOOST_SCOPED_ENUM_UT_DECLARE_CONVERSION_OPERATOR \
|
||||
explicit BOOST_CONSTEXPR operator underlying_type() const BOOST_NOEXCEPT { return get_underlying_value_(); }
|
||||
|
||||
#else
|
||||
|
||||
#define BOOST_SCOPED_ENUM_UT_DECLARE_CONVERSION_OPERATOR
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Start a declaration of a scoped enum.
|
||||
*
|
||||
* @param EnumType The new scoped enum.
|
||||
* @param UnderlyingType The underlying type.
|
||||
*/
|
||||
#define BOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(EnumType, UnderlyingType) \
|
||||
struct EnumType { \
|
||||
typedef void is_boost_scoped_enum_tag; \
|
||||
typedef UnderlyingType underlying_type; \
|
||||
EnumType() BOOST_NOEXCEPT {} \
|
||||
explicit BOOST_CONSTEXPR EnumType(underlying_type v) BOOST_NOEXCEPT : v_(v) {} \
|
||||
BOOST_CONSTEXPR underlying_type get_underlying_value_() const BOOST_NOEXCEPT { return v_; } \
|
||||
BOOST_SCOPED_ENUM_UT_DECLARE_CONVERSION_OPERATOR \
|
||||
private: \
|
||||
underlying_type v_; \
|
||||
typedef EnumType self_type; \
|
||||
public: \
|
||||
enum enum_type
|
||||
|
||||
#define BOOST_SCOPED_ENUM_DECLARE_END2() \
|
||||
BOOST_CONSTEXPR enum_type get_native_value_() const BOOST_NOEXCEPT { return enum_type(v_); } \
|
||||
friend BOOST_CONSTEXPR bool operator ==(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)==enum_type(rhs.v_); } \
|
||||
friend BOOST_CONSTEXPR bool operator ==(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)==rhs; } \
|
||||
friend BOOST_CONSTEXPR bool operator ==(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs==enum_type(rhs.v_); } \
|
||||
friend BOOST_CONSTEXPR bool operator !=(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)!=enum_type(rhs.v_); } \
|
||||
friend BOOST_CONSTEXPR bool operator !=(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)!=rhs; } \
|
||||
friend BOOST_CONSTEXPR bool operator !=(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs!=enum_type(rhs.v_); } \
|
||||
friend BOOST_CONSTEXPR bool operator <(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)<enum_type(rhs.v_); } \
|
||||
friend BOOST_CONSTEXPR bool operator <(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)<rhs; } \
|
||||
friend BOOST_CONSTEXPR bool operator <(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs<enum_type(rhs.v_); } \
|
||||
friend BOOST_CONSTEXPR bool operator <=(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)<=enum_type(rhs.v_); } \
|
||||
friend BOOST_CONSTEXPR bool operator <=(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)<=rhs; } \
|
||||
friend BOOST_CONSTEXPR bool operator <=(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs<=enum_type(rhs.v_); } \
|
||||
friend BOOST_CONSTEXPR bool operator >(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)>enum_type(rhs.v_); } \
|
||||
friend BOOST_CONSTEXPR bool operator >(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)>rhs; } \
|
||||
friend BOOST_CONSTEXPR bool operator >(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs>enum_type(rhs.v_); } \
|
||||
friend BOOST_CONSTEXPR bool operator >=(self_type lhs, self_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)>=enum_type(rhs.v_); } \
|
||||
friend BOOST_CONSTEXPR bool operator >=(self_type lhs, enum_type rhs) BOOST_NOEXCEPT { return enum_type(lhs.v_)>=rhs; } \
|
||||
friend BOOST_CONSTEXPR bool operator >=(enum_type lhs, self_type rhs) BOOST_NOEXCEPT { return lhs>=enum_type(rhs.v_); } \
|
||||
};
|
||||
|
||||
#define BOOST_SCOPED_ENUM_DECLARE_END(EnumType) \
|
||||
; \
|
||||
BOOST_CONSTEXPR EnumType(enum_type v) BOOST_NOEXCEPT : v_(v) {} \
|
||||
BOOST_SCOPED_ENUM_DECLARE_END2()
|
||||
|
||||
/**
|
||||
* Starts a declaration of a scoped enum with the default int underlying type.
|
||||
*
|
||||
* @param EnumType The new scoped enum.
|
||||
*/
|
||||
#define BOOST_SCOPED_ENUM_DECLARE_BEGIN(EnumType) \
|
||||
BOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(EnumType,int)
|
||||
|
||||
/**
|
||||
* Name of the native enum type.
|
||||
*
|
||||
* @param EnumType The new scoped enum.
|
||||
*/
|
||||
#define BOOST_SCOPED_ENUM_NATIVE(EnumType) EnumType::enum_type
|
||||
/**
|
||||
* Forward declares an scoped enum.
|
||||
*
|
||||
* @param EnumType The scoped enum.
|
||||
*/
|
||||
#define BOOST_SCOPED_ENUM_FORWARD_DECLARE(EnumType) struct EnumType
|
||||
|
||||
#else // BOOST_NO_CXX11_SCOPED_ENUMS
|
||||
|
||||
#define BOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(EnumType,UnderlyingType) enum class EnumType : UnderlyingType
|
||||
#define BOOST_SCOPED_ENUM_DECLARE_BEGIN(EnumType) enum class EnumType
|
||||
#define BOOST_SCOPED_ENUM_DECLARE_END2()
|
||||
#define BOOST_SCOPED_ENUM_DECLARE_END(EnumType) ;
|
||||
|
||||
#define BOOST_SCOPED_ENUM_NATIVE(EnumType) EnumType
|
||||
#define BOOST_SCOPED_ENUM_FORWARD_DECLARE(EnumType) enum class EnumType
|
||||
|
||||
#endif // BOOST_NO_CXX11_SCOPED_ENUMS
|
||||
|
||||
// Deprecated macros
|
||||
#define BOOST_SCOPED_ENUM_START(name) BOOST_SCOPED_ENUM_DECLARE_BEGIN(name)
|
||||
#define BOOST_SCOPED_ENUM_END BOOST_SCOPED_ENUM_DECLARE_END2()
|
||||
#define BOOST_SCOPED_ENUM(name) BOOST_SCOPED_ENUM_NATIVE(name)
|
||||
|
||||
#endif // BOOST_CORE_SCOPED_ENUM_HPP
|
||||
@ -1,407 +0,0 @@
|
||||
/*
|
||||
Copyright 2019 Glen Joseph Fernandes
|
||||
(glenjofe@gmail.com)
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
#ifndef BOOST_CORE_SPAN_HPP
|
||||
#define BOOST_CORE_SPAN_HPP
|
||||
|
||||
#include <array>
|
||||
#include <iterator>
|
||||
#include <type_traits>
|
||||
#include <cstddef>
|
||||
|
||||
namespace boost {
|
||||
|
||||
constexpr std::size_t dynamic_extent = static_cast<std::size_t>(-1);
|
||||
|
||||
template<class T, std::size_t E = dynamic_extent>
|
||||
class span;
|
||||
|
||||
namespace detail {
|
||||
|
||||
template<class U, class T>
|
||||
struct span_convertible {
|
||||
static constexpr bool value = std::is_convertible<U(*)[], T(*)[]>::value;
|
||||
};
|
||||
|
||||
template<std::size_t E, std::size_t N>
|
||||
struct span_capacity {
|
||||
static constexpr bool value = E == boost::dynamic_extent || E == N;
|
||||
};
|
||||
|
||||
template<class T, std::size_t E, class U, std::size_t N>
|
||||
struct span_compatible {
|
||||
static constexpr bool value = span_capacity<E, N>::value &&
|
||||
span_convertible<U, T>::value;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct span_uncvref {
|
||||
typedef typename std::remove_cv<typename
|
||||
std::remove_reference<T>::type>::type type;
|
||||
};
|
||||
|
||||
template<class>
|
||||
struct span_is_span {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
|
||||
template<class T, std::size_t E>
|
||||
struct span_is_span<boost::span<T, E> > {
|
||||
static constexpr bool value = true;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct span_is_array {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
|
||||
template<class T, std::size_t N>
|
||||
struct span_is_array<std::array<T, N> > {
|
||||
static constexpr bool value = true;
|
||||
};
|
||||
|
||||
template<class, class = void>
|
||||
struct span_data { };
|
||||
|
||||
template<class T>
|
||||
struct span_data<T,
|
||||
typename std::enable_if<std::is_pointer<decltype(std::declval<T
|
||||
&>().data())>::value>::type> {
|
||||
typedef typename std::remove_pointer<decltype(std::declval<T
|
||||
&>().data())>::type type;
|
||||
};
|
||||
|
||||
template<class, class, class = void>
|
||||
struct span_has_data {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
|
||||
template<class R, class T>
|
||||
struct span_has_data<R, T, typename std::enable_if<span_convertible<typename
|
||||
span_data<R>::type, T>::value>::type> {
|
||||
static constexpr bool value = true;
|
||||
};
|
||||
|
||||
template<class, class = void>
|
||||
struct span_has_size {
|
||||
static constexpr bool value = false;
|
||||
};
|
||||
|
||||
template<class R>
|
||||
struct span_has_size<R, typename
|
||||
std::enable_if<std::is_convertible<decltype(std::declval<R&>().size()),
|
||||
std::size_t>::value>::type> {
|
||||
static constexpr bool value = true;
|
||||
};
|
||||
|
||||
template<class R, class T>
|
||||
struct span_is_range {
|
||||
static constexpr bool value = (std::is_const<T>::value ||
|
||||
std::is_lvalue_reference<R>::value) &&
|
||||
!span_is_span<typename span_uncvref<R>::type>::value &&
|
||||
!span_is_array<typename span_uncvref<R>::type>::value &&
|
||||
!std::is_array<typename span_uncvref<R>::type>::value &&
|
||||
span_has_data<R, T>::value &&
|
||||
span_has_size<R>::value;
|
||||
};
|
||||
|
||||
template<std::size_t E, std::size_t N>
|
||||
struct span_implicit {
|
||||
static constexpr bool value = E == boost::dynamic_extent ||
|
||||
N != boost::dynamic_extent;
|
||||
};
|
||||
|
||||
template<class T, std::size_t E, class U, std::size_t N>
|
||||
struct span_copyable {
|
||||
static constexpr bool value = (N == boost::dynamic_extent ||
|
||||
span_capacity<E, N>::value) && span_convertible<U, T>::value;
|
||||
};
|
||||
|
||||
template<std::size_t E, std::size_t O>
|
||||
struct span_sub {
|
||||
static constexpr std::size_t value = E == boost::dynamic_extent ?
|
||||
boost::dynamic_extent : E - O;
|
||||
};
|
||||
|
||||
template<class T, std::size_t E>
|
||||
struct span_store {
|
||||
constexpr span_store(T* p_, std::size_t) noexcept
|
||||
: p(p_) { }
|
||||
static constexpr std::size_t n = E;
|
||||
T* p;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct span_store<T, boost::dynamic_extent> {
|
||||
constexpr span_store(T* p_, std::size_t n_) noexcept
|
||||
: p(p_)
|
||||
, n(n_) { }
|
||||
T* p;
|
||||
std::size_t n;
|
||||
};
|
||||
|
||||
template<class T, std::size_t E>
|
||||
struct span_bytes {
|
||||
static constexpr std::size_t value = sizeof(T) * E;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct span_bytes<T, boost::dynamic_extent> {
|
||||
static constexpr std::size_t value = boost::dynamic_extent;
|
||||
};
|
||||
|
||||
} /* detail */
|
||||
|
||||
template<class T, std::size_t E>
|
||||
class span {
|
||||
public:
|
||||
typedef T element_type;
|
||||
typedef typename std::remove_cv<T>::type value_type;
|
||||
typedef std::size_t size_type;
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
typedef T* pointer;
|
||||
typedef const T* const_pointer;
|
||||
typedef T& reference;
|
||||
typedef const T& const_reference;
|
||||
typedef T* iterator;
|
||||
typedef const T* const_iterator;
|
||||
typedef std::reverse_iterator<T*> reverse_iterator;
|
||||
typedef std::reverse_iterator<const T*> const_reverse_iterator;
|
||||
|
||||
static constexpr std::size_t extent = E;
|
||||
|
||||
template<std::size_t N = E,
|
||||
typename std::enable_if<N == dynamic_extent || N == 0, int>::type = 0>
|
||||
constexpr span() noexcept
|
||||
: s_(0, 0) { }
|
||||
|
||||
template<class I,
|
||||
typename std::enable_if<E == dynamic_extent &&
|
||||
detail::span_convertible<I, T>::value, int>::type = 0>
|
||||
constexpr span(I* f, size_type c)
|
||||
: s_(f, c) { }
|
||||
|
||||
template<class I,
|
||||
typename std::enable_if<E != dynamic_extent &&
|
||||
detail::span_convertible<I, T>::value, int>::type = 0>
|
||||
explicit constexpr span(I* f, size_type c)
|
||||
: s_(f, c) { }
|
||||
|
||||
template<class I, class L,
|
||||
typename std::enable_if<E == dynamic_extent &&
|
||||
detail::span_convertible<I, T>::value, int>::type = 0>
|
||||
constexpr span(I* f, L* l)
|
||||
: s_(f, l - f) { }
|
||||
|
||||
template<class I, class L,
|
||||
typename std::enable_if<E != dynamic_extent &&
|
||||
detail::span_convertible<I, T>::value, int>::type = 0>
|
||||
explicit constexpr span(I* f, L* l)
|
||||
: s_(f, l - f) { }
|
||||
|
||||
template<std::size_t N,
|
||||
typename std::enable_if<detail::span_capacity<E, N>::value,
|
||||
int>::type = 0>
|
||||
constexpr span(typename std::enable_if<true, T>::type (&a)[N]) noexcept
|
||||
: s_(a, N) { }
|
||||
|
||||
template<class U, std::size_t N,
|
||||
typename std::enable_if<detail::span_compatible<T, E, U, N>::value,
|
||||
int>::type = 0>
|
||||
constexpr span(std::array<U, N>& a) noexcept
|
||||
: s_(a.data(), N) { }
|
||||
|
||||
template<class U, std::size_t N,
|
||||
typename std::enable_if<detail::span_compatible<T, E, const U,
|
||||
N>::value, int>::type = 0>
|
||||
constexpr span(const std::array<U, N>& a) noexcept
|
||||
: s_(a.data(), N) { }
|
||||
|
||||
template<class R,
|
||||
typename std::enable_if<E == dynamic_extent &&
|
||||
detail::span_is_range<R, T>::value, int>::type = 0>
|
||||
constexpr span(R&& r) noexcept(noexcept(r.data()) && noexcept(r.size()))
|
||||
: s_(r.data(), r.size()) { }
|
||||
|
||||
template<class R,
|
||||
typename std::enable_if<E != dynamic_extent &&
|
||||
detail::span_is_range<R, T>::value, int>::type = 0>
|
||||
explicit constexpr span(R&& r) noexcept(noexcept(r.data()) &&
|
||||
noexcept(r.size()))
|
||||
: s_(r.data(), r.size()) { }
|
||||
|
||||
template<class U, std::size_t N,
|
||||
typename std::enable_if<detail::span_implicit<E, N>::value &&
|
||||
detail::span_copyable<T, E, U, N>::value, int>::type = 0>
|
||||
constexpr span(const span<U, N>& s) noexcept
|
||||
: s_(s.data(), s.size()) { }
|
||||
|
||||
template<class U, std::size_t N,
|
||||
typename std::enable_if<!detail::span_implicit<E, N>::value &&
|
||||
detail::span_copyable<T, E, U, N>::value, int>::type = 0>
|
||||
explicit constexpr span(const span<U, N>& s) noexcept
|
||||
: s_(s.data(), s.size()) { }
|
||||
|
||||
template<std::size_t C>
|
||||
constexpr span<T, C> first() const {
|
||||
static_assert(C <= E, "Count <= Extent");
|
||||
return span<T, C>(s_.p, C);
|
||||
}
|
||||
|
||||
template<std::size_t C>
|
||||
constexpr span<T, C> last() const {
|
||||
static_assert(C <= E, "Count <= Extent");
|
||||
return span<T, C>(s_.p + (s_.n - C), C);
|
||||
}
|
||||
|
||||
template<std::size_t O, std::size_t C = dynamic_extent>
|
||||
constexpr typename std::enable_if<C == dynamic_extent,
|
||||
span<T, detail::span_sub<E, O>::value> >::type subspan() const {
|
||||
static_assert(O <= E, "Offset <= Extent");
|
||||
return span<T, detail::span_sub<E, O>::value>(s_.p + O, s_.n - O);
|
||||
}
|
||||
|
||||
template<std::size_t O, std::size_t C = dynamic_extent>
|
||||
constexpr typename std::enable_if<C != dynamic_extent,
|
||||
span<T, C> >::type subspan() const {
|
||||
static_assert(O <= E && C <= E - O,
|
||||
"Offset <= Extent && Count <= Extent - Offset");
|
||||
return span<T, C>(s_.p + O, C);
|
||||
}
|
||||
|
||||
constexpr span<T, dynamic_extent> first(size_type c) const {
|
||||
return span<T, dynamic_extent>(s_.p, c);
|
||||
}
|
||||
|
||||
constexpr span<T, dynamic_extent> last(size_type c) const {
|
||||
return span<T, dynamic_extent>(s_.p + (s_.n - c), c);
|
||||
}
|
||||
|
||||
constexpr span<T, dynamic_extent> subspan(size_type o,
|
||||
size_type c = dynamic_extent) const {
|
||||
return span<T, dynamic_extent>(s_.p + o,
|
||||
c == dynamic_extent ? s_.n - o : c);
|
||||
}
|
||||
|
||||
constexpr size_type size() const noexcept {
|
||||
return s_.n;
|
||||
}
|
||||
|
||||
constexpr size_type size_bytes() const noexcept {
|
||||
return s_.n * sizeof(T);
|
||||
}
|
||||
|
||||
constexpr bool empty() const noexcept {
|
||||
return s_.n == 0;
|
||||
}
|
||||
|
||||
constexpr reference operator[](size_type i) const {
|
||||
return s_.p[i];
|
||||
}
|
||||
|
||||
constexpr reference front() const {
|
||||
return *s_.p;
|
||||
}
|
||||
|
||||
constexpr reference back() const {
|
||||
return s_.p[s_.n - 1];
|
||||
}
|
||||
|
||||
constexpr pointer data() const noexcept {
|
||||
return s_.p;
|
||||
}
|
||||
|
||||
constexpr iterator begin() const noexcept {
|
||||
return s_.p;
|
||||
}
|
||||
|
||||
constexpr iterator end() const noexcept {
|
||||
return s_.p + s_.n;
|
||||
}
|
||||
|
||||
constexpr reverse_iterator rbegin() const noexcept {
|
||||
return reverse_iterator(s_.p + s_.n);
|
||||
}
|
||||
|
||||
constexpr reverse_iterator rend() const noexcept {
|
||||
return reverse_iterator(s_.p);
|
||||
}
|
||||
|
||||
constexpr const_iterator cbegin() const noexcept {
|
||||
return s_.p;
|
||||
}
|
||||
|
||||
constexpr const_iterator cend() const noexcept {
|
||||
return s_.p + s_.n;
|
||||
}
|
||||
|
||||
constexpr const_reverse_iterator crbegin() const noexcept {
|
||||
return const_reverse_iterator(s_.p + s_.n);
|
||||
}
|
||||
|
||||
constexpr const_reverse_iterator crend() const noexcept {
|
||||
return const_reverse_iterator(s_.p);
|
||||
}
|
||||
|
||||
friend constexpr iterator begin(span s) noexcept {
|
||||
return s.begin();
|
||||
}
|
||||
|
||||
friend constexpr iterator end(span s) noexcept {
|
||||
return s.end();
|
||||
}
|
||||
|
||||
private:
|
||||
detail::span_store<T, E> s_;
|
||||
};
|
||||
|
||||
template<class T, std::size_t E>
|
||||
constexpr std::size_t span<T, E>::extent;
|
||||
|
||||
#ifdef __cpp_deduction_guides
|
||||
template<class I, class L>
|
||||
span(I*, L) -> span<I>;
|
||||
|
||||
template<class T, std::size_t N>
|
||||
span(T(&)[N]) -> span<T, N>;
|
||||
|
||||
template<class T, std::size_t N>
|
||||
span(std::array<T, N>&) -> span<T, N>;
|
||||
|
||||
template<class T, std::size_t N>
|
||||
span(const std::array<T, N>&) -> span<const T, N>;
|
||||
|
||||
template<class R>
|
||||
span(R&&) -> span<typename detail::span_data<R>::type>;
|
||||
|
||||
template<class T, std::size_t E>
|
||||
span(span<T, E>) -> span<T, E>;
|
||||
#endif
|
||||
|
||||
#ifdef __cpp_lib_byte
|
||||
template<class T, std::size_t E>
|
||||
inline span<const std::byte, detail::span_bytes<T, E>::value>
|
||||
as_bytes(span<T, E> s) noexcept
|
||||
{
|
||||
return span<const std::byte, detail::span_bytes<T,
|
||||
E>::value>(reinterpret_cast<const std::byte*>(s.data()),
|
||||
s.size_bytes());
|
||||
}
|
||||
|
||||
template<class T, std::size_t E>
|
||||
inline typename std::enable_if<!std::is_const<T>::value,
|
||||
span<std::byte, detail::span_bytes<T, E>::value> >::type
|
||||
as_writable_bytes(span<T, E> s) noexcept
|
||||
{
|
||||
return span<std::byte, detail::span_bytes<T,
|
||||
E>::value>(reinterpret_cast<std::byte*>(s.data()), s.size_bytes());
|
||||
}
|
||||
#endif
|
||||
|
||||
} /* boost */
|
||||
|
||||
#endif
|
||||
@ -1,70 +0,0 @@
|
||||
// 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 <boost/core/enable_if.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#if __cplusplus >= 201103L || defined(BOOST_DINKUMWARE_STDLIB)
|
||||
#include <utility> // for std::swap (C++11)
|
||||
#else
|
||||
#include <algorithm> // for std::swap (C++98)
|
||||
#endif
|
||||
#include <cstddef> // for std::size_t
|
||||
|
||||
namespace boost_swap_impl
|
||||
{
|
||||
// we can't use type_traits here
|
||||
|
||||
template<class T> struct is_const { enum _vt { value = 0 }; };
|
||||
template<class T> struct is_const<T const> { enum _vt { value = 1 }; };
|
||||
|
||||
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
|
||||
typename enable_if_c< !boost_swap_impl::is_const<T1>::value && !boost_swap_impl::is_const<T2>::value >::type
|
||||
swap(T1& left, T2& right)
|
||||
{
|
||||
::boost_swap_impl::swap_impl(left, right);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,167 +0,0 @@
|
||||
#ifndef BOOST_CORE_TYPEINFO_HPP_INCLUDED
|
||||
#define BOOST_CORE_TYPEINFO_HPP_INCLUDED
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
// core::typeinfo, BOOST_CORE_TYPEID
|
||||
//
|
||||
// Copyright 2007, 2014 Peter Dimov
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#if defined( BOOST_NO_TYPEID )
|
||||
|
||||
#include <boost/current_function.hpp>
|
||||
#include <functional>
|
||||
#include <cstring>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
namespace core
|
||||
{
|
||||
|
||||
class typeinfo
|
||||
{
|
||||
private:
|
||||
|
||||
typeinfo( typeinfo const& );
|
||||
typeinfo& operator=( typeinfo const& );
|
||||
|
||||
char const * name_;
|
||||
void (*lib_id_)();
|
||||
|
||||
public:
|
||||
|
||||
typeinfo( char const * name, void (*lib_id)() ): name_( name ), lib_id_( lib_id )
|
||||
{
|
||||
}
|
||||
|
||||
bool operator==( typeinfo const& rhs ) const
|
||||
{
|
||||
#if ( defined(_WIN32) || defined(__CYGWIN__) ) && ( defined(__GNUC__) || defined(__clang__) ) && !defined(BOOST_DISABLE_CURRENT_FUNCTION)
|
||||
|
||||
return lib_id_ == rhs.lib_id_? this == &rhs: std::strcmp( name_, rhs.name_ ) == 0;
|
||||
|
||||
#else
|
||||
|
||||
return this == &rhs;
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
bool operator!=( typeinfo const& rhs ) const
|
||||
{
|
||||
return !( *this == rhs );
|
||||
}
|
||||
|
||||
bool before( typeinfo const& rhs ) const
|
||||
{
|
||||
#if ( defined(_WIN32) || defined(__CYGWIN__) ) && ( defined(__GNUC__) || defined(__clang__) ) && !defined(BOOST_DISABLE_CURRENT_FUNCTION)
|
||||
|
||||
return lib_id_ == rhs.lib_id_? std::less< typeinfo const* >()( this, &rhs ): std::strcmp( name_, rhs.name_ ) < 0;
|
||||
|
||||
#else
|
||||
|
||||
return std::less< typeinfo const* >()( this, &rhs );
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
char const* name() const
|
||||
{
|
||||
return name_;
|
||||
}
|
||||
};
|
||||
|
||||
inline char const * demangled_name( core::typeinfo const & ti )
|
||||
{
|
||||
return ti.name();
|
||||
}
|
||||
|
||||
} // namespace core
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
template<class T> struct BOOST_SYMBOL_VISIBLE core_typeid_
|
||||
{
|
||||
static boost::core::typeinfo ti_;
|
||||
|
||||
static char const * name()
|
||||
{
|
||||
return BOOST_CURRENT_FUNCTION;
|
||||
}
|
||||
};
|
||||
|
||||
BOOST_SYMBOL_VISIBLE inline void core_typeid_lib_id()
|
||||
{
|
||||
}
|
||||
|
||||
template<class T> boost::core::typeinfo core_typeid_< T >::ti_( core_typeid_< T >::name(), &core_typeid_lib_id );
|
||||
|
||||
template<class T> struct core_typeid_< T & >: core_typeid_< T >
|
||||
{
|
||||
};
|
||||
|
||||
template<class T> struct core_typeid_< T const >: core_typeid_< T >
|
||||
{
|
||||
};
|
||||
|
||||
template<class T> struct core_typeid_< T volatile >: core_typeid_< T >
|
||||
{
|
||||
};
|
||||
|
||||
template<class T> struct core_typeid_< T const volatile >: core_typeid_< T >
|
||||
{
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#define BOOST_CORE_TYPEID(T) (boost::detail::core_typeid_<T>::ti_)
|
||||
|
||||
#else
|
||||
|
||||
#include <boost/core/demangle.hpp>
|
||||
#include <typeinfo>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
namespace core
|
||||
{
|
||||
|
||||
#if defined( BOOST_NO_STD_TYPEINFO )
|
||||
|
||||
typedef ::type_info typeinfo;
|
||||
|
||||
#else
|
||||
|
||||
typedef std::type_info typeinfo;
|
||||
|
||||
#endif
|
||||
|
||||
inline std::string demangled_name( core::typeinfo const & ti )
|
||||
{
|
||||
return core::demangle( ti.name() );
|
||||
}
|
||||
|
||||
} // namespace core
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#define BOOST_CORE_TYPEID(T) typeid(T)
|
||||
|
||||
#endif
|
||||
|
||||
#endif // #ifndef BOOST_CORE_TYPEINFO_HPP_INCLUDED
|
||||
@ -1,155 +0,0 @@
|
||||
/*
|
||||
* Copyright Andrey Semashev 2018 - 2020.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* https://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
/*!
|
||||
* \file uncaught_exceptions.hpp
|
||||
* \author Andrey Semashev
|
||||
* \date 2018-11-10
|
||||
*
|
||||
* \brief This header provides an `uncaught_exceptions` function implementation, which was introduced in C++17.
|
||||
*
|
||||
* The code in this file is based on the implementation by Evgeny Panasyuk:
|
||||
*
|
||||
* https://github.com/panaseleus/stack_unwinding/blob/master/boost/exception/uncaught_exception_count.hpp
|
||||
*/
|
||||
|
||||
#ifndef BOOST_CORE_UNCAUGHT_EXCEPTIONS_HPP_INCLUDED_
|
||||
#define BOOST_CORE_UNCAUGHT_EXCEPTIONS_HPP_INCLUDED_
|
||||
|
||||
#include <exception>
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#if defined(BOOST_HAS_PRAGMA_ONCE)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if (defined(__cpp_lib_uncaught_exceptions) && __cpp_lib_uncaught_exceptions >= 201411)
|
||||
#if defined(__APPLE__)
|
||||
#include <Availability.h>
|
||||
// Apple systems only support std::uncaught_exceptions starting with specific versions:
|
||||
// - Mac OS >= 10.12
|
||||
// - iOS >= 10.0
|
||||
// - tvOS >= 10.0
|
||||
// - watchOS >= 3.0
|
||||
// https://github.com/boostorg/core/issues/80
|
||||
#if (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200) || \
|
||||
(defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000)
|
||||
#define BOOST_CORE_HAS_UNCAUGHT_EXCEPTIONS
|
||||
#endif
|
||||
#else
|
||||
#define BOOST_CORE_HAS_UNCAUGHT_EXCEPTIONS
|
||||
#endif // defined(__APPLE__)
|
||||
// Visual Studio 14.0 supports N4152 std::uncaught_exceptions() but doesn't define __cpp_lib_uncaught_exceptions
|
||||
#elif (defined(_MSC_VER) && _MSC_VER >= 1900)
|
||||
#define BOOST_CORE_HAS_UNCAUGHT_EXCEPTIONS
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_CORE_HAS_UNCAUGHT_EXCEPTIONS)
|
||||
|
||||
// cxxabi.h availability macro
|
||||
#if defined(__has_include) && (!defined(BOOST_GCC) || (__GNUC__ >= 5))
|
||||
# if __has_include(<cxxabi.h>)
|
||||
# define BOOST_CORE_HAS_CXXABI_H
|
||||
# endif
|
||||
#elif defined(__GLIBCXX__) || defined(__GLIBCPP__)
|
||||
# define BOOST_CORE_HAS_CXXABI_H
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_CORE_HAS_CXXABI_H)
|
||||
// MinGW GCC 4.4 seem to not work the same way the newer GCC versions do. As a result, __cxa_get_globals based implementation will always return 0.
|
||||
// Just disable it for now and fall back to std::uncaught_exception().
|
||||
// On AIX, xlclang++ does have cxxabi.h but doesn't have __cxa_get_globals (https://github.com/boostorg/core/issues/78).
|
||||
#if !( \
|
||||
(defined(__MINGW32__) && (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) < 405)) || \
|
||||
defined(__ibmxl__) \
|
||||
)
|
||||
#include <cxxabi.h>
|
||||
#include <cstring>
|
||||
#define BOOST_CORE_HAS_CXA_GET_GLOBALS
|
||||
// At least on MinGW and Linux, only GCC since 4.7 declares __cxa_get_globals() in cxxabi.h. Older versions of GCC do not expose this function but it's there.
|
||||
// On OpenBSD, it seems, the declaration is also missing.
|
||||
// Note that at least on FreeBSD 11, cxxabi.h declares __cxa_get_globals with a different exception specification, so we can't declare the function unconditionally.
|
||||
// On Linux with clang and libc++ and on OS X, there is a version of cxxabi.h from libc++abi that doesn't declare __cxa_get_globals, but provides __cxa_uncaught_exceptions.
|
||||
// The function only appeared in version _LIBCPPABI_VERSION >= 1002 of the library. Unfortunately, there are linking errors about undefined reference to __cxa_uncaught_exceptions
|
||||
// on Ubuntu Trusty and OS X, so we avoid using it and forward-declare __cxa_get_globals instead.
|
||||
// On QNX SDP 7.0 (QCC 5.4.0), there are multiple cxxabi.h, one from glibcxx from gcc and another from libc++abi from LLVM. Which one is included will be determined by the qcc
|
||||
// command line arguments (-V and/or -Y; http://www.qnx.com/developers/docs/7.0.0/#com.qnx.doc.neutrino.utilities/topic/q/qcc.html). The LLVM libc++abi is missing the declaration
|
||||
// of __cxa_get_globals but it is also patched by QNX developers to not define _LIBCPPABI_VERSION. Older QNX SDP versions, up to and including 6.6, don't provide LLVM and libc++abi.
|
||||
// See https://github.com/boostorg/core/issues/59.
|
||||
#if !defined(__FreeBSD__) && \
|
||||
( \
|
||||
(defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) < 407) || \
|
||||
defined(__OpenBSD__) || \
|
||||
(defined(__QNXNTO__) && !defined(__GLIBCXX__) && !defined(__GLIBCPP__)) || \
|
||||
defined(_LIBCPPABI_VERSION) \
|
||||
)
|
||||
namespace __cxxabiv1 {
|
||||
struct __cxa_eh_globals;
|
||||
#if defined(__OpenBSD__)
|
||||
extern "C" __cxa_eh_globals* __cxa_get_globals();
|
||||
#else
|
||||
extern "C" __cxa_eh_globals* __cxa_get_globals() BOOST_NOEXCEPT_OR_NOTHROW __attribute__((__const__));
|
||||
#endif
|
||||
} // namespace __cxxabiv1
|
||||
#endif
|
||||
#endif
|
||||
#endif // defined(BOOST_CORE_HAS_CXXABI_H)
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER >= 1400
|
||||
#include <cstring>
|
||||
#define BOOST_CORE_HAS_GETPTD
|
||||
namespace boost {
|
||||
namespace core {
|
||||
namespace detail {
|
||||
extern "C" void* _getptd();
|
||||
} // namespace detail
|
||||
} // namespace core
|
||||
} // namespace boost
|
||||
#endif // defined(_MSC_VER) && _MSC_VER >= 1400
|
||||
|
||||
#endif // !defined(BOOST_CORE_HAS_UNCAUGHT_EXCEPTIONS)
|
||||
|
||||
#if !defined(BOOST_CORE_HAS_UNCAUGHT_EXCEPTIONS) && !defined(BOOST_CORE_HAS_CXA_GET_GLOBALS) && !defined(BOOST_CORE_HAS_GETPTD)
|
||||
//! This macro is defined when `uncaught_exceptions` is not guaranteed to return values greater than 1 if multiple exceptions are pending
|
||||
#define BOOST_CORE_UNCAUGHT_EXCEPTIONS_EMULATED
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace core {
|
||||
|
||||
//! Returns the number of currently pending exceptions
|
||||
inline unsigned int uncaught_exceptions() BOOST_NOEXCEPT
|
||||
{
|
||||
#if defined(BOOST_CORE_HAS_UNCAUGHT_EXCEPTIONS)
|
||||
// C++17 implementation
|
||||
return static_cast< unsigned int >(std::uncaught_exceptions());
|
||||
#elif defined(BOOST_CORE_HAS_CXA_GET_GLOBALS)
|
||||
// Tested on {clang 3.2,GCC 3.5.6,GCC 4.1.2,GCC 4.4.6,GCC 4.4.7}x{x32,x64}
|
||||
unsigned int count;
|
||||
std::memcpy(&count, reinterpret_cast< const unsigned char* >(::abi::__cxa_get_globals()) + sizeof(void*), sizeof(count)); // __cxa_eh_globals::uncaughtExceptions, x32 offset - 0x4, x64 - 0x8
|
||||
return count;
|
||||
#elif defined(BOOST_CORE_HAS_GETPTD)
|
||||
// MSVC specific. Tested on {MSVC2005SP1,MSVC2008SP1,MSVC2010SP1,MSVC2012}x{x32,x64}.
|
||||
unsigned int count;
|
||||
std::memcpy(&count, static_cast< const unsigned char* >(boost::core::detail::_getptd()) + (sizeof(void*) == 8u ? 0x100 : 0x90), sizeof(count)); // _tiddata::_ProcessingThrow, x32 offset - 0x90, x64 - 0x100
|
||||
return count;
|
||||
#else
|
||||
// Portable C++03 implementation. Does not allow to detect multiple nested exceptions.
|
||||
return static_cast< unsigned int >(std::uncaught_exception());
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace core
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#undef BOOST_CORE_HAS_CXXABI_H
|
||||
#undef BOOST_CORE_HAS_CXA_GET_GLOBALS
|
||||
#undef BOOST_CORE_HAS_UNCAUGHT_EXCEPTIONS
|
||||
#undef BOOST_CORE_HAS_GETPTD
|
||||
|
||||
#endif // BOOST_CORE_UNCAUGHT_EXCEPTIONS_HPP_INCLUDED_
|
||||
@ -1,79 +0,0 @@
|
||||
// underlying_type.hpp ---------------------------------------------------------//
|
||||
|
||||
// Copyright Beman Dawes, 2009
|
||||
// Copyright (C) 2011-2012 Vicente J. Botet Escriba
|
||||
// Copyright (C) 2012 Anthony Williams
|
||||
// Copyright (C) 2014 Andrey Semashev
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#ifndef BOOST_CORE_UNDERLYING_TYPE_HPP
|
||||
#define BOOST_CORE_UNDERLYING_TYPE_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
// GCC 4.7 and later seem to provide std::underlying_type
|
||||
#if !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS) || (defined(BOOST_GCC) && BOOST_GCC >= 40700 && defined(__GXX_EXPERIMENTAL_CXX0X__))
|
||||
#include <type_traits>
|
||||
#define BOOST_DETAIL_HAS_STD_UNDERLYING_TYPE
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace detail {
|
||||
|
||||
template< typename EnumType, typename Void = void >
|
||||
struct underlying_type_impl;
|
||||
|
||||
#if defined(BOOST_NO_CXX11_SCOPED_ENUMS)
|
||||
|
||||
// Support for boost/core/scoped_enum.hpp
|
||||
template< typename EnumType >
|
||||
struct underlying_type_impl< EnumType, typename EnumType::is_boost_scoped_enum_tag >
|
||||
{
|
||||
/**
|
||||
* The member typedef type names the underlying type of EnumType. It is EnumType::underlying_type when the EnumType is an emulated scoped enum,
|
||||
*/
|
||||
typedef typename EnumType::underlying_type type;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_DETAIL_HAS_STD_UNDERLYING_TYPE)
|
||||
|
||||
template< typename EnumType, typename Void >
|
||||
struct underlying_type_impl
|
||||
{
|
||||
typedef typename std::underlying_type< EnumType >::type type;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace detail
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_SCOPED_ENUMS) && !defined(BOOST_DETAIL_HAS_STD_UNDERLYING_TYPE)
|
||||
#define BOOST_NO_UNDERLYING_TYPE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Meta-function to get the underlying type of a scoped enum.
|
||||
*
|
||||
* Requires EnumType must be an enum type or the emulation of a scoped enum.
|
||||
* If BOOST_NO_UNDERLYING_TYPE is defined, the implementation will not be able
|
||||
* to deduce the underlying type of enums. The user is expected to specialize
|
||||
* this trait in this case.
|
||||
*/
|
||||
template< typename EnumType >
|
||||
struct underlying_type :
|
||||
public detail::underlying_type_impl< EnumType >
|
||||
{
|
||||
};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_CORE_UNDERLYING_TYPE_HPP
|
||||
@ -1,17 +0,0 @@
|
||||
/*
|
||||
Copyright 2019 Glen Joseph Fernandes
|
||||
(glenjofe@gmail.com)
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
#ifndef BOOST_CORE_USE_DEFAULT_HPP
|
||||
#define BOOST_CORE_USE_DEFAULT_HPP
|
||||
|
||||
namespace boost {
|
||||
|
||||
struct use_default { };
|
||||
|
||||
} /* boost */
|
||||
|
||||
#endif
|
||||
2306
Slang/boost/crc.hpp
2306
Slang/boost/crc.hpp
File diff suppressed because it is too large
Load Diff
@ -1,43 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 1998-2002
|
||||
* John Maddock
|
||||
*
|
||||
* Use, modification and distribution are subject to the
|
||||
* Boost Software License, Version 1.0. (See accompanying file
|
||||
* LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org/libs/regex for most recent version.
|
||||
* FILE cregex.cpp
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: Declares POSIX API functions
|
||||
* + boost::RegEx high level wrapper.
|
||||
*/
|
||||
|
||||
#ifndef BOOST_RE_CREGEX_HPP
|
||||
#define BOOST_RE_CREGEX_HPP
|
||||
|
||||
#ifndef BOOST_REGEX_CONFIG_HPP
|
||||
#include <boost/regex/config.hpp>
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_REGEX_CXX03
|
||||
#include <boost/regex/v4/cregex.hpp>
|
||||
#else
|
||||
#include <boost/regex/v5/cregex.hpp>
|
||||
#endif
|
||||
|
||||
#endif /* include guard */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,58 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright Christopher Kormanyos 2014.
|
||||
// Copyright John Maddock 2014.
|
||||
// Copyright Paul Bristow 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)
|
||||
//
|
||||
|
||||
// <boost/cstdfloat.hpp> implements floating-point typedefs having
|
||||
// specified widths, as described in N3626 (proposed for C++14).
|
||||
// See: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3626.pdf
|
||||
|
||||
#ifndef BOOST_MATH_CSTDFLOAT_2014_01_09_HPP_
|
||||
#define BOOST_MATH_CSTDFLOAT_2014_01_09_HPP_
|
||||
|
||||
// Include the floating-point type definitions.
|
||||
#include <boost/math/cstdfloat/cstdfloat_types.hpp>
|
||||
|
||||
// Support a specialization of std::numeric_limits<> for the wrapped quadmath library (if available).
|
||||
#if !defined(BOOST_CSTDFLOAT_NO_LIBQUADMATH_LIMITS)
|
||||
#include <boost/math/cstdfloat/cstdfloat_limits.hpp>
|
||||
#endif
|
||||
|
||||
// Support <cmath> functions for the wrapped quadmath library (if available).
|
||||
#if !defined(BOOST_CSTDFLOAT_NO_LIBQUADMATH_CMATH)
|
||||
#include <boost/math/cstdfloat/cstdfloat_cmath.hpp>
|
||||
#endif
|
||||
|
||||
// Support I/O stream operations for the wrapped quadmath library (if available).
|
||||
#if !defined(BOOST_CSTDFLOAT_NO_LIBQUADMATH_IOSTREAM)
|
||||
#if defined(BOOST_CSTDFLOAT_NO_LIBQUADMATH_CMATH)
|
||||
#error You can not use <boost/math/cstdfloat/cstdfloat_iostream.hpp> with BOOST_CSTDFLOAT_NO_LIBQUADMATH_CMATH defined.
|
||||
#endif
|
||||
#include <boost/math/cstdfloat/cstdfloat_iostream.hpp>
|
||||
#endif
|
||||
|
||||
// Support a specialization of std::complex<> for the wrapped quadmath library (if available).
|
||||
#if !defined(BOOST_CSTDFLOAT_NO_LIBQUADMATH_COMPLEX)
|
||||
#if defined(BOOST_CSTDFLOAT_NO_LIBQUADMATH_LIMITS)
|
||||
#error You can not use <boost/math/cstdfloat/cstdfloat_complex.hpp> with BOOST_CSTDFLOAT_NO_LIBQUADMATH_LIMITS defined.
|
||||
#endif
|
||||
#if defined(BOOST_CSTDFLOAT_NO_LIBQUADMATH_CMATH)
|
||||
#error You can not use <boost/math/cstdfloat/cstdfloat_complex.hpp> with BOOST_CSTDFLOAT_NO_LIBQUADMATH_CMATH defined.
|
||||
#endif
|
||||
#if defined(BOOST_CSTDFLOAT_NO_LIBQUADMATH_IOSTREAM)
|
||||
#error You can not use <boost/math/cstdfloat/cstdfloat_complex.hpp> with BOOST_CSTDFLOAT_NO_LIBQUADMATH_IOSTREAM defined.
|
||||
#endif
|
||||
#include <boost/math/cstdfloat/cstdfloat_complex.hpp>
|
||||
#endif
|
||||
|
||||
|
||||
// Undefine BOOST_NO_FLOAT128_T because this constant is not meant for public use.
|
||||
#if defined(BOOST_CSTDFLOAT_HAS_INTERNAL_FLOAT128_T)
|
||||
#undef BOOST_CSTDFLOAT_HAS_INTERNAL_FLOAT128_T
|
||||
#endif
|
||||
|
||||
#endif // BOOST_MATH_CSTDFLOAT_2014_01_09_HPP_
|
||||
@ -1,556 +0,0 @@
|
||||
// boost cstdint.hpp header file ------------------------------------------//
|
||||
|
||||
// (C) Copyright Beman Dawes 1999.
|
||||
// (C) Copyright Jens Mauer 2001
|
||||
// (C) Copyright John Maddock 2001
|
||||
// Distributed under the Boost
|
||||
// Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See http://www.boost.org/libs/integer for documentation.
|
||||
|
||||
// Revision History
|
||||
// 31 Oct 01 use BOOST_HAS_LONG_LONG to check for "long long" (Jens M.)
|
||||
// 16 Apr 01 check LONGLONG_MAX when looking for "long long" (Jens Maurer)
|
||||
// 23 Jan 01 prefer "long" over "int" for int32_t and intmax_t (Jens Maurer)
|
||||
// 12 Nov 00 Merged <boost/stdint.h> (Jens Maurer)
|
||||
// 23 Sep 00 Added INTXX_C macro support (John Maddock).
|
||||
// 22 Sep 00 Better 64-bit support (John Maddock)
|
||||
// 29 Jun 00 Reimplement to avoid including stdint.h within namespace boost
|
||||
// 8 Aug 99 Initial version (Beman Dawes)
|
||||
|
||||
|
||||
#ifndef BOOST_CSTDINT_HPP
|
||||
#define BOOST_CSTDINT_HPP
|
||||
|
||||
//
|
||||
// Since we always define the INT#_C macros as per C++0x,
|
||||
// define __STDC_CONSTANT_MACROS so that <stdint.h> does the right
|
||||
// thing if possible, and so that the user knows that the macros
|
||||
// are actually defined as per C99.
|
||||
//
|
||||
#ifndef __STDC_CONSTANT_MACROS
|
||||
# define __STDC_CONSTANT_MACROS
|
||||
#endif
|
||||
|
||||
#include <boost/config.hpp>
|
||||
//
|
||||
// For the following code we get several warnings along the lines of:
|
||||
//
|
||||
// boost/cstdint.hpp:428:35: error: use of C99 long long integer constant
|
||||
//
|
||||
// So we declare this a system header to suppress these warnings.
|
||||
// See also https://github.com/boostorg/config/issues/190
|
||||
//
|
||||
#if defined(__GNUC__) && (__GNUC__ >= 4)
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
|
||||
//
|
||||
// Note that GLIBC is a bit inconsistent about whether int64_t is defined or not
|
||||
// depending upon what headers happen to have been included first...
|
||||
// so we disable use of stdint.h when GLIBC does not define __GLIBC_HAVE_LONG_LONG.
|
||||
// See https://svn.boost.org/trac/boost/ticket/3548 and http://sources.redhat.com/bugzilla/show_bug.cgi?id=10990
|
||||
//
|
||||
#if defined(BOOST_HAS_STDINT_H) \
|
||||
&& (!defined(__GLIBC__) \
|
||||
|| defined(__GLIBC_HAVE_LONG_LONG) \
|
||||
|| (defined(__GLIBC__) && ((__GLIBC__ > 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 17)))))
|
||||
|
||||
// The following #include is an implementation artifact; not part of interface.
|
||||
# ifdef __hpux
|
||||
// HP-UX has a vaguely nice <stdint.h> in a non-standard location
|
||||
# include <inttypes.h>
|
||||
# ifdef __STDC_32_MODE__
|
||||
// this is triggered with GCC, because it defines __cplusplus < 199707L
|
||||
# define BOOST_NO_INT64_T
|
||||
# endif
|
||||
# elif defined(__FreeBSD__) || defined(__IBMCPP__) || defined(_AIX)
|
||||
# include <inttypes.h>
|
||||
# else
|
||||
# include <stdint.h>
|
||||
|
||||
// There is a bug in Cygwin two _C macros
|
||||
# if defined(INTMAX_C) && defined(__CYGWIN__)
|
||||
# undef INTMAX_C
|
||||
# undef UINTMAX_C
|
||||
# define INTMAX_C(c) c##LL
|
||||
# define UINTMAX_C(c) c##ULL
|
||||
# endif
|
||||
|
||||
# endif
|
||||
|
||||
#if defined(__QNX__) && defined(__EXT_QNX)
|
||||
|
||||
// QNX (Dinkumware stdlib) defines these as non-standard names.
|
||||
// Reflect to the standard names.
|
||||
|
||||
typedef ::intleast8_t int_least8_t;
|
||||
typedef ::intfast8_t int_fast8_t;
|
||||
typedef ::uintleast8_t uint_least8_t;
|
||||
typedef ::uintfast8_t uint_fast8_t;
|
||||
|
||||
typedef ::intleast16_t int_least16_t;
|
||||
typedef ::intfast16_t int_fast16_t;
|
||||
typedef ::uintleast16_t uint_least16_t;
|
||||
typedef ::uintfast16_t uint_fast16_t;
|
||||
|
||||
typedef ::intleast32_t int_least32_t;
|
||||
typedef ::intfast32_t int_fast32_t;
|
||||
typedef ::uintleast32_t uint_least32_t;
|
||||
typedef ::uintfast32_t uint_fast32_t;
|
||||
|
||||
# ifndef BOOST_NO_INT64_T
|
||||
|
||||
typedef ::intleast64_t int_least64_t;
|
||||
typedef ::intfast64_t int_fast64_t;
|
||||
typedef ::uintleast64_t uint_least64_t;
|
||||
typedef ::uintfast64_t uint_fast64_t;
|
||||
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
using ::int8_t;
|
||||
using ::int_least8_t;
|
||||
using ::int_fast8_t;
|
||||
using ::uint8_t;
|
||||
using ::uint_least8_t;
|
||||
using ::uint_fast8_t;
|
||||
|
||||
using ::int16_t;
|
||||
using ::int_least16_t;
|
||||
using ::int_fast16_t;
|
||||
using ::uint16_t;
|
||||
using ::uint_least16_t;
|
||||
using ::uint_fast16_t;
|
||||
|
||||
using ::int32_t;
|
||||
using ::int_least32_t;
|
||||
using ::int_fast32_t;
|
||||
using ::uint32_t;
|
||||
using ::uint_least32_t;
|
||||
using ::uint_fast32_t;
|
||||
|
||||
# ifndef BOOST_NO_INT64_T
|
||||
|
||||
using ::int64_t;
|
||||
using ::int_least64_t;
|
||||
using ::int_fast64_t;
|
||||
using ::uint64_t;
|
||||
using ::uint_least64_t;
|
||||
using ::uint_fast64_t;
|
||||
|
||||
# endif
|
||||
|
||||
using ::intmax_t;
|
||||
using ::uintmax_t;
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#elif defined(__FreeBSD__) && (__FreeBSD__ <= 4) || defined(__osf__) || defined(__VMS) || defined(__SOLARIS9__) || defined(__NetBSD__)
|
||||
// FreeBSD and Tru64 have an <inttypes.h> that contains much of what we need.
|
||||
# include <inttypes.h>
|
||||
|
||||
namespace boost {
|
||||
|
||||
using ::int8_t;
|
||||
typedef int8_t int_least8_t;
|
||||
typedef int8_t int_fast8_t;
|
||||
using ::uint8_t;
|
||||
typedef uint8_t uint_least8_t;
|
||||
typedef uint8_t uint_fast8_t;
|
||||
|
||||
using ::int16_t;
|
||||
typedef int16_t int_least16_t;
|
||||
typedef int16_t int_fast16_t;
|
||||
using ::uint16_t;
|
||||
typedef uint16_t uint_least16_t;
|
||||
typedef uint16_t uint_fast16_t;
|
||||
|
||||
using ::int32_t;
|
||||
typedef int32_t int_least32_t;
|
||||
typedef int32_t int_fast32_t;
|
||||
using ::uint32_t;
|
||||
typedef uint32_t uint_least32_t;
|
||||
typedef uint32_t uint_fast32_t;
|
||||
|
||||
# ifndef BOOST_NO_INT64_T
|
||||
|
||||
using ::int64_t;
|
||||
typedef int64_t int_least64_t;
|
||||
typedef int64_t int_fast64_t;
|
||||
using ::uint64_t;
|
||||
typedef uint64_t uint_least64_t;
|
||||
typedef uint64_t uint_fast64_t;
|
||||
|
||||
typedef int64_t intmax_t;
|
||||
typedef uint64_t uintmax_t;
|
||||
|
||||
# else
|
||||
|
||||
typedef int32_t intmax_t;
|
||||
typedef uint32_t uintmax_t;
|
||||
|
||||
# endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#else // BOOST_HAS_STDINT_H
|
||||
|
||||
# include <boost/limits.hpp> // implementation artifact; not part of interface
|
||||
# include <limits.h> // needed for limits macros
|
||||
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
// These are fairly safe guesses for some 16-bit, and most 32-bit and 64-bit
|
||||
// platforms. For other systems, they will have to be hand tailored.
|
||||
//
|
||||
// Because the fast types are assumed to be the same as the undecorated types,
|
||||
// it may be possible to hand tailor a more efficient implementation. Such
|
||||
// an optimization may be illusionary; on the Intel x86-family 386 on, for
|
||||
// example, byte arithmetic and load/stores are as fast as "int" sized ones.
|
||||
|
||||
// 8-bit types ------------------------------------------------------------//
|
||||
|
||||
# if UCHAR_MAX == 0xff
|
||||
typedef signed char int8_t;
|
||||
typedef signed char int_least8_t;
|
||||
typedef signed char int_fast8_t;
|
||||
typedef unsigned char uint8_t;
|
||||
typedef unsigned char uint_least8_t;
|
||||
typedef unsigned char uint_fast8_t;
|
||||
# else
|
||||
# error defaults not correct; you must hand modify boost/cstdint.hpp
|
||||
# endif
|
||||
|
||||
// 16-bit types -----------------------------------------------------------//
|
||||
|
||||
# if USHRT_MAX == 0xffff
|
||||
# if defined(__crayx1)
|
||||
// The Cray X1 has a 16-bit short, however it is not recommend
|
||||
// for use in performance critical code.
|
||||
typedef short int16_t;
|
||||
typedef short int_least16_t;
|
||||
typedef int int_fast16_t;
|
||||
typedef unsigned short uint16_t;
|
||||
typedef unsigned short uint_least16_t;
|
||||
typedef unsigned int uint_fast16_t;
|
||||
# else
|
||||
typedef short int16_t;
|
||||
typedef short int_least16_t;
|
||||
typedef short int_fast16_t;
|
||||
typedef unsigned short uint16_t;
|
||||
typedef unsigned short uint_least16_t;
|
||||
typedef unsigned short uint_fast16_t;
|
||||
# endif
|
||||
# elif (USHRT_MAX == 0xffffffff) && defined(__MTA__)
|
||||
// On MTA / XMT short is 32 bits unless the -short16 compiler flag is specified
|
||||
// MTA / XMT does support the following non-standard integer types
|
||||
typedef __short16 int16_t;
|
||||
typedef __short16 int_least16_t;
|
||||
typedef __short16 int_fast16_t;
|
||||
typedef unsigned __short16 uint16_t;
|
||||
typedef unsigned __short16 uint_least16_t;
|
||||
typedef unsigned __short16 uint_fast16_t;
|
||||
# elif (USHRT_MAX == 0xffffffff) && defined(CRAY)
|
||||
// no 16-bit types on Cray:
|
||||
typedef short int_least16_t;
|
||||
typedef short int_fast16_t;
|
||||
typedef unsigned short uint_least16_t;
|
||||
typedef unsigned short uint_fast16_t;
|
||||
# else
|
||||
# error defaults not correct; you must hand modify boost/cstdint.hpp
|
||||
# endif
|
||||
|
||||
// 32-bit types -----------------------------------------------------------//
|
||||
|
||||
# if UINT_MAX == 0xffffffff
|
||||
typedef int int32_t;
|
||||
typedef int int_least32_t;
|
||||
typedef int int_fast32_t;
|
||||
typedef unsigned int uint32_t;
|
||||
typedef unsigned int uint_least32_t;
|
||||
typedef unsigned int uint_fast32_t;
|
||||
# elif (USHRT_MAX == 0xffffffff)
|
||||
typedef short int32_t;
|
||||
typedef short int_least32_t;
|
||||
typedef short int_fast32_t;
|
||||
typedef unsigned short uint32_t;
|
||||
typedef unsigned short uint_least32_t;
|
||||
typedef unsigned short uint_fast32_t;
|
||||
# elif ULONG_MAX == 0xffffffff
|
||||
typedef long int32_t;
|
||||
typedef long int_least32_t;
|
||||
typedef long int_fast32_t;
|
||||
typedef unsigned long uint32_t;
|
||||
typedef unsigned long uint_least32_t;
|
||||
typedef unsigned long uint_fast32_t;
|
||||
# elif (UINT_MAX == 0xffffffffffffffff) && defined(__MTA__)
|
||||
// Integers are 64 bits on the MTA / XMT
|
||||
typedef __int32 int32_t;
|
||||
typedef __int32 int_least32_t;
|
||||
typedef __int32 int_fast32_t;
|
||||
typedef unsigned __int32 uint32_t;
|
||||
typedef unsigned __int32 uint_least32_t;
|
||||
typedef unsigned __int32 uint_fast32_t;
|
||||
# else
|
||||
# error defaults not correct; you must hand modify boost/cstdint.hpp
|
||||
# endif
|
||||
|
||||
// 64-bit types + intmax_t and uintmax_t ----------------------------------//
|
||||
|
||||
# if defined(BOOST_HAS_LONG_LONG) && \
|
||||
!defined(BOOST_MSVC) && !defined(BOOST_BORLANDC) && \
|
||||
(!defined(__GLIBCPP__) || defined(_GLIBCPP_USE_LONG_LONG)) && \
|
||||
(defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX))
|
||||
# if defined(__hpux)
|
||||
// HP-UX's value of ULONG_LONG_MAX is unusable in preprocessor expressions
|
||||
# elif (defined(ULLONG_MAX) && ULLONG_MAX == 18446744073709551615ULL) || (defined(ULONG_LONG_MAX) && ULONG_LONG_MAX == 18446744073709551615ULL) || (defined(ULONGLONG_MAX) && ULONGLONG_MAX == 18446744073709551615ULL)
|
||||
// 2**64 - 1
|
||||
# else
|
||||
# error defaults not correct; you must hand modify boost/cstdint.hpp
|
||||
# endif
|
||||
|
||||
typedef ::boost::long_long_type intmax_t;
|
||||
typedef ::boost::ulong_long_type uintmax_t;
|
||||
typedef ::boost::long_long_type int64_t;
|
||||
typedef ::boost::long_long_type int_least64_t;
|
||||
typedef ::boost::long_long_type int_fast64_t;
|
||||
typedef ::boost::ulong_long_type uint64_t;
|
||||
typedef ::boost::ulong_long_type uint_least64_t;
|
||||
typedef ::boost::ulong_long_type uint_fast64_t;
|
||||
|
||||
# elif ULONG_MAX != 0xffffffff
|
||||
|
||||
# if ULONG_MAX == 18446744073709551615 // 2**64 - 1
|
||||
typedef long intmax_t;
|
||||
typedef unsigned long uintmax_t;
|
||||
typedef long int64_t;
|
||||
typedef long int_least64_t;
|
||||
typedef long int_fast64_t;
|
||||
typedef unsigned long uint64_t;
|
||||
typedef unsigned long uint_least64_t;
|
||||
typedef unsigned long uint_fast64_t;
|
||||
# else
|
||||
# error defaults not correct; you must hand modify boost/cstdint.hpp
|
||||
# endif
|
||||
# elif defined(__GNUC__) && defined(BOOST_HAS_LONG_LONG)
|
||||
__extension__ typedef long long intmax_t;
|
||||
__extension__ typedef unsigned long long uintmax_t;
|
||||
__extension__ typedef long long int64_t;
|
||||
__extension__ typedef long long int_least64_t;
|
||||
__extension__ typedef long long int_fast64_t;
|
||||
__extension__ typedef unsigned long long uint64_t;
|
||||
__extension__ typedef unsigned long long uint_least64_t;
|
||||
__extension__ typedef unsigned long long uint_fast64_t;
|
||||
# elif defined(BOOST_HAS_MS_INT64)
|
||||
//
|
||||
// we have Borland/Intel/Microsoft __int64:
|
||||
//
|
||||
typedef __int64 intmax_t;
|
||||
typedef unsigned __int64 uintmax_t;
|
||||
typedef __int64 int64_t;
|
||||
typedef __int64 int_least64_t;
|
||||
typedef __int64 int_fast64_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
typedef unsigned __int64 uint_least64_t;
|
||||
typedef unsigned __int64 uint_fast64_t;
|
||||
# else // assume no 64-bit integers
|
||||
# define BOOST_NO_INT64_T
|
||||
typedef int32_t intmax_t;
|
||||
typedef uint32_t uintmax_t;
|
||||
# endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
|
||||
#endif // BOOST_HAS_STDINT_H
|
||||
|
||||
// intptr_t/uintptr_t are defined separately because they are optional and not universally available
|
||||
#if defined(BOOST_WINDOWS) && !defined(_WIN32_WCE) && !defined(BOOST_HAS_STDINT_H)
|
||||
// Older MSVC don't have stdint.h and have intptr_t/uintptr_t defined in stddef.h
|
||||
#include <stddef.h>
|
||||
#endif
|
||||
|
||||
#if (defined(BOOST_WINDOWS) && !defined(_WIN32_WCE)) \
|
||||
|| (defined(_XOPEN_UNIX) && (_XOPEN_UNIX+0 > 0) && !defined(__UCLIBC__)) \
|
||||
|| defined(__CYGWIN__) || defined(__VXWORKS__) \
|
||||
|| defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__) \
|
||||
|| defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || (defined(sun) && !defined(BOOST_HAS_STDINT_H)) || defined(INTPTR_MAX)
|
||||
|
||||
namespace boost {
|
||||
using ::intptr_t;
|
||||
using ::uintptr_t;
|
||||
}
|
||||
#define BOOST_HAS_INTPTR_T
|
||||
|
||||
// Clang pretends to be GCC, so it'll match this condition
|
||||
#elif defined(__GNUC__) && defined(__INTPTR_TYPE__) && defined(__UINTPTR_TYPE__)
|
||||
|
||||
namespace boost {
|
||||
typedef __INTPTR_TYPE__ intptr_t;
|
||||
typedef __UINTPTR_TYPE__ uintptr_t;
|
||||
}
|
||||
#define BOOST_HAS_INTPTR_T
|
||||
|
||||
#endif
|
||||
|
||||
#endif // BOOST_CSTDINT_HPP
|
||||
|
||||
|
||||
/****************************************************
|
||||
|
||||
Macro definition section:
|
||||
|
||||
Added 23rd September 2000 (John Maddock).
|
||||
Modified 11th September 2001 to be excluded when
|
||||
BOOST_HAS_STDINT_H is defined (John Maddock).
|
||||
Modified 11th Dec 2009 to always define the
|
||||
INT#_C macros if they're not already defined (John Maddock).
|
||||
|
||||
******************************************************/
|
||||
|
||||
#if !defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) && \
|
||||
(!defined(INT8_C) || !defined(INT16_C) || !defined(INT32_C) || !defined(INT64_C))
|
||||
//
|
||||
// Undef the macros as a precaution, since we may get here if <stdint.h> has failed
|
||||
// to define them all, see https://svn.boost.org/trac/boost/ticket/12786
|
||||
//
|
||||
#undef INT8_C
|
||||
#undef INT16_C
|
||||
#undef INT32_C
|
||||
#undef INT64_C
|
||||
#undef INTMAX_C
|
||||
#undef UINT8_C
|
||||
#undef UINT16_C
|
||||
#undef UINT32_C
|
||||
#undef UINT64_C
|
||||
#undef UINTMAX_C
|
||||
|
||||
#include <limits.h>
|
||||
# define BOOST__STDC_CONSTANT_MACROS_DEFINED
|
||||
# if defined(BOOST_HAS_MS_INT64)
|
||||
//
|
||||
// Borland/Intel/Microsoft compilers have width specific suffixes:
|
||||
//
|
||||
#ifndef INT8_C
|
||||
# define INT8_C(value) value##i8
|
||||
#endif
|
||||
#ifndef INT16_C
|
||||
# define INT16_C(value) value##i16
|
||||
#endif
|
||||
#ifndef INT32_C
|
||||
# define INT32_C(value) value##i32
|
||||
#endif
|
||||
#ifndef INT64_C
|
||||
# define INT64_C(value) value##i64
|
||||
#endif
|
||||
# ifdef BOOST_BORLANDC
|
||||
// Borland bug: appending ui8 makes the type a signed char
|
||||
# define UINT8_C(value) static_cast<unsigned char>(value##u)
|
||||
# else
|
||||
# define UINT8_C(value) value##ui8
|
||||
# endif
|
||||
#ifndef UINT16_C
|
||||
# define UINT16_C(value) value##ui16
|
||||
#endif
|
||||
#ifndef UINT32_C
|
||||
# define UINT32_C(value) value##ui32
|
||||
#endif
|
||||
#ifndef UINT64_C
|
||||
# define UINT64_C(value) value##ui64
|
||||
#endif
|
||||
#ifndef INTMAX_C
|
||||
# define INTMAX_C(value) value##i64
|
||||
# define UINTMAX_C(value) value##ui64
|
||||
#endif
|
||||
|
||||
# else
|
||||
// do it the old fashioned way:
|
||||
|
||||
// 8-bit types ------------------------------------------------------------//
|
||||
|
||||
# if (UCHAR_MAX == 0xff) && !defined(INT8_C)
|
||||
# define INT8_C(value) static_cast<boost::int8_t>(value)
|
||||
# define UINT8_C(value) static_cast<boost::uint8_t>(value##u)
|
||||
# endif
|
||||
|
||||
// 16-bit types -----------------------------------------------------------//
|
||||
|
||||
# if (USHRT_MAX == 0xffff) && !defined(INT16_C)
|
||||
# define INT16_C(value) static_cast<boost::int16_t>(value)
|
||||
# define UINT16_C(value) static_cast<boost::uint16_t>(value##u)
|
||||
# endif
|
||||
|
||||
// 32-bit types -----------------------------------------------------------//
|
||||
#ifndef INT32_C
|
||||
# if (UINT_MAX == 0xffffffff)
|
||||
# define INT32_C(value) value
|
||||
# define UINT32_C(value) value##u
|
||||
# elif ULONG_MAX == 0xffffffff
|
||||
# define INT32_C(value) value##L
|
||||
# define UINT32_C(value) value##uL
|
||||
# endif
|
||||
#endif
|
||||
|
||||
// 64-bit types + intmax_t and uintmax_t ----------------------------------//
|
||||
#ifndef INT64_C
|
||||
# if defined(BOOST_HAS_LONG_LONG) && \
|
||||
(defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX) || defined(_ULLONG_MAX) || defined(_LLONG_MAX))
|
||||
|
||||
# if defined(__hpux)
|
||||
// HP-UX's value of ULONG_LONG_MAX is unusable in preprocessor expressions
|
||||
# define INT64_C(value) value##LL
|
||||
# define UINT64_C(value) value##uLL
|
||||
# elif (defined(ULLONG_MAX) && ULLONG_MAX == 18446744073709551615ULL) || \
|
||||
(defined(ULONG_LONG_MAX) && ULONG_LONG_MAX == 18446744073709551615ULL) || \
|
||||
(defined(ULONGLONG_MAX) && ULONGLONG_MAX == 18446744073709551615ULL) || \
|
||||
(defined(_ULLONG_MAX) && _ULLONG_MAX == 18446744073709551615ULL) || \
|
||||
(defined(_LLONG_MAX) && _LLONG_MAX == 9223372036854775807LL)
|
||||
|
||||
# define INT64_C(value) value##LL
|
||||
# define UINT64_C(value) value##uLL
|
||||
# else
|
||||
# error defaults not correct; you must hand modify boost/cstdint.hpp
|
||||
# endif
|
||||
# elif ULONG_MAX != 0xffffffff
|
||||
|
||||
# if ULONG_MAX == 18446744073709551615U // 2**64 - 1
|
||||
# define INT64_C(value) value##L
|
||||
# define UINT64_C(value) value##uL
|
||||
# else
|
||||
# error defaults not correct; you must hand modify boost/cstdint.hpp
|
||||
# endif
|
||||
# elif defined(BOOST_HAS_LONG_LONG)
|
||||
// Usual macros not defined, work things out for ourselves:
|
||||
# if(~0uLL == 18446744073709551615ULL)
|
||||
# define INT64_C(value) value##LL
|
||||
# define UINT64_C(value) value##uLL
|
||||
# else
|
||||
# error defaults not correct; you must hand modify boost/cstdint.hpp
|
||||
# endif
|
||||
# else
|
||||
# error defaults not correct; you must hand modify boost/cstdint.hpp
|
||||
# endif
|
||||
|
||||
# ifdef BOOST_NO_INT64_T
|
||||
# define INTMAX_C(value) INT32_C(value)
|
||||
# define UINTMAX_C(value) UINT32_C(value)
|
||||
# else
|
||||
# define INTMAX_C(value) INT64_C(value)
|
||||
# define UINTMAX_C(value) UINT64_C(value)
|
||||
# endif
|
||||
#endif
|
||||
# endif // Borland/Microsoft specific width suffixes
|
||||
|
||||
#endif // INT#_C macros.
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,41 +0,0 @@
|
||||
// boost/cstdlib.hpp header ------------------------------------------------//
|
||||
|
||||
// Copyright Beman Dawes 2001. Distributed under the Boost
|
||||
// Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See http://www.boost.org/libs/utility/cstdlib.html for documentation.
|
||||
|
||||
// Revision History
|
||||
// 26 Feb 01 Initial version (Beman Dawes)
|
||||
|
||||
#ifndef BOOST_CSTDLIB_HPP
|
||||
#define BOOST_CSTDLIB_HPP
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
// The intent is to propose the following for addition to namespace std
|
||||
// in the C++ Standard Library, and to then deprecate EXIT_SUCCESS and
|
||||
// EXIT_FAILURE. As an implementation detail, this header defines the
|
||||
// new constants in terms of EXIT_SUCCESS and EXIT_FAILURE. In a new
|
||||
// standard, the constants would be implementation-defined, although it
|
||||
// might be worthwhile to "suggest" (which a standard is allowed to do)
|
||||
// values of 0 and 1 respectively.
|
||||
|
||||
// Rationale for having multiple failure values: some environments may
|
||||
// wish to distinguish between different classes of errors.
|
||||
// Rationale for choice of values: programs often use values < 100 for
|
||||
// their own error reporting. Values > 255 are sometimes reserved for
|
||||
// system detected errors. 200/201 were suggested to minimize conflict.
|
||||
|
||||
const int exit_success = EXIT_SUCCESS; // implementation-defined value
|
||||
const int exit_failure = EXIT_FAILURE; // implementation-defined value
|
||||
const int exit_exception_failure = 200; // otherwise uncaught exception
|
||||
const int exit_test_failure = 201; // report_error or
|
||||
// report_critical_error called.
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,75 +0,0 @@
|
||||
#ifndef BOOST_CURRENT_FUNCTION_HPP_INCLUDED
|
||||
#define BOOST_CURRENT_FUNCTION_HPP_INCLUDED
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
//
|
||||
// boost/current_function.hpp - BOOST_CURRENT_FUNCTION
|
||||
//
|
||||
// Copyright 2002-2018 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
|
||||
//
|
||||
// http://www.boost.org/libs/assert
|
||||
//
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
inline void current_function_helper()
|
||||
{
|
||||
|
||||
#if defined( BOOST_DISABLE_CURRENT_FUNCTION )
|
||||
|
||||
# define BOOST_CURRENT_FUNCTION "(unknown)"
|
||||
|
||||
#elif defined(__GNUC__) || (defined(__MWERKS__) && (__MWERKS__ >= 0x3000)) || (defined(__ICC) && (__ICC >= 600)) || defined(__ghs__) || defined(__clang__)
|
||||
|
||||
# define BOOST_CURRENT_FUNCTION __PRETTY_FUNCTION__
|
||||
|
||||
#elif defined(__DMC__) && (__DMC__ >= 0x810)
|
||||
|
||||
# define BOOST_CURRENT_FUNCTION __PRETTY_FUNCTION__
|
||||
|
||||
#elif defined(__FUNCSIG__)
|
||||
|
||||
# define BOOST_CURRENT_FUNCTION __FUNCSIG__
|
||||
|
||||
#elif (defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 600)) || (defined(__IBMCPP__) && (__IBMCPP__ >= 500))
|
||||
|
||||
# define BOOST_CURRENT_FUNCTION __FUNCTION__
|
||||
|
||||
#elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x550)
|
||||
|
||||
# define BOOST_CURRENT_FUNCTION __FUNC__
|
||||
|
||||
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)
|
||||
|
||||
# define BOOST_CURRENT_FUNCTION __func__
|
||||
|
||||
#elif defined(__cplusplus) && (__cplusplus >= 201103)
|
||||
|
||||
# define BOOST_CURRENT_FUNCTION __func__
|
||||
|
||||
#else
|
||||
|
||||
# define BOOST_CURRENT_FUNCTION "(unknown)"
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_CURRENT_FUNCTION_HPP_INCLUDED
|
||||
@ -1,70 +0,0 @@
|
||||
// boost cxx11_char_types.hpp --------------------------------------------------------//
|
||||
|
||||
// Copyright Beman Dawes 2011
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
//--------------------------------------------------------------------------------------//
|
||||
// //
|
||||
// The purpose of this header is to emulate the C++11 char16_t and char32_t //
|
||||
// character and string types so that they can be used in both C++11 and C++03 //
|
||||
// programs. //
|
||||
// //
|
||||
// The emulation names use char16/char32 rather than char16_t/char32_t to avoid use //
|
||||
// of names that are keywords in C++11. //
|
||||
// //
|
||||
// The emulation names are placed in namespace boost, as is usual for Boost C++11 //
|
||||
// emulation names such as those in header <boost/cstdint.hpp>. //
|
||||
// //
|
||||
// An alternative would would have been to place the C++11 emulation names at global //
|
||||
// scope, and put the C++11 string types in namespace std. That is the approach taken //
|
||||
// by Microsoft Visual Studio 2010, but is controversion with some Boost users and //
|
||||
// developers, and runs counter to usual Boost practice. //
|
||||
// //
|
||||
// Thanks to Mathias Gaunard and others for discussions leading to the final form //
|
||||
// of these typedefs. //
|
||||
// //
|
||||
// Boost C++11 C++03 //
|
||||
// ---------------- -------------- -------------------------------- //
|
||||
// boost::char16 char16_t uint16_t //
|
||||
// boost::char32 char32_t uint32_t //
|
||||
// boost::u16string std::u16string std::basic_string<boost::char16> //
|
||||
// boost::u32string std::u32string std::basic_string<boost::char32> //
|
||||
// //
|
||||
// Uses the typedefs provided by Microsoft Visual C++ 2010 if present //
|
||||
// //
|
||||
// Thanks to Mathias Gaunard and others for discussions leading to the final form //
|
||||
// of these typedefs. //
|
||||
// //
|
||||
//--------------------------------------------------------------------------------------//
|
||||
|
||||
#if !defined(BOOST_CXX11_CHAR_TYPES_HPP)
|
||||
# define BOOST_CXX11_CHAR_TYPES_HPP
|
||||
|
||||
# include <boost/config.hpp>
|
||||
# include <boost/cstdint.hpp>
|
||||
# include <string>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
# if defined(BOOST_NO_CXX11_CHAR16_T) && (!defined(_MSC_VER) || _MSC_VER < 1600) // 1600 == VC++10
|
||||
typedef boost::uint_least16_t char16;
|
||||
typedef std::basic_string<boost::char16> u16string;
|
||||
# else
|
||||
typedef char16_t char16;
|
||||
typedef std::u16string u16string;
|
||||
# endif
|
||||
|
||||
# if defined(BOOST_NO_CXX11_CHAR32_T) && (!defined(_MSC_VER) || _MSC_VER < 1600) // 1600 == VC++10
|
||||
typedef boost::uint_least32_t char32;
|
||||
typedef std::basic_string<boost::char32> u32string;
|
||||
# else
|
||||
typedef char32_t char32;
|
||||
typedef std::u32string u32string;
|
||||
# endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // !defined(BOOST_CXX11_CHAR_TYPES_HPP)
|
||||
@ -1,17 +0,0 @@
|
||||
#ifndef BOOST_DATE_TIME_ALL_HPP___
|
||||
#define BOOST_DATE_TIME_ALL_HPP___
|
||||
|
||||
/* Copyright (c) 2006 CrystalClear Software, Inc.
|
||||
* Use, modification and distribution is subject to the
|
||||
* Boost Software License, Version 1.0. (See accompanying
|
||||
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
* Author: Jeff Garland
|
||||
* $Date$
|
||||
*/
|
||||
|
||||
// See www.boost.org/libs/date_time for documentation.
|
||||
|
||||
//gregorian and posix time included by indirectly
|
||||
#include "boost/date_time/local_time/local_time.hpp"
|
||||
|
||||
#endif // BOOST_DATE_TIME_ALL_HPP___
|
||||
@ -1,20 +0,0 @@
|
||||
#ifndef BOOST_DESCRIBE_HPP_INCLUDED
|
||||
#define BOOST_DESCRIBE_HPP_INCLUDED
|
||||
|
||||
// Copyright 2020 Peter Dimov
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/describe/enumerators.hpp>
|
||||
#include <boost/describe/bases.hpp>
|
||||
#include <boost/describe/members.hpp>
|
||||
#include <boost/describe/enum.hpp>
|
||||
#include <boost/describe/class.hpp>
|
||||
#include <boost/describe/modifiers.hpp>
|
||||
#include <boost/describe/enum_to_string.hpp>
|
||||
#include <boost/describe/enum_from_string.hpp>
|
||||
#include <boost/describe/operators.hpp>
|
||||
#include <boost/describe/descriptor_by_name.hpp>
|
||||
#include <boost/describe/descriptor_by_pointer.hpp>
|
||||
|
||||
#endif // #ifndef BOOST_DESCRIBE_HPP_INCLUDED
|
||||
@ -1,27 +0,0 @@
|
||||
// Copyright 2014 Renato Tegon Forti, Antony Polukhin.
|
||||
// Copyright 2015-2021 Antony Polukhin.
|
||||
//
|
||||
// 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_DLL_DLL_HPP
|
||||
#define BOOST_DLL_DLL_HPP
|
||||
|
||||
/// \file boost/dll.hpp
|
||||
/// \brief Includes all the non-experimental headers of the Boost.DLL library.
|
||||
|
||||
#include <boost/dll/config.hpp>
|
||||
#include <boost/dll/shared_library.hpp>
|
||||
#include <boost/dll/alias.hpp>
|
||||
#include <boost/dll/import.hpp>
|
||||
#include <boost/dll/library_info.hpp>
|
||||
#include <boost/dll/runtime_symbol_info.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
#endif // BOOST_DLL_DLL_HPP
|
||||
|
||||
@ -1,17 +0,0 @@
|
||||
// -----------------------------------------------------------
|
||||
//
|
||||
// Copyright (c) 2001-2002 Chuck Allison and Jeremy Siek
|
||||
// Copyright (c) 2003-2004, 2008 Gennaro Prota
|
||||
//
|
||||
// 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_DYNAMIC_BITSET_HPP
|
||||
#define BOOST_DYNAMIC_BITSET_HPP
|
||||
|
||||
#include "boost/dynamic_bitset/dynamic_bitset.hpp"
|
||||
|
||||
#endif // include guard
|
||||
@ -1,25 +0,0 @@
|
||||
// -----------------------------------------------------------
|
||||
//
|
||||
// Copyright (c) 2001-2002 Chuck Allison and Jeremy Siek
|
||||
// Copyright (c) 2003-2004 Gennaro Prota
|
||||
//
|
||||
// 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_DYNAMIC_BITSET_FWD_HPP
|
||||
#define BOOST_DYNAMIC_BITSET_FWD_HPP
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace boost {
|
||||
|
||||
template <typename Block = unsigned long,
|
||||
typename Allocator = std::allocator<Block> >
|
||||
class dynamic_bitset;
|
||||
|
||||
}
|
||||
|
||||
#endif // include guard
|
||||
@ -1,18 +0,0 @@
|
||||
#ifndef BOOST_ENABLE_SHARED_FROM_THIS_HPP_INCLUDED
|
||||
#define BOOST_ENABLE_SHARED_FROM_THIS_HPP_INCLUDED
|
||||
|
||||
//
|
||||
// enable_shared_from_this.hpp
|
||||
//
|
||||
// Copyright (c) 2002 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
|
||||
//
|
||||
// See http://www.boost.org/libs/smart_ptr/ for documentation.
|
||||
//
|
||||
|
||||
#include <boost/smart_ptr/enable_shared_from_this.hpp>
|
||||
|
||||
#endif // #ifndef BOOST_ENABLE_SHARED_FROM_THIS_HPP_INCLUDED
|
||||
@ -1,13 +0,0 @@
|
||||
#ifndef BOOST_ENDIAN_HPP_INCLUDED
|
||||
#define BOOST_ENDIAN_HPP_INCLUDED
|
||||
|
||||
// Copyright 2019 Peter Dimov
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/endian/conversion.hpp>
|
||||
#include <boost/endian/buffers.hpp>
|
||||
#include <boost/endian/arithmetic.hpp>
|
||||
|
||||
#endif // #ifndef BOOST_ENDIAN_HPP_INCLUDED
|
||||
@ -1,11 +0,0 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//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_EXCEPTION_FA5836A2CADA11DC8CD47C8555D89593
|
||||
#define BOOST_EXCEPTION_FA5836A2CADA11DC8CD47C8555D89593
|
||||
|
||||
#include <boost/exception/detail/exception_ptr.hpp>
|
||||
|
||||
#endif
|
||||
@ -1,24 +0,0 @@
|
||||
// boost/filesystem.hpp --------------------------------------------------------------//
|
||||
|
||||
// Copyright Beman Dawes 2010
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
// Library home page: http://www.boost.org/libs/filesystem
|
||||
|
||||
//--------------------------------------------------------------------------------------//
|
||||
|
||||
#ifndef BOOST_FILESYSTEM_FILESYSTEM_HPP
|
||||
#define BOOST_FILESYSTEM_FILESYSTEM_HPP
|
||||
|
||||
#include <boost/filesystem/config.hpp>
|
||||
#include <boost/filesystem/path.hpp>
|
||||
#include <boost/filesystem/exception.hpp>
|
||||
#include <boost/filesystem/directory.hpp>
|
||||
#include <boost/filesystem/operations.hpp>
|
||||
#include <boost/filesystem/file_status.hpp>
|
||||
#include <boost/filesystem/convenience.hpp>
|
||||
#include <boost/filesystem/string_file.hpp>
|
||||
|
||||
#endif // BOOST_FILESYSTEM_FILESYSTEM_HPP
|
||||
@ -1,22 +0,0 @@
|
||||
/* Copyright 2006-2008 Joaquin M Lopez Munoz.
|
||||
* 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/flyweight for library home page.
|
||||
*/
|
||||
|
||||
#ifndef BOOST_FLYWEIGHT_HPP
|
||||
#define BOOST_FLYWEIGHT_HPP
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/flyweight/flyweight.hpp>
|
||||
#include <boost/flyweight/hashed_factory.hpp>
|
||||
#include <boost/flyweight/refcounted.hpp>
|
||||
#include <boost/flyweight/simple_locking.hpp>
|
||||
#include <boost/flyweight/static_holder.hpp>
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,51 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// foreach.hpp header file
|
||||
//
|
||||
// Copyright 2010 Eric Niebler.
|
||||
// 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/foreach for documentation
|
||||
//
|
||||
// Credits:
|
||||
// Kazutoshi Satoda: for suggesting the need for a _fwd header for foreach's
|
||||
// customization points.
|
||||
|
||||
#ifndef BOOST_FOREACH_FWD_HPP
|
||||
#define BOOST_FOREACH_FWD_HPP
|
||||
|
||||
// This must be at global scope, hence the uglified name
|
||||
enum boost_foreach_argument_dependent_lookup_hack
|
||||
{
|
||||
boost_foreach_argument_dependent_lookup_hack_value
|
||||
};
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
namespace foreach
|
||||
{
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// boost::foreach::tag
|
||||
//
|
||||
typedef boost_foreach_argument_dependent_lookup_hack tag;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// boost::foreach::is_lightweight_proxy
|
||||
// Specialize this for user-defined collection types if they are inexpensive to copy.
|
||||
// This tells BOOST_FOREACH it can avoid the rvalue/lvalue detection stuff.
|
||||
template<typename T>
|
||||
struct is_lightweight_proxy;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// boost::foreach::is_noncopyable
|
||||
// Specialize this for user-defined collection types if they cannot be copied.
|
||||
// This also tells BOOST_FOREACH to avoid the rvalue/lvalue detection stuff.
|
||||
template<typename T>
|
||||
struct is_noncopyable;
|
||||
|
||||
} // namespace foreach
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif
|
||||
@ -1,59 +0,0 @@
|
||||
// ----------------------------------------------------------------------------
|
||||
// format.hpp : primary header
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Copyright Samuel Krempp 2003. Use, modification, and distribution are
|
||||
// subject to the Boost Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See http://www.boost.org/libs/format for library home page
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#ifndef BOOST_FORMAT_HPP
|
||||
#define BOOST_FORMAT_HPP
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#ifndef BOOST_NO_STD_LOCALE
|
||||
#include <locale>
|
||||
#endif
|
||||
|
||||
// *** Compatibility framework
|
||||
#include <boost/format/detail/compat_workarounds.hpp>
|
||||
|
||||
#ifdef BOOST_NO_LOCALE_ISIDIGIT
|
||||
#include <cctype> // we'll use the non-locale <cctype>'s std::isdigit(int)
|
||||
#endif
|
||||
|
||||
// **** Forward declarations ----------------------------------
|
||||
#include <boost/format/format_fwd.hpp> // basic_format<Ch,Tr>, and other frontends
|
||||
#include <boost/format/internals_fwd.hpp> // misc forward declarations for internal use
|
||||
|
||||
// **** Auxiliary structs (stream_format_state<Ch,Tr> , and format_item<Ch,Tr> )
|
||||
#include <boost/format/internals.hpp>
|
||||
|
||||
// **** Format class interface --------------------------------
|
||||
#include <boost/format/format_class.hpp>
|
||||
|
||||
// **** Exceptions -----------------------------------------------
|
||||
#include <boost/format/exceptions.hpp>
|
||||
|
||||
// **** Implementation -------------------------------------------
|
||||
#include <boost/format/format_implementation.hpp> // member functions
|
||||
#include <boost/format/group.hpp> // class for grouping arguments
|
||||
#include <boost/format/feed_args.hpp> // argument-feeding functions
|
||||
#include <boost/format/parsing.hpp> // format-string parsing (member-)functions
|
||||
|
||||
// **** Implementation of the free functions ----------------------
|
||||
#include <boost/format/free_funcs.hpp>
|
||||
|
||||
|
||||
// *** Undefine 'local' macros :
|
||||
#include <boost/format/detail/unset_macros.hpp>
|
||||
|
||||
#endif // BOOST_FORMAT_HPP
|
||||
@ -1,74 +0,0 @@
|
||||
// Boost.Function library
|
||||
|
||||
// Copyright Douglas Gregor 2001-2003. Use, modification and
|
||||
// distribution is subject to the Boost Software License, Version
|
||||
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// For more information, see http://www.boost.org/libs/function
|
||||
|
||||
// William Kempf, Jesse Jones and Karl Nelson were all very helpful in the
|
||||
// design of this library.
|
||||
|
||||
#ifndef BOOST_FUNCTION_MAX_ARGS
|
||||
# define BOOST_FUNCTION_MAX_ARGS 10
|
||||
#endif // BOOST_FUNCTION_MAX_ARGS
|
||||
|
||||
#if !defined(BOOST_FUNCTION_MAX_ARGS_DEFINED) || (BOOST_FUNCTION_MAX_ARGS_DEFINED != BOOST_FUNCTION_MAX_ARGS)
|
||||
|
||||
#if !defined(BOOST_FUNCTION_MAX_ARGS_DEFINED)
|
||||
#define BOOST_FUNCTION_MAX_ARGS_DEFINED 0
|
||||
#endif
|
||||
|
||||
#include <functional> // unary_function, binary_function
|
||||
|
||||
#include <boost/preprocessor/iterate.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
|
||||
// Include the prologue here so that the use of file-level iteration
|
||||
// in anything that may be included by function_template.hpp doesn't break
|
||||
#include <boost/function/detail/prologue.hpp>
|
||||
|
||||
// Older Visual Age C++ version do not handle the file iteration well
|
||||
#if BOOST_WORKAROUND(__IBMCPP__, >= 500) && BOOST_WORKAROUND(__IBMCPP__, < 800)
|
||||
# if BOOST_FUNCTION_MAX_ARGS >= 0
|
||||
# include <boost/function/function0.hpp>
|
||||
# endif
|
||||
# if BOOST_FUNCTION_MAX_ARGS >= 1
|
||||
# include <boost/function/function1.hpp>
|
||||
# endif
|
||||
# if BOOST_FUNCTION_MAX_ARGS >= 2
|
||||
# include <boost/function/function2.hpp>
|
||||
# endif
|
||||
# if BOOST_FUNCTION_MAX_ARGS >= 3
|
||||
# include <boost/function/function3.hpp>
|
||||
# endif
|
||||
# if BOOST_FUNCTION_MAX_ARGS >= 4
|
||||
# include <boost/function/function4.hpp>
|
||||
# endif
|
||||
# if BOOST_FUNCTION_MAX_ARGS >= 5
|
||||
# include <boost/function/function5.hpp>
|
||||
# endif
|
||||
# if BOOST_FUNCTION_MAX_ARGS >= 6
|
||||
# include <boost/function/function6.hpp>
|
||||
# endif
|
||||
# if BOOST_FUNCTION_MAX_ARGS >= 7
|
||||
# include <boost/function/function7.hpp>
|
||||
# endif
|
||||
# if BOOST_FUNCTION_MAX_ARGS >= 8
|
||||
# include <boost/function/function8.hpp>
|
||||
# endif
|
||||
# if BOOST_FUNCTION_MAX_ARGS >= 9
|
||||
# include <boost/function/function9.hpp>
|
||||
# endif
|
||||
# if BOOST_FUNCTION_MAX_ARGS >= 10
|
||||
# include <boost/function/function10.hpp>
|
||||
# endif
|
||||
#else
|
||||
// What is the '3' for?
|
||||
# define BOOST_PP_ITERATION_PARAMS_1 (3,(0,BOOST_FUNCTION_MAX_ARGS,<boost/function/detail/function_iterate.hpp>))
|
||||
# include BOOST_PP_ITERATE()
|
||||
# undef BOOST_PP_ITERATION_PARAMS_1
|
||||
#endif
|
||||
|
||||
#endif // !defined(BOOST_FUNCTION_MAX_ARGS_DEFINED) || (BOOST_FUNCTION_MAX_ARGS_DEFINED != BOOST_FUNCTION_MAX_ARGS)
|
||||
@ -1,28 +0,0 @@
|
||||
// Copyright Douglas Gregor 2004.
|
||||
// Copyright 2005 Peter Dimov
|
||||
|
||||
// Use, modification and distribution is subject to
|
||||
// the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// For more information, see http://www.boost.org
|
||||
#ifndef BOOST_FUNCTION_EQUAL_HPP
|
||||
#define BOOST_FUNCTION_EQUAL_HPP
|
||||
|
||||
namespace boost {
|
||||
|
||||
template<typename F, typename G>
|
||||
bool function_equal_impl(const F& f, const G& g, long)
|
||||
{ return f == g; }
|
||||
|
||||
// function_equal_impl needs to be unqualified to pick
|
||||
// user overloads on two-phase compilers
|
||||
|
||||
template<typename F, typename G>
|
||||
bool function_equal(const F& f, const G& g)
|
||||
{ return function_equal_impl(f, g, 0); }
|
||||
|
||||
} // end namespace boost
|
||||
|
||||
#endif // BOOST_FUNCTION_EQUAL_HPP
|
||||
@ -1,18 +0,0 @@
|
||||
// (C) Copyright Andrey Semashev 2017.
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_FUNCTION_OUTPUT_ITERATOR_HPP
|
||||
#define BOOST_FUNCTION_OUTPUT_ITERATOR_HPP
|
||||
|
||||
// This is a deprecated header left for backward compatibility.
|
||||
// Use boost/iterator/function_output_iterator.hpp instead.
|
||||
|
||||
#include <boost/config/header_deprecated.hpp>
|
||||
|
||||
BOOST_HEADER_DEPRECATED("<boost/iterator/function_output_iterator.hpp>")
|
||||
|
||||
#include <boost/iterator/function_output_iterator.hpp>
|
||||
|
||||
#endif // BOOST_FUNCTION_OUTPUT_ITERATOR_HPP
|
||||
@ -1,581 +0,0 @@
|
||||
// ------------------------------------------------------------------------------
|
||||
// Copyright (c) 2000 Cadenza New Zealand Ltd
|
||||
// Distributed under the Boost Software License, Version 1.0. (See accompany-
|
||||
// ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
// ------------------------------------------------------------------------------
|
||||
// Boost functional.hpp header file
|
||||
// See http://www.boost.org/libs/functional for documentation.
|
||||
// ------------------------------------------------------------------------------
|
||||
// $Id$
|
||||
// ------------------------------------------------------------------------------
|
||||
|
||||
#ifndef BOOST_FUNCTIONAL_HPP
|
||||
#define BOOST_FUNCTIONAL_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/call_traits.hpp>
|
||||
#include <functional>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace functional
|
||||
{
|
||||
namespace detail {
|
||||
#if defined(_HAS_AUTO_PTR_ETC) && !_HAS_AUTO_PTR_ETC
|
||||
// std::unary_function and std::binary_function were both removed
|
||||
// in C++17.
|
||||
|
||||
template <typename Arg1, typename Result>
|
||||
struct unary_function
|
||||
{
|
||||
typedef Arg1 argument_type;
|
||||
typedef Result result_type;
|
||||
};
|
||||
|
||||
template <typename Arg1, typename Arg2, typename Result>
|
||||
struct binary_function
|
||||
{
|
||||
typedef Arg1 first_argument_type;
|
||||
typedef Arg2 second_argument_type;
|
||||
typedef Result result_type;
|
||||
};
|
||||
#else
|
||||
// Use the standard objects when we have them.
|
||||
|
||||
using std::unary_function;
|
||||
using std::binary_function;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
// --------------------------------------------------------------------------
|
||||
// The following traits classes allow us to avoid the need for ptr_fun
|
||||
// because the types of arguments and the result of a function can be
|
||||
// deduced.
|
||||
//
|
||||
// In addition to the standard types defined in unary_function and
|
||||
// binary_function, we add
|
||||
//
|
||||
// - function_type, the type of the function or function object itself.
|
||||
//
|
||||
// - param_type, the type that should be used for passing the function or
|
||||
// function object as an argument.
|
||||
// --------------------------------------------------------------------------
|
||||
namespace detail
|
||||
{
|
||||
template <class Operation>
|
||||
struct unary_traits_imp;
|
||||
|
||||
template <class Operation>
|
||||
struct unary_traits_imp<Operation*>
|
||||
{
|
||||
typedef Operation function_type;
|
||||
typedef const function_type & param_type;
|
||||
typedef typename Operation::result_type result_type;
|
||||
typedef typename Operation::argument_type argument_type;
|
||||
};
|
||||
|
||||
template <class R, class A>
|
||||
struct unary_traits_imp<R(*)(A)>
|
||||
{
|
||||
typedef R (*function_type)(A);
|
||||
typedef R (*param_type)(A);
|
||||
typedef R result_type;
|
||||
typedef A argument_type;
|
||||
};
|
||||
|
||||
template <class Operation>
|
||||
struct binary_traits_imp;
|
||||
|
||||
template <class Operation>
|
||||
struct binary_traits_imp<Operation*>
|
||||
{
|
||||
typedef Operation function_type;
|
||||
typedef const function_type & param_type;
|
||||
typedef typename Operation::result_type result_type;
|
||||
typedef typename Operation::first_argument_type first_argument_type;
|
||||
typedef typename Operation::second_argument_type second_argument_type;
|
||||
};
|
||||
|
||||
template <class R, class A1, class A2>
|
||||
struct binary_traits_imp<R(*)(A1,A2)>
|
||||
{
|
||||
typedef R (*function_type)(A1,A2);
|
||||
typedef R (*param_type)(A1,A2);
|
||||
typedef R result_type;
|
||||
typedef A1 first_argument_type;
|
||||
typedef A2 second_argument_type;
|
||||
};
|
||||
} // namespace detail
|
||||
|
||||
template <class Operation>
|
||||
struct unary_traits
|
||||
{
|
||||
typedef typename detail::unary_traits_imp<Operation*>::function_type function_type;
|
||||
typedef typename detail::unary_traits_imp<Operation*>::param_type param_type;
|
||||
typedef typename detail::unary_traits_imp<Operation*>::result_type result_type;
|
||||
typedef typename detail::unary_traits_imp<Operation*>::argument_type argument_type;
|
||||
};
|
||||
|
||||
template <class R, class A>
|
||||
struct unary_traits<R(*)(A)>
|
||||
{
|
||||
typedef R (*function_type)(A);
|
||||
typedef R (*param_type)(A);
|
||||
typedef R result_type;
|
||||
typedef A argument_type;
|
||||
};
|
||||
|
||||
template <class Operation>
|
||||
struct binary_traits
|
||||
{
|
||||
typedef typename detail::binary_traits_imp<Operation*>::function_type function_type;
|
||||
typedef typename detail::binary_traits_imp<Operation*>::param_type param_type;
|
||||
typedef typename detail::binary_traits_imp<Operation*>::result_type result_type;
|
||||
typedef typename detail::binary_traits_imp<Operation*>::first_argument_type first_argument_type;
|
||||
typedef typename detail::binary_traits_imp<Operation*>::second_argument_type second_argument_type;
|
||||
};
|
||||
|
||||
template <class R, class A1, class A2>
|
||||
struct binary_traits<R(*)(A1,A2)>
|
||||
{
|
||||
typedef R (*function_type)(A1,A2);
|
||||
typedef R (*param_type)(A1,A2);
|
||||
typedef R result_type;
|
||||
typedef A1 first_argument_type;
|
||||
typedef A2 second_argument_type;
|
||||
};
|
||||
#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
// --------------------------------------------------------------------------
|
||||
// If we have no partial specialisation available, decay to a situation
|
||||
// that is no worse than in the Standard, i.e., ptr_fun will be required.
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
template <class Operation>
|
||||
struct unary_traits
|
||||
{
|
||||
typedef Operation function_type;
|
||||
typedef const Operation& param_type;
|
||||
typedef typename Operation::result_type result_type;
|
||||
typedef typename Operation::argument_type argument_type;
|
||||
};
|
||||
|
||||
template <class Operation>
|
||||
struct binary_traits
|
||||
{
|
||||
typedef Operation function_type;
|
||||
typedef const Operation & param_type;
|
||||
typedef typename Operation::result_type result_type;
|
||||
typedef typename Operation::first_argument_type first_argument_type;
|
||||
typedef typename Operation::second_argument_type second_argument_type;
|
||||
};
|
||||
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// unary_negate, not1
|
||||
// --------------------------------------------------------------------------
|
||||
template <class Predicate>
|
||||
class unary_negate
|
||||
: public boost::functional::detail::unary_function<typename unary_traits<Predicate>::argument_type,bool>
|
||||
{
|
||||
public:
|
||||
explicit unary_negate(typename unary_traits<Predicate>::param_type x)
|
||||
:
|
||||
pred(x)
|
||||
{}
|
||||
bool operator()(typename call_traits<typename unary_traits<Predicate>::argument_type>::param_type x) const
|
||||
{
|
||||
return !pred(x);
|
||||
}
|
||||
private:
|
||||
typename unary_traits<Predicate>::function_type pred;
|
||||
};
|
||||
|
||||
template <class Predicate>
|
||||
unary_negate<Predicate> not1(const Predicate &pred)
|
||||
{
|
||||
// The cast is to placate Borland C++Builder in certain circumstances.
|
||||
// I don't think it should be necessary.
|
||||
return unary_negate<Predicate>((typename unary_traits<Predicate>::param_type)pred);
|
||||
}
|
||||
|
||||
template <class Predicate>
|
||||
unary_negate<Predicate> not1(Predicate &pred)
|
||||
{
|
||||
return unary_negate<Predicate>(pred);
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// binary_negate, not2
|
||||
// --------------------------------------------------------------------------
|
||||
template <class Predicate>
|
||||
class binary_negate
|
||||
: public boost::functional::detail::binary_function<
|
||||
typename binary_traits<Predicate>::first_argument_type,
|
||||
typename binary_traits<Predicate>::second_argument_type,
|
||||
bool>
|
||||
{
|
||||
public:
|
||||
explicit binary_negate(typename binary_traits<Predicate>::param_type x)
|
||||
:
|
||||
pred(x)
|
||||
{}
|
||||
bool operator()(typename call_traits<typename binary_traits<Predicate>::first_argument_type>::param_type x,
|
||||
typename call_traits<typename binary_traits<Predicate>::second_argument_type>::param_type y) const
|
||||
{
|
||||
return !pred(x,y);
|
||||
}
|
||||
private:
|
||||
typename binary_traits<Predicate>::function_type pred;
|
||||
};
|
||||
|
||||
template <class Predicate>
|
||||
binary_negate<Predicate> not2(const Predicate &pred)
|
||||
{
|
||||
// The cast is to placate Borland C++Builder in certain circumstances.
|
||||
// I don't think it should be necessary.
|
||||
return binary_negate<Predicate>((typename binary_traits<Predicate>::param_type)pred);
|
||||
}
|
||||
|
||||
template <class Predicate>
|
||||
binary_negate<Predicate> not2(Predicate &pred)
|
||||
{
|
||||
return binary_negate<Predicate>(pred);
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// binder1st, bind1st
|
||||
// --------------------------------------------------------------------------
|
||||
template <class Operation>
|
||||
class binder1st
|
||||
: public boost::functional::detail::unary_function<
|
||||
typename binary_traits<Operation>::second_argument_type,
|
||||
typename binary_traits<Operation>::result_type>
|
||||
{
|
||||
public:
|
||||
binder1st(typename binary_traits<Operation>::param_type x,
|
||||
typename call_traits<typename binary_traits<Operation>::first_argument_type>::param_type y)
|
||||
:
|
||||
op(x), value(y)
|
||||
{}
|
||||
|
||||
typename binary_traits<Operation>::result_type
|
||||
operator()(typename call_traits<typename binary_traits<Operation>::second_argument_type>::param_type x) const
|
||||
{
|
||||
return op(value, x);
|
||||
}
|
||||
|
||||
protected:
|
||||
typename binary_traits<Operation>::function_type op;
|
||||
typename binary_traits<Operation>::first_argument_type value;
|
||||
};
|
||||
|
||||
template <class Operation>
|
||||
inline binder1st<Operation> bind1st(const Operation &op,
|
||||
typename call_traits<
|
||||
typename binary_traits<Operation>::first_argument_type
|
||||
>::param_type x)
|
||||
{
|
||||
// The cast is to placate Borland C++Builder in certain circumstances.
|
||||
// I don't think it should be necessary.
|
||||
return binder1st<Operation>((typename binary_traits<Operation>::param_type)op, x);
|
||||
}
|
||||
|
||||
template <class Operation>
|
||||
inline binder1st<Operation> bind1st(Operation &op,
|
||||
typename call_traits<
|
||||
typename binary_traits<Operation>::first_argument_type
|
||||
>::param_type x)
|
||||
{
|
||||
return binder1st<Operation>(op, x);
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// binder2nd, bind2nd
|
||||
// --------------------------------------------------------------------------
|
||||
template <class Operation>
|
||||
class binder2nd
|
||||
: public boost::functional::detail::unary_function<
|
||||
typename binary_traits<Operation>::first_argument_type,
|
||||
typename binary_traits<Operation>::result_type>
|
||||
{
|
||||
public:
|
||||
binder2nd(typename binary_traits<Operation>::param_type x,
|
||||
typename call_traits<typename binary_traits<Operation>::second_argument_type>::param_type y)
|
||||
:
|
||||
op(x), value(y)
|
||||
{}
|
||||
|
||||
typename binary_traits<Operation>::result_type
|
||||
operator()(typename call_traits<typename binary_traits<Operation>::first_argument_type>::param_type x) const
|
||||
{
|
||||
return op(x, value);
|
||||
}
|
||||
|
||||
protected:
|
||||
typename binary_traits<Operation>::function_type op;
|
||||
typename binary_traits<Operation>::second_argument_type value;
|
||||
};
|
||||
|
||||
template <class Operation>
|
||||
inline binder2nd<Operation> bind2nd(const Operation &op,
|
||||
typename call_traits<
|
||||
typename binary_traits<Operation>::second_argument_type
|
||||
>::param_type x)
|
||||
{
|
||||
// The cast is to placate Borland C++Builder in certain circumstances.
|
||||
// I don't think it should be necessary.
|
||||
return binder2nd<Operation>((typename binary_traits<Operation>::param_type)op, x);
|
||||
}
|
||||
|
||||
template <class Operation>
|
||||
inline binder2nd<Operation> bind2nd(Operation &op,
|
||||
typename call_traits<
|
||||
typename binary_traits<Operation>::second_argument_type
|
||||
>::param_type x)
|
||||
{
|
||||
return binder2nd<Operation>(op, x);
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// mem_fun, etc
|
||||
// --------------------------------------------------------------------------
|
||||
template <class S, class T>
|
||||
class mem_fun_t : public boost::functional::detail::unary_function<T*, S>
|
||||
{
|
||||
public:
|
||||
explicit mem_fun_t(S (T::*p)())
|
||||
:
|
||||
ptr(p)
|
||||
{}
|
||||
S operator()(T* p) const
|
||||
{
|
||||
return (p->*ptr)();
|
||||
}
|
||||
private:
|
||||
S (T::*ptr)();
|
||||
};
|
||||
|
||||
template <class S, class T, class A>
|
||||
class mem_fun1_t : public boost::functional::detail::binary_function<T*, A, S>
|
||||
{
|
||||
public:
|
||||
explicit mem_fun1_t(S (T::*p)(A))
|
||||
:
|
||||
ptr(p)
|
||||
{}
|
||||
S operator()(T* p, typename call_traits<A>::param_type x) const
|
||||
{
|
||||
return (p->*ptr)(x);
|
||||
}
|
||||
private:
|
||||
S (T::*ptr)(A);
|
||||
};
|
||||
|
||||
template <class S, class T>
|
||||
class const_mem_fun_t : public boost::functional::detail::unary_function<const T*, S>
|
||||
{
|
||||
public:
|
||||
explicit const_mem_fun_t(S (T::*p)() const)
|
||||
:
|
||||
ptr(p)
|
||||
{}
|
||||
S operator()(const T* p) const
|
||||
{
|
||||
return (p->*ptr)();
|
||||
}
|
||||
private:
|
||||
S (T::*ptr)() const;
|
||||
};
|
||||
|
||||
template <class S, class T, class A>
|
||||
class const_mem_fun1_t : public boost::functional::detail::binary_function<const T*, A, S>
|
||||
{
|
||||
public:
|
||||
explicit const_mem_fun1_t(S (T::*p)(A) const)
|
||||
:
|
||||
ptr(p)
|
||||
{}
|
||||
S operator()(const T* p, typename call_traits<A>::param_type x) const
|
||||
{
|
||||
return (p->*ptr)(x);
|
||||
}
|
||||
private:
|
||||
S (T::*ptr)(A) const;
|
||||
};
|
||||
|
||||
template<class S, class T>
|
||||
inline mem_fun_t<S,T> mem_fun(S (T::*f)())
|
||||
{
|
||||
return mem_fun_t<S,T>(f);
|
||||
}
|
||||
|
||||
template<class S, class T, class A>
|
||||
inline mem_fun1_t<S,T,A> mem_fun(S (T::*f)(A))
|
||||
{
|
||||
return mem_fun1_t<S,T,A>(f);
|
||||
}
|
||||
|
||||
#ifndef BOOST_NO_POINTER_TO_MEMBER_CONST
|
||||
template<class S, class T>
|
||||
inline const_mem_fun_t<S,T> mem_fun(S (T::*f)() const)
|
||||
{
|
||||
return const_mem_fun_t<S,T>(f);
|
||||
}
|
||||
|
||||
template<class S, class T, class A>
|
||||
inline const_mem_fun1_t<S,T,A> mem_fun(S (T::*f)(A) const)
|
||||
{
|
||||
return const_mem_fun1_t<S,T,A>(f);
|
||||
}
|
||||
#endif // BOOST_NO_POINTER_TO_MEMBER_CONST
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// mem_fun_ref, etc
|
||||
// --------------------------------------------------------------------------
|
||||
template <class S, class T>
|
||||
class mem_fun_ref_t : public boost::functional::detail::unary_function<T&, S>
|
||||
{
|
||||
public:
|
||||
explicit mem_fun_ref_t(S (T::*p)())
|
||||
:
|
||||
ptr(p)
|
||||
{}
|
||||
S operator()(T& p) const
|
||||
{
|
||||
return (p.*ptr)();
|
||||
}
|
||||
private:
|
||||
S (T::*ptr)();
|
||||
};
|
||||
|
||||
template <class S, class T, class A>
|
||||
class mem_fun1_ref_t : public boost::functional::detail::binary_function<T&, A, S>
|
||||
{
|
||||
public:
|
||||
explicit mem_fun1_ref_t(S (T::*p)(A))
|
||||
:
|
||||
ptr(p)
|
||||
{}
|
||||
S operator()(T& p, typename call_traits<A>::param_type x) const
|
||||
{
|
||||
return (p.*ptr)(x);
|
||||
}
|
||||
private:
|
||||
S (T::*ptr)(A);
|
||||
};
|
||||
|
||||
template <class S, class T>
|
||||
class const_mem_fun_ref_t : public boost::functional::detail::unary_function<const T&, S>
|
||||
{
|
||||
public:
|
||||
explicit const_mem_fun_ref_t(S (T::*p)() const)
|
||||
:
|
||||
ptr(p)
|
||||
{}
|
||||
|
||||
S operator()(const T &p) const
|
||||
{
|
||||
return (p.*ptr)();
|
||||
}
|
||||
private:
|
||||
S (T::*ptr)() const;
|
||||
};
|
||||
|
||||
template <class S, class T, class A>
|
||||
class const_mem_fun1_ref_t : public boost::functional::detail::binary_function<const T&, A, S>
|
||||
{
|
||||
public:
|
||||
explicit const_mem_fun1_ref_t(S (T::*p)(A) const)
|
||||
:
|
||||
ptr(p)
|
||||
{}
|
||||
|
||||
S operator()(const T& p, typename call_traits<A>::param_type x) const
|
||||
{
|
||||
return (p.*ptr)(x);
|
||||
}
|
||||
private:
|
||||
S (T::*ptr)(A) const;
|
||||
};
|
||||
|
||||
template<class S, class T>
|
||||
inline mem_fun_ref_t<S,T> mem_fun_ref(S (T::*f)())
|
||||
{
|
||||
return mem_fun_ref_t<S,T>(f);
|
||||
}
|
||||
|
||||
template<class S, class T, class A>
|
||||
inline mem_fun1_ref_t<S,T,A> mem_fun_ref(S (T::*f)(A))
|
||||
{
|
||||
return mem_fun1_ref_t<S,T,A>(f);
|
||||
}
|
||||
|
||||
#ifndef BOOST_NO_POINTER_TO_MEMBER_CONST
|
||||
template<class S, class T>
|
||||
inline const_mem_fun_ref_t<S,T> mem_fun_ref(S (T::*f)() const)
|
||||
{
|
||||
return const_mem_fun_ref_t<S,T>(f);
|
||||
}
|
||||
|
||||
template<class S, class T, class A>
|
||||
inline const_mem_fun1_ref_t<S,T,A> mem_fun_ref(S (T::*f)(A) const)
|
||||
{
|
||||
return const_mem_fun1_ref_t<S,T,A>(f);
|
||||
}
|
||||
#endif // BOOST_NO_POINTER_TO_MEMBER_CONST
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ptr_fun
|
||||
// --------------------------------------------------------------------------
|
||||
template <class Arg, class Result>
|
||||
class pointer_to_unary_function : public boost::functional::detail::unary_function<Arg,Result>
|
||||
{
|
||||
public:
|
||||
explicit pointer_to_unary_function(Result (*f)(Arg))
|
||||
:
|
||||
func(f)
|
||||
{}
|
||||
|
||||
Result operator()(typename call_traits<Arg>::param_type x) const
|
||||
{
|
||||
return func(x);
|
||||
}
|
||||
|
||||
private:
|
||||
Result (*func)(Arg);
|
||||
};
|
||||
|
||||
template <class Arg, class Result>
|
||||
inline pointer_to_unary_function<Arg,Result> ptr_fun(Result (*f)(Arg))
|
||||
{
|
||||
return pointer_to_unary_function<Arg,Result>(f);
|
||||
}
|
||||
|
||||
template <class Arg1, class Arg2, class Result>
|
||||
class pointer_to_binary_function : public boost::functional::detail::binary_function<Arg1,Arg2,Result>
|
||||
{
|
||||
public:
|
||||
explicit pointer_to_binary_function(Result (*f)(Arg1, Arg2))
|
||||
:
|
||||
func(f)
|
||||
{}
|
||||
|
||||
Result operator()(typename call_traits<Arg1>::param_type x, typename call_traits<Arg2>::param_type y) const
|
||||
{
|
||||
return func(x,y);
|
||||
}
|
||||
|
||||
private:
|
||||
Result (*func)(Arg1, Arg2);
|
||||
};
|
||||
|
||||
template <class Arg1, class Arg2, class Result>
|
||||
inline pointer_to_binary_function<Arg1,Arg2,Result> ptr_fun(Result (*f)(Arg1, Arg2))
|
||||
{
|
||||
return pointer_to_binary_function<Arg1,Arg2,Result>(f);
|
||||
}
|
||||
} // namespace boost
|
||||
|
||||
#endif
|
||||
@ -1,85 +0,0 @@
|
||||
// (C) Copyright Jens Maurer 2001.
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// Revision History:
|
||||
|
||||
// 15 Nov 2001 Jens Maurer
|
||||
// created.
|
||||
|
||||
// See http://www.boost.org/libs/utility/iterator_adaptors.htm for documentation.
|
||||
|
||||
#ifndef BOOST_ITERATOR_ADAPTOR_GENERATOR_ITERATOR_HPP
|
||||
#define BOOST_ITERATOR_ADAPTOR_GENERATOR_ITERATOR_HPP
|
||||
|
||||
#include <boost/iterator/iterator_facade.hpp>
|
||||
#include <boost/ref.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace iterators {
|
||||
|
||||
template<class Generator>
|
||||
class generator_iterator
|
||||
: public iterator_facade<
|
||||
generator_iterator<Generator>
|
||||
, typename Generator::result_type
|
||||
, single_pass_traversal_tag
|
||||
, typename Generator::result_type const&
|
||||
>
|
||||
{
|
||||
typedef iterator_facade<
|
||||
generator_iterator<Generator>
|
||||
, typename Generator::result_type
|
||||
, single_pass_traversal_tag
|
||||
, typename Generator::result_type const&
|
||||
> super_t;
|
||||
|
||||
public:
|
||||
generator_iterator() {}
|
||||
generator_iterator(Generator* g) : m_g(g), m_value((*m_g)()) {}
|
||||
|
||||
void increment()
|
||||
{
|
||||
m_value = (*m_g)();
|
||||
}
|
||||
|
||||
const typename Generator::result_type&
|
||||
dereference() const
|
||||
{
|
||||
return m_value;
|
||||
}
|
||||
|
||||
bool equal(generator_iterator const& y) const
|
||||
{
|
||||
return this->m_g == y.m_g && this->m_value == y.m_value;
|
||||
}
|
||||
|
||||
private:
|
||||
Generator* m_g;
|
||||
typename Generator::result_type m_value;
|
||||
};
|
||||
|
||||
template<class Generator>
|
||||
struct generator_iterator_generator
|
||||
{
|
||||
typedef generator_iterator<Generator> type;
|
||||
};
|
||||
|
||||
template <class Generator>
|
||||
inline generator_iterator<Generator>
|
||||
make_generator_iterator(Generator & gen)
|
||||
{
|
||||
typedef generator_iterator<Generator> result_t;
|
||||
return result_t(&gen);
|
||||
}
|
||||
|
||||
} // namespace iterators
|
||||
|
||||
using iterators::generator_iterator;
|
||||
using iterators::generator_iterator_generator;
|
||||
using iterators::make_generator_iterator;
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_ITERATOR_ADAPTOR_GENERATOR_ITERATOR_HPP
|
||||
@ -1,19 +0,0 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2011 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2011 Mateusz Loskot, London, UK.
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_HPP
|
||||
#define BOOST_GEOMETRY_HPP
|
||||
|
||||
#include <boost/geometry/geometry.hpp>
|
||||
|
||||
#endif // BOOST_GEOMETRY_HPP
|
||||
@ -1,76 +0,0 @@
|
||||
// Copyright Peter Dimov and David Abrahams 2002.
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
#ifndef GET_POINTER_DWA20021219_HPP
|
||||
#define GET_POINTER_DWA20021219_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
// In order to avoid circular dependencies with Boost.TR1
|
||||
// we make sure that our include of <memory> doesn't try to
|
||||
// pull in the TR1 headers: that's why we use this header
|
||||
// rather than including <memory> directly:
|
||||
#include <boost/config/no_tr1/memory.hpp> // std::auto_ptr
|
||||
|
||||
namespace boost {
|
||||
|
||||
// get_pointer(p) extracts a ->* capable pointer from p
|
||||
|
||||
template<class T> T * get_pointer(T * p)
|
||||
{
|
||||
return p;
|
||||
}
|
||||
|
||||
// get_pointer(shared_ptr<T> const & p) has been moved to shared_ptr.hpp
|
||||
|
||||
#if !defined( BOOST_NO_AUTO_PTR )
|
||||
|
||||
#if defined( __GNUC__ ) && (defined( __GXX_EXPERIMENTAL_CXX0X__ ) || (__cplusplus >= 201103L))
|
||||
#if defined( BOOST_GCC )
|
||||
#if BOOST_GCC >= 40600
|
||||
#define BOOST_CORE_DETAIL_DISABLE_LIBSTDCXX_DEPRECATED_WARNINGS
|
||||
#endif // BOOST_GCC >= 40600
|
||||
#elif defined( __clang__ ) && defined( __has_warning )
|
||||
#if __has_warning("-Wdeprecated-declarations")
|
||||
#define BOOST_CORE_DETAIL_DISABLE_LIBSTDCXX_DEPRECATED_WARNINGS
|
||||
#endif // __has_warning("-Wdeprecated-declarations")
|
||||
#endif
|
||||
#endif // defined( __GNUC__ ) && (defined( __GXX_EXPERIMENTAL_CXX0X__ ) || (__cplusplus >= 201103L))
|
||||
|
||||
#if defined( BOOST_CORE_DETAIL_DISABLE_LIBSTDCXX_DEPRECATED_WARNINGS )
|
||||
// Disable libstdc++ warnings about std::auto_ptr being deprecated in C++11 mode
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#define BOOST_CORE_DETAIL_DISABLED_DEPRECATED_WARNINGS
|
||||
#endif
|
||||
|
||||
template<class T> T * get_pointer(std::auto_ptr<T> const& p)
|
||||
{
|
||||
return p.get();
|
||||
}
|
||||
|
||||
#if defined( BOOST_CORE_DETAIL_DISABLE_LIBSTDCXX_DEPRECATED_WARNINGS )
|
||||
#pragma GCC diagnostic pop
|
||||
#undef BOOST_CORE_DETAIL_DISABLE_LIBSTDCXX_DEPRECATED_WARNINGS
|
||||
#endif
|
||||
|
||||
#endif // !defined( BOOST_NO_AUTO_PTR )
|
||||
|
||||
#if !defined( BOOST_NO_CXX11_SMART_PTR )
|
||||
|
||||
template<class T> T * get_pointer( std::unique_ptr<T> const& p )
|
||||
{
|
||||
return p.get();
|
||||
}
|
||||
|
||||
template<class T> T * get_pointer( std::shared_ptr<T> const& p )
|
||||
{
|
||||
return p.get();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // GET_POINTER_DWA20021219_HPP
|
||||
@ -1,49 +0,0 @@
|
||||
//
|
||||
// Copyright 2018 Stefan Seefeld
|
||||
// Copyright 2005-2007 Adobe Systems Incorporated
|
||||
//
|
||||
// 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_GIL_HPP
|
||||
#define BOOST_GIL_HPP
|
||||
|
||||
#include <boost/gil/algorithm.hpp>
|
||||
#include <boost/gil/bit_aligned_pixel_iterator.hpp>
|
||||
#include <boost/gil/bit_aligned_pixel_reference.hpp>
|
||||
#include <boost/gil/channel.hpp>
|
||||
#include <boost/gil/channel_algorithm.hpp>
|
||||
#include <boost/gil/cmyk.hpp>
|
||||
#include <boost/gil/color_base.hpp>
|
||||
#include <boost/gil/color_base_algorithm.hpp>
|
||||
#include <boost/gil/color_convert.hpp>
|
||||
#include <boost/gil/concepts.hpp>
|
||||
#include <boost/gil/deprecated.hpp>
|
||||
#include <boost/gil/device_n.hpp>
|
||||
#include <boost/gil/gray.hpp>
|
||||
#include <boost/gil/image.hpp>
|
||||
#include <boost/gil/image_view.hpp>
|
||||
#include <boost/gil/image_view_factory.hpp>
|
||||
#include <boost/gil/iterator_from_2d.hpp>
|
||||
#include <boost/gil/locator.hpp>
|
||||
#include <boost/gil/metafunctions.hpp>
|
||||
#include <boost/gil/packed_pixel.hpp>
|
||||
#include <boost/gil/pixel.hpp>
|
||||
#include <boost/gil/pixel_iterator.hpp>
|
||||
#include <boost/gil/pixel_iterator_adaptor.hpp>
|
||||
#include <boost/gil/planar_pixel_iterator.hpp>
|
||||
#include <boost/gil/planar_pixel_reference.hpp>
|
||||
#include <boost/gil/point.hpp>
|
||||
#include <boost/gil/position_iterator.hpp>
|
||||
#include <boost/gil/premultiply.hpp>
|
||||
#include <boost/gil/rgb.hpp>
|
||||
#include <boost/gil/rgba.hpp>
|
||||
#include <boost/gil/step_iterator.hpp>
|
||||
#include <boost/gil/typedefs.hpp>
|
||||
#include <boost/gil/utilities.hpp>
|
||||
#include <boost/gil/virtual_locator.hpp>
|
||||
#include <boost/gil/image_processing/scaling.hpp>
|
||||
#include <boost/gil/image_processing/threshold.hpp>
|
||||
|
||||
#endif
|
||||
@ -1,209 +0,0 @@
|
||||
/*!
|
||||
@file
|
||||
Includes all the library components except the adapters for external
|
||||
libraries.
|
||||
|
||||
@copyright Louis Dionne 2013-2017
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
|
||||
#ifndef BOOST_HANA_HPP
|
||||
#define BOOST_HANA_HPP
|
||||
|
||||
//! @defgroup group-concepts Concepts
|
||||
//! Concepts provided by the library.
|
||||
|
||||
//! @defgroup group-datatypes Data types
|
||||
//! General purpose data types provided by the library.
|
||||
|
||||
//! @defgroup group-functional Functional
|
||||
//! General purpose function objects.
|
||||
|
||||
//! @defgroup group-core Core
|
||||
//! Core utilities of the library.
|
||||
|
||||
//! @defgroup group-experimental Experimental features
|
||||
//! Experimental features that may or may not make it into the library.
|
||||
//! These features should not expected to be stable.
|
||||
|
||||
//! @defgroup group-ext External adapters
|
||||
//! Adapters for external libraries.
|
||||
|
||||
//! @defgroup group-config Configuration options
|
||||
//! Configurable options to tweak the global behavior of the library.
|
||||
|
||||
//! @defgroup group-assertions Assertions
|
||||
//! Macros to perform different kinds of assertions.
|
||||
|
||||
//! @defgroup group-details Details
|
||||
//! Implementation details. Do not rely on anything here, even if it is
|
||||
//! documented.
|
||||
|
||||
// Include config.hpp first, so that warning messages about compiler support
|
||||
// appear as soon as possible.
|
||||
#include <boost/hana/config.hpp>
|
||||
|
||||
|
||||
#ifdef BOOST_HANA_DOXYGEN_INVOKED
|
||||
namespace boost {
|
||||
//! Namespace containing everything in the library.
|
||||
namespace hana {
|
||||
//! Namespace containing C++14 user-defined literals provided by Hana.
|
||||
namespace literals {}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <boost/hana/accessors.hpp>
|
||||
#include <boost/hana/adapt_adt.hpp>
|
||||
#include <boost/hana/adapt_struct.hpp>
|
||||
#include <boost/hana/adjust.hpp>
|
||||
#include <boost/hana/adjust_if.hpp>
|
||||
#include <boost/hana/all.hpp>
|
||||
#include <boost/hana/all_of.hpp>
|
||||
#include <boost/hana/and.hpp>
|
||||
#include <boost/hana/any.hpp>
|
||||
#include <boost/hana/any_of.hpp>
|
||||
#include <boost/hana/ap.hpp>
|
||||
#include <boost/hana/append.hpp>
|
||||
#include <boost/hana/assert.hpp>
|
||||
#include <boost/hana/at.hpp>
|
||||
#include <boost/hana/at_key.hpp>
|
||||
#include <boost/hana/back.hpp>
|
||||
#include <boost/hana/basic_tuple.hpp>
|
||||
#include <boost/hana/bool.hpp>
|
||||
#include <boost/hana/cartesian_product.hpp>
|
||||
#include <boost/hana/chain.hpp>
|
||||
#include <boost/hana/comparing.hpp>
|
||||
#include <boost/hana/concat.hpp>
|
||||
#include <boost/hana/concept.hpp>
|
||||
#include <boost/hana/contains.hpp>
|
||||
#include <boost/hana/core.hpp>
|
||||
#include <boost/hana/count.hpp>
|
||||
#include <boost/hana/count_if.hpp>
|
||||
#include <boost/hana/cycle.hpp>
|
||||
#include <boost/hana/define_struct.hpp>
|
||||
#include <boost/hana/difference.hpp>
|
||||
#include <boost/hana/div.hpp>
|
||||
#include <boost/hana/drop_back.hpp>
|
||||
#include <boost/hana/drop_front.hpp>
|
||||
#include <boost/hana/drop_front_exactly.hpp>
|
||||
#include <boost/hana/drop_while.hpp>
|
||||
#include <boost/hana/duplicate.hpp>
|
||||
#include <boost/hana/empty.hpp>
|
||||
#include <boost/hana/equal.hpp>
|
||||
#include <boost/hana/erase_key.hpp>
|
||||
#include <boost/hana/eval.hpp>
|
||||
#include <boost/hana/eval_if.hpp>
|
||||
#include <boost/hana/extend.hpp>
|
||||
#include <boost/hana/extract.hpp>
|
||||
#include <boost/hana/fill.hpp>
|
||||
#include <boost/hana/filter.hpp>
|
||||
#include <boost/hana/find.hpp>
|
||||
#include <boost/hana/find_if.hpp>
|
||||
#include <boost/hana/first.hpp>
|
||||
#include <boost/hana/flatten.hpp>
|
||||
#include <boost/hana/fold.hpp>
|
||||
#include <boost/hana/fold_left.hpp>
|
||||
#include <boost/hana/fold_right.hpp>
|
||||
#include <boost/hana/for_each.hpp>
|
||||
#include <boost/hana/front.hpp>
|
||||
#include <boost/hana/functional.hpp>
|
||||
#include <boost/hana/fuse.hpp>
|
||||
#include <boost/hana/greater.hpp>
|
||||
#include <boost/hana/greater_equal.hpp>
|
||||
#include <boost/hana/group.hpp>
|
||||
#include <boost/hana/index_if.hpp>
|
||||
#include <boost/hana/if.hpp>
|
||||
#include <boost/hana/insert.hpp>
|
||||
#include <boost/hana/insert_range.hpp>
|
||||
#include <boost/hana/integral_constant.hpp>
|
||||
#include <boost/hana/intersection.hpp>
|
||||
#include <boost/hana/intersperse.hpp>
|
||||
#include <boost/hana/is_disjoint.hpp>
|
||||
#include <boost/hana/is_empty.hpp>
|
||||
#include <boost/hana/is_subset.hpp>
|
||||
#include <boost/hana/keys.hpp>
|
||||
#include <boost/hana/lazy.hpp>
|
||||
#include <boost/hana/length.hpp>
|
||||
#include <boost/hana/less.hpp>
|
||||
#include <boost/hana/less_equal.hpp>
|
||||
#include <boost/hana/lexicographical_compare.hpp>
|
||||
#include <boost/hana/lift.hpp>
|
||||
#include <boost/hana/map.hpp>
|
||||
#include <boost/hana/max.hpp>
|
||||
#include <boost/hana/maximum.hpp>
|
||||
#include <boost/hana/members.hpp>
|
||||
#include <boost/hana/min.hpp>
|
||||
#include <boost/hana/minimum.hpp>
|
||||
#include <boost/hana/minus.hpp>
|
||||
#include <boost/hana/mod.hpp>
|
||||
#include <boost/hana/monadic_compose.hpp>
|
||||
#include <boost/hana/monadic_fold_left.hpp>
|
||||
#include <boost/hana/monadic_fold_right.hpp>
|
||||
#include <boost/hana/mult.hpp>
|
||||
#include <boost/hana/negate.hpp>
|
||||
#include <boost/hana/none.hpp>
|
||||
#include <boost/hana/none_of.hpp>
|
||||
#include <boost/hana/not.hpp>
|
||||
#include <boost/hana/not_equal.hpp>
|
||||
#include <boost/hana/one.hpp>
|
||||
#include <boost/hana/optional.hpp>
|
||||
#include <boost/hana/or.hpp>
|
||||
#include <boost/hana/ordering.hpp>
|
||||
#include <boost/hana/pair.hpp>
|
||||
#include <boost/hana/partition.hpp>
|
||||
#include <boost/hana/permutations.hpp>
|
||||
#include <boost/hana/plus.hpp>
|
||||
#include <boost/hana/power.hpp>
|
||||
#include <boost/hana/prefix.hpp>
|
||||
#include <boost/hana/prepend.hpp>
|
||||
#include <boost/hana/product.hpp>
|
||||
#include <boost/hana/range.hpp>
|
||||
#include <boost/hana/remove.hpp>
|
||||
#include <boost/hana/remove_at.hpp>
|
||||
#include <boost/hana/remove_if.hpp>
|
||||
#include <boost/hana/remove_range.hpp>
|
||||
#include <boost/hana/repeat.hpp>
|
||||
#include <boost/hana/replace.hpp>
|
||||
#include <boost/hana/replace_if.hpp>
|
||||
#include <boost/hana/replicate.hpp>
|
||||
#include <boost/hana/reverse.hpp>
|
||||
#include <boost/hana/reverse_fold.hpp>
|
||||
#include <boost/hana/scan_left.hpp>
|
||||
#include <boost/hana/scan_right.hpp>
|
||||
#include <boost/hana/second.hpp>
|
||||
#include <boost/hana/set.hpp>
|
||||
#include <boost/hana/size.hpp>
|
||||
#include <boost/hana/slice.hpp>
|
||||
#include <boost/hana/sort.hpp>
|
||||
#include <boost/hana/span.hpp>
|
||||
#include <boost/hana/string.hpp>
|
||||
#include <boost/hana/suffix.hpp>
|
||||
#include <boost/hana/sum.hpp>
|
||||
#include <boost/hana/symmetric_difference.hpp>
|
||||
#include <boost/hana/take_back.hpp>
|
||||
#include <boost/hana/take_front.hpp>
|
||||
#include <boost/hana/take_while.hpp>
|
||||
#include <boost/hana/tap.hpp>
|
||||
#include <boost/hana/then.hpp>
|
||||
#include <boost/hana/traits.hpp>
|
||||
#include <boost/hana/transform.hpp>
|
||||
#include <boost/hana/tuple.hpp>
|
||||
#include <boost/hana/type.hpp>
|
||||
#include <boost/hana/unfold_left.hpp>
|
||||
#include <boost/hana/unfold_right.hpp>
|
||||
#include <boost/hana/union.hpp>
|
||||
#include <boost/hana/unique.hpp>
|
||||
#include <boost/hana/unpack.hpp>
|
||||
#include <boost/hana/value.hpp>
|
||||
#include <boost/hana/version.hpp>
|
||||
#include <boost/hana/while.hpp>
|
||||
#include <boost/hana/zero.hpp>
|
||||
#include <boost/hana/zip.hpp>
|
||||
#include <boost/hana/zip_shortest.hpp>
|
||||
#include <boost/hana/zip_shortest_with.hpp>
|
||||
#include <boost/hana/zip_with.hpp>
|
||||
|
||||
#endif // !BOOST_HANA_HPP
|
||||
@ -1,37 +0,0 @@
|
||||
// Copyright 2015-2018 Hans Dembinski
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt
|
||||
// or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_HISTOGRAM_HPP
|
||||
#define BOOST_HISTOGRAM_HPP
|
||||
|
||||
/**
|
||||
\file boost/histogram.hpp
|
||||
Includes all standard headers of the Boost.Histogram library.
|
||||
|
||||
Extra headers not automatically included are:
|
||||
- [boost/histogram/ostream.hpp][1]
|
||||
- [boost/histogram/axis/ostream.hpp][2]
|
||||
- [boost/histogram/accumulators/ostream.hpp][3]
|
||||
- [boost/histogram/serialization.hpp][4]
|
||||
|
||||
[1]: histogram/reference.html#header.boost.histogram.ostream_hpp
|
||||
[2]: histogram/reference.html#header.boost.histogram.axis.ostream_hpp
|
||||
[3]: histogram/reference.html#header.boost.histogram.accumulators.ostream_hpp
|
||||
[4]: histogram/reference.html#header.boost.histogram.serialization_hpp
|
||||
*/
|
||||
|
||||
#include <boost/histogram/accumulators.hpp>
|
||||
#include <boost/histogram/algorithm.hpp>
|
||||
#include <boost/histogram/axis.hpp>
|
||||
#include <boost/histogram/histogram.hpp>
|
||||
#include <boost/histogram/indexed.hpp>
|
||||
#include <boost/histogram/literals.hpp>
|
||||
#include <boost/histogram/make_histogram.hpp>
|
||||
#include <boost/histogram/make_profile.hpp>
|
||||
#include <boost/histogram/storage_adaptor.hpp>
|
||||
#include <boost/histogram/unlimited_storage.hpp>
|
||||
|
||||
#endif
|
||||
@ -1,63 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2016 Paul Fultz II
|
||||
boost/hof.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)
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_HOF_GUARD_BOOST_HOF_HPP
|
||||
#define BOOST_HOF_GUARD_BOOST_HOF_HPP
|
||||
|
||||
#include <boost/hof/alias.hpp>
|
||||
#include <boost/hof/always.hpp>
|
||||
#include <boost/hof/apply_eval.hpp>
|
||||
#include <boost/hof/apply.hpp>
|
||||
#include <boost/hof/arg.hpp>
|
||||
#include <boost/hof/proj.hpp>
|
||||
#include <boost/hof/capture.hpp>
|
||||
#include <boost/hof/combine.hpp>
|
||||
#include <boost/hof/compose.hpp>
|
||||
#include <boost/hof/fold.hpp>
|
||||
#include <boost/hof/first_of.hpp>
|
||||
#include <boost/hof/construct.hpp>
|
||||
#include <boost/hof/decay.hpp>
|
||||
#include <boost/hof/decorate.hpp>
|
||||
#include <boost/hof/eval.hpp>
|
||||
#include <boost/hof/fix.hpp>
|
||||
#include <boost/hof/flip.hpp>
|
||||
#include <boost/hof/flow.hpp>
|
||||
#include <boost/hof/function.hpp>
|
||||
#include <boost/hof/identity.hpp>
|
||||
#include <boost/hof/if.hpp>
|
||||
#include <boost/hof/implicit.hpp>
|
||||
#include <boost/hof/indirect.hpp>
|
||||
#include <boost/hof/infix.hpp>
|
||||
#include <boost/hof/is_invocable.hpp>
|
||||
#include <boost/hof/lambda.hpp>
|
||||
#include <boost/hof/lazy.hpp>
|
||||
#include <boost/hof/lift.hpp>
|
||||
#include <boost/hof/limit.hpp>
|
||||
#include <boost/hof/match.hpp>
|
||||
#include <boost/hof/mutable.hpp>
|
||||
#include <boost/hof/pack.hpp>
|
||||
#include <boost/hof/partial.hpp>
|
||||
#include <boost/hof/pipable.hpp>
|
||||
#include <boost/hof/placeholders.hpp>
|
||||
#include <boost/hof/protect.hpp>
|
||||
#include <boost/hof/repeat.hpp>
|
||||
#include <boost/hof/repeat_while.hpp>
|
||||
#include <boost/hof/result.hpp>
|
||||
#include <boost/hof/returns.hpp>
|
||||
#include <boost/hof/reveal.hpp>
|
||||
#include <boost/hof/reverse_fold.hpp>
|
||||
#include <boost/hof/rotate.hpp>
|
||||
#include <boost/hof/static.hpp>
|
||||
#include <boost/hof/tap.hpp>
|
||||
#include <boost/hof/unpack.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace hof {
|
||||
|
||||
}} // namespace boost::hof
|
||||
|
||||
#endif
|
||||
@ -1,38 +0,0 @@
|
||||
// Copyright David Abrahams 2003.
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_IMPLICIT_CAST_DWA200356_HPP
|
||||
#define BOOST_IMPLICIT_CAST_DWA200356_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace detail {
|
||||
|
||||
template<class T> struct icast_identity
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
// implementation originally suggested by C. Green in
|
||||
// http://lists.boost.org/MailArchives/boost/msg00886.php
|
||||
|
||||
// The use of identity creates a non-deduced form, so that the
|
||||
// explicit template argument must be supplied
|
||||
template <typename T>
|
||||
BOOST_CONSTEXPR inline T implicit_cast (typename boost::detail::icast_identity<T>::type x) {
|
||||
return x;
|
||||
}
|
||||
|
||||
} // namespace boost
|
||||
|
||||
|
||||
#endif // BOOST_IMPLICIT_CAST_DWA200356_HPP
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user