Initial Commit
This commit is contained in:
@@ -0,0 +1,84 @@
|
||||
// (C) Copyright John Maddock 2007.
|
||||
// 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)
|
||||
//
|
||||
// This file is machine generated, do not edit by hand
|
||||
|
||||
// Polynomial evaluation using Horners rule
|
||||
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_10_HPP
|
||||
#define BOOST_MATH_TOOLS_POLY_EVAL_10_HPP
|
||||
|
||||
namespace boost{ namespace math{ namespace tools{ namespace detail{
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T*, const V&, const mpl::int_<0>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>(0);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>(a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>(a[1] * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>((((a[4] * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>(((((a[5] * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>((((((a[6] * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>(((((((a[7] * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<9>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>((((((((a[8] * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
template <class T, class V>
|
||||
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<10>*) BOOST_MATH_NOEXCEPT(V)
|
||||
{
|
||||
return static_cast<V>(((((((((a[9] * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
|
||||
}
|
||||
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_TAG_OF_09232005_0845)
|
||||
#define FUSION_TAG_OF_09232005_0845
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
#include <boost/fusion/support/tag_of_fwd.hpp>
|
||||
#include <boost/fusion/support/detail/is_mpl_sequence.hpp>
|
||||
#include <boost/mpl/has_xxx.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/config/no_tr1/utility.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
template <typename T, std::size_t N>
|
||||
class array; // forward
|
||||
|
||||
namespace tuples
|
||||
{
|
||||
struct null_type;
|
||||
|
||||
template <
|
||||
class T0, class T1, class T2, class T3, class T4,
|
||||
class T5, class T6, class T7, class T8, class T9
|
||||
>
|
||||
class tuple;
|
||||
|
||||
template <class Head, class Tail>
|
||||
struct cons;
|
||||
}
|
||||
}
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct non_fusion_tag;
|
||||
struct mpl_sequence_tag;
|
||||
|
||||
namespace detail
|
||||
{
|
||||
BOOST_MPL_HAS_XXX_TRAIT_DEF(fusion_tag)
|
||||
|
||||
template <typename Sequence, typename Active>
|
||||
struct tag_of_impl
|
||||
: mpl::if_<fusion::detail::is_mpl_sequence<Sequence>,
|
||||
mpl::identity<mpl_sequence_tag>,
|
||||
mpl::identity<non_fusion_tag> >::type
|
||||
{};
|
||||
|
||||
template <typename Sequence>
|
||||
struct tag_of_impl<
|
||||
Sequence
|
||||
, typename boost::enable_if<detail::has_fusion_tag<Sequence> >::type>
|
||||
{
|
||||
typedef typename Sequence::fusion_tag type;
|
||||
};
|
||||
}
|
||||
|
||||
namespace traits
|
||||
{
|
||||
template <typename Sequence, typename Active>
|
||||
struct tag_of
|
||||
: boost::fusion::detail::tag_of_impl<Sequence, Active>
|
||||
{};
|
||||
}
|
||||
|
||||
namespace detail
|
||||
{
|
||||
template<typename T>
|
||||
struct tag_of
|
||||
: traits::tag_of<typename remove_const<T>::type>
|
||||
{};
|
||||
}
|
||||
}}
|
||||
#endif
|
||||
@@ -0,0 +1,46 @@
|
||||
// Copyright Neil Groves 2009. 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/range/
|
||||
//
|
||||
#ifndef BOOST_RANGE_ALGORITHM_REPLACE_COPY_IF_HPP_INCLUDED
|
||||
#define BOOST_RANGE_ALGORITHM_REPLACE_COPY_IF_HPP_INCLUDED
|
||||
|
||||
#include <boost/concept_check.hpp>
|
||||
#include <boost/range/begin.hpp>
|
||||
#include <boost/range/end.hpp>
|
||||
#include <boost/range/concepts.hpp>
|
||||
#include <algorithm>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace range
|
||||
{
|
||||
|
||||
/// \brief template function replace_copy_if
|
||||
///
|
||||
/// range-based version of the replace_copy_if std algorithm
|
||||
///
|
||||
/// \pre ForwardRange is a model of the ForwardRangeConcept
|
||||
/// \pre Predicate is a model of the PredicateConcept
|
||||
/// \pre Value is convertible to Predicate's argument type
|
||||
/// \pre Value is Assignable
|
||||
/// \pre Value is convertible to a type in OutputIterator's set of value types.
|
||||
template< class ForwardRange, class OutputIterator, class Predicate, class Value >
|
||||
inline OutputIterator
|
||||
replace_copy_if(const ForwardRange& rng, OutputIterator out_it, Predicate pred,
|
||||
const Value& with_what)
|
||||
{
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange> ));
|
||||
return std::replace_copy_if(boost::begin(rng), boost::end(rng), out_it,
|
||||
pred, with_what);
|
||||
}
|
||||
|
||||
} // namespace range
|
||||
using range::replace_copy_if;
|
||||
} // namespace boost
|
||||
|
||||
#endif // include guard
|
||||
@@ -0,0 +1,242 @@
|
||||
// Copyright David Abrahams 2002.
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
#ifndef NUMARRAY_DWA2002922_HPP
|
||||
# define NUMARRAY_DWA2002922_HPP
|
||||
|
||||
# include <boost/python/detail/prefix.hpp>
|
||||
|
||||
# include <boost/python/tuple.hpp>
|
||||
# include <boost/python/str.hpp>
|
||||
# include <boost/preprocessor/iteration/local.hpp>
|
||||
# include <boost/preprocessor/cat.hpp>
|
||||
# include <boost/preprocessor/repetition/enum.hpp>
|
||||
# include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
# include <boost/preprocessor/repetition/enum_binary_params.hpp>
|
||||
|
||||
namespace boost { namespace python { namespace numeric {
|
||||
|
||||
class array;
|
||||
|
||||
namespace aux
|
||||
{
|
||||
struct BOOST_PYTHON_DECL array_base : object
|
||||
{
|
||||
# define BOOST_PP_LOCAL_MACRO(n) \
|
||||
array_base(BOOST_PP_ENUM_PARAMS_Z(1, n, object const& x));
|
||||
# define BOOST_PP_LOCAL_LIMITS (1, 7)
|
||||
# include BOOST_PP_LOCAL_ITERATE()
|
||||
|
||||
object argmax(long axis=-1);
|
||||
object argmin(long axis=-1);
|
||||
object argsort(long axis=-1);
|
||||
object astype(object const& type = object());
|
||||
void byteswap();
|
||||
object copy() const;
|
||||
object diagonal(long offset = 0, long axis1 = 0, long axis2 = 1) const;
|
||||
void info() const;
|
||||
bool is_c_array() const;
|
||||
bool isbyteswapped() const;
|
||||
array new_(object type) const;
|
||||
void sort();
|
||||
object trace(long offset = 0, long axis1 = 0, long axis2 = 1) const;
|
||||
object type() const;
|
||||
char typecode() const;
|
||||
|
||||
object factory(
|
||||
object const& sequence = object()
|
||||
, object const& typecode = object()
|
||||
, bool copy = true
|
||||
, bool savespace = false
|
||||
, object type = object()
|
||||
, object shape = object());
|
||||
|
||||
object getflat() const;
|
||||
long getrank() const;
|
||||
object getshape() const;
|
||||
bool isaligned() const;
|
||||
bool iscontiguous() const;
|
||||
long itemsize() const;
|
||||
long nelements() const;
|
||||
object nonzero() const;
|
||||
|
||||
void put(object const& indices, object const& values);
|
||||
|
||||
void ravel();
|
||||
|
||||
object repeat(object const& repeats, long axis=0);
|
||||
|
||||
void resize(object const& shape);
|
||||
|
||||
void setflat(object const& flat);
|
||||
void setshape(object const& shape);
|
||||
|
||||
void swapaxes(long axis1, long axis2);
|
||||
|
||||
object take(object const& sequence, long axis = 0) const;
|
||||
|
||||
void tofile(object const& file) const;
|
||||
|
||||
str tostring() const;
|
||||
|
||||
void transpose(object const& axes = object());
|
||||
|
||||
object view() const;
|
||||
|
||||
public: // implementation detail - do not touch.
|
||||
BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(array_base, object);
|
||||
};
|
||||
|
||||
struct BOOST_PYTHON_DECL array_object_manager_traits
|
||||
{
|
||||
static bool check(PyObject* obj);
|
||||
static detail::new_non_null_reference adopt(PyObject* obj);
|
||||
static PyTypeObject const* get_pytype() ;
|
||||
};
|
||||
} // namespace aux
|
||||
|
||||
class array : public aux::array_base
|
||||
{
|
||||
typedef aux::array_base base;
|
||||
public:
|
||||
|
||||
object astype() { return base::astype(); }
|
||||
|
||||
template <class Type>
|
||||
object astype(Type const& type_)
|
||||
{
|
||||
return base::astype(object(type_));
|
||||
}
|
||||
|
||||
template <class Type>
|
||||
array new_(Type const& type_) const
|
||||
{
|
||||
return base::new_(object(type_));
|
||||
}
|
||||
|
||||
template <class Sequence>
|
||||
void resize(Sequence const& x)
|
||||
{
|
||||
base::resize(object(x));
|
||||
}
|
||||
|
||||
# define BOOST_PP_LOCAL_MACRO(n) \
|
||||
void resize(BOOST_PP_ENUM_PARAMS_Z(1, n, long x)) \
|
||||
{ \
|
||||
resize(make_tuple(BOOST_PP_ENUM_PARAMS_Z(1, n, x))); \
|
||||
}
|
||||
# define BOOST_PP_LOCAL_LIMITS (1, BOOST_PYTHON_MAX_ARITY)
|
||||
# include BOOST_PP_LOCAL_ITERATE()
|
||||
|
||||
template <class Sequence>
|
||||
void setshape(Sequence const& x)
|
||||
{
|
||||
base::setshape(object(x));
|
||||
}
|
||||
|
||||
# define BOOST_PP_LOCAL_MACRO(n) \
|
||||
void setshape(BOOST_PP_ENUM_PARAMS_Z(1, n, long x)) \
|
||||
{ \
|
||||
setshape(make_tuple(BOOST_PP_ENUM_PARAMS_Z(1, n, x))); \
|
||||
}
|
||||
# define BOOST_PP_LOCAL_LIMITS (1, BOOST_PYTHON_MAX_ARITY)
|
||||
# include BOOST_PP_LOCAL_ITERATE()
|
||||
|
||||
template <class Indices, class Values>
|
||||
void put(Indices const& indices, Values const& values)
|
||||
{
|
||||
base::put(object(indices), object(values));
|
||||
}
|
||||
|
||||
template <class Sequence>
|
||||
object take(Sequence const& sequence, long axis = 0)
|
||||
{
|
||||
return base::take(object(sequence), axis);
|
||||
}
|
||||
|
||||
template <class File>
|
||||
void tofile(File const& f) const
|
||||
{
|
||||
base::tofile(object(f));
|
||||
}
|
||||
|
||||
object factory()
|
||||
{
|
||||
return base::factory();
|
||||
}
|
||||
|
||||
template <class Sequence>
|
||||
object factory(Sequence const& sequence)
|
||||
{
|
||||
return base::factory(object(sequence));
|
||||
}
|
||||
|
||||
template <class Sequence, class Typecode>
|
||||
object factory(
|
||||
Sequence const& sequence
|
||||
, Typecode const& typecode_
|
||||
, bool copy = true
|
||||
, bool savespace = false
|
||||
)
|
||||
{
|
||||
return base::factory(object(sequence), object(typecode_), copy, savespace);
|
||||
}
|
||||
|
||||
template <class Sequence, class Typecode, class Type>
|
||||
object factory(
|
||||
Sequence const& sequence
|
||||
, Typecode const& typecode_
|
||||
, bool copy
|
||||
, bool savespace
|
||||
, Type const& type
|
||||
)
|
||||
{
|
||||
return base::factory(object(sequence), object(typecode_), copy, savespace, object(type));
|
||||
}
|
||||
|
||||
template <class Sequence, class Typecode, class Type, class Shape>
|
||||
object factory(
|
||||
Sequence const& sequence
|
||||
, Typecode const& typecode_
|
||||
, bool copy
|
||||
, bool savespace
|
||||
, Type const& type
|
||||
, Shape const& shape
|
||||
)
|
||||
{
|
||||
return base::factory(object(sequence), object(typecode_), copy, savespace, object(type), object(shape));
|
||||
}
|
||||
|
||||
# define BOOST_PYTHON_ENUM_AS_OBJECT(z, n, x) object(BOOST_PP_CAT(x,n))
|
||||
# define BOOST_PP_LOCAL_MACRO(n) \
|
||||
template <BOOST_PP_ENUM_PARAMS_Z(1, n, class T)> \
|
||||
explicit array(BOOST_PP_ENUM_BINARY_PARAMS_Z(1, n, T, const& x)) \
|
||||
: base(BOOST_PP_ENUM_1(n, BOOST_PYTHON_ENUM_AS_OBJECT, x)) \
|
||||
{}
|
||||
# define BOOST_PP_LOCAL_LIMITS (1, 7)
|
||||
# include BOOST_PP_LOCAL_ITERATE()
|
||||
# undef BOOST_PYTHON_AS_OBJECT
|
||||
|
||||
static BOOST_PYTHON_DECL void set_module_and_type(char const* package_name = 0, char const* type_attribute_name = 0);
|
||||
static BOOST_PYTHON_DECL std::string get_module_name();
|
||||
|
||||
public: // implementation detail -- for internal use only
|
||||
BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(array, base);
|
||||
};
|
||||
|
||||
} // namespace boost::python::numeric
|
||||
|
||||
namespace converter
|
||||
{
|
||||
template <>
|
||||
struct object_manager_traits< numeric::array >
|
||||
: numeric::aux::array_object_manager_traits
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(bool, is_specialized = true);
|
||||
};
|
||||
}
|
||||
|
||||
}} // namespace boost::python
|
||||
|
||||
#endif // NUMARRAY_DWA2002922_HPP
|
||||
@@ -0,0 +1,35 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
Copyright (c) 2011 Brandon Kohn
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_MAP_DETAIL_VALUE_AT_IMPL_HPP)
|
||||
#define BOOST_FUSION_MAP_DETAIL_VALUE_AT_IMPL_HPP
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/mpl/at.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct map_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct value_at_impl;
|
||||
|
||||
template <>
|
||||
struct value_at_impl<map_tag>
|
||||
{
|
||||
template <typename Sequence, typename N>
|
||||
struct apply
|
||||
{
|
||||
typedef typename mpl::at<typename Sequence::storage_type::types, N>::type type;
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif //BOOST_FUSION_MAP_DETAIL_VALUE_AT_IMPL_HPP
|
||||
@@ -0,0 +1,28 @@
|
||||
// Boost.Units - A C++ library for zero-overhead dimensional analysis and
|
||||
// unit/quantity manipulation and conversion
|
||||
//
|
||||
// Copyright (C) 2003-2008 Matthias Christian Schabel
|
||||
// Copyright (C) 2008 Steven Watanabe
|
||||
//
|
||||
// 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_UNITS_FREQUENCY_DERIVED_DIMENSION_HPP
|
||||
#define BOOST_UNITS_FREQUENCY_DERIVED_DIMENSION_HPP
|
||||
|
||||
#include <boost/units/derived_dimension.hpp>
|
||||
#include <boost/units/physical_dimensions/time.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace units {
|
||||
|
||||
/// derived dimension for frequency : T^-1
|
||||
typedef derived_dimension<time_base_dimension,-1>::type frequency_dimension;
|
||||
|
||||
} // namespace units
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_UNITS_FREQUENCY_DERIVED_DIMENSION_HPP
|
||||
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
*
|
||||
* 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 for most recent version.
|
||||
* FILE pattern_except.hpp
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: Declares pattern-matching exception classes.
|
||||
*/
|
||||
|
||||
#ifndef BOOST_RE_PAT_EXCEPT_HPP
|
||||
#define BOOST_RE_PAT_EXCEPT_HPP
|
||||
|
||||
#ifndef BOOST_REGEX_CONFIG_HPP
|
||||
#include <boost/regex/config.hpp>
|
||||
#endif
|
||||
|
||||
#include <stdexcept>
|
||||
#include <cstddef>
|
||||
#include <boost/regex/v4/error_type.hpp>
|
||||
|
||||
namespace boost{
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable: 4103)
|
||||
#endif
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_PREFIX
|
||||
#endif
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4275)
|
||||
#endif
|
||||
class BOOST_REGEX_DECL regex_error : public std::runtime_error
|
||||
{
|
||||
public:
|
||||
explicit regex_error(const std::string& s, regex_constants::error_type err = regex_constants::error_unknown, std::ptrdiff_t pos = 0);
|
||||
explicit regex_error(regex_constants::error_type err);
|
||||
~regex_error() throw();
|
||||
regex_constants::error_type code()const
|
||||
{ return m_error_code; }
|
||||
std::ptrdiff_t position()const
|
||||
{ return m_position; }
|
||||
void raise()const;
|
||||
private:
|
||||
regex_constants::error_type m_error_code;
|
||||
std::ptrdiff_t m_position;
|
||||
};
|
||||
|
||||
typedef regex_error bad_pattern;
|
||||
typedef regex_error bad_expression;
|
||||
|
||||
namespace BOOST_REGEX_DETAIL_NS{
|
||||
|
||||
BOOST_REGEX_DECL void BOOST_REGEX_CALL raise_runtime_error(const std::runtime_error& ex);
|
||||
|
||||
template <class traits>
|
||||
void raise_error(const traits& t, regex_constants::error_type code)
|
||||
{
|
||||
(void)t; // warning suppression
|
||||
std::runtime_error e(t.error_string(code));
|
||||
::boost::BOOST_REGEX_DETAIL_NS::raise_runtime_error(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable: 4103)
|
||||
#endif
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,303 @@
|
||||
// (C) Copyright John Maddock 2001 - 2003.
|
||||
// (C) Copyright Darin Adler 2001 - 2002.
|
||||
// (C) Copyright Peter Dimov 2001.
|
||||
// (C) Copyright Aleksey Gurtovoy 2002.
|
||||
// (C) Copyright David Abrahams 2002 - 2003.
|
||||
// (C) Copyright Beman Dawes 2002 - 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 for most recent version.
|
||||
//
|
||||
// Microsoft Visual C++ compiler setup:
|
||||
//
|
||||
// We need to be careful with the checks in this file, as contrary
|
||||
// to popular belief there are versions with _MSC_VER with the final
|
||||
// digit non-zero (mainly the MIPS cross compiler).
|
||||
//
|
||||
// So we either test _MSC_VER >= XXXX or else _MSC_VER < XXXX.
|
||||
// No other comparisons (==, >, or <=) are safe.
|
||||
//
|
||||
|
||||
#define BOOST_MSVC _MSC_VER
|
||||
|
||||
//
|
||||
// Helper macro BOOST_MSVC_FULL_VER for use in Boost code:
|
||||
//
|
||||
#if _MSC_FULL_VER > 100000000
|
||||
# define BOOST_MSVC_FULL_VER _MSC_FULL_VER
|
||||
#else
|
||||
# define BOOST_MSVC_FULL_VER (_MSC_FULL_VER * 10)
|
||||
#endif
|
||||
|
||||
// Attempt to suppress VC6 warnings about the length of decorated names (obsolete):
|
||||
#pragma warning( disable : 4503 ) // warning: decorated name length exceeded
|
||||
|
||||
#define BOOST_HAS_PRAGMA_ONCE
|
||||
|
||||
//
|
||||
// versions check:
|
||||
// we don't support Visual C++ prior to version 7.1:
|
||||
#if _MSC_VER < 1310
|
||||
# error "Compiler not supported or configured - please reconfigure"
|
||||
#endif
|
||||
|
||||
#if _MSC_FULL_VER < 180020827
|
||||
# define BOOST_NO_FENV_H
|
||||
#endif
|
||||
|
||||
#if _MSC_VER < 1400
|
||||
// although a conforming signature for swprint exists in VC7.1
|
||||
// it appears not to actually work:
|
||||
# define BOOST_NO_SWPRINTF
|
||||
// Our extern template tests also fail for this compiler:
|
||||
# define BOOST_NO_CXX11_EXTERN_TEMPLATE
|
||||
// Variadic macros do not exist for VC7.1 and lower
|
||||
# define BOOST_NO_CXX11_VARIADIC_MACROS
|
||||
# define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
|
||||
#endif
|
||||
|
||||
#if _MSC_VER < 1500 // 140X == VC++ 8.0
|
||||
# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
#endif
|
||||
|
||||
#if _MSC_VER < 1600 // 150X == VC++ 9.0
|
||||
// A bug in VC9:
|
||||
# define BOOST_NO_ADL_BARRIER
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef _NATIVE_WCHAR_T_DEFINED
|
||||
# define BOOST_NO_INTRINSIC_WCHAR_T
|
||||
#endif
|
||||
|
||||
//
|
||||
// check for exception handling support:
|
||||
#if !defined(_CPPUNWIND) && !defined(BOOST_NO_EXCEPTIONS)
|
||||
# define BOOST_NO_EXCEPTIONS
|
||||
#endif
|
||||
|
||||
//
|
||||
// __int64 support:
|
||||
//
|
||||
#define BOOST_HAS_MS_INT64
|
||||
#if defined(_MSC_EXTENSIONS) || (_MSC_VER >= 1400)
|
||||
# define BOOST_HAS_LONG_LONG
|
||||
#else
|
||||
# define BOOST_NO_LONG_LONG
|
||||
#endif
|
||||
#if (_MSC_VER >= 1400) && !defined(_DEBUG)
|
||||
# define BOOST_HAS_NRVO
|
||||
#endif
|
||||
#if _MSC_VER >= 1600 // 160X == VC++ 10.0
|
||||
# define BOOST_HAS_PRAGMA_DETECT_MISMATCH
|
||||
#endif
|
||||
//
|
||||
// disable Win32 API's if compiler extensions are
|
||||
// turned off:
|
||||
//
|
||||
#if !defined(_MSC_EXTENSIONS) && !defined(BOOST_DISABLE_WIN32)
|
||||
# define BOOST_DISABLE_WIN32
|
||||
#endif
|
||||
#if !defined(_CPPRTTI) && !defined(BOOST_NO_RTTI)
|
||||
# define BOOST_NO_RTTI
|
||||
#endif
|
||||
|
||||
//
|
||||
// TR1 features:
|
||||
//
|
||||
#if _MSC_VER >= 1700
|
||||
// # define BOOST_HAS_TR1_HASH // don't know if this is true yet.
|
||||
// # define BOOST_HAS_TR1_TYPE_TRAITS // don't know if this is true yet.
|
||||
# define BOOST_HAS_TR1_UNORDERED_MAP
|
||||
# define BOOST_HAS_TR1_UNORDERED_SET
|
||||
#endif
|
||||
|
||||
//
|
||||
// C++0x features
|
||||
//
|
||||
// See above for BOOST_NO_LONG_LONG
|
||||
|
||||
// C++ features supported by VC++ 10 (aka 2010)
|
||||
//
|
||||
#if _MSC_VER < 1600
|
||||
# define BOOST_NO_CXX11_AUTO_DECLARATIONS
|
||||
# define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
|
||||
# define BOOST_NO_CXX11_LAMBDAS
|
||||
# define BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
# define BOOST_NO_CXX11_STATIC_ASSERT
|
||||
# define BOOST_NO_CXX11_NULLPTR
|
||||
# define BOOST_NO_CXX11_DECLTYPE
|
||||
#endif // _MSC_VER < 1600
|
||||
|
||||
#if _MSC_VER >= 1600
|
||||
# define BOOST_HAS_STDINT_H
|
||||
#endif
|
||||
|
||||
// C++11 features supported by VC++ 11 (aka 2012)
|
||||
//
|
||||
#if _MSC_VER < 1700
|
||||
# define BOOST_NO_CXX11_FINAL
|
||||
# define BOOST_NO_CXX11_RANGE_BASED_FOR
|
||||
# define BOOST_NO_CXX11_SCOPED_ENUMS
|
||||
#endif // _MSC_VER < 1700
|
||||
|
||||
// C++11 features supported by VC++ 12 (aka 2013).
|
||||
//
|
||||
#if _MSC_FULL_VER < 180020827
|
||||
# define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
|
||||
# define BOOST_NO_CXX11_DELETED_FUNCTIONS
|
||||
# define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
|
||||
# define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
|
||||
# define BOOST_NO_CXX11_RAW_LITERALS
|
||||
# define BOOST_NO_CXX11_TEMPLATE_ALIASES
|
||||
# define BOOST_NO_CXX11_TRAILING_RESULT_TYPES
|
||||
# define BOOST_NO_CXX11_VARIADIC_TEMPLATES
|
||||
# define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
|
||||
# define BOOST_NO_CXX11_DECLTYPE_N3276
|
||||
#endif
|
||||
|
||||
#if _MSC_FULL_VER >= 180020827
|
||||
#define BOOST_HAS_EXPM1
|
||||
#define BOOST_HAS_LOG1P
|
||||
#endif
|
||||
|
||||
// C++11 features supported by VC++ 14 (aka 2015)
|
||||
//
|
||||
#if (_MSC_FULL_VER < 190023026)
|
||||
# define BOOST_NO_CXX11_NOEXCEPT
|
||||
# define BOOST_NO_CXX11_REF_QUALIFIERS
|
||||
# define BOOST_NO_CXX11_USER_DEFINED_LITERALS
|
||||
# define BOOST_NO_CXX11_ALIGNAS
|
||||
# define BOOST_NO_CXX11_INLINE_NAMESPACES
|
||||
# define BOOST_NO_CXX11_CHAR16_T
|
||||
# define BOOST_NO_CXX11_CHAR32_T
|
||||
# define BOOST_NO_CXX11_UNICODE_LITERALS
|
||||
# define BOOST_NO_CXX14_DECLTYPE_AUTO
|
||||
# define BOOST_NO_CXX14_INITIALIZED_LAMBDA_CAPTURES
|
||||
# define BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION
|
||||
# define BOOST_NO_CXX14_BINARY_LITERALS
|
||||
# define BOOST_NO_CXX14_GENERIC_LAMBDAS
|
||||
# define BOOST_NO_CXX14_DIGIT_SEPARATORS
|
||||
# define BOOST_NO_CXX11_THREAD_LOCAL
|
||||
#endif
|
||||
// C++11 features supported by VC++ 14 update 3 (aka 2015)
|
||||
//
|
||||
#if (_MSC_FULL_VER < 190024210)
|
||||
# define BOOST_NO_CXX14_VARIABLE_TEMPLATES
|
||||
# define BOOST_NO_SFINAE_EXPR
|
||||
# define BOOST_NO_CXX11_CONSTEXPR
|
||||
#endif
|
||||
|
||||
// C++14 features supported by VC++ 15 Preview 5
|
||||
//
|
||||
#if (_MSC_VER < 1910)
|
||||
# define BOOST_NO_CXX14_AGGREGATE_NSDMI
|
||||
# define BOOST_NO_CXX14_CONSTEXPR
|
||||
#endif
|
||||
|
||||
// MSVC including version 14 has not yet completely
|
||||
// implemented value-initialization, as is reported:
|
||||
// "VC++ does not value-initialize members of derived classes without
|
||||
// user-declared constructor", reported in 2009 by Sylvester Hesp:
|
||||
// https://connect.microsoft.com/VisualStudio/feedback/details/484295
|
||||
// "Presence of copy constructor breaks member class initialization",
|
||||
// reported in 2009 by Alex Vakulenko:
|
||||
// https://connect.microsoft.com/VisualStudio/feedback/details/499606
|
||||
// "Value-initialization in new-expression", reported in 2005 by
|
||||
// Pavel Kuznetsov (MetaCommunications Engineering):
|
||||
// https://connect.microsoft.com/VisualStudio/feedback/details/100744
|
||||
// Reported again by John Maddock in 2015 for VC14:
|
||||
// https://connect.microsoft.com/VisualStudio/feedback/details/1582233/c-subobjects-still-not-value-initialized-correctly
|
||||
// See also: http://www.boost.org/libs/utility/value_init.htm#compiler_issues
|
||||
// (Niels Dekker, LKEB, May 2010)
|
||||
#define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
|
||||
//
|
||||
// C++ 11:
|
||||
//
|
||||
#define BOOST_NO_TWO_PHASE_NAME_LOOKUP
|
||||
|
||||
//
|
||||
// prefix and suffix headers:
|
||||
//
|
||||
#ifndef BOOST_ABI_PREFIX
|
||||
# define BOOST_ABI_PREFIX "boost/config/abi/msvc_prefix.hpp"
|
||||
#endif
|
||||
#ifndef BOOST_ABI_SUFFIX
|
||||
# define BOOST_ABI_SUFFIX "boost/config/abi/msvc_suffix.hpp"
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_COMPILER
|
||||
// TODO:
|
||||
// these things are mostly bogus. 1200 means version 12.0 of the compiler. The
|
||||
// artificial versions assigned to them only refer to the versions of some IDE
|
||||
// these compilers have been shipped with, and even that is not all of it. Some
|
||||
// were shipped with freely downloadable SDKs, others as crosscompilers in eVC.
|
||||
// IOW, you can't use these 'versions' in any sensible way. Sorry.
|
||||
# if defined(UNDER_CE)
|
||||
# if _MSC_VER < 1400
|
||||
// Note: I'm not aware of any CE compiler with version 13xx
|
||||
# if defined(BOOST_ASSERT_CONFIG)
|
||||
# error "Unknown EVC++ compiler version - please run the configure tests and report the results"
|
||||
# else
|
||||
# pragma message("Unknown EVC++ compiler version - please run the configure tests and report the results")
|
||||
# endif
|
||||
# elif _MSC_VER < 1500
|
||||
# define BOOST_COMPILER_VERSION evc8
|
||||
# elif _MSC_VER < 1600
|
||||
# define BOOST_COMPILER_VERSION evc9
|
||||
# elif _MSC_VER < 1700
|
||||
# define BOOST_COMPILER_VERSION evc10
|
||||
# elif _MSC_VER < 1800
|
||||
# define BOOST_COMPILER_VERSION evc11
|
||||
# elif _MSC_VER < 1900
|
||||
# define BOOST_COMPILER_VERSION evc12
|
||||
# elif _MSC_VER < 2000
|
||||
# define BOOST_COMPILER_VERSION evc14
|
||||
# else
|
||||
# if defined(BOOST_ASSERT_CONFIG)
|
||||
# error "Unknown EVC++ compiler version - please run the configure tests and report the results"
|
||||
# else
|
||||
# pragma message("Unknown EVC++ compiler version - please run the configure tests and report the results")
|
||||
# endif
|
||||
# endif
|
||||
# else
|
||||
# if _MSC_VER < 1310
|
||||
// Note: Versions up to 7.0 aren't supported.
|
||||
# define BOOST_COMPILER_VERSION 5.0
|
||||
# elif _MSC_VER < 1300
|
||||
# define BOOST_COMPILER_VERSION 6.0
|
||||
# elif _MSC_VER < 1310
|
||||
# define BOOST_COMPILER_VERSION 7.0
|
||||
# elif _MSC_VER < 1400
|
||||
# define BOOST_COMPILER_VERSION 7.1
|
||||
# elif _MSC_VER < 1500
|
||||
# define BOOST_COMPILER_VERSION 8.0
|
||||
# elif _MSC_VER < 1600
|
||||
# define BOOST_COMPILER_VERSION 9.0
|
||||
# elif _MSC_VER < 1700
|
||||
# define BOOST_COMPILER_VERSION 10.0
|
||||
# elif _MSC_VER < 1800
|
||||
# define BOOST_COMPILER_VERSION 11.0
|
||||
# elif _MSC_VER < 1900
|
||||
# define BOOST_COMPILER_VERSION 12.0
|
||||
# elif _MSC_VER < 2000
|
||||
# define BOOST_COMPILER_VERSION 14.0
|
||||
# else
|
||||
# define BOOST_COMPILER_VERSION _MSC_VER
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# define BOOST_COMPILER "Microsoft Visual C++ version " BOOST_STRINGIZE(BOOST_COMPILER_VERSION)
|
||||
#endif
|
||||
|
||||
//
|
||||
// last known and checked version is 19.10.24629 (VC++ 2017 RC):
|
||||
#if (_MSC_VER > 1910)
|
||||
# if defined(BOOST_ASSERT_CONFIG)
|
||||
# error "Unknown compiler version - please run the configure tests and report the results"
|
||||
# else
|
||||
# pragma message("Unknown compiler version - please run the configure tests and report the results")
|
||||
# endif
|
||||
#endif
|
||||
@@ -0,0 +1,142 @@
|
||||
#ifndef BOOST_ARCHIVE_XML_IARCHIVE_HPP
|
||||
#define BOOST_ARCHIVE_XML_IARCHIVE_HPP
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
#if defined(_MSC_VER)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// xml_iarchive.hpp
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// 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 http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#include <istream>
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
#include <boost/archive/detail/auto_link_archive.hpp>
|
||||
#include <boost/archive/basic_text_iprimitive.hpp>
|
||||
#include <boost/archive/basic_xml_iarchive.hpp>
|
||||
#include <boost/archive/detail/register_archive.hpp>
|
||||
#include <boost/serialization/item_version_type.hpp>
|
||||
|
||||
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable : 4511 4512)
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
namespace detail {
|
||||
template<class Archive> class interface_iarchive;
|
||||
} // namespace detail
|
||||
|
||||
template<class CharType>
|
||||
class basic_xml_grammar;
|
||||
typedef basic_xml_grammar<char> xml_grammar;
|
||||
|
||||
template<class Archive>
|
||||
class BOOST_SYMBOL_VISIBLE xml_iarchive_impl :
|
||||
public basic_text_iprimitive<std::istream>,
|
||||
public basic_xml_iarchive<Archive>
|
||||
{
|
||||
#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
public:
|
||||
#else
|
||||
protected:
|
||||
friend class detail::interface_iarchive<Archive>;
|
||||
friend class basic_xml_iarchive<Archive>;
|
||||
friend class load_access;
|
||||
#endif
|
||||
// use boost:scoped_ptr to implement automatic deletion;
|
||||
boost::scoped_ptr<xml_grammar> gimpl;
|
||||
|
||||
std::istream & get_is(){
|
||||
return is;
|
||||
}
|
||||
template<class T>
|
||||
void load(T & t){
|
||||
basic_text_iprimitive<std::istream>::load(t);
|
||||
}
|
||||
void
|
||||
load(version_type & t){
|
||||
unsigned int v;
|
||||
load(v);
|
||||
t = version_type(v);
|
||||
}
|
||||
void
|
||||
load(boost::serialization::item_version_type & t){
|
||||
unsigned int v;
|
||||
load(v);
|
||||
t = boost::serialization::item_version_type(v);
|
||||
}
|
||||
BOOST_ARCHIVE_DECL void
|
||||
load(char * t);
|
||||
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
|
||||
BOOST_ARCHIVE_DECL void
|
||||
load(wchar_t * t);
|
||||
#endif
|
||||
BOOST_ARCHIVE_DECL void
|
||||
load(std::string &s);
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
BOOST_ARCHIVE_DECL void
|
||||
load(std::wstring &ws);
|
||||
#endif
|
||||
template<class T>
|
||||
void load_override(T & t){
|
||||
basic_xml_iarchive<Archive>::load_override(t);
|
||||
}
|
||||
BOOST_ARCHIVE_DECL void
|
||||
load_override(class_name_type & t);
|
||||
BOOST_ARCHIVE_DECL void
|
||||
init();
|
||||
BOOST_ARCHIVE_DECL
|
||||
xml_iarchive_impl(std::istream & is, unsigned int flags);
|
||||
BOOST_ARCHIVE_DECL
|
||||
~xml_iarchive_impl();
|
||||
};
|
||||
|
||||
} // namespace archive
|
||||
} // namespace boost
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
|
||||
#ifdef BOOST_MSVC
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable : 4511 4512)
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace archive {
|
||||
|
||||
class BOOST_SYMBOL_VISIBLE xml_iarchive :
|
||||
public xml_iarchive_impl<xml_iarchive>{
|
||||
public:
|
||||
xml_iarchive(std::istream & is, unsigned int flags = 0) :
|
||||
xml_iarchive_impl<xml_iarchive>(is, flags)
|
||||
{}
|
||||
~xml_iarchive(){};
|
||||
};
|
||||
|
||||
} // namespace archive
|
||||
} // namespace boost
|
||||
|
||||
// required by export
|
||||
BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::xml_iarchive)
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#endif // BOOST_ARCHIVE_XML_IARCHIVE_HPP
|
||||
@@ -0,0 +1,301 @@
|
||||
#ifndef BOOST_CORE_REF_HPP
|
||||
#define BOOST_CORE_REF_HPP
|
||||
|
||||
// MS compatible compilers support #pragma once
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/utility/addressof.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
//
|
||||
// ref.hpp - ref/cref, useful helper functions
|
||||
//
|
||||
// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
|
||||
// Copyright (C) 2001, 2002 Peter Dimov
|
||||
// Copyright (C) 2002 David Abrahams
|
||||
//
|
||||
// Copyright (C) 2014 Glen Joseph Fernandes
|
||||
// glenfe at live dot com
|
||||
// Copyright (C) 2014 Agustin Berge
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// See http://www.boost.org/libs/core/doc/html/core/ref.html for documentation.
|
||||
//
|
||||
|
||||
/**
|
||||
@file
|
||||
*/
|
||||
|
||||
/**
|
||||
Boost namespace.
|
||||
*/
|
||||
namespace boost
|
||||
{
|
||||
|
||||
#if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, == 1600 )
|
||||
|
||||
struct ref_workaround_tag {};
|
||||
|
||||
#endif
|
||||
|
||||
// reference_wrapper
|
||||
|
||||
/**
|
||||
@brief Contains a reference to an object of type `T`.
|
||||
|
||||
`reference_wrapper` is primarily used to "feed" references to
|
||||
function templates (algorithms) that take their parameter by
|
||||
value. It provides an implicit conversion to `T&`, which
|
||||
usually allows the function templates to work on references
|
||||
unmodified.
|
||||
*/
|
||||
template<class T> class reference_wrapper
|
||||
{
|
||||
public:
|
||||
/**
|
||||
Type `T`.
|
||||
*/
|
||||
typedef T type;
|
||||
|
||||
/**
|
||||
Constructs a `reference_wrapper` object that stores a
|
||||
reference to `t`.
|
||||
|
||||
@remark Does not throw.
|
||||
*/
|
||||
BOOST_FORCEINLINE explicit reference_wrapper(T& t): t_(boost::addressof(t)) {}
|
||||
|
||||
#if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, == 1600 )
|
||||
|
||||
BOOST_FORCEINLINE explicit reference_wrapper( T & t, ref_workaround_tag ): t_( boost::addressof( t ) ) {}
|
||||
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
/**
|
||||
@remark Construction from a temporary object is disabled.
|
||||
*/
|
||||
BOOST_DELETED_FUNCTION(reference_wrapper(T&& t))
|
||||
public:
|
||||
#endif
|
||||
|
||||
/**
|
||||
@return The stored reference.
|
||||
@remark Does not throw.
|
||||
*/
|
||||
BOOST_FORCEINLINE operator T& () const { return *t_; }
|
||||
|
||||
/**
|
||||
@return The stored reference.
|
||||
@remark Does not throw.
|
||||
*/
|
||||
BOOST_FORCEINLINE T& get() const { return *t_; }
|
||||
|
||||
/**
|
||||
@return A pointer to the object referenced by the stored
|
||||
reference.
|
||||
@remark Does not throw.
|
||||
*/
|
||||
BOOST_FORCEINLINE T* get_pointer() const { return t_; }
|
||||
|
||||
private:
|
||||
|
||||
T* t_;
|
||||
};
|
||||
|
||||
// ref
|
||||
|
||||
/**
|
||||
@cond
|
||||
*/
|
||||
#if defined( __BORLANDC__ ) && BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT(0x581) )
|
||||
# define BOOST_REF_CONST
|
||||
#else
|
||||
# define BOOST_REF_CONST const
|
||||
#endif
|
||||
/**
|
||||
@endcond
|
||||
*/
|
||||
|
||||
/**
|
||||
@return `reference_wrapper<T>(t)`
|
||||
@remark Does not throw.
|
||||
*/
|
||||
template<class T> BOOST_FORCEINLINE reference_wrapper<T> BOOST_REF_CONST ref( T & t )
|
||||
{
|
||||
#if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, == 1600 )
|
||||
|
||||
return reference_wrapper<T>( t, ref_workaround_tag() );
|
||||
|
||||
#else
|
||||
|
||||
return reference_wrapper<T>( t );
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
// cref
|
||||
|
||||
/**
|
||||
@return `reference_wrapper<T const>(t)`
|
||||
@remark Does not throw.
|
||||
*/
|
||||
template<class T> BOOST_FORCEINLINE reference_wrapper<T const> BOOST_REF_CONST cref( T const & t )
|
||||
{
|
||||
return reference_wrapper<T const>(t);
|
||||
}
|
||||
|
||||
#undef BOOST_REF_CONST
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
|
||||
/**
|
||||
@cond
|
||||
*/
|
||||
#if defined(BOOST_NO_CXX11_DELETED_FUNCTIONS)
|
||||
# define BOOST_REF_DELETE
|
||||
#else
|
||||
# define BOOST_REF_DELETE = delete
|
||||
#endif
|
||||
/**
|
||||
@endcond
|
||||
*/
|
||||
|
||||
/**
|
||||
@remark Construction from a temporary object is disabled.
|
||||
*/
|
||||
template<class T> void ref(T const&&) BOOST_REF_DELETE;
|
||||
|
||||
/**
|
||||
@remark Construction from a temporary object is disabled.
|
||||
*/
|
||||
template<class T> void cref(T const&&) BOOST_REF_DELETE;
|
||||
|
||||
#undef BOOST_REF_DELETE
|
||||
|
||||
#endif
|
||||
|
||||
// is_reference_wrapper
|
||||
|
||||
/**
|
||||
@brief Determine if a type `T` is an instantiation of
|
||||
`reference_wrapper`.
|
||||
|
||||
The value static constant will be true if the type `T` is a
|
||||
specialization of `reference_wrapper`.
|
||||
*/
|
||||
template<typename T> struct is_reference_wrapper
|
||||
{
|
||||
BOOST_STATIC_CONSTANT( bool, value = false );
|
||||
};
|
||||
|
||||
/**
|
||||
@cond
|
||||
*/
|
||||
template<typename T> struct is_reference_wrapper< reference_wrapper<T> >
|
||||
{
|
||||
BOOST_STATIC_CONSTANT( bool, value = true );
|
||||
};
|
||||
|
||||
#if !defined(BOOST_NO_CV_SPECIALIZATIONS)
|
||||
|
||||
template<typename T> struct is_reference_wrapper< reference_wrapper<T> const >
|
||||
{
|
||||
BOOST_STATIC_CONSTANT( bool, value = true );
|
||||
};
|
||||
|
||||
template<typename T> struct is_reference_wrapper< reference_wrapper<T> volatile >
|
||||
{
|
||||
BOOST_STATIC_CONSTANT( bool, value = true );
|
||||
};
|
||||
|
||||
template<typename T> struct is_reference_wrapper< reference_wrapper<T> const volatile >
|
||||
{
|
||||
BOOST_STATIC_CONSTANT( bool, value = true );
|
||||
};
|
||||
|
||||
#endif // !defined(BOOST_NO_CV_SPECIALIZATIONS)
|
||||
|
||||
/**
|
||||
@endcond
|
||||
*/
|
||||
|
||||
|
||||
// unwrap_reference
|
||||
|
||||
/**
|
||||
@brief Find the type in a `reference_wrapper`.
|
||||
|
||||
The `typedef` type is `T::type` if `T` is a
|
||||
`reference_wrapper`, `T` otherwise.
|
||||
*/
|
||||
template<typename T> struct unwrap_reference
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
/**
|
||||
@cond
|
||||
*/
|
||||
template<typename T> struct unwrap_reference< reference_wrapper<T> >
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
#if !defined(BOOST_NO_CV_SPECIALIZATIONS)
|
||||
|
||||
template<typename T> struct unwrap_reference< reference_wrapper<T> const >
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
template<typename T> struct unwrap_reference< reference_wrapper<T> volatile >
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
template<typename T> struct unwrap_reference< reference_wrapper<T> const volatile >
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
#endif // !defined(BOOST_NO_CV_SPECIALIZATIONS)
|
||||
|
||||
/**
|
||||
@endcond
|
||||
*/
|
||||
|
||||
// unwrap_ref
|
||||
|
||||
/**
|
||||
@return `unwrap_reference<T>::type&(t)`
|
||||
@remark Does not throw.
|
||||
*/
|
||||
template<class T> BOOST_FORCEINLINE typename unwrap_reference<T>::type& unwrap_ref( T & t )
|
||||
{
|
||||
return t;
|
||||
}
|
||||
|
||||
// get_pointer
|
||||
|
||||
/**
|
||||
@cond
|
||||
*/
|
||||
template<class T> BOOST_FORCEINLINE T* get_pointer( reference_wrapper<T> const & r )
|
||||
{
|
||||
return r.get_pointer();
|
||||
}
|
||||
/**
|
||||
@endcond
|
||||
*/
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_CORE_REF_HPP
|
||||
@@ -0,0 +1,133 @@
|
||||
/*==============================================================================
|
||||
Copyright (c) 2013 Jamboree
|
||||
|
||||
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_FUSION_FLATTEN_VIEW_HPP_INCLUDED
|
||||
#define BOOST_FUSION_FLATTEN_VIEW_HPP_INCLUDED
|
||||
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/single_view.hpp>
|
||||
#include <boost/fusion/support/detail/access.hpp>
|
||||
#include <boost/fusion/support/is_view.hpp>
|
||||
#include <boost/fusion/support/category_of.hpp>
|
||||
#include <boost/fusion/support/sequence_base.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/end.hpp>
|
||||
#include <boost/fusion/view/flatten_view/flatten_view_iterator.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct forward_traversal_tag;
|
||||
struct flatten_view_tag;
|
||||
|
||||
template <typename Sequence>
|
||||
struct flatten_view
|
||||
: sequence_base<flatten_view<Sequence> >
|
||||
{
|
||||
typedef flatten_view_tag fusion_tag;
|
||||
typedef fusion_sequence_tag tag; // this gets picked up by MPL
|
||||
typedef mpl::true_ is_view;
|
||||
typedef forward_traversal_tag category;
|
||||
|
||||
typedef Sequence sequence_type;
|
||||
typedef typename result_of::begin<Sequence>::type first_type;
|
||||
typedef typename result_of::end<Sequence>::type last_type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
explicit flatten_view(Sequence& seq)
|
||||
: seq(seq)
|
||||
{}
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
first_type first() const { return fusion::begin(seq); }
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
last_type last() const { return fusion::end(seq); }
|
||||
|
||||
typename mpl::if_<traits::is_view<Sequence>, Sequence, Sequence&>::type seq;
|
||||
};
|
||||
}}
|
||||
|
||||
namespace boost { namespace fusion { namespace extension
|
||||
{
|
||||
template<>
|
||||
struct begin_impl<flatten_view_tag>
|
||||
{
|
||||
template<typename Sequence>
|
||||
struct apply
|
||||
{
|
||||
typedef typename Sequence::first_type first_type;
|
||||
|
||||
typedef typename
|
||||
result_of::begin<
|
||||
mpl::single_view<
|
||||
typename Sequence::sequence_type> >::type
|
||||
root_iterator;
|
||||
|
||||
typedef
|
||||
detail::seek_descent<root_iterator, first_type>
|
||||
seek_descent;
|
||||
|
||||
typedef typename seek_descent::type type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static inline
|
||||
type call(Sequence& seq)
|
||||
{
|
||||
return seek_descent::apply(root_iterator(), seq.first());
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct end_impl<flatten_view_tag>
|
||||
{
|
||||
template<typename Sequence>
|
||||
struct apply
|
||||
{
|
||||
typedef typename Sequence::last_type last_type;
|
||||
|
||||
typedef typename
|
||||
result_of::end<
|
||||
mpl::single_view<
|
||||
typename Sequence::sequence_type> >::type
|
||||
type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static inline
|
||||
type call(Sequence&)
|
||||
{
|
||||
return type();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct size_impl<flatten_view_tag>
|
||||
{
|
||||
template <typename Sequence>
|
||||
struct apply
|
||||
: result_of::distance
|
||||
<
|
||||
typename result_of::begin<Sequence>::type
|
||||
, typename result_of::end<Sequence>::type
|
||||
>
|
||||
{};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct empty_impl<flatten_view_tag>
|
||||
{
|
||||
template <typename Sequence>
|
||||
struct apply
|
||||
: result_of::empty<typename Sequence::sequence_type>
|
||||
{};
|
||||
};
|
||||
}}}
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,32 @@
|
||||
|
||||
// (C) Copyright Tobias Schwinger
|
||||
//
|
||||
// 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_FT_IS_FUNCTION_HPP_INCLUDED
|
||||
#define BOOST_FT_IS_FUNCTION_HPP_INCLUDED
|
||||
|
||||
#include <boost/mpl/aux_/lambda_support.hpp>
|
||||
|
||||
#include <boost/function_types/components.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace function_types
|
||||
{
|
||||
template< typename T, typename Tag = null_tag >
|
||||
struct is_function
|
||||
: function_types::represents
|
||||
< function_types::components<T>
|
||||
, function_types::tag<Tag ,detail::function_tag>
|
||||
>
|
||||
{
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(2,is_function,(T,Tag))
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,509 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// \file make_expr.hpp
|
||||
/// Definition of the \c make_expr() and \c unpack_expr() utilities for
|
||||
/// building Proto expression nodes from child nodes or from a Fusion
|
||||
/// sequence of child nodes, respectively.
|
||||
//
|
||||
// Copyright 2008 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)
|
||||
|
||||
#ifndef BOOST_PROTO_MAKE_EXPR_HPP_EAN_04_01_2005
|
||||
#define BOOST_PROTO_MAKE_EXPR_HPP_EAN_04_01_2005
|
||||
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/preprocessor/arithmetic/inc.hpp>
|
||||
#include <boost/preprocessor/arithmetic/dec.hpp>
|
||||
#include <boost/preprocessor/arithmetic/sub.hpp>
|
||||
#include <boost/preprocessor/punctuation/comma_if.hpp>
|
||||
#include <boost/preprocessor/iteration/iterate.hpp>
|
||||
#include <boost/preprocessor/facilities/intercept.hpp>
|
||||
#include <boost/preprocessor/repetition/enum.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_shifted_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_trailing_binary_params.hpp>
|
||||
#include <boost/preprocessor/repetition/repeat.hpp>
|
||||
#include <boost/ref.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
#include <boost/type_traits/add_const.hpp>
|
||||
#include <boost/type_traits/add_reference.hpp>
|
||||
#include <boost/type_traits/remove_cv.hpp>
|
||||
#include <boost/proto/proto_fwd.hpp>
|
||||
#include <boost/proto/traits.hpp>
|
||||
#include <boost/proto/domain.hpp>
|
||||
#include <boost/proto/generate.hpp>
|
||||
#include <boost/fusion/include/at_c.hpp>
|
||||
#include <boost/fusion/include/begin.hpp>
|
||||
#include <boost/fusion/include/next.hpp>
|
||||
#include <boost/fusion/include/value_of.hpp>
|
||||
#include <boost/fusion/include/size.hpp>
|
||||
#include <boost/proto/detail/poly_function.hpp>
|
||||
#include <boost/proto/detail/deprecated.hpp>
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable : 4180) // qualifier applied to function type has no meaning; ignored
|
||||
# pragma warning(disable : 4714) // function 'xxx' marked as __forceinline not inlined
|
||||
#endif
|
||||
|
||||
namespace boost { namespace proto
|
||||
{
|
||||
/// INTERNAL ONLY
|
||||
///
|
||||
#define BOOST_PROTO_AS_CHILD_TYPE(Z, N, DATA) \
|
||||
typename boost::proto::detail::protoify< \
|
||||
BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(3, 0, DATA), N) \
|
||||
, BOOST_PP_TUPLE_ELEM(3, 2, DATA) \
|
||||
>::result_type \
|
||||
/**/
|
||||
|
||||
/// INTERNAL ONLY
|
||||
///
|
||||
#define BOOST_PROTO_AS_CHILD(Z, N, DATA) \
|
||||
boost::proto::detail::protoify< \
|
||||
BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(3, 0, DATA), N) \
|
||||
, BOOST_PP_TUPLE_ELEM(3, 2, DATA) \
|
||||
>()(BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(3, 1, DATA), N)) \
|
||||
/**/
|
||||
|
||||
namespace detail
|
||||
{
|
||||
template<typename T, typename Domain>
|
||||
struct protoify
|
||||
: Domain::template as_expr<T>
|
||||
{};
|
||||
|
||||
template<typename T, typename Domain>
|
||||
struct protoify<T &, Domain>
|
||||
: Domain::template as_child<T>
|
||||
{};
|
||||
|
||||
template<typename T, typename Domain>
|
||||
struct protoify<boost::reference_wrapper<T>, Domain>
|
||||
: Domain::template as_child<T>
|
||||
{};
|
||||
|
||||
template<typename T, typename Domain>
|
||||
struct protoify<boost::reference_wrapper<T> const, Domain>
|
||||
: Domain::template as_child<T>
|
||||
{};
|
||||
|
||||
// Definition of detail::unpack_expr_
|
||||
#include <boost/proto/detail/unpack_expr_.hpp>
|
||||
|
||||
// Definition of detail::make_expr_
|
||||
#include <boost/proto/detail/make_expr_.hpp>
|
||||
}
|
||||
|
||||
namespace result_of
|
||||
{
|
||||
/// \brief Metafunction that computes the return type of the
|
||||
/// \c make_expr() function, with a domain deduced from the
|
||||
/// domains of the children.
|
||||
///
|
||||
/// Use the <tt>result_of::make_expr\<\></tt> metafunction to
|
||||
/// compute the return type of the \c make_expr() function.
|
||||
///
|
||||
/// In this specialization, the domain is deduced from the
|
||||
/// domains of the child types. (If
|
||||
/// <tt>is_domain\<A0\>::value</tt> is \c true, then another
|
||||
/// specialization is selected.)
|
||||
template<
|
||||
typename Tag
|
||||
, BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_ARITY, typename A)
|
||||
, typename Void1 // = void
|
||||
, typename Void2 // = void
|
||||
>
|
||||
struct make_expr
|
||||
{
|
||||
/// Same as <tt>result_of::make_expr\<Tag, D, A0, ... AN\>::type</tt>
|
||||
/// where \c D is the deduced domain, which is calculated as follows:
|
||||
///
|
||||
/// For each \c x in <tt>[0,N)</tt> (proceeding in order beginning with
|
||||
/// <tt>x=0</tt>), if <tt>domain_of\<Ax\>::type</tt> is not
|
||||
/// \c default_domain, then \c D is <tt>domain_of\<Ax\>::type</tt>.
|
||||
/// Otherwise, \c D is \c default_domain.
|
||||
typedef
|
||||
typename detail::make_expr_<
|
||||
Tag
|
||||
, deduce_domain
|
||||
BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, A)
|
||||
>::result_type
|
||||
type;
|
||||
};
|
||||
|
||||
/// \brief Metafunction that computes the return type of the
|
||||
/// \c make_expr() function, within the specified domain.
|
||||
///
|
||||
/// Use the <tt>result_of::make_expr\<\></tt> metafunction to compute
|
||||
/// the return type of the \c make_expr() function.
|
||||
template<
|
||||
typename Tag
|
||||
, typename Domain
|
||||
BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, typename A)
|
||||
>
|
||||
struct make_expr<
|
||||
Tag
|
||||
, Domain
|
||||
BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, A)
|
||||
, typename Domain::proto_is_domain_
|
||||
>
|
||||
{
|
||||
/// If \c Tag is <tt>tag::terminal</tt>, then \c type is a
|
||||
/// typedef for <tt>boost::result_of\<Domain(expr\<tag::terminal,
|
||||
/// term\<A0\> \>)\>::type</tt>.
|
||||
///
|
||||
/// Otherwise, \c type is a typedef for <tt>boost::result_of\<Domain(expr\<Tag,
|
||||
/// listN\< as_child\<A0\>::type, ... as_child\<AN\>::type\>)
|
||||
/// \>::type</tt>, where \c N is the number of non-void template
|
||||
/// arguments, and <tt>as_child\<A\>::type</tt> is evaluated as
|
||||
/// follows:
|
||||
///
|
||||
/// \li If <tt>is_expr\<A\>::value</tt> is \c true, then the
|
||||
/// child type is \c A.
|
||||
/// \li If \c A is <tt>B &</tt> or <tt>cv boost::reference_wrapper\<B\></tt>,
|
||||
/// and <tt>is_expr\<B\>::value</tt> is \c true, then the
|
||||
/// child type is <tt>B &</tt>.
|
||||
/// \li If <tt>is_expr\<A\>::value</tt> is \c false, then the
|
||||
/// child type is <tt>boost::result_of\<Domain(expr\<tag::terminal, term\<A\> \>
|
||||
/// )\>::type</tt>.
|
||||
/// \li If \c A is <tt>B &</tt> or <tt>cv boost::reference_wrapper\<B\></tt>,
|
||||
/// and <tt>is_expr\<B\>::value</tt> is \c false, then the
|
||||
/// child type is <tt>boost::result_of\<Domain(expr\<tag::terminal, term\<B &\> \>
|
||||
/// )\>::type</tt>.
|
||||
typedef
|
||||
typename detail::make_expr_<
|
||||
Tag
|
||||
, Domain
|
||||
BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, A)
|
||||
>::result_type
|
||||
type;
|
||||
};
|
||||
|
||||
/// \brief Metafunction that computes the return type of the
|
||||
/// \c unpack_expr() function, with a domain deduced from the
|
||||
/// domains of the children.
|
||||
///
|
||||
/// Use the <tt>result_of::unpack_expr\<\></tt> metafunction to
|
||||
/// compute the return type of the \c unpack_expr() function.
|
||||
///
|
||||
/// \c Sequence is a Fusion Forward Sequence.
|
||||
///
|
||||
/// In this specialization, the domain is deduced from the
|
||||
/// domains of the child types. (If
|
||||
/// <tt>is_domain\<Sequence>::value</tt> is \c true, then another
|
||||
/// specialization is selected.)
|
||||
template<
|
||||
typename Tag
|
||||
, typename Sequence
|
||||
, typename Void1 // = void
|
||||
, typename Void2 // = void
|
||||
>
|
||||
struct unpack_expr
|
||||
{
|
||||
/// Let \c S be the type of a Fusion Random Access Sequence
|
||||
/// equivalent to \c Sequence. Then \c type is the
|
||||
/// same as <tt>result_of::make_expr\<Tag,
|
||||
/// fusion::result_of::value_at_c\<S, 0\>::type, ...
|
||||
/// fusion::result_of::value_at_c\<S, N-1\>::type\>::type</tt>,
|
||||
/// where \c N is the size of \c S.
|
||||
typedef
|
||||
typename detail::unpack_expr_<
|
||||
Tag
|
||||
, deduce_domain
|
||||
, Sequence
|
||||
, fusion::result_of::size<Sequence>::type::value
|
||||
>::type
|
||||
type;
|
||||
};
|
||||
|
||||
/// \brief Metafunction that computes the return type of the
|
||||
/// \c unpack_expr() function, within the specified domain.
|
||||
///
|
||||
/// Use the <tt>result_of::make_expr\<\></tt> metafunction to compute
|
||||
/// the return type of the \c make_expr() function.
|
||||
template<typename Tag, typename Domain, typename Sequence>
|
||||
struct unpack_expr<Tag, Domain, Sequence, typename Domain::proto_is_domain_>
|
||||
{
|
||||
/// Let \c S be the type of a Fusion Random Access Sequence
|
||||
/// equivalent to \c Sequence. Then \c type is the
|
||||
/// same as <tt>result_of::make_expr\<Tag, Domain,
|
||||
/// fusion::result_of::value_at_c\<S, 0\>::type, ...
|
||||
/// fusion::result_of::value_at_c\<S, N-1\>::type\>::type</tt>,
|
||||
/// where \c N is the size of \c S.
|
||||
typedef
|
||||
typename detail::unpack_expr_<
|
||||
Tag
|
||||
, Domain
|
||||
, Sequence
|
||||
, fusion::result_of::size<Sequence>::type::value
|
||||
>::type
|
||||
type;
|
||||
};
|
||||
}
|
||||
|
||||
namespace functional
|
||||
{
|
||||
/// \brief A callable function object equivalent to the
|
||||
/// \c proto::make_expr() function.
|
||||
///
|
||||
/// In all cases, <tt>functional::make_expr\<Tag, Domain\>()(a0, ... aN)</tt>
|
||||
/// is equivalent to <tt>proto::make_expr\<Tag, Domain\>(a0, ... aN)</tt>.
|
||||
///
|
||||
/// <tt>functional::make_expr\<Tag\>()(a0, ... aN)</tt>
|
||||
/// is equivalent to <tt>proto::make_expr\<Tag\>(a0, ... aN)</tt>.
|
||||
template<typename Tag, typename Domain /* = deduce_domain*/>
|
||||
struct make_expr
|
||||
{
|
||||
BOOST_PROTO_CALLABLE()
|
||||
BOOST_PROTO_POLY_FUNCTION()
|
||||
|
||||
template<typename Sig>
|
||||
struct result;
|
||||
|
||||
template<typename This, typename A0>
|
||||
struct result<This(A0)>
|
||||
{
|
||||
typedef
|
||||
typename result_of::make_expr<
|
||||
Tag
|
||||
, Domain
|
||||
, A0
|
||||
>::type
|
||||
type;
|
||||
};
|
||||
|
||||
/// Construct an expression node with tag type \c Tag
|
||||
/// and in the domain \c Domain.
|
||||
///
|
||||
/// \return <tt>proto::make_expr\<Tag, Domain\>(a0,...aN)</tt>
|
||||
template<typename A0>
|
||||
BOOST_FORCEINLINE
|
||||
typename result_of::make_expr<
|
||||
Tag
|
||||
, Domain
|
||||
, A0 const
|
||||
>::type const
|
||||
operator ()(A0 const &a0) const
|
||||
{
|
||||
return proto::detail::make_expr_<
|
||||
Tag
|
||||
, Domain
|
||||
, A0 const
|
||||
>()(a0);
|
||||
}
|
||||
|
||||
// Additional overloads generated by the preprocessor ...
|
||||
#include <boost/proto/detail/make_expr_funop.hpp>
|
||||
|
||||
/// INTERNAL ONLY
|
||||
///
|
||||
template<
|
||||
BOOST_PP_ENUM_BINARY_PARAMS(
|
||||
BOOST_PROTO_MAX_ARITY
|
||||
, typename A
|
||||
, = void BOOST_PP_INTERCEPT
|
||||
)
|
||||
>
|
||||
struct impl
|
||||
: detail::make_expr_<
|
||||
Tag
|
||||
, Domain
|
||||
BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_ARITY, A)
|
||||
>
|
||||
{};
|
||||
};
|
||||
|
||||
/// \brief A callable function object equivalent to the
|
||||
/// \c proto::unpack_expr() function.
|
||||
///
|
||||
/// In all cases, <tt>functional::unpack_expr\<Tag, Domain\>()(seq)</tt>
|
||||
/// is equivalent to <tt>proto::unpack_expr\<Tag, Domain\>(seq)</tt>.
|
||||
///
|
||||
/// <tt>functional::unpack_expr\<Tag\>()(seq)</tt>
|
||||
/// is equivalent to <tt>proto::unpack_expr\<Tag\>(seq)</tt>.
|
||||
template<typename Tag, typename Domain /* = deduce_domain*/>
|
||||
struct unpack_expr
|
||||
{
|
||||
BOOST_PROTO_CALLABLE()
|
||||
|
||||
template<typename Sig>
|
||||
struct result;
|
||||
|
||||
template<typename This, typename Sequence>
|
||||
struct result<This(Sequence)>
|
||||
{
|
||||
typedef
|
||||
typename result_of::unpack_expr<
|
||||
Tag
|
||||
, Domain
|
||||
, typename remove_reference<Sequence>::type
|
||||
>::type
|
||||
type;
|
||||
};
|
||||
|
||||
/// Construct an expression node with tag type \c Tag
|
||||
/// and in the domain \c Domain.
|
||||
///
|
||||
/// \param sequence A Fusion Forward Sequence
|
||||
/// \return <tt>proto::unpack_expr\<Tag, Domain\>(sequence)</tt>
|
||||
template<typename Sequence>
|
||||
BOOST_FORCEINLINE
|
||||
typename result_of::unpack_expr<Tag, Domain, Sequence const>::type const
|
||||
operator ()(Sequence const &sequence) const
|
||||
{
|
||||
return proto::detail::unpack_expr_<
|
||||
Tag
|
||||
, Domain
|
||||
, Sequence const
|
||||
, fusion::result_of::size<Sequence>::type::value
|
||||
>::call(sequence);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace functional
|
||||
|
||||
/// \brief Construct an expression of the requested tag type
|
||||
/// with a domain and with the specified arguments as children.
|
||||
///
|
||||
/// This function template may be invoked either with or without
|
||||
/// specifying a \c Domain argument. If no domain is specified,
|
||||
/// the domain is deduced by examining in order the domains of
|
||||
/// the given arguments and taking the first that is not
|
||||
/// \c default_domain, if any such domain exists, or
|
||||
/// \c default_domain otherwise.
|
||||
///
|
||||
/// Let \c wrap_(x) be defined such that:
|
||||
/// \li If \c x is a <tt>boost::reference_wrapper\<\></tt>,
|
||||
/// \c wrap_(x) is equivalent to <tt>as_child\<Domain\>(x.get())</tt>.
|
||||
/// \li Otherwise, \c wrap_(x) is equivalent to
|
||||
/// <tt>as_expr\<Domain\>(x)</tt>.
|
||||
///
|
||||
/// Let <tt>make_\<Tag\>(b0,...bN)</tt> be defined as
|
||||
/// <tt>expr\<Tag, listN\<C0,...CN\> \>::make(c0,...cN)</tt>
|
||||
/// where \c Bx is the type of \c bx.
|
||||
///
|
||||
/// \return <tt>Domain()(make_\<Tag\>(wrap_(a0),...wrap_(aN)))</tt>.
|
||||
template<typename Tag, typename A0>
|
||||
BOOST_FORCEINLINE
|
||||
typename lazy_disable_if<
|
||||
is_domain<A0>
|
||||
, result_of::make_expr<
|
||||
Tag
|
||||
, A0 const
|
||||
>
|
||||
>::type const
|
||||
make_expr(A0 const &a0)
|
||||
{
|
||||
return proto::detail::make_expr_<
|
||||
Tag
|
||||
, deduce_domain
|
||||
, A0 const
|
||||
>()(a0);
|
||||
}
|
||||
|
||||
/// \overload
|
||||
///
|
||||
template<typename Tag, typename Domain, typename C0>
|
||||
BOOST_FORCEINLINE
|
||||
typename result_of::make_expr<
|
||||
Tag
|
||||
, Domain
|
||||
, C0 const
|
||||
>::type const
|
||||
make_expr(C0 const &c0)
|
||||
{
|
||||
return proto::detail::make_expr_<
|
||||
Tag
|
||||
, Domain
|
||||
, C0 const
|
||||
>()(c0);
|
||||
}
|
||||
|
||||
// Additional overloads generated by the preprocessor...
|
||||
#include <boost/proto/detail/make_expr.hpp>
|
||||
|
||||
/// \brief Construct an expression of the requested tag type
|
||||
/// with a domain and with childres from the specified Fusion
|
||||
/// Forward Sequence.
|
||||
///
|
||||
/// This function template may be invoked either with or without
|
||||
/// specifying a \c Domain argument. If no domain is specified,
|
||||
/// the domain is deduced by examining in order the domains of the
|
||||
/// elements of \c sequence and taking the first that is not
|
||||
/// \c default_domain, if any such domain exists, or
|
||||
/// \c default_domain otherwise.
|
||||
///
|
||||
/// Let \c s be a Fusion Random Access Sequence equivalent to \c sequence.
|
||||
/// Let <tt>wrap_\<N\>(s)</tt>, where \c s has type \c S, be defined
|
||||
/// such that:
|
||||
/// \li If <tt>fusion::result_of::value_at_c\<S,N\>::type</tt> is a reference,
|
||||
/// <tt>wrap_\<N\>(s)</tt> is equivalent to
|
||||
/// <tt>as_child\<Domain\>(fusion::at_c\<N\>(s))</tt>.
|
||||
/// \li Otherwise, <tt>wrap_\<N\>(s)</tt> is equivalent to
|
||||
/// <tt>as_expr\<Domain\>(fusion::at_c\<N\>(s))</tt>.
|
||||
///
|
||||
/// Let <tt>make_\<Tag\>(b0,...bN)</tt> be defined as
|
||||
/// <tt>expr\<Tag, listN\<B0,...BN\> \>::make(b0,...bN)</tt>
|
||||
/// where \c Bx is the type of \c bx.
|
||||
///
|
||||
/// \param sequence a Fusion Forward Sequence.
|
||||
/// \return <tt>Domain()(make_\<Tag\>(wrap_\<0\>(s),...wrap_\<N-1\>(s)))</tt>,
|
||||
/// where N is the size of \c Sequence.
|
||||
template<typename Tag, typename Sequence>
|
||||
BOOST_FORCEINLINE
|
||||
typename lazy_disable_if<
|
||||
is_domain<Sequence>
|
||||
, result_of::unpack_expr<Tag, Sequence const>
|
||||
>::type const
|
||||
unpack_expr(Sequence const &sequence)
|
||||
{
|
||||
return proto::detail::unpack_expr_<
|
||||
Tag
|
||||
, deduce_domain
|
||||
, Sequence const
|
||||
, fusion::result_of::size<Sequence>::type::value
|
||||
>::call(sequence);
|
||||
}
|
||||
|
||||
/// \overload
|
||||
///
|
||||
template<typename Tag, typename Domain, typename Sequence2>
|
||||
BOOST_FORCEINLINE
|
||||
typename result_of::unpack_expr<Tag, Domain, Sequence2 const>::type const
|
||||
unpack_expr(Sequence2 const &sequence2)
|
||||
{
|
||||
return proto::detail::unpack_expr_<
|
||||
Tag
|
||||
, Domain
|
||||
, Sequence2 const
|
||||
, fusion::result_of::size<Sequence2>::type::value
|
||||
>::call(sequence2);
|
||||
}
|
||||
|
||||
/// INTERNAL ONLY
|
||||
///
|
||||
template<typename Tag, typename Domain>
|
||||
struct is_callable<functional::make_expr<Tag, Domain> >
|
||||
: mpl::true_
|
||||
{};
|
||||
|
||||
/// INTERNAL ONLY
|
||||
///
|
||||
template<typename Tag, typename Domain>
|
||||
struct is_callable<functional::unpack_expr<Tag, Domain> >
|
||||
: mpl::true_
|
||||
{};
|
||||
|
||||
}}
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#endif // BOOST_PROTO_MAKE_EXPR_HPP_EAN_04_01_2005
|
||||
@@ -0,0 +1,16 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
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 is an auto-generated file. Do not edit!
|
||||
==============================================================================*/
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct void_;
|
||||
template <
|
||||
typename T0 = void_ , typename T1 = void_ , typename T2 = void_ , typename T3 = void_ , typename T4 = void_ , typename T5 = void_ , typename T6 = void_ , typename T7 = void_ , typename T8 = void_ , typename T9 = void_ , typename T10 = void_ , typename T11 = void_ , typename T12 = void_ , typename T13 = void_ , typename T14 = void_ , typename T15 = void_ , typename T16 = void_ , typename T17 = void_ , typename T18 = void_ , typename T19 = void_ , typename T20 = void_ , typename T21 = void_ , typename T22 = void_ , typename T23 = void_ , typename T24 = void_ , typename T25 = void_ , typename T26 = void_ , typename T27 = void_ , typename T28 = void_ , typename T29 = void_ , typename T30 = void_ , typename T31 = void_ , typename T32 = void_ , typename T33 = void_ , typename T34 = void_ , typename T35 = void_ , typename T36 = void_ , typename T37 = void_ , typename T38 = void_ , typename T39 = void_
|
||||
>
|
||||
struct list;
|
||||
}}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 5.8 KiB |
@@ -0,0 +1,98 @@
|
||||
/*==============================================================================
|
||||
Copyright (c) 2005-2010 Joel de Guzman
|
||||
Copyright (c) 2010 Thomas Heller
|
||||
Copyright (c) 2016 Kohei Takahashi
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_PHOENIX_OPERATOR_MEMBER_HPP
|
||||
#define BOOST_PHOENIX_OPERATOR_MEMBER_HPP
|
||||
|
||||
#include <boost/phoenix/core/limits.hpp>
|
||||
#include <boost/get_pointer.hpp>
|
||||
#include <boost/phoenix/core/domain.hpp>
|
||||
#include <boost/phoenix/core/meta_grammar.hpp>
|
||||
#include <boost/phoenix/core/call.hpp>
|
||||
#include <boost/phoenix/core/expression.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
#include <boost/type_traits/is_member_function_pointer.hpp>
|
||||
#include <boost/proto/operators.hpp>
|
||||
#include <boost/phoenix/support/iterate.hpp>
|
||||
|
||||
#ifdef BOOST_PHOENIX_NO_VARIADIC_EXPRESSION
|
||||
# include <boost/phoenix/operator/detail/cpp03/mem_fun_ptr_expr.hpp>
|
||||
#else
|
||||
BOOST_PHOENIX_DEFINE_EXPRESSION_VARARG(
|
||||
(boost)(phoenix)(mem_fun_ptr)
|
||||
, (meta_grammar)(meta_grammar)
|
||||
, _
|
||||
)
|
||||
#endif
|
||||
|
||||
#include <boost/phoenix/operator/detail/define_operator.hpp>
|
||||
|
||||
namespace boost { namespace phoenix
|
||||
{
|
||||
#if defined(BOOST_PHOENIX_NO_VARIADIC_OPERATOR)
|
||||
#include <boost/phoenix/operator/detail/cpp03/mem_fun_ptr_gen.hpp>
|
||||
#else
|
||||
// TODO
|
||||
#endif
|
||||
|
||||
BOOST_PHOENIX_BINARY_OPERATORS((mem_ptr))
|
||||
|
||||
template<>
|
||||
struct phoenix_generator::case_<proto::tag::mem_ptr>
|
||||
: proto::or_<
|
||||
proto::when<
|
||||
proto::and_<
|
||||
proto::mem_ptr<meta_grammar, proto::terminal<proto::_> >
|
||||
, proto::if_<is_member_function_pointer<boost::remove_reference<proto::call<proto::_value(proto::_right)> > >()>
|
||||
>
|
||||
, proto::call<detail::make_mem_fun_ptr_gen(proto::_left, proto::call<proto::_value(proto::_right)>)>
|
||||
>
|
||||
, proto::otherwise<
|
||||
proto::call<proto::pod_generator<actor>(proto::_)>
|
||||
>
|
||||
>
|
||||
{};
|
||||
|
||||
namespace result_of
|
||||
{
|
||||
template <
|
||||
typename Context
|
||||
, BOOST_PHOENIX_typename_A_void(BOOST_PHOENIX_LIMIT)
|
||||
, typename Dummy = void
|
||||
>
|
||||
struct mem_fun_ptr_eval;
|
||||
|
||||
#if defined(BOOST_PHOENIX_NO_VARIADIC_OPERATOR)
|
||||
#include <boost/phoenix/operator/detail/cpp03/mem_fun_ptr_eval_result_of.hpp>
|
||||
#else
|
||||
// TODO
|
||||
#endif
|
||||
}
|
||||
|
||||
struct mem_fun_ptr_eval
|
||||
{
|
||||
template<typename Sig>
|
||||
struct result;
|
||||
|
||||
#if defined(BOOST_PHOENIX_NO_VARIADIC_OPERATOR)
|
||||
#include <boost/phoenix/operator/detail/cpp03/mem_fun_ptr_eval.hpp>
|
||||
#else
|
||||
// TODO
|
||||
#endif
|
||||
};
|
||||
|
||||
template <typename Dummy>
|
||||
struct default_actions::when<rule::mem_fun_ptr, Dummy>
|
||||
: call<mem_fun_ptr_eval>
|
||||
{};
|
||||
}}
|
||||
|
||||
#include <boost/phoenix/operator/detail/undef_operator.hpp>
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,38 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2014-2015 Kohei Takahashi
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#ifndef FUSION_VECTOR_CONFIG_11052014_1720
|
||||
#define FUSION_VECTOR_CONFIG_11052014_1720
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
|
||||
#if (defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) \
|
||||
|| defined(BOOST_NO_CXX11_RVALUE_REFERENCES) \
|
||||
|| defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) \
|
||||
|| defined(BOOST_NO_CXX11_DECLTYPE)) \
|
||||
|| defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS) \
|
||||
|| defined(BOOST_FUSION_DISABLE_VARIADIC_VECTOR) \
|
||||
|| (defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES))
|
||||
# if defined(BOOST_FUSION_HAS_VARIADIC_VECTOR)
|
||||
# undef BOOST_FUSION_HAS_VARIADIC_VECTOR
|
||||
# endif
|
||||
#else
|
||||
# if !defined(BOOST_FUSION_HAS_VARIADIC_VECTOR)
|
||||
# define BOOST_FUSION_HAS_VARIADIC_VECTOR
|
||||
# endif
|
||||
#endif
|
||||
|
||||
// Sometimes, MSVC 12 shows compile error with std::size_t of template parameter.
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1800))
|
||||
# if defined(BOOST_FUSION_HAS_VARIADIC_VECTOR)
|
||||
# undef BOOST_FUSION_HAS_VARIADIC_VECTOR
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
// Copyright Neil Groves 2009. 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/range/
|
||||
//
|
||||
#ifndef BOOST_RANGE_ALGORITHM_COUNT_IF_HPP_INCLUDED
|
||||
#define BOOST_RANGE_ALGORITHM_COUNT_IF_HPP_INCLUDED
|
||||
|
||||
#include <boost/concept_check.hpp>
|
||||
#include <boost/range/begin.hpp>
|
||||
#include <boost/range/end.hpp>
|
||||
#include <boost/range/concepts.hpp>
|
||||
#include <boost/range/difference_type.hpp>
|
||||
#include <algorithm>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace range
|
||||
{
|
||||
|
||||
/// \brief template function count_if
|
||||
///
|
||||
/// range-based version of the count_if std algorithm
|
||||
///
|
||||
/// \pre SinglePassRange is a model of the SinglePassRangeConcept
|
||||
/// \pre UnaryPredicate is a model of the UnaryPredicateConcept
|
||||
template< class SinglePassRange, class UnaryPredicate >
|
||||
inline BOOST_DEDUCED_TYPENAME boost::range_difference<SinglePassRange>::type
|
||||
count_if(SinglePassRange& rng, UnaryPredicate pred)
|
||||
{
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange> ));
|
||||
return std::count_if(boost::begin(rng), boost::end(rng), pred);
|
||||
}
|
||||
|
||||
/// \overload
|
||||
template< class SinglePassRange, class UnaryPredicate >
|
||||
inline BOOST_DEDUCED_TYPENAME boost::range_difference<const SinglePassRange>::type
|
||||
count_if(const SinglePassRange& rng, UnaryPredicate pred)
|
||||
{
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange> ));
|
||||
return std::count_if(boost::begin(rng), boost::end(rng), pred);
|
||||
}
|
||||
|
||||
} // namespace range
|
||||
using range::count_if;
|
||||
} // namespace boost
|
||||
|
||||
#endif // include guard
|
||||
@@ -0,0 +1,225 @@
|
||||
// Copyright 2002 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)
|
||||
|
||||
// Boost.MultiArray Library
|
||||
// Authors: Ronald Garcia
|
||||
// Jeremy Siek
|
||||
// Andrew Lumsdaine
|
||||
// See http://www.boost.org/libs/multi_array for documentation.
|
||||
|
||||
#ifndef BOOST_MULTI_ARRAY_CONCEPT_CHECKS_RG110101_HPP
|
||||
#define BOOST_MULTI_ARRAY_CONCEPT_CHECKS_RG110101_HPP
|
||||
|
||||
//
|
||||
// concept-checks.hpp - Checks out Const MultiArray and MultiArray
|
||||
// concepts
|
||||
//
|
||||
|
||||
#include "boost/concept_check.hpp"
|
||||
#include "boost/iterator/iterator_concepts.hpp"
|
||||
|
||||
namespace boost {
|
||||
namespace multi_array_concepts {
|
||||
|
||||
namespace detail {
|
||||
//
|
||||
// idgen_helper -
|
||||
// This is a helper for generating index_gen instantiations with
|
||||
// the right type in order to test the call to
|
||||
// operator[](index_gen). Since one would normally write:
|
||||
// A[ indices[range1][range2] ]; // or
|
||||
// B[ indices[index1][index2][range1] ];
|
||||
// idgen helper allows us to generate the "indices" type by
|
||||
// creating it through recursive calls.
|
||||
template <std::size_t N>
|
||||
struct idgen_helper {
|
||||
|
||||
template <typename Array, typename IdxGen, typename Call_Type>
|
||||
static void call(Array& a, const IdxGen& idgen, Call_Type c) {
|
||||
typedef typename Array::index_range index_range;
|
||||
typedef typename Array::index index;
|
||||
idgen_helper<N-1>::call(a,idgen[c],c);
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct idgen_helper<0> {
|
||||
|
||||
template <typename Array, typename IdxGen, typename Call_Type>
|
||||
static void call(Array& a, const IdxGen& idgen, Call_Type) {
|
||||
typedef typename Array::index_range index_range;
|
||||
typedef typename Array::index index;
|
||||
a[ idgen ];
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
|
||||
template <typename Array, std::size_t NumDims >
|
||||
struct ConstMultiArrayConcept
|
||||
{
|
||||
void constraints() {
|
||||
// function_requires< CopyConstructibleConcept<Array> >();
|
||||
function_requires< boost_concepts::ForwardTraversalConcept<iterator> >();
|
||||
function_requires< boost_concepts::ReadableIteratorConcept<iterator> >();
|
||||
function_requires< boost_concepts::ForwardTraversalConcept<const_iterator> >();
|
||||
function_requires< boost_concepts::ReadableIteratorConcept<const_iterator> >();
|
||||
|
||||
// RG - a( CollectionArchetype) when available...
|
||||
a[ id ];
|
||||
// Test slicing, keeping only the first dimension, losing the rest
|
||||
detail::idgen_helper<NumDims-1>::call(a,idgen[range],id);
|
||||
|
||||
// Test slicing, keeping all dimensions.
|
||||
detail::idgen_helper<NumDims-1>::call(a,idgen[range],range);
|
||||
|
||||
st = a.size();
|
||||
st = a.num_dimensions();
|
||||
st = Array::dimensionality;
|
||||
st = a.num_elements();
|
||||
stp = a.shape();
|
||||
idp = a.strides();
|
||||
idp = a.index_bases();
|
||||
cit = a.begin();
|
||||
cit = a.end();
|
||||
crit = a.rbegin();
|
||||
crit = a.rend();
|
||||
eltp = a.origin();
|
||||
}
|
||||
|
||||
typedef typename Array::value_type value_type;
|
||||
typedef typename Array::reference reference;
|
||||
typedef typename Array::const_reference const_reference;
|
||||
typedef typename Array::size_type size_type;
|
||||
typedef typename Array::difference_type difference_type;
|
||||
typedef typename Array::iterator iterator;
|
||||
typedef typename Array::const_iterator const_iterator;
|
||||
typedef typename Array::reverse_iterator reverse_iterator;
|
||||
typedef typename Array::const_reverse_iterator const_reverse_iterator;
|
||||
typedef typename Array::element element;
|
||||
typedef typename Array::index index;
|
||||
typedef typename Array::index_gen index_gen;
|
||||
typedef typename Array::index_range index_range;
|
||||
typedef typename Array::extent_gen extent_gen;
|
||||
typedef typename Array::extent_range extent_range;
|
||||
|
||||
Array a;
|
||||
size_type st;
|
||||
const size_type* stp;
|
||||
index id;
|
||||
const index* idp;
|
||||
const_iterator cit;
|
||||
const_reverse_iterator crit;
|
||||
const element* eltp;
|
||||
index_gen idgen;
|
||||
index_range range;
|
||||
};
|
||||
|
||||
|
||||
template <typename Array, std::size_t NumDims >
|
||||
struct MutableMultiArrayConcept
|
||||
{
|
||||
void constraints() {
|
||||
// function_requires< CopyConstructibleConcept<Array> >();
|
||||
|
||||
function_requires< boost_concepts::ForwardTraversalConcept<iterator> >();
|
||||
function_requires< boost_concepts::ReadableIteratorConcept<iterator> >();
|
||||
function_requires< boost_concepts::WritableIteratorConcept<iterator> >();
|
||||
function_requires< boost_concepts::ForwardTraversalConcept<const_iterator> >();
|
||||
function_requires< boost_concepts::ReadableIteratorConcept<const_iterator> >();
|
||||
function_requires< boost::OutputIterator<iterator,value_type> >();
|
||||
|
||||
// RG - a( CollectionArchetype) when available...
|
||||
value_type vt = a[ id ];
|
||||
|
||||
// Test slicing, keeping only the first dimension, losing the rest
|
||||
detail::idgen_helper<NumDims-1>::call(a,idgen[range],id);
|
||||
|
||||
// Test slicing, keeping all dimensions.
|
||||
detail::idgen_helper<NumDims-1>::call(a,idgen[range],range);
|
||||
|
||||
st = a.size();
|
||||
st = a.num_dimensions();
|
||||
st = a.num_elements();
|
||||
stp = a.shape();
|
||||
idp = a.strides();
|
||||
idp = a.index_bases();
|
||||
it = a.begin();
|
||||
it = a.end();
|
||||
rit = a.rbegin();
|
||||
rit = a.rend();
|
||||
eltp = a.origin();
|
||||
const_constraints(a);
|
||||
}
|
||||
|
||||
void const_constraints(const Array& a) {
|
||||
|
||||
// value_type vt = a[ id ];
|
||||
|
||||
// Test slicing, keeping only the first dimension, losing the rest
|
||||
detail::idgen_helper<NumDims-1>::call(a,idgen[range],id);
|
||||
|
||||
// Test slicing, keeping all dimensions.
|
||||
detail::idgen_helper<NumDims-1>::call(a,idgen[range],range);
|
||||
|
||||
st = a.size();
|
||||
st = a.num_dimensions();
|
||||
st = a.num_elements();
|
||||
stp = a.shape();
|
||||
idp = a.strides();
|
||||
idp = a.index_bases();
|
||||
cit = a.begin();
|
||||
cit = a.end();
|
||||
crit = a.rbegin();
|
||||
crit = a.rend();
|
||||
eltp = a.origin();
|
||||
}
|
||||
|
||||
typedef typename Array::value_type value_type;
|
||||
typedef typename Array::reference reference;
|
||||
typedef typename Array::const_reference const_reference;
|
||||
typedef typename Array::size_type size_type;
|
||||
typedef typename Array::difference_type difference_type;
|
||||
typedef typename Array::iterator iterator;
|
||||
typedef typename Array::const_iterator const_iterator;
|
||||
typedef typename Array::reverse_iterator reverse_iterator;
|
||||
typedef typename Array::const_reverse_iterator const_reverse_iterator;
|
||||
typedef typename Array::element element;
|
||||
typedef typename Array::index index;
|
||||
typedef typename Array::index_gen index_gen;
|
||||
typedef typename Array::index_range index_range;
|
||||
typedef typename Array::extent_gen extent_gen;
|
||||
typedef typename Array::extent_range extent_range;
|
||||
|
||||
Array a;
|
||||
size_type st;
|
||||
const size_type* stp;
|
||||
index id;
|
||||
const index* idp;
|
||||
iterator it;
|
||||
const_iterator cit;
|
||||
reverse_iterator rit;
|
||||
const_reverse_iterator crit;
|
||||
const element* eltp;
|
||||
index_gen idgen;
|
||||
index_range range;
|
||||
};
|
||||
|
||||
|
||||
} // namespace multi_array
|
||||
|
||||
namespace detail {
|
||||
namespace multi_array { // Old locations for these
|
||||
using boost::multi_array_concepts::ConstMultiArrayConcept;
|
||||
using boost::multi_array_concepts::MutableMultiArrayConcept;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace boost
|
||||
|
||||
|
||||
#endif // BOOST_MULTI_ARRAY_CONCEPT_CHECKS_RG110101_HPP
|
||||
@@ -0,0 +1,150 @@
|
||||
|
||||
// Copyright Aleksey Gurtovoy 2000-2004
|
||||
// Copyright David Abrahams 2003-2004
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
// Preprocessed version of "boost/mpl/map/map10.hpp" header
|
||||
// -- DO NOT modify by hand!
|
||||
|
||||
namespace boost { namespace mpl {
|
||||
|
||||
template<
|
||||
typename P0
|
||||
>
|
||||
struct map1
|
||||
: m_item<
|
||||
typename P0::first
|
||||
, typename P0::second
|
||||
, map0< >
|
||||
>
|
||||
{
|
||||
typedef map1 type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename P0, typename P1
|
||||
>
|
||||
struct map2
|
||||
: m_item<
|
||||
typename P1::first
|
||||
, typename P1::second
|
||||
, map1<P0>
|
||||
>
|
||||
{
|
||||
typedef map2 type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename P0, typename P1, typename P2
|
||||
>
|
||||
struct map3
|
||||
: m_item<
|
||||
typename P2::first
|
||||
, typename P2::second
|
||||
, map2< P0,P1 >
|
||||
>
|
||||
{
|
||||
typedef map3 type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename P0, typename P1, typename P2, typename P3
|
||||
>
|
||||
struct map4
|
||||
: m_item<
|
||||
typename P3::first
|
||||
, typename P3::second
|
||||
, map3< P0,P1,P2 >
|
||||
>
|
||||
{
|
||||
typedef map4 type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename P0, typename P1, typename P2, typename P3, typename P4
|
||||
>
|
||||
struct map5
|
||||
: m_item<
|
||||
typename P4::first
|
||||
, typename P4::second
|
||||
, map4< P0,P1,P2,P3 >
|
||||
>
|
||||
{
|
||||
typedef map5 type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename P0, typename P1, typename P2, typename P3, typename P4
|
||||
, typename P5
|
||||
>
|
||||
struct map6
|
||||
: m_item<
|
||||
typename P5::first
|
||||
, typename P5::second
|
||||
, map5< P0,P1,P2,P3,P4 >
|
||||
>
|
||||
{
|
||||
typedef map6 type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename P0, typename P1, typename P2, typename P3, typename P4
|
||||
, typename P5, typename P6
|
||||
>
|
||||
struct map7
|
||||
: m_item<
|
||||
typename P6::first
|
||||
, typename P6::second
|
||||
, map6< P0,P1,P2,P3,P4,P5 >
|
||||
>
|
||||
{
|
||||
typedef map7 type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename P0, typename P1, typename P2, typename P3, typename P4
|
||||
, typename P5, typename P6, typename P7
|
||||
>
|
||||
struct map8
|
||||
: m_item<
|
||||
typename P7::first
|
||||
, typename P7::second
|
||||
, map7< P0,P1,P2,P3,P4,P5,P6 >
|
||||
>
|
||||
{
|
||||
typedef map8 type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename P0, typename P1, typename P2, typename P3, typename P4
|
||||
, typename P5, typename P6, typename P7, typename P8
|
||||
>
|
||||
struct map9
|
||||
: m_item<
|
||||
typename P8::first
|
||||
, typename P8::second
|
||||
, map8< P0,P1,P2,P3,P4,P5,P6,P7 >
|
||||
>
|
||||
{
|
||||
typedef map9 type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename P0, typename P1, typename P2, typename P3, typename P4
|
||||
, typename P5, typename P6, typename P7, typename P8, typename P9
|
||||
>
|
||||
struct map10
|
||||
: m_item<
|
||||
typename P9::first
|
||||
, typename P9::second
|
||||
, map9< P0,P1,P2,P3,P4,P5,P6,P7,P8 >
|
||||
>
|
||||
{
|
||||
typedef map10 type;
|
||||
};
|
||||
|
||||
}}
|
||||
@@ -0,0 +1,115 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_TAG_OF_09262006_1900)
|
||||
#define BOOST_FUSION_TAG_OF_09262006_1900
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/support/tag_of_fwd.hpp>
|
||||
|
||||
namespace boost { namespace tuples
|
||||
{
|
||||
struct null_type;
|
||||
|
||||
template <
|
||||
class T0, class T1, class T2, class T3, class T4,
|
||||
class T5, class T6, class T7, class T8, class T9
|
||||
>
|
||||
class tuple;
|
||||
|
||||
template <class Head, class Tail>
|
||||
struct cons;
|
||||
}}
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct boost_tuple_tag;
|
||||
struct fusion_sequence_tag;
|
||||
|
||||
namespace traits
|
||||
{
|
||||
template <
|
||||
class T0, class T1, class T2, class T3, class T4,
|
||||
class T5, class T6, class T7, class T8, class T9
|
||||
>
|
||||
#if defined(BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS)
|
||||
struct tag_of<tuples::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>, void >
|
||||
#else
|
||||
struct tag_of<tuples::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> >
|
||||
#endif
|
||||
{
|
||||
typedef boost_tuple_tag type;
|
||||
};
|
||||
|
||||
template <class Head, class Tail>
|
||||
#if defined(BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS)
|
||||
struct tag_of<tuples::cons<Head, Tail>, void >
|
||||
#else
|
||||
struct tag_of<tuples::cons<Head, Tail> >
|
||||
#endif
|
||||
{
|
||||
typedef boost_tuple_tag type;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct tag_of<tuples::null_type>
|
||||
{
|
||||
typedef boost_tuple_tag type;
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
namespace boost { namespace mpl
|
||||
{
|
||||
template<typename>
|
||||
struct sequence_tag;
|
||||
|
||||
template <
|
||||
class T0, class T1, class T2, class T3, class T4,
|
||||
class T5, class T6, class T7, class T8, class T9
|
||||
>
|
||||
struct sequence_tag<tuples::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> >
|
||||
{
|
||||
typedef fusion::fusion_sequence_tag type;
|
||||
};
|
||||
|
||||
template <
|
||||
class T0, class T1, class T2, class T3, class T4,
|
||||
class T5, class T6, class T7, class T8, class T9
|
||||
>
|
||||
struct sequence_tag<
|
||||
tuples::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> const
|
||||
>
|
||||
{
|
||||
typedef fusion::fusion_sequence_tag type;
|
||||
};
|
||||
|
||||
template <class Head, class Tail>
|
||||
struct sequence_tag<tuples::cons<Head, Tail> >
|
||||
{
|
||||
typedef fusion::fusion_sequence_tag type;
|
||||
};
|
||||
|
||||
template <class Head, class Tail>
|
||||
struct sequence_tag<tuples::cons<Head, Tail> const>
|
||||
{
|
||||
typedef fusion::fusion_sequence_tag type;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct sequence_tag<tuples::null_type>
|
||||
{
|
||||
typedef fusion::fusion_sequence_tag type;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct sequence_tag<tuples::null_type const>
|
||||
{
|
||||
typedef fusion::fusion_sequence_tag type;
|
||||
};
|
||||
}}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,36 @@
|
||||
// Copyright David Abrahams 2006. 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_CONCEPT_USAGE_DWA2006919_HPP
|
||||
# define BOOST_CONCEPT_USAGE_DWA2006919_HPP
|
||||
|
||||
# include <boost/concept/assert.hpp>
|
||||
# include <boost/detail/workaround.hpp>
|
||||
# include <boost/concept/detail/backward_compatibility.hpp>
|
||||
|
||||
namespace boost { namespace concepts {
|
||||
|
||||
template <class Model>
|
||||
struct usage_requirements
|
||||
{
|
||||
~usage_requirements() { ((Model*)0)->~Model(); }
|
||||
};
|
||||
|
||||
# if BOOST_WORKAROUND(__GNUC__, <= 3)
|
||||
|
||||
# define BOOST_CONCEPT_USAGE(model) \
|
||||
model(); /* at least 2.96 and 3.4.3 both need this :( */ \
|
||||
BOOST_CONCEPT_ASSERT((boost::concepts::usage_requirements<model>)); \
|
||||
~model()
|
||||
|
||||
# else
|
||||
|
||||
# define BOOST_CONCEPT_USAGE(model) \
|
||||
BOOST_CONCEPT_ASSERT((boost::concepts::usage_requirements<model>)); \
|
||||
~model()
|
||||
|
||||
# endif
|
||||
|
||||
}} // namespace boost::concepts
|
||||
|
||||
#endif // BOOST_CONCEPT_USAGE_DWA2006919_HPP
|
||||
Reference in New Issue
Block a user