update boost

This commit is contained in:
2023-11-24 12:56:13 -06:00
parent cfc99971af
commit 19d727037a
9260 changed files with 849256 additions and 299957 deletions

View File

@@ -23,7 +23,7 @@ namespace boost { namespace yap {
template<typename Expr, bool MutableRvalueRef>
struct deref_impl
{
decltype(auto) operator()(Expr && expr)
constexpr decltype(auto) operator()(Expr && expr)
{
return std::move(*expr.elements[hana::llong_c<0>]);
}
@@ -32,7 +32,7 @@ namespace boost { namespace yap {
template<typename Expr>
struct deref_impl<Expr, false>
{
decltype(auto) operator()(Expr && expr)
constexpr decltype(auto) operator()(Expr && expr)
{
return *expr.elements[hana::llong_c<0>];
}
@@ -44,7 +44,7 @@ namespace boost { namespace yap {
/** "Dereferences" a reference-expression, forwarding its referent to
the caller. */
template<typename Expr>
decltype(auto) deref(Expr && expr)
constexpr decltype(auto) deref(Expr && expr)
{
static_assert(
is_expr<Expr>::value, "deref() is only defined for expressions.");
@@ -82,7 +82,7 @@ namespace boost { namespace yap {
#ifdef BOOST_NO_CONSTEXPR_IF
template<bool ValueOfTerminalsOnly, typename T>
decltype(auto) value_impl(T && x);
constexpr decltype(auto) value_impl(T && x);
template<
typename T,
@@ -104,7 +104,7 @@ namespace boost { namespace yap {
TakeValue,
IsLvalueRef>
{
decltype(auto) operator()(T && x)
constexpr decltype(auto) operator()(T && x)
{
return ::boost::yap::detail::value_impl<ValueOfTerminalsOnly>(
::boost::yap::deref(static_cast<T &&>(x)));
@@ -114,7 +114,7 @@ namespace boost { namespace yap {
template<typename T, bool ValueOfTerminalsOnly>
struct value_expr_impl<T, false, ValueOfTerminalsOnly, true, true>
{
decltype(auto) operator()(T && x)
constexpr decltype(auto) operator()(T && x)
{
return x.elements[hana::llong_c<0>];
}
@@ -123,7 +123,7 @@ namespace boost { namespace yap {
template<typename T, bool ValueOfTerminalsOnly>
struct value_expr_impl<T, false, ValueOfTerminalsOnly, true, false>
{
decltype(auto) operator()(T && x)
constexpr decltype(auto) operator()(T && x)
{
return std::move(x.elements[hana::llong_c<0>]);
}
@@ -137,13 +137,16 @@ namespace boost { namespace yap {
false,
IsLvalueRef>
{
decltype(auto) operator()(T && x) { return static_cast<T &&>(x); }
constexpr decltype(auto) operator()(T && x)
{
return static_cast<T &&>(x);
}
};
template<typename T, bool IsExpr, bool ValueOfTerminalsOnly>
struct value_impl_t
{
decltype(auto) operator()(T && x)
constexpr decltype(auto) operator()(T && x)
{
constexpr expr_kind kind = detail::remove_cv_ref_t<T>::kind;
constexpr detail::expr_arity arity = detail::arity_of<kind>();
@@ -162,11 +165,14 @@ namespace boost { namespace yap {
template<typename T, bool ValueOfTerminalsOnly>
struct value_impl_t<T, false, ValueOfTerminalsOnly>
{
decltype(auto) operator()(T && x) { return static_cast<T &&>(x); }
constexpr decltype(auto) operator()(T && x)
{
return static_cast<T &&>(x);
}
};
template<bool ValueOfTerminalsOnly, typename T>
decltype(auto) value_impl(T && x)
constexpr decltype(auto) value_impl(T && x)
{
return detail::
value_impl_t<T, is_expr<T>::value, ValueOfTerminalsOnly>{}(
@@ -176,7 +182,7 @@ namespace boost { namespace yap {
#else
template<bool ValueOfTerminalsOnly, typename T>
decltype(auto) value_impl(T && x)
constexpr decltype(auto) value_impl(T && x)
{
if constexpr (is_expr<T>::value) {
using namespace hana::literals;
@@ -224,7 +230,7 @@ namespace boost { namespace yap {
- Otherwise, \a x is forwarded to the caller. */
template<typename T>
decltype(auto) value(T && x)
constexpr decltype(auto) value(T && x)
{
return detail::value_impl<false>(static_cast<T &&>(x));
}
@@ -232,7 +238,7 @@ namespace boost { namespace yap {
#ifdef BOOST_NO_CONSTEXPR_IF
template<typename Expr, typename I>
decltype(auto) get(Expr && expr, I const & i);
constexpr decltype(auto) get(Expr && expr, I const & i);
namespace detail {
@@ -242,7 +248,7 @@ namespace boost { namespace yap {
template<long long I, typename Expr, bool IsLvalueRef>
struct get_impl<I, Expr, true, IsLvalueRef>
{
decltype(auto) operator()(Expr && expr, hana::llong<I> i)
constexpr decltype(auto) operator()(Expr && expr, hana::llong<I> i)
{
return ::boost::yap::get(
::boost::yap::deref(static_cast<Expr &&>(expr)), i);
@@ -252,7 +258,7 @@ namespace boost { namespace yap {
template<long long I, typename Expr>
struct get_impl<I, Expr, false, true>
{
decltype(auto) operator()(Expr && expr, hana::llong<I> i)
constexpr decltype(auto) operator()(Expr && expr, hana::llong<I> i)
{
return expr.elements[i];
}
@@ -261,7 +267,7 @@ namespace boost { namespace yap {
template<long long I, typename Expr>
struct get_impl<I, Expr, false, false>
{
decltype(auto) operator()(Expr && expr, hana::llong<I> i)
constexpr decltype(auto) operator()(Expr && expr, hana::llong<I> i)
{
return std::move(expr.elements[i]);
}
@@ -277,7 +283,7 @@ namespace boost { namespace yap {
\note <code>get()</code> is only valid if \a Expr is an expression.
*/
template<typename Expr, typename I>
decltype(auto) get(Expr && expr, I const & i)
constexpr decltype(auto) get(Expr && expr, I const & i)
{
static_assert(
is_expr<Expr>::value, "get() is only defined for expressions.");
@@ -317,7 +323,7 @@ namespace boost { namespace yap {
/** Returns <code>get(expr, boost::hana::llong_c<I>)</code>. */
template<long long I, typename Expr>
decltype(auto) get_c(Expr && expr)
constexpr decltype(auto) get_c(Expr && expr)
{
return ::boost::yap::get(static_cast<Expr &&>(expr), hana::llong_c<I>);
}
@@ -330,7 +336,7 @@ namespace boost { namespace yap {
operator expression.
*/
template<typename Expr>
decltype(auto) left(Expr && expr)
constexpr decltype(auto) left(Expr && expr)
{
using namespace hana::literals;
return ::boost::yap::get(static_cast<Expr &&>(expr), 0_c);
@@ -349,7 +355,7 @@ namespace boost { namespace yap {
operator expression.
*/
template<typename Expr>
decltype(auto) right(Expr && expr)
constexpr decltype(auto) right(Expr && expr)
{
using namespace hana::literals;
return ::boost::yap::get(static_cast<Expr &&>(expr), 1_c);
@@ -368,7 +374,7 @@ namespace boost { namespace yap {
<code>expr_kind::if_else</code> expression.
*/
template<typename Expr>
decltype(auto) cond(Expr && expr)
constexpr decltype(auto) cond(Expr && expr)
{
using namespace hana::literals;
return ::boost::yap::get(static_cast<Expr &&>(expr), 0_c);
@@ -386,7 +392,7 @@ namespace boost { namespace yap {
<code>expr_kind::if_else</code> expression.
*/
template<typename Expr>
decltype(auto) then(Expr && expr)
constexpr decltype(auto) then(Expr && expr)
{
using namespace hana::literals;
return ::boost::yap::get(static_cast<Expr &&>(expr), 1_c);
@@ -404,7 +410,7 @@ namespace boost { namespace yap {
<code>expr_kind::if_else</code> expression.
*/
template<typename Expr>
decltype(auto) else_(Expr && expr)
constexpr decltype(auto) else_(Expr && expr)
{
using namespace hana::literals;
return ::boost::yap::get(static_cast<Expr &&>(expr), 2_c);
@@ -422,7 +428,7 @@ namespace boost { namespace yap {
<code>expr_kind::call</code> expression.
*/
template<typename Expr>
decltype(auto) callable(Expr && expr)
constexpr decltype(auto) callable(Expr && expr)
{
return ::boost::yap::get(static_cast<Expr &&>(expr), hana::llong_c<0>);
constexpr expr_kind kind = detail::remove_cv_ref_t<Expr>::kind;
@@ -440,7 +446,7 @@ namespace boost { namespace yap {
<code>expr_kind::call</code> expression.
*/
template<long long I, typename Expr>
decltype(auto) argument(Expr && expr, hana::llong<I> i)
constexpr decltype(auto) argument(Expr && expr, hana::llong<I> i)
{
return ::boost::yap::get(
static_cast<Expr &&>(expr), hana::llong_c<I + 1>);
@@ -473,7 +479,7 @@ namespace boost { namespace yap {
template<expr_kind, class> class ExprTemplate,
expr_kind Kind,
typename... T>
auto make_expression(T &&... t)
constexpr auto make_expression(T &&... t)
{
constexpr detail::expr_arity arity = detail::arity_of<Kind>();
static_assert(
@@ -498,7 +504,7 @@ namespace boost { namespace yap {
an expression.
*/
template<template<expr_kind, class> class ExprTemplate, typename T>
auto make_terminal(T && t)
constexpr auto make_terminal(T && t)
{
static_assert(
!is_expr<T>::value,
@@ -518,13 +524,16 @@ namespace boost { namespace yap {
bool IsExpr>
struct as_expr_impl
{
decltype(auto) operator()(T && t) { return static_cast<T &&>(t); }
constexpr decltype(auto) operator()(T && t)
{
return static_cast<T &&>(t);
}
};
template<template<expr_kind, class> class ExprTemplate, typename T>
struct as_expr_impl<ExprTemplate, T, false>
{
decltype(auto) operator()(T && t)
constexpr decltype(auto) operator()(T && t)
{
return make_terminal<ExprTemplate>(static_cast<T &&>(t));
}
@@ -540,7 +549,7 @@ namespace boost { namespace yap {
- Otherwise, \a t is wrapped in a terminal expression.
*/
template<template<expr_kind, class> class ExprTemplate, typename T>
decltype(auto) as_expr(T && t)
constexpr decltype(auto) as_expr(T && t)
{
#ifdef BOOST_NO_CONSTEXPR_IF
return detail::as_expr_impl<ExprTemplate, T, is_expr<T>::value>{}(
@@ -562,7 +571,7 @@ namespace boost { namespace yap {
struct expression_function
{
template<typename... U>
decltype(auto) operator()(U &&... u)
constexpr decltype(auto) operator()(U &&... u)
{
return ::boost::yap::evaluate(expr, static_cast<U &&>(u)...);
}
@@ -590,7 +599,7 @@ namespace boost { namespace yap {
Expr is an expression.
*/
template<typename Expr>
auto make_expression_function(Expr && expr)
constexpr auto make_expression_function(Expr && expr)
{
static_assert(
is_expr<Expr>::value,
@@ -610,7 +619,7 @@ namespace boost { namespace yap {
expression with the given values.
*/
template<typename... T>
auto replacements(T &&... t)
constexpr auto replacements(T &&... t)
{
return detail::placeholder_transform_t<T...>(static_cast<T &&>(t)...);
}
@@ -623,7 +632,7 @@ namespace boost { namespace yap {
where <code>max_p</code> is the maximum placeholder index in \a expr.
*/
template<typename Expr, typename... T>
decltype(auto) replace_placeholders(Expr && expr, T &&... t)
constexpr decltype(auto) replace_placeholders(Expr && expr, T &&... t)
{
static_assert(
is_expr<Expr>::value,
@@ -637,7 +646,7 @@ namespace boost { namespace yap {
given values.
*/
template<typename... T>
inline auto evaluation(T &&... t)
constexpr auto evaluation(T &&... t)
{
return detail::evaluation_transform_t<T...>(static_cast<T &&>(t)...);
}
@@ -649,7 +658,7 @@ namespace boost { namespace yap {
expression.
*/
template<typename Expr, typename... T>
decltype(auto) evaluate(Expr && expr, T &&... t)
constexpr decltype(auto) evaluate(Expr && expr, T &&... t)
{
static_assert(
is_expr<Expr>::value,
@@ -712,7 +721,7 @@ namespace boost { namespace yap {
combination of these.
*/
template<typename Expr, typename Transform, typename... Transforms>
decltype(auto) transform_strict(
constexpr decltype(auto) transform_strict(
Expr && expr, Transform && transform, Transforms &&... transforms)
{
static_assert(

View File

@@ -155,21 +155,21 @@ namespace boost { namespace yap {
#ifndef BOOST_YAP_DOXYGEN
template<typename Expr, typename... T>
decltype(auto) evaluate(Expr && expr, T &&... t);
constexpr decltype(auto) evaluate(Expr && expr, T &&... t);
template<typename Expr, typename Transform, typename... Transforms>
constexpr decltype(auto) transform(
Expr && expr, Transform && transform, Transforms &&... transforms);
template<typename Expr, typename Transform, typename... Transforms>
decltype(auto) transform_strict(
constexpr decltype(auto) transform_strict(
Expr && expr, Transform && transform, Transforms &&... transforms);
template<typename T>
decltype(auto) deref(T && x);
constexpr decltype(auto) deref(T && x);
template<typename Expr>
decltype(auto) value(Expr && expr);
constexpr decltype(auto) value(Expr && expr);
#endif // BOOST_YAP_DOXYGEN

View File

@@ -226,7 +226,7 @@ namespace boost { namespace yap { namespace detail {
struct make_operand
{
template<typename U>
auto operator()(U && u)
constexpr auto operator()(U && u)
{
return T{static_cast<U &&>(u)};
}
@@ -235,13 +235,13 @@ namespace boost { namespace yap { namespace detail {
template<template<expr_kind, class> class ExprTemplate, typename Tuple>
struct make_operand<ExprTemplate<expr_kind::expr_ref, Tuple>>
{
auto operator()(ExprTemplate<expr_kind::expr_ref, Tuple> expr)
constexpr auto operator()(ExprTemplate<expr_kind::expr_ref, Tuple> expr)
{
return expr;
}
template<typename U>
auto operator()(U && u)
constexpr auto operator()(U && u)
{
return ExprTemplate<expr_kind::expr_ref, Tuple>{
Tuple{std::addressof(u)}};

View File

@@ -73,7 +73,7 @@ namespace boost { namespace yap { namespace detail {
{
using tuple_t = hana::tuple<rvalue_ref_to_value_t<PlaceholderArgs>...>;
placeholder_transform_t(PlaceholderArgs &&... args) :
constexpr placeholder_transform_t(PlaceholderArgs &&... args) :
placeholder_args_(static_cast<PlaceholderArgs &&>(args)...)
{}
@@ -86,7 +86,7 @@ namespace boost { namespace yap { namespace detail {
"Out of range placeholder index,");
using nth_type = nth_element<I - 1, PlaceholderArgs...>;
return as_expr<minimal_expr>(
rvalue_mover<!std::is_lvalue_reference<nth_type>::value>::value(
rvalue_mover<!std::is_lvalue_reference<nth_type>::value>{}(
placeholder_args_[hana::llong<I - 1>{}]));
}
@@ -98,7 +98,7 @@ namespace boost { namespace yap { namespace detail {
{
using tuple_t = hana::tuple<rvalue_ref_to_value_t<PlaceholderArgs>...>;
evaluation_transform_t(PlaceholderArgs &&... args) :
constexpr evaluation_transform_t(PlaceholderArgs &&... args) :
placeholder_args_(static_cast<PlaceholderArgs &&>(args)...)
{}
@@ -331,7 +331,8 @@ namespace boost { namespace yap { namespace detail {
struct default_transform<false, false, false>
{
template<typename Expr, typename TransformTuple>
decltype(auto) operator()(Expr && expr, TransformTuple transforms) const
constexpr decltype(auto)
operator()(Expr && expr, TransformTuple transforms) const
{
return transform_nonterminal(
expr, std::move(expr.elements), transforms);
@@ -433,7 +434,7 @@ namespace boost { namespace yap { namespace detail {
};
template<typename T>
decltype(auto) terminal_value(T && x)
constexpr decltype(auto) terminal_value(T && x)
{
return value_impl<true>(static_cast<T &&>(x));
}

View File

@@ -20,7 +20,7 @@ namespace boost { namespace yap {
"ref" and "term" for the non-operator kinds
<code>expr_kind::expr_ref</code> amd <code>expr_kind::terminal</code>,
respectively.*/
inline char const * op_string(expr_kind kind)
inline constexpr char const * op_string(expr_kind kind)
{
switch (kind) {
case expr_kind::expr_ref: return "ref";
@@ -123,9 +123,9 @@ namespace boost { namespace yap {
std::ostream & print_type(std::ostream & os, hana::tuple<T> const &)
{
os << typeindex::type_id<T>().pretty_name();
if (std::is_const<T>::value)
if (std::is_const<std::remove_reference_t<T>>::value)
os << " const";
if (std::is_volatile<T>::value)
if (std::is_volatile<std::remove_reference_t<T>>::value)
os << " volatile";
if (std::is_lvalue_reference<T>::value)
os << " &";

View File

@@ -91,7 +91,7 @@
#define BOOST_YAP_USER_UNARY_OPERATOR( \
op_name, expr_template, result_expr_template) \
template<::boost::yap::expr_kind Kind, typename Tuple> \
auto operator BOOST_YAP_INDIRECT_CALL(op_name)( \
constexpr auto operator BOOST_YAP_INDIRECT_CALL(op_name)( \
expr_template<Kind, Tuple> const & x) \
{ \
using lhs_type = ::boost::yap::detail::operand_type_t< \
@@ -104,7 +104,7 @@
tuple_type{::boost::yap::detail::make_operand<lhs_type>{}(x)}}; \
} \
template<::boost::yap::expr_kind Kind, typename Tuple> \
auto operator BOOST_YAP_INDIRECT_CALL(op_name)( \
constexpr auto operator BOOST_YAP_INDIRECT_CALL(op_name)( \
expr_template<Kind, Tuple> & x) \
{ \
using lhs_type = ::boost::yap::detail::operand_type_t< \
@@ -117,7 +117,7 @@
tuple_type{::boost::yap::detail::make_operand<lhs_type>{}(x)}}; \
} \
template<::boost::yap::expr_kind Kind, typename Tuple> \
auto operator BOOST_YAP_INDIRECT_CALL(op_name)( \
constexpr auto operator BOOST_YAP_INDIRECT_CALL(op_name)( \
expr_template<Kind, Tuple> && x) \
{ \
using tuple_type = ::boost::hana::tuple<expr_template<Kind, Tuple>>; \
@@ -278,7 +278,7 @@
resulting expression.
The \a rhs parameter to each of the defined overloads may be any type,
including an expression, except that the overloads are cosntrained by
including an expression, except that the overloads are constrained by
std::enable_if<> not to conflict with the assignment and move assignement
operators. If \a rhs is a non-expression, it is wrapped in a terminal
expression.
@@ -352,7 +352,7 @@
resulting expression.
The \a rhs parameter to each of the defined overloads may be any type,
including an expression, except that the overloads are cosntrained by
including an expression, except that the overloads are constrained by
std::enable_if<> not to conflict with the assignment and move assignement
operators. If \a rhs is a non-expression, it is wrapped in a terminal
expression.